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.
445 lines
1.4 MiB
445 lines
1.4 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[70,3,5,6,7,8,9],{"+NIl":function(Ye,se,U){(function(Z){Z(U("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(z,N){"use strict";function V(c,l){c.cmdState.push(l)}function W(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function M(c){var l=c.cmdState.pop();l&&l.closeBracket()}function K(c){for(var l=c.cmdState,d=l.length-1;d>=0;d--){var o=l[d];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function H(c,l,d){return function(){this.name=c,this.bracketNo=0,this.style=l,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=H("importmodule","tag",["string","builtin"]),n.documentclass=H("documentclass","tag",["","atom"]),n.usepackage=H("usepackage","tag",["atom"]),n.begin=H("begin","tag",["atom"]),n.end=H("end","tag",["atom"]),n.label=H("label","tag",["atom"]),n.ref=H("ref","tag",["atom"]),n.eqref=H("eqref","tag",["atom"]),n.cite=H("cite","tag",["atom"]),n.bibitem=H("bibitem","tag",["atom"]),n.Bibitem=H("Bibitem","tag",["atom"]),n.RBibitem=H("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(c,l){c.f=l}function y(c,l){var d;if(c.match(/^\\[a-zA-Z@]+/)){var o=c.current().slice(1);return d=n.hasOwnProperty(o)?n[o]:n.DEFAULT,d=new d,V(l,d),D(l,f),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return D(l,function(a,i){return m(a,i,"\\]")}),"keyword";if(c.match("\\("))return D(l,function(a,i){return m(a,i,"\\)")}),"keyword";if(c.match("$$"))return D(l,function(a,i){return m(a,i,"$$")}),"keyword";if(c.match("$"))return D(l,function(a,i){return m(a,i,"$")}),"keyword";var u=c.next();if(u=="%")return c.skipToEnd(),"comment";if(u=="}"||u=="]"){if(d=W(l),d)d.closeBracket(u),D(l,f);else return"error";return"bracket"}else return u=="{"||u=="["?(d=n.DEFAULT,d=new d,V(l,d),"bracket"):/\d/.test(u)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=K(l),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function m(c,l,d){if(c.eatSpace())return null;if(d&&c.match(d))return D(l,y),"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 o=c.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(c.skipToEnd(),"comment"):"error"}function f(c,l){var d=c.peek(),o;return d=="{"||d=="["?(o=W(l),o.openBracket(d),c.eat(d),D(l,y),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(D(l,y),M(l),y(c,l))}return{startState:function(){var c=N.inMathMode?function(l,d){return m(l,d)}:y;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,l){return l.f(c,l)},blankLine:function(c){c.f=y,c.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(Ye,se,U){},"/GNS":function(Ye,se,U){Ye.exports=U.p+"static/search1.c4136dd4.png"},"/cxE":function(Ye,se,U){"use strict";U.d(se,"f",function(){return N}),U.d(se,"g",function(){return V}),U.d(se,"h",function(){return W}),U.d(se,"e",function(){return K}),U.d(se,"b",function(){return H}),U.d(se,"c",function(){return n}),U.d(se,"d",function(){return D}),U.d(se,"a",function(){return y});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(f=>{f(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const z=new Z;function N(m){K(m)||z.onUnexpectedError(m);return}function V(m){K(m)||z.onUnexpectedExternalError(m);return}function W(m){if(m instanceof Error){let{name:f,message:c}=m;const l=m.stacktrace||m.stack;return{$isError:!0,name:f,message:c,stack:l}}return m}const M="Canceled";function K(m){return m instanceof Error&&m.name===M&&m.message===M}function H(){const m=new Error(M);return m.name=m.message,m}function n(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function D(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class y extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(Ye,se,U){(function(Z){Z(U("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(H,n,D){var y=D&&D!=Z.Init;if(n&&!y)H.on("blur",W),H.on("change",M),H.on("swapDoc",M),Z.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){V(H)}),M(H);else if(!n&&y){H.off("blur",W),H.off("change",M),H.off("swapDoc",M),Z.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),z(H);var m=H.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}n&&!H.hasFocus()&&W(H)});function z(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function N(H){z(H);var n=H.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=H.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=H.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),H.display.lineSpace.insertBefore(n,H.display.lineSpace.firstChild)}function V(H){setTimeout(function(){var n=!1,D=H.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:H.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?N(H):z(H)},20)}function W(H){K(H)&&N(H)}function M(H){var n=H.getWrapperElement(),D=K(H);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?N(H):z(H)}function K(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1eCo":function(Ye,se,U){(function(Z){Z(U("VrN/"))})(function(Z){"use strict";var z={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(V,W){var M=V.indentUnit,K={},H=W.htmlMode?z:N;for(var n in H)K[n]=H[n];for(var n in W)K[n]=W[n];var D,y;function m(h,A){function E(x){return A.tokenize=x,x(h,A)}var v=h.next();if(v=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?E(l("atom","]]>")):null:h.match("--")?E(l("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),E(d(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),A.tokenize=l("meta","?>"),"meta"):(D=h.eat("/")?"closeTag":"openTag",A.tokenize=f,"tag bracket");if(v=="&"){var P;return h.eat("#")?h.eat("x")?P=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):P=h.eatWhile(/[\d]/)&&h.eat(";"):P=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),P?"atom":"error"}else return h.eatWhile(/[^&<]/),null}m.isInText=!0;function f(h,A){var E=h.next();if(E==">"||E=="/"&&h.eat(">"))return A.tokenize=m,D=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return D="equals",null;if(E=="<"){A.tokenize=m,A.state=i,A.tagName=A.tagStart=null;var v=A.tokenize(h,A);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(E)?(A.tokenize=c(E),A.stringStartCol=h.column(),A.tokenize(h,A)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(h){var A=function(E,v){for(;!E.eol();)if(E.next()==h){v.tokenize=f;break}return"string"};return A.isInAttribute=!0,A}function l(h,A){return function(E,v){for(;!E.eol();){if(E.match(A)){v.tokenize=m;break}E.next()}return h}}function d(h){return function(A,E){for(var v;(v=A.next())!=null;){if(v=="<")return E.tokenize=d(h+1),E.tokenize(A,E);if(v==">")if(h==1){E.tokenize=m;break}else return E.tokenize=d(h-1),E.tokenize(A,E)}return"meta"}}function o(h,A,E){this.prev=h.context,this.tagName=A,this.indent=h.indented,this.startOfLine=E,(K.doNotIndent.hasOwnProperty(A)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function u(h){h.context&&(h.context=h.context.prev)}function a(h,A){for(var E;;){if(!h.context)return;if(E=h.context.tagName,!K.contextGrabbers.hasOwnProperty(E)||!K.contextGrabbers[E].hasOwnProperty(A))return;u(h)}}function i(h,A,E){return h=="openTag"?(E.tagStart=A.column(),R):h=="closeTag"?S:i}function R(h,A,E){return h=="word"?(E.tagName=A.current(),y="tag",O):K.allowMissingTagName&&h=="endTag"?(y="tag bracket",O(h,A,E)):(y="error",R)}function S(h,A,E){if(h=="word"){var v=A.current();return E.context&&E.context.tagName!=v&&K.implicitlyClosed.hasOwnProperty(E.context.tagName)&&u(E),E.context&&E.context.tagName==v||K.matchClosing===!1?(y="tag",T):(y="tag error",I)}else return K.allowMissingTagName&&h=="endTag"?(y="tag bracket",T(h,A,E)):(y="error",I)}function T(h,A,E){return h!="endTag"?(y="error",T):(u(E),i)}function I(h,A,E){return y="error",T(h,A,E)}function O(h,A,E){if(h=="word")return y="attribute",_;if(h=="endTag"||h=="selfcloseTag"){var v=E.tagName,P=E.tagStart;return E.tagName=E.tagStart=null,h=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(v)?a(E,v):(a(E,v),E.context=new o(E,v,P==E.indented)),i}return y="error",O}function _(h,A,E){return h=="equals"?b:(K.allowMissing||(y="error"),O(h,A,E))}function b(h,A,E){return h=="string"?p:h=="word"&&K.allowUnquoted?(y="string",O):(y="error",O(h,A,E))}function p(h,A,E){return h=="string"?p:O(h,A,E)}return{startState:function(h){var A={tokenize:m,state:i,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(A.baseIndent=h),A},token:function(h,A){if(!A.tagName&&h.sol()&&(A.indented=h.indentation()),h.eatSpace())return null;D=null;var E=A.tokenize(h,A);return(E||D)&&E!="comment"&&(y=null,A.state=A.state(D||E,h,A),y&&(E=y=="error"?E+" error":y)),E},indent:function(h,A,E){var v=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+M;if(v&&v.noIndent)return Z.Pass;if(h.tokenize!=f&&h.tokenize!=m)return E?E.match(/^(\s*)/)[0].length:0;if(h.tagName)return K.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+M*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(A))return 0;var P=A&&/^<(\/)?([\w_:\.-]*)/.exec(A);if(P&&P[1])for(;v;)if(v.tagName==P[2]){v=v.prev;break}else if(K.implicitlyClosed.hasOwnProperty(v.tagName))v=v.prev;else break;else if(P)for(;v;){var x=K.contextGrabbers[v.tagName];if(x&&x.hasOwnProperty(P[2]))v=v.prev;else break}for(;v&&v.prev&&!v.startOfLine;)v=v.prev;return v?v.indent+M:h.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(h){h.state==b&&(h.state=O)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var A=[],E=h.context;E;E=E.prev)E.tagName&&A.push(E.tagName);return A.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(Ye,se,U){"use strict";U.d(se,"d",function(){return tt}),U.d(se,"b",function(){return Te}),U.d(se,"c",function(){return ot}),U.d(se,"a",function(){return Ot});var Z=U("VTBJ"),z=U("1OyB"),N=U("vuIU"),V=U("JX7q"),W=U("Ji7U"),M=U("LK+K"),K=U("q1tI"),H=U("I8Z2"),n=U("BGR+"),D=U("wx14"),y=U("rePB"),m=U("4IlW"),f=U("2GS6"),c=U("Gytx"),l=U.n(c),d=U("TSYQ"),o=U.n(d),u=U("U8pU"),a=U("ODXe"),i=/iPhone/i,R=/iPod/i,S=/iPad/i,T=/\bAndroid(?:.+)Mobile\b/i,I=/Android/i,O=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,p=/\bWindows(?:.+)ARM\b/i,h=/BlackBerry/i,A=/BB10/i,E=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,P=/Mobile(?:.+)Firefox\b/i;function x(vt,qe){return vt.test(qe)}function C(vt){var qe=vt||(typeof navigator!="undefined"?navigator.userAgent:""),Qe=qe.split("[FBAN");if(typeof Qe[1]!="undefined"){var Ue=Qe,ue=Object(a.a)(Ue,1);qe=ue[0]}if(Qe=qe.split("Twitter"),typeof Qe[1]!="undefined"){var me=Qe,$e=Object(a.a)(me,1);qe=$e[0]}var je={apple:{phone:x(i,qe)&&!x(b,qe),ipod:x(R,qe),tablet:!x(i,qe)&&x(S,qe)&&!x(b,qe),device:(x(i,qe)||x(R,qe)||x(S,qe))&&!x(b,qe)},amazon:{phone:x(O,qe),tablet:!x(O,qe)&&x(_,qe),device:x(O,qe)||x(_,qe)},android:{phone:!x(b,qe)&&x(O,qe)||!x(b,qe)&&x(T,qe),tablet:!x(b,qe)&&!x(O,qe)&&!x(T,qe)&&(x(_,qe)||x(I,qe)),device:!x(b,qe)&&(x(O,qe)||x(_,qe)||x(T,qe)||x(I,qe))||x(/\bokhttp\b/i,qe)},windows:{phone:x(b,qe),tablet:x(p,qe),device:x(b,qe)||x(p,qe)},other:{blackberry:x(h,qe),blackberry10:x(A,qe),opera:x(E,qe),firefox:x(P,qe),chrome:x(v,qe),device:x(h,qe)||x(A,qe)||x(E,qe)||x(P,qe)||x(v,qe)},any:null,phone:null,tablet:null};return je.any=je.apple.device||je.android.device||je.windows.device||je.other.device,je.phone=je.apple.phone||je.android.phone||je.windows.phone,je.tablet=je.apple.tablet||je.android.tablet||je.windows.tablet,je}var j=Object(Z.a)(Object(Z.a)({},C()),{},{isMobile:C}),B=j;function w(){}function Y(vt,qe,Qe){var Ue=qe||"";return vt.key||"".concat(Ue,"item_").concat(Qe)}function $(vt){return"".concat(vt,"-menu-")}function oe(vt,qe){var Qe=-1;K.Children.forEach(vt,function(Ue){Qe+=1,Ue&&Ue.type&&Ue.type.isMenuItemGroup?K.Children.forEach(Ue.props.children,function(ue){Qe+=1,qe(ue,Qe)}):qe(Ue,Qe)})}function de(vt,qe,Qe){if(!vt||Qe.find)return;K.Children.forEach(vt,function(Ue){if(Ue){var ue=Ue.type;if(!ue||!(ue.isSubMenu||ue.isMenuItem||ue.isMenuItemGroup))return;qe.indexOf(Ue.key)!==-1?Qe.find=!0:Ue.props.children&&de(Ue.props.children,qe,Qe)}})}var Fe=["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"],Ae=function(qe){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=qe&&typeof qe.getBoundingClientRect=="function"&&qe.getBoundingClientRect().width;if(Ue){if(Qe){var ue=getComputedStyle(qe),me=ue.marginLeft,$e=ue.marginRight;Ue+=+me.replace("px","")+ +$e.replace("px","")}Ue=+Ue.toFixed(6)}return Ue||0},Re=function(qe,Qe,Ue){qe&&Object(u.a)(qe.style)==="object"&&(qe.style[Qe]=Ue)},Me=function(){return B.any},Be=U("KQm4"),pe=U("Ff2n"),fe=U("i8i4"),ne=U("bdgK"),xe=U("uciX"),ce=U("8XRh"),Pe={adjustX:1,adjustY:1},He={topLeft:{points:["bl","tl"],overflow:Pe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Pe,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Pe,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Pe,offset:[4,0]}},ke={topLeft:{points:["bl","tl"],overflow:Pe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Pe,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Pe,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Pe,offset:[4,0]}},Ve=He,et=0,le={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},_e=function(qe,Qe,Ue){var ue=$(Qe),me=qe.getState();qe.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},me.defaultActiveFirst),{},Object(y.a)({},ue,Ue))})},Ce=function(vt){Object(W.a)(Qe,vt);var qe=Object(M.a)(Qe);function Qe(Ue){var ue;Object(z.a)(this,Qe),ue=qe.call(this,Ue),ue.onDestroy=function(We){ue.props.onDestroy(We)},ue.onKeyDown=function(We){var it=We.keyCode,st=ue.menuInstance,dt=ue.props,Et=dt.isOpen,jt=dt.store;if(it===m.a.ENTER)return ue.onTitleClick(We),_e(jt,ue.props.eventKey,!0),!0;if(it===m.a.RIGHT)return Et?st.onKeyDown(We):(ue.triggerOpenChange(!0),_e(jt,ue.props.eventKey,!0)),!0;if(it===m.a.LEFT){var en;if(Et)en=st.onKeyDown(We);else return;return en||(ue.triggerOpenChange(!1),en=!0),en}return Et&&(it===m.a.UP||it===m.a.DOWN)?st.onKeyDown(We):void 0},ue.onOpenChange=function(We){ue.props.onOpenChange(We)},ue.onPopupVisibleChange=function(We){ue.triggerOpenChange(We,We?"mouseenter":"mouseleave")},ue.onMouseEnter=function(We){var it=ue.props,st=it.eventKey,dt=it.onMouseEnter,Et=it.store;_e(Et,ue.props.eventKey,!1),dt({key:st,domEvent:We})},ue.onMouseLeave=function(We){var it=ue.props,st=it.parentMenu,dt=it.eventKey,Et=it.onMouseLeave;st.subMenuInstance=Object(V.a)(ue),Et({key:dt,domEvent:We})},ue.onTitleMouseEnter=function(We){var it=ue.props,st=it.eventKey,dt=it.onItemHover,Et=it.onTitleMouseEnter;dt({key:st,hover:!0}),Et({key:st,domEvent:We})},ue.onTitleMouseLeave=function(We){var it=ue.props,st=it.parentMenu,dt=it.eventKey,Et=it.onItemHover,jt=it.onTitleMouseLeave;st.subMenuInstance=Object(V.a)(ue),Et({key:dt,hover:!1}),jt({key:dt,domEvent:We})},ue.onTitleClick=function(We){var it=Object(V.a)(ue),st=it.props;if(st.onTitleClick({key:st.eventKey,domEvent:We}),st.triggerSubMenuAction==="hover")return;ue.triggerOpenChange(!st.isOpen,"click"),_e(st.store,ue.props.eventKey,!1)},ue.onSubMenuClick=function(We){typeof ue.props.onClick=="function"&&ue.props.onClick(ue.addKeyPath(We))},ue.onSelect=function(We){ue.props.onSelect(We)},ue.onDeselect=function(We){ue.props.onDeselect(We)},ue.getPrefixCls=function(){return"".concat(ue.props.rootPrefixCls,"-submenu")},ue.getActiveClassName=function(){return"".concat(ue.getPrefixCls(),"-active")},ue.getDisabledClassName=function(){return"".concat(ue.getPrefixCls(),"-disabled")},ue.getSelectedClassName=function(){return"".concat(ue.getPrefixCls(),"-selected")},ue.getOpenClassName=function(){return"".concat(ue.props.rootPrefixCls,"-submenu-open")},ue.saveMenuInstance=function(We){ue.menuInstance=We},ue.addKeyPath=function(We){return Object(Z.a)(Object(Z.a)({},We),{},{keyPath:(We.keyPath||[]).concat(ue.props.eventKey)})},ue.triggerOpenChange=function(We,it){var st=ue.props.eventKey,dt=function(){ue.onOpenChange({key:st,item:Object(V.a)(ue),trigger:it,open:We})};it==="mouseenter"?ue.mouseenterTimeout=setTimeout(function(){dt()},0):dt()},ue.isChildrenSelected=function(){var We={find:!1};return de(ue.props.children,ue.props.selectedKeys,We),We.find},ue.isOpen=function(){return ue.props.openKeys.indexOf(ue.props.eventKey)!==-1},ue.adjustWidth=function(){if(!ue.subMenuTitle||!ue.menuInstance)return;var We=fe.findDOMNode(ue.menuInstance);if(We.offsetWidth>=ue.subMenuTitle.offsetWidth)return;We.style.minWidth="".concat(ue.subMenuTitle.offsetWidth,"px")},ue.saveSubMenuTitle=function(We){ue.subMenuTitle=We},ue.getBaseProps=function(){var We=Object(V.a)(ue),it=We.props;return{mode:it.mode==="horizontal"?"vertical":it.mode,visible:ue.props.isOpen,level:it.level+1,inlineIndent:it.inlineIndent,focusable:!1,onClick:ue.onSubMenuClick,onSelect:ue.onSelect,onDeselect:ue.onDeselect,onDestroy:ue.onDestroy,selectedKeys:it.selectedKeys,eventKey:"".concat(it.eventKey,"-menu-"),openKeys:it.openKeys,motion:it.motion,onOpenChange:ue.onOpenChange,subMenuOpenDelay:it.subMenuOpenDelay,parentMenu:Object(V.a)(ue),subMenuCloseDelay:it.subMenuCloseDelay,forceSubMenuRender:it.forceSubMenuRender,triggerSubMenuAction:it.triggerSubMenuAction,builtinPlacements:it.builtinPlacements,defaultActiveFirst:it.store.getState().defaultActiveFirst[$(it.eventKey)],multiple:it.multiple,prefixCls:it.rootPrefixCls,id:ue.internalMenuId,manualRef:ue.saveMenuInstance,itemIcon:it.itemIcon,expandIcon:it.expandIcon,direction:it.direction}},ue.getMotion=function(We,it){var st=Object(V.a)(ue),dt=st.haveRendered,Et=ue.props,jt=Et.motion,en=Et.rootPrefixCls,Yt=Object(Z.a)(Object(Z.a)({},jt),{},{leavedClassName:"".concat(en,"-hidden"),removeOnLeave:!1,motionAppear:dt||!it||We!=="inline"});return Yt};var me=Ue.store,$e=Ue.eventKey,je=me.getState(),Je=je.defaultActiveFirst;ue.isRootMenu=!1;var mt=!1;return Je&&(mt=Je[$e]),_e(me,$e,mt),ue}return Object(N.a)(Qe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ue=this,me=this.props,$e=me.mode,je=me.parentMenu,Je=me.manualRef;if(Je&&Je(this),$e!=="horizontal"||!je.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ue.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ue=this.props,me=ue.onDestroy,$e=ue.eventKey;me&&me($e),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ue){var me=this,$e=this.getBaseProps(),je=this.getMotion($e.mode,$e.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||$e.visible||$e.forceSubMenuRender,!this.haveOpened)return K.createElement("div",null);var Je=$e.direction;return K.createElement(ce.default,Object.assign({visible:$e.visible},je),function(mt){var We=mt.className,it=mt.style,st=o()("".concat($e.prefixCls,"-sub"),We,Object(y.a)({},"".concat($e.prefixCls,"-rtl"),Je==="rtl"));return K.createElement(Se,Object.assign({},$e,{id:me.internalMenuId,className:st,style:it}),ue)})}},{key:"render",value:function(){var ue,me=Object(Z.a)({},this.props),$e=me.isOpen,je=this.getPrefixCls(),Je=me.mode==="inline",mt=o()(je,"".concat(je,"-").concat(me.mode),(ue={},Object(y.a)(ue,me.className,!!me.className),Object(y.a)(ue,this.getOpenClassName(),$e),Object(y.a)(ue,this.getActiveClassName(),me.active||$e&&!Je),Object(y.a)(ue,this.getDisabledClassName(),me.disabled),Object(y.a)(ue,this.getSelectedClassName(),this.isChildrenSelected()),ue));this.internalMenuId||(me.eventKey?this.internalMenuId="".concat(me.eventKey,"$Menu"):(et+=1,this.internalMenuId="$__$".concat(et,"$Menu")));var We={},it={},st={};me.disabled||(We={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},it={onClick:this.onTitleClick},st={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var dt={},Et=me.direction;Je&&(Et==="rtl"?dt.paddingRight=me.inlineIndent*me.level:dt.paddingLeft=me.inlineIndent*me.level);var jt={};this.props.isOpen&&(jt={"aria-owns":this.internalMenuId});var en=null;me.mode!=="horizontal"&&(en=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(en=K.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Yt=K.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:dt,className:"".concat(je,"-title"),role:"button"},st,it,{"aria-expanded":$e},jt,{"aria-haspopup":"true",title:typeof me.title=="string"?me.title:void 0}),me.title,en||K.createElement("i",{className:"".concat(je,"-arrow")})),Ct=this.renderChildren(me.children),pn=me.parentMenu.isRootMenu?me.parentMenu.props.getPopupContainer:function(Pn){return Pn.parentNode},Rt=le[me.mode],zt=me.popupOffset?{offset:me.popupOffset}:{},Pt=me.mode==="inline"?"":me.popupClassName;Pt+=Et==="rtl"?" ".concat(je,"-rtl"):"";var qt=me.disabled,yn=me.triggerSubMenuAction,wn=me.subMenuOpenDelay,yt=me.forceSubMenuRender,Vt=me.subMenuCloseDelay,Mn=me.builtinPlacements;Fe.forEach(function(Pn){return delete me[Pn]}),delete me.onClick;var Un=Et==="rtl"?Object.assign({},ke,Mn):Object.assign({},He,Mn);return delete me.direction,K.createElement("li",Object.assign({},me,We,{className:mt,role:"menuitem"}),Je&&Yt,Je&&Ct,!Je&&K.createElement(xe.a,{prefixCls:je,popupClassName:o()("".concat(je,"-popup"),Pt),getPopupContainer:pn,builtinPlacements:Un,popupPlacement:Rt,popupVisible:$e,popupAlign:zt,popup:Ct,action:qt?[]:[yn],mouseEnterDelay:wn,mouseLeaveDelay:Vt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:yt},Yt))}}]),Qe}(K.Component);Ce.defaultProps={onMouseEnter:w,onMouseLeave:w,onTitleMouseEnter:w,onTitleMouseLeave:w,onTitleClick:w,manualRef:w,mode:"vertical",title:""};var De=Object(H.b)(function(vt,qe){var Qe=vt.openKeys,Ue=vt.activeKey,ue=vt.selectedKeys,me=qe.eventKey,$e=qe.subMenuKey;return{isOpen:Qe.indexOf(me)>-1,active:Ue[$e]===me,selectedKeys:ue}})(Ce);De.isSubMenu=!0;var tt=De,ct="menuitem-overflowed",ft=.5,ut=function(vt){Object(W.a)(Qe,vt);var qe=Object(M.a)(Qe);function Qe(){var Ue;return Object(z.a)(this,Qe),Ue=qe.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 ue=Ue.props.prefixCls,me=fe.findDOMNode(Object(V.a)(Ue));return me?[].slice.call(me.children).filter(function($e){return $e.className.split(" ").indexOf("".concat(ue,"-overflowed-submenu"))<0}):[]},Ue.getOverflowedSubMenuItem=function(ue,me,$e){var je=Ue.props,Je=je.overflowedIndicator,mt=je.level,We=je.mode,it=je.prefixCls,st=je.theme;if(mt!==1||We!=="horizontal")return null;var dt=Ue.props.children[0],Et=dt.props,jt=Et.children,en=Et.title,Yt=Et.style,Ct=Object(pe.a)(Et,["children","title","style"]),pn=Object(Z.a)({},Yt),Rt="".concat(ue,"-overflowed-indicator"),zt="".concat(ue,"-overflowed-indicator");me.length===0&&$e!==!0?pn=Object(Z.a)(Object(Z.a)({},pn),{},{display:"none"}):$e&&(pn=Object(Z.a)(Object(Z.a)({},pn),{},{visibility:"hidden",position:"absolute"}),Rt="".concat(Rt,"-placeholder"),zt="".concat(zt,"-placeholder"));var Pt=st?"".concat(it,"-").concat(st):"",qt={};return Fe.forEach(function(yn){Ct[yn]!==void 0&&(qt[yn]=Ct[yn])}),K.createElement(tt,Object.assign({title:Je,className:"".concat(it,"-overflowed-submenu"),popupClassName:Pt},qt,{key:Rt,eventKey:zt,disabled:!1,style:pn}),me)},Ue.setChildrenWidthAndResize=function(){if(Ue.props.mode!=="horizontal")return;var ue=fe.findDOMNode(Object(V.a)(Ue));if(!ue)return;var me=ue.children;if(!me||me.length===0)return;var $e=ue.children[me.length-1];Re($e,"display","inline-block");var je=Ue.getMenuItemNodes(),Je=je.filter(function(mt){return mt.className.split(" ").indexOf(ct)>=0});Je.forEach(function(mt){Re(mt,"display","inline-block")}),Ue.menuItemSizes=je.map(function(mt){return Ae(mt,!0)}),Je.forEach(function(mt){Re(mt,"display","none")}),Ue.overflowedIndicatorWidth=Ae(ue.children[ue.children.length-1],!0),Ue.originalTotalWidth=Ue.menuItemSizes.reduce(function(mt,We){return mt+We},0),Ue.handleResize(),Re($e,"display","none")},Ue.handleResize=function(){if(Ue.props.mode!=="horizontal")return;var ue=fe.findDOMNode(Object(V.a)(Ue));if(!ue)return;var me=Ae(ue);Ue.overflowedItems=[];var $e=0,je;Ue.originalTotalWidth>me+ft&&(je=-1,Ue.menuItemSizes.forEach(function(Je){$e+=Je,$e+Ue.overflowedIndicatorWidth<=me&&(je+=1)})),Ue.setState({lastVisibleIndex:je})},Ue}return Object(N.a)(Qe,[{key:"componentDidMount",value:function(){var ue=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var me=fe.findDOMNode(this);if(!me)return;this.resizeObserver=new ne.default(function($e){$e.forEach(function(){var je=ue.cancelFrameId;cancelAnimationFrame(je),ue.cancelFrameId=requestAnimationFrame(ue.setChildrenWidthAndResize)})}),[].slice.call(me.children).concat(me).forEach(function($e){ue.resizeObserver.observe($e)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ue.resizeObserver.disconnect(),[].slice.call(me.children).concat(me).forEach(function($e){ue.resizeObserver.observe($e)}),ue.setChildrenWidthAndResize()}),this.mutationObserver.observe(me,{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(ue){var me=this,$e=this.state.lastVisibleIndex;return(ue||[]).reduce(function(je,Je,mt){var We=Je;if(me.props.mode==="horizontal"){var it=me.getOverflowedSubMenuItem(Je.props.eventKey,[]);$e!==void 0&&me.props.className.indexOf("".concat(me.props.prefixCls,"-root"))!==-1&&(mt>$e&&(We=K.cloneElement(Je,{style:{display:"none"},eventKey:"".concat(Je.props.eventKey,"-hidden"),className:"".concat(ct)})),mt===$e+1&&(me.overflowedItems=ue.slice($e+1).map(function(dt){return K.cloneElement(dt,{key:dt.props.eventKey,mode:"vertical-left"})}),it=me.getOverflowedSubMenuItem(Je.props.eventKey,me.overflowedItems)));var st=[].concat(Object(Be.a)(je),[it,We]);return mt===ue.length-1&&st.push(me.getOverflowedSubMenuItem(Je.props.eventKey,[],!0)),st}return[].concat(Object(Be.a)(je),[We])},[])}},{key:"render",value:function(){var ue=this.props,me=ue.visible,$e=ue.prefixCls,je=ue.overflowedIndicator,Je=ue.mode,mt=ue.level,We=ue.tag,it=ue.children,st=ue.theme,dt=Object(pe.a)(ue,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Et=We;return K.createElement(Et,Object.assign({},dt),this.renderChildren(it))}}]),Qe}(K.Component);ut.defaultProps={tag:"div",className:""};var xt=ut;function bt(vt){return vt.length?vt.every(function(qe){return!!qe.props.disabled}):!0}function Ne(vt,qe,Qe){var Ue=vt.getState();vt.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ue.activeKey),{},Object(y.a)({},qe,Qe))})}function Oe(vt){return vt.eventKey||"0-menu-"}function nt(vt,qe){var Qe=qe,Ue=vt.children,ue=vt.eventKey;if(Qe){var me;if(oe(Ue,function($e,je){$e&&$e.props&&!$e.props.disabled&&Qe===Y($e,ue,je)&&(me=!0)}),me)return Qe}return Qe=null,vt.defaultActiveFirst&&oe(Ue,function($e,je){!Qe&&$e&&!$e.props.disabled&&(Qe=Y($e,ue,je))}),Qe}function lt(vt){if(vt){var qe=this.instanceArray.indexOf(vt);qe!==-1?this.instanceArray[qe]=vt:this.instanceArray.push(vt)}}var Ke=function(vt){Object(W.a)(Qe,vt);var qe=Object(M.a)(Qe);function Qe(Ue){var ue;return Object(z.a)(this,Qe),ue=qe.call(this,Ue),ue.onKeyDown=function(me,$e){var je=me.keyCode,Je;if(ue.getFlatInstanceArray().forEach(function(We){We&&We.props.active&&We.onKeyDown&&(Je=We.onKeyDown(me))}),Je)return 1;var mt=null;return(je===m.a.UP||je===m.a.DOWN)&&(mt=ue.step(je===m.a.UP?-1:1)),mt?(me.preventDefault(),Ne(ue.props.store,Oe(ue.props),mt.props.eventKey),typeof $e=="function"&&$e(mt),1):void 0},ue.onItemHover=function(me){var $e=me.key,je=me.hover;Ne(ue.props.store,Oe(ue.props),je?$e:null)},ue.onDeselect=function(me){ue.props.onDeselect(me)},ue.onSelect=function(me){ue.props.onSelect(me)},ue.onClick=function(me){ue.props.onClick(me)},ue.onOpenChange=function(me){ue.props.onOpenChange(me)},ue.onDestroy=function(me){ue.props.onDestroy(me)},ue.getFlatInstanceArray=function(){return ue.instanceArray},ue.step=function(me){var $e=ue.getFlatInstanceArray(),je=ue.props.store.getState().activeKey[Oe(ue.props)],Je=$e.length;if(!Je)return null;me<0&&($e=$e.concat().reverse());var mt=-1;if($e.every(function(dt,Et){return dt&&dt.props.eventKey===je?(mt=Et,!1):!0}),!ue.props.defaultActiveFirst&&mt!==-1&&bt($e.slice(mt,Je-1)))return;var We=(mt+1)%Je,it=We;do{var st=$e[it];if(!st||st.props.disabled)it=(it+1)%Je;else return st}while(it!==We);return null},ue.renderCommonMenuItem=function(me,$e,je){var Je=ue.props.store.getState(),mt=Object(V.a)(ue),We=mt.props,it=Y(me,We.eventKey,$e),st=me.props;if(!st||typeof me.type=="string")return me;var dt=it===Je.activeKey,Et=Object(Z.a)(Object(Z.a)({mode:st.mode||We.mode,level:We.level,inlineIndent:We.inlineIndent,renderMenuItem:ue.renderMenuItem,rootPrefixCls:We.prefixCls,index:$e,parentMenu:We.parentMenu,manualRef:st.disabled?void 0:Object(f.a)(me.ref,lt.bind(Object(V.a)(ue))),eventKey:it,active:!st.disabled&&dt,multiple:We.multiple,onClick:function(en){(st.onClick||w)(en),ue.onClick(en)},onItemHover:ue.onItemHover,motion:We.motion,subMenuOpenDelay:We.subMenuOpenDelay,subMenuCloseDelay:We.subMenuCloseDelay,forceSubMenuRender:We.forceSubMenuRender,onOpenChange:ue.onOpenChange,onDeselect:ue.onDeselect,onSelect:ue.onSelect,builtinPlacements:We.builtinPlacements,itemIcon:st.itemIcon||ue.props.itemIcon,expandIcon:st.expandIcon||ue.props.expandIcon},je),{},{direction:We.direction});return(We.mode==="inline"||Me())&&(Et.triggerSubMenuAction="click"),K.cloneElement(me,Et)},ue.renderMenuItem=function(me,$e,je){if(!me)return null;var Je=ue.props.store.getState(),mt={openKeys:Je.openKeys,selectedKeys:Je.selectedKeys,triggerSubMenuAction:ue.props.triggerSubMenuAction,subMenuKey:je};return ue.renderCommonMenuItem(me,$e,mt)},Ue.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ue.store.getState().activeKey),{},Object(y.a)({},Ue.eventKey,nt(Ue,Ue.activeKey)))}),ue.instanceArray=[],ue}return Object(N.a)(Qe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ue){return this.props.visible||ue.visible||this.props.className!==ue.className||!l()(this.props.style,ue.style)}},{key:"componentDidUpdate",value:function(ue){var me=this.props,$e="activeKey"in me?me.activeKey:me.store.getState().activeKey[Oe(me)],je=nt(me,$e);if(je!==$e)Ne(me.store,Oe(me),je);else if("activeKey"in ue){var Je=nt(ue,ue.activeKey);je!==Je&&Ne(me.store,Oe(me),je)}}},{key:"render",value:function(){var ue=this,me=Object(D.a)({},this.props);this.instanceArray=[];var $e=o()(me.prefixCls,me.className,"".concat(me.prefixCls,"-").concat(me.mode)),je={className:$e,role:me.role||"menu"};me.id&&(je.id=me.id),me.focusable&&(je.tabIndex=0,je.onKeyDown=this.onKeyDown);var Je=me.prefixCls,mt=me.eventKey,We=me.visible,it=me.level,st=me.mode,dt=me.overflowedIndicator,Et=me.theme;return Fe.forEach(function(jt){return delete me[jt]}),delete me.onClick,K.createElement(xt,Object.assign({},me,{prefixCls:Je,mode:st,tag:"ul",level:it,theme:Et,visible:We,overflowedIndicator:dt},je),K.Children.map(me.children,function(jt,en){return ue.renderMenuItem(jt,en,mt||"0-menu-")}))}}]),Qe}(K.Component);Ke.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:w};var Xe=Object(H.b)()(Ke),Se=Xe,ge=U("Kwbf");function Ee(vt,qe,Qe){var Ue=vt.prefixCls,ue=vt.motion,me=vt.defaultMotions,$e=me===void 0?{}:me,je=vt.openAnimation,Je=vt.openTransitionName,mt=qe.switchingModeFromInline;if(ue)return ue;if(Object(u.a)(je)==="object"&&je)Object(ge.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof je=="string")return{motionName:"".concat(Ue,"-open-").concat(je)};if(Je)return{motionName:Je};var We=$e[Qe];return We||(mt?null:$e.other)}var ie=function(vt){Object(W.a)(Qe,vt);var qe=Object(M.a)(Qe);function Qe(Ue){var ue;Object(z.a)(this,Qe),ue=qe.call(this,Ue),ue.inlineOpenKeys=[],ue.onSelect=function(je){var Je=Object(V.a)(ue),mt=Je.props;if(mt.selectable){var We=ue.store.getState(),it=We.selectedKeys,st=je.key;mt.multiple?it=it.concat([st]):it=[st],"selectedKeys"in mt||ue.store.setState({selectedKeys:it}),mt.onSelect(Object(Z.a)(Object(Z.a)({},je),{},{selectedKeys:it}))}},ue.onClick=function(je){var Je=ue.getRealMenuMode(),mt=Object(V.a)(ue),We=mt.store,it=mt.props.onOpenChange;Je!=="inline"&&!("openKeys"in ue.props)&&(We.setState({openKeys:[]}),it([])),ue.props.onClick(je)},ue.onKeyDown=function(je,Je){ue.innerMenu.getWrappedInstance().onKeyDown(je,Je)},ue.onOpenChange=function(je){var Je=Object(V.a)(ue),mt=Je.props,We=ue.store.getState().openKeys.concat(),it=!1,st=function(Et){var jt=!1;if(Et.open)jt=We.indexOf(Et.key)===-1,jt&&We.push(Et.key);else{var en=We.indexOf(Et.key);jt=en!==-1,jt&&We.splice(en,1)}it=it||jt};Array.isArray(je)?je.forEach(st):st(je),it&&("openKeys"in ue.props||ue.store.setState({openKeys:We}),mt.onOpenChange(We))},ue.onDeselect=function(je){var Je=Object(V.a)(ue),mt=Je.props;if(mt.selectable){var We=ue.store.getState().selectedKeys.concat(),it=je.key,st=We.indexOf(it);st!==-1&&We.splice(st,1),"selectedKeys"in mt||ue.store.setState({selectedKeys:We}),mt.onDeselect(Object(Z.a)(Object(Z.a)({},je),{},{selectedKeys:We}))}},ue.onMouseEnter=function(je){ue.restoreModeVerticalFromInline();var Je=ue.props.onMouseEnter;Je&&Je(je)},ue.onTransitionEnd=function(je){var Je=je.propertyName==="width"&&je.target===je.currentTarget,mt=je.target.className,We=Object.prototype.toString.call(mt)==="[object SVGAnimatedString]"?mt.animVal:mt,it=je.propertyName==="font-size"&&We.indexOf("anticon")>=0;(Je||it)&&ue.restoreModeVerticalFromInline()},ue.setInnerMenu=function(je){ue.innerMenu=je},ue.isRootMenu=!0;var me=Ue.defaultSelectedKeys,$e=Ue.defaultOpenKeys;return"selectedKeys"in Ue&&(me=Ue.selectedKeys||[]),"openKeys"in Ue&&($e=Ue.openKeys||[]),ue.store=Object(H.c)({selectedKeys:me,openKeys:$e,activeKey:{"0-menu-":nt(Ue,Ue.activeKey)}}),ue.state={switchingModeFromInline:!1},ue}return Object(N.a)(Qe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ue){this.updateOpentKeysWhenSwitchMode(ue),this.updateMiniStore();var me=this.props,$e=me.siderCollapsed,je=me.inlineCollapsed,Je=me.onOpenChange;(!ue.inlineCollapsed&&je||!ue.siderCollapsed&&$e)&&Je([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ue){var me=this.props,$e=this.store,je=this.inlineOpenKeys,Je=$e.getState(),mt={};ue.mode==="inline"&&me.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in me||((me.inlineCollapsed&&!ue.inlineCollapsed||me.siderCollapsed&&!ue.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Je.openKeys.concat(),mt.openKeys=[]),(!me.inlineCollapsed&&ue.inlineCollapsed||!me.siderCollapsed&&ue.siderCollapsed)&&(mt.openKeys=je,this.inlineOpenKeys=[])),Object.keys(mt).length&&$e.setState(mt)}},{key:"updateMenuDisplay",value:function(){var ue=this.props.collapsedWidth,me=this.store,$e=this.prevOpenKeys,je=this.getInlineCollapsed()&&(ue===0||ue==="0"||ue==="0px");je?(this.prevOpenKeys=me.getState().openKeys.concat(),this.store.setState({openKeys:[]})):$e&&(this.store.setState({openKeys:$e}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ue=this.props.mode,me=this.state.switchingModeFromInline,$e=this.getInlineCollapsed();return me&&$e?"inline":$e?"vertical":ue}},{key:"getInlineCollapsed",value:function(){var ue=this.props,me=ue.inlineCollapsed,$e=ue.siderCollapsed;return $e!==void 0?$e:me}},{key:"restoreModeVerticalFromInline",value:function(){var ue=this.state.switchingModeFromInline;ue&&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 ue=Object(Z.a)({},Object(n.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),me=this.getRealMenuMode();return ue.className+=" ".concat(ue.prefixCls,"-root"),ue.direction==="rtl"&&(ue.className+=" ".concat(ue.prefixCls,"-rtl")),ue=Object(Z.a)(Object(Z.a)({},ue),{},{mode:me,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ee(this.props,this.state,me)}),delete ue.openAnimation,delete ue.openTransitionName,K.createElement(H.a,{store:this.store},K.createElement(Se,Object.assign({},ue,{ref:this.setInnerMenu}),this.props.children))}}]),Qe}(K.Component);ie.defaultProps={selectable:!0,onClick:w,onSelect:w,onOpenChange:w,onDeselect:w,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:K.createElement("span",null,"\xB7\xB7\xB7")};var ae=ie,he=function(vt){Object(W.a)(Qe,vt);var qe=Object(M.a)(Qe);function Qe(){var Ue;return Object(z.a)(this,Qe),Ue=qe.apply(this,arguments),Ue.onKeyDown=function(ue){var me=ue.keyCode;return me===m.a.ENTER?(Ue.onClick(ue),!0):void 0},Ue.onMouseLeave=function(ue){var me=Ue.props,$e=me.eventKey,je=me.onItemHover,Je=me.onMouseLeave;je({key:$e,hover:!1}),Je({key:$e,domEvent:ue})},Ue.onMouseEnter=function(ue){var me=Ue.props,$e=me.eventKey,je=me.onItemHover,Je=me.onMouseEnter;je({key:$e,hover:!0}),Je({key:$e,domEvent:ue})},Ue.onClick=function(ue){var me=Ue.props,$e=me.eventKey,je=me.multiple,Je=me.onClick,mt=me.onSelect,We=me.onDeselect,it=me.isSelected,st={key:$e,keyPath:[$e],item:Object(V.a)(Ue),domEvent:ue};Je(st),je?it?We(st):mt(st):it||mt(st)},Ue.saveNode=function(ue){Ue.node=ue},Ue}return Object(N.a)(Qe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ue=this.props;ue.onDestroy&&ue.onDestroy(ue.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 ue,me=Object(Z.a)({},this.props),$e=o()(this.getPrefixCls(),me.className,(ue={},Object(y.a)(ue,this.getActiveClassName(),!me.disabled&&me.active),Object(y.a)(ue,this.getSelectedClassName(),me.isSelected),Object(y.a)(ue,this.getDisabledClassName(),me.disabled),ue)),je=Object(Z.a)(Object(Z.a)({},me.attribute),{},{title:typeof me.title=="string"?me.title:void 0,className:$e,role:me.role||"menuitem","aria-disabled":me.disabled});me.role==="option"?je=Object(Z.a)(Object(Z.a)({},je),{},{role:"option","aria-selected":me.isSelected}):(me.role===null||me.role==="none")&&(je.role="none");var Je={onClick:me.disabled?null:this.onClick,onMouseLeave:me.disabled?null:this.onMouseLeave,onMouseEnter:me.disabled?null:this.onMouseEnter},mt=Object(Z.a)({},me.style);me.mode==="inline"&&(me.direction==="rtl"?mt.paddingRight=me.inlineIndent*me.level:mt.paddingLeft=me.inlineIndent*me.level),Fe.forEach(function(it){return delete me[it]}),delete me.direction;var We=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(We=K.createElement(this.props.itemIcon,this.props)),K.createElement("li",Object.assign({},Object(n.default)(me,["onClick","onMouseEnter","onMouseLeave","onSelect"]),je,Je,{style:mt,ref:this.saveNode}),me.children,We)}}]),Qe}(K.Component);he.isMenuItem=!0,he.defaultProps={onSelect:w,onMouseEnter:w,onMouseLeave:w,manualRef:w};var ve=Object(H.b)(function(vt,qe){var Qe=vt.activeKey,Ue=vt.selectedKeys,ue=qe.eventKey,me=qe.subMenuKey;return{active:Qe[me]===ue,isSelected:Ue.indexOf(ue)!==-1}})(he),Te=ve,Ge=function(vt){Object(W.a)(Qe,vt);var qe=Object(M.a)(Qe);function Qe(){var Ue;return Object(z.a)(this,Qe),Ue=qe.apply(this,arguments),Ue.renderInnerMenuItem=function(ue){var me=Ue.props,$e=me.renderMenuItem,je=me.index;return $e(ue,je,Ue.props.subMenuKey)},Ue}return Object(N.a)(Qe,[{key:"render",value:function(){var ue=Object(D.a)({},this.props),me=ue.className,$e=me===void 0?"":me,je=ue.rootPrefixCls,Je="".concat(je,"-item-group-title"),mt="".concat(je,"-item-group-list"),We=ue.title,it=ue.children;return Fe.forEach(function(st){return delete ue[st]}),delete ue.onClick,delete ue.direction,K.createElement("li",Object.assign({},ue,{className:"".concat($e," ").concat(je,"-item-group")}),K.createElement("div",{className:Je,title:typeof We=="string"?We:void 0},We),K.createElement("ul",{className:mt},K.Children.map(it,this.renderInnerMenuItem)))}}]),Qe}(K.Component);Ge.isMenuItemGroup=!0,Ge.defaultProps={disabled:!0};var ot=Ge,Tt=function(qe){var Qe=qe.className,Ue=qe.rootPrefixCls,ue=qe.style;return K.createElement("li",{className:"".concat(Qe," ").concat(Ue,"-item-divider"),style:ue})};Tt.defaultProps={disabled:!0,className:"",style:{}};var Ot=Tt,wt=se.e=ae},"24hK":function(Ye,se,U){"use strict";U.d(se,"a",function(){return z});class Z{constructor(N){this.element=N,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class z{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 N=this._first;for(;N!==Z.Undefined;){const V=N.next;N.prev=Z.Undefined,N.next=Z.Undefined,N=V}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,V){const W=new Z(N);if(this._first===Z.Undefined)this._first=W,this._last=W;else if(V){const K=this._last;this._last=W,W.prev=K,K.next=W}else{const K=this._first;this._first=W,W.next=K,K.prev=W}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(W))}}shift(){if(this._first===Z.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===Z.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==Z.Undefined&&N.next!==Z.Undefined){const V=N.prev;V.next=N.next,N.next.prev=V}else N.prev===Z.Undefined&&N.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):N.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):N.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==Z.Undefined;)yield N.element,N=N.next}}},"3/fG":function(Ye,se,U){"use strict";U.d(se,"a",function(){return z});function Z(N,V){let W;return V.length===0?W=N:W=N.replace(/\{(\d+)\}/g,function(M,K){const H=K[0];return typeof V[H]!="undefined"?V[H]:M}),W}function z(N,V,...W){return Z(V,W)}},"4qgm":function(Ye,se){Ye.exports="data:image/png;base64,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"},"4u4S":function(Ye,se){Ye.exports="data:image/png;base64,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"},"55Ip":function(Ye,se,U){"use strict";U.d(se,"a",function(){return a});var Z=U("Ty5D"),z=U("dI71"),N=U("q1tI"),V=U.n(N),W=U("YS25"),M=U("17x9"),K=U.n(M),H=U("wx14"),n=U("zLVn"),D=U("9R94"),y=function(b){Object(z.a)(p,b);function p(){for(var A,E=arguments.length,v=new Array(E),P=0;P<E;P++)v[P]=arguments[P];return A=b.call.apply(b,[this].concat(v))||this,A.history=Object(W.a)(A.props),A}var h=p.prototype;return h.render=function(){return V.a.createElement(Z.c,{history:this.history,children:this.props.children})},p}(V.a.Component),m=function(b){Object(z.a)(p,b);function p(){for(var A,E=arguments.length,v=new Array(E),P=0;P<E;P++)v[P]=arguments[P];return A=b.call.apply(b,[this].concat(v))||this,A.history=Object(W.b)(A.props),A}var h=p.prototype;return h.render=function(){return V.a.createElement(Z.c,{history:this.history,children:this.props.children})},p}(V.a.Component),f=function(p,h){return typeof p=="function"?p(h):p},c=function(p,h){return typeof p=="string"?Object(W.c)(p,null,null,h):p},l=function(p){return p},d=V.a.forwardRef;typeof d=="undefined"&&(d=l);function o(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var u=d(function(b,p){var h=b.innerRef,A=b.navigate,E=b.onClick,v=Object(n.a)(b,["innerRef","navigate","onClick"]),P=v.target,x=Object(H.a)({},v,{onClick:function(j){try{E&&E(j)}catch(B){throw j.preventDefault(),B}!j.defaultPrevented&&j.button===0&&(!P||P==="_self")&&!o(j)&&(j.preventDefault(),A())}});return l!==d?x.ref=p||h:x.ref=h,V.a.createElement("a",x)}),a=d(function(b,p){var h=b.component,A=h===void 0?u:h,E=b.replace,v=b.to,P=b.innerRef,x=Object(n.a)(b,["component","replace","to","innerRef"]);return V.a.createElement(Z.e.Consumer,null,function(C){C||Object(D.a)(!1);var j=C.history,B=c(f(v,C.location),C.location),w=B?j.createHref(B):"",Y=Object(H.a)({},x,{href:w,navigate:function(){var oe=f(v,C.location),de=E?j.replace:j.push;de(oe)}});return l!==d?Y.ref=p||P:Y.innerRef=P,V.a.createElement(A,Y)})});if(!1)var i,R;var S=function(p){return p},T=V.a.forwardRef;typeof T=="undefined"&&(T=S);function I(){for(var b=arguments.length,p=new Array(b),h=0;h<b;h++)p[h]=arguments[h];return p.filter(function(A){return A}).join(" ")}var O=T(function(b,p){var h=b["aria-current"],A=h===void 0?"page":h,E=b.activeClassName,v=E===void 0?"active":E,P=b.activeStyle,x=b.className,C=b.exact,j=b.isActive,B=b.location,w=b.sensitive,Y=b.strict,$=b.style,oe=b.to,de=b.innerRef,Fe=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(Ae){Ae||Object(D.a)(!1);var Re=B||Ae.location,Me=c(f(oe,Re),Re),Be=Me.pathname,pe=Be&&Be.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),fe=pe?Object(Z.f)(Re.pathname,{path:pe,exact:C,sensitive:w,strict:Y}):null,ne=!!(j?j(fe,Re):fe),xe=ne?I(x,v):x,ce=ne?Object(H.a)({},$,{},P):$,Pe=Object(H.a)({"aria-current":ne&&A||null,className:xe,style:ce,to:Me},Fe);return S!==T?Pe.ref=p||de:Pe.innerRef=de,V.a.createElement(a,Pe)})});if(!1)var _},"5D2P":function(Ye,se){Ye.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFTklEQVRoQ91aS4xURRQ993UzUUZcqFEc4meh0cQFSlwgrvAHSgQWhOhCk4GZqmdw+ERUWDkrBMUBnIzzqqYjcTaaGBLFxA8MjIk/3PhZCCa6UAyKC11ARnDo6Wvu+HrS0/R7r96nWVBJpxfv3nPPrbp169aHUEAzxsxl5gcB3AdgAREtkH8AXSH87wBOMfMp+QfwFREd0Vr/k9c8ZQUwxixi5mWe5y1l5qUAyimxqkQ0XqvVxonoE631Nyn1p8VTO7B///75Fy5c2MzMWwB0ZDHaQmeSiPbMmTNnb3d39+k0mKkcMMZsBiC/W9IYSSH7K4C9Wuu9rjpODoyMjNxQq9VGADzuCpxT7gPP83p7e3v/TMJJdCAIgoVEdBDAzUlgBX8/ycwrfd//Pg431gFr7RPM/HbBxFLBEdGTSql3opQiHQiCoI+IXk9lrU3CzLzR9/3BVvAtHbDWPsrMH7aJTyZYInpMKfVRs/JFDlQqlduq1eoxIro2k6U2KTHzX+VyeXFPT8/PjSYucsBae4iZH24Tj1ywRHRYKfVIpANhnt+Ty0r7lbc0rhMzI2CMuRHAlwBubT+HXBZ+AbBEa/3HrFLCWruTmV/MBZ1N+TiAdyNUX2qZeYh2KaW2zThQqVTumZqaOlZgbePqynEiWquU+qFZwRjzBoBnIoAmS6WSTOhvp0PIGPMcgN2uVguSiyQfBIFPRMMJdrZqrV+bdsBa+x4zryqImAtMJHlr7RJmPgxgbhwQEb2vlFpNAwMDV3Z2dp7JUM+7EG0lE0l+dHS089y5c4dkkjqAVycmJq4ma+0yZv7YQaEIkUjyAh4EwTAR+a6GiGg5BUGwg4i2uyrlkEsi7xL3s8wz88syAm8x89M5iLmoxpIP4348bRYkolEyxowBkA25S1sLQJbyHhfhUCaWvMT9+fPnx5h5cQrMuugRceAEgDsdlKfTVph2rwMgC4mk37gWSz5L3DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"5VLF":function(Ye,se,U){"use strict";var Z,z;function N(V,W,M){var K=function(H,n){return V.js_beautify(H,n)};return K.js=V.js_beautify,K.css=W.css_beautify,K.html=M.html_beautify,K.js_beautify=V.js_beautify,K.css_beautify=W.css_beautify,K.html_beautify=M.html_beautify,K}!(Z=[U("6UM0"),U("TXwP"),U("psGv")],z=function(V,W,M){return N(V,W,M)}.apply(se,Z),z!==void 0&&(Ye.exports=z))},"5Y4S":function(Ye,se,U){"use strict";U.d(se,"a",function(){return N});var Z=U("MNsG");const z=Z.b.performance&&typeof Z.b.performance.now=="function";class N{constructor(V){this._highResolution=z&&V,this._startTime=this._now(),this._stopTime=-1}static create(V=!0){return new N(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()}}},"6+eU":function(Ye,se,U){"use strict";U.d(se,"a",function(){return T});var Z=U("wx14"),z=U("rePB"),N=U("VTBJ"),V=U("1OyB"),W=U("vuIU"),M=U("Ji7U"),K=U("LK+K"),H=U("q1tI"),n=U.n(H),D=U("TSYQ"),y=U.n(D),m=function(O){var _,b="".concat(O.rootPrefixCls,"-item"),p=y()(b,"".concat(b,"-").concat(O.page),(_={},Object(z.a)(_,"".concat(b,"-active"),O.active),Object(z.a)(_,O.className,!!O.className),Object(z.a)(_,"".concat(b,"-disabled"),!O.page),_)),h=function(){O.onClick(O.page)},A=function(v){O.onKeyPress(v,O.onClick,O.page)};return n.a.createElement("li",{title:O.showTitle?O.page:null,className:p,onClick:h,onKeyPress:A,tabIndex:"0"},O.itemRender(O.page,"page",n.a.createElement("a",{rel:"nofollow"},O.page)))},f=m,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},l=function(I){Object(M.a)(_,I);var O=Object(K.a)(_);function _(){var b;Object(V.a)(this,_);for(var p=arguments.length,h=new Array(p),A=0;A<p;A++)h[A]=arguments[A];return b=O.call.apply(O,[this].concat(h)),b.state={goInputText:""},b.buildOptionText=function(E){return"".concat(E," ").concat(b.props.locale.items_per_page)},b.changeSize=function(E){b.props.changeSize(Number(E))},b.handleChange=function(E){b.setState({goInputText:E.target.value})},b.handleBlur=function(E){var v=b.props,P=v.goButton,x=v.quickGo,C=v.rootPrefixCls,j=b.state.goInputText;if(P||j==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(C,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(C,"-next"))>=0))return;b.setState({goInputText:""}),x(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(W.a)(_,[{key:"getValidValue",value:function(){var p=this.state,h=p.goInputText,A=p.current;return!h||isNaN(h)?A:Number(h)}},{key:"getPageSizeOptions",value:function(){var p=this.props,h=p.pageSize,A=p.pageSizeOptions;return A.some(function(E){return E.toString()===h.toString()})?A:A.concat([h.toString()]).sort(function(E,v){var P=isNaN(Number(E))?0:Number(E),x=isNaN(Number(v))?0:Number(v);return P-x})}},{key:"render",value:function(){var p=this,h=this.props,A=h.pageSize,E=h.locale,v=h.rootPrefixCls,P=h.changeSize,x=h.quickGo,C=h.goButton,j=h.selectComponentClass,B=h.buildOptionText,w=h.selectPrefixCls,Y=h.disabled,$=this.state.goInputText,oe="".concat(v,"-options"),de=j,Fe=null,Ae=null,Re=null;if(!P&&!x)return null;var Me=this.getPageSizeOptions();if(P&&de){var Be=Me.map(function(pe,fe){return n.a.createElement(de.Option,{key:fe,value:pe.toString()},(B||p.buildOptionText)(pe))});Fe=n.a.createElement(de,{disabled:Y,prefixCls:w,showSearch:!1,className:"".concat(oe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(A||Me[0]).toString(),onChange:this.changeSize,getPopupContainer:function(fe){return fe.parentNode}},Be)}return x&&(C&&(Re=typeof C=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:Y,className:"".concat(oe,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},C)),Ae=n.a.createElement("div",{className:"".concat(oe,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:Y,type:"text",value:$,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,Re)),n.a.createElement("li",{className:"".concat(oe)},Fe,Ae)}}]),_}(n.a.Component);l.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=l,o=U("N2Kk");function u(){}function a(I){return typeof I=="number"&&isFinite(I)&&Math.floor(I)===I}function i(I,O,_){return _}function R(I,O,_){var b=typeof I=="undefined"?O.pageSize:I;return Math.floor((_.total-1)/b)+1}var S=function(I){Object(M.a)(_,I);var O=Object(K.a)(_);function _(b){var p;Object(V.a)(this,_),p=O.call(this,b),p.getJumpPrevPage=function(){return Math.max(1,p.state.current-(p.props.showLessItems?3:5))},p.getJumpNextPage=function(){return Math.min(R(void 0,p.state,p.props),p.state.current+(p.props.showLessItems?3:5))},p.getItemIcon=function(P,x){var C=p.props.prefixCls,j=P||n.a.createElement("button",{type:"button","aria-label":x,className:"".concat(C,"-item-link")});return typeof P=="function"&&(j=n.a.createElement(P,Object(N.a)({},p.props))),j},p.savePaginationNode=function(P){p.paginationNode=P},p.isValid=function(P){return a(P)&&P!==p.state.current},p.shouldDisplayQuickJumper=function(){var P=p.props,x=P.showQuickJumper,C=P.pageSize,j=P.total;return j<=C?!1:x},p.handleKeyDown=function(P){(P.keyCode===c.ARROW_UP||P.keyCode===c.ARROW_DOWN)&&P.preventDefault()},p.handleKeyUp=function(P){var x=p.getValidValue(P),C=p.state.currentInputValue;x!==C&&p.setState({currentInputValue:x}),P.keyCode===c.ENTER?p.handleChange(x):P.keyCode===c.ARROW_UP?p.handleChange(x-1):P.keyCode===c.ARROW_DOWN&&p.handleChange(x+1)},p.changePageSize=function(P){var x=p.state.current,C=R(P,p.state,p.props);x=x>C?C:x,C===0&&(x=p.state.current),typeof P=="number"&&("pageSize"in p.props||p.setState({pageSize:P}),"current"in p.props||p.setState({current:x,currentInputValue:x})),p.props.onShowSizeChange(x,P),"onChange"in p.props&&p.props.onChange&&p.props.onChange(x,P)},p.handleChange=function(P){var x=p.props.disabled,C=P;if(p.isValid(C)&&!x){var j=R(void 0,p.state,p.props);C>j?C=j:C<1&&(C=1),"current"in p.props||p.setState({current:C,currentInputValue:C});var B=p.state.pageSize;return p.props.onChange(C,B),C}return p.state.current},p.prev=function(){p.hasPrev()&&p.handleChange(p.state.current-1)},p.next=function(){p.hasNext()&&p.handleChange(p.state.current+1)},p.jumpPrev=function(){p.handleChange(p.getJumpPrevPage())},p.jumpNext=function(){p.handleChange(p.getJumpNextPage())},p.hasPrev=function(){return p.state.current>1},p.hasNext=function(){return p.state.current<R(void 0,p.state,p.props)},p.runIfEnter=function(P,x){if(P.key==="Enter"||P.charCode===13){for(var C=arguments.length,j=new Array(C>2?C-2:0),B=2;B<C;B++)j[B-2]=arguments[B];x.apply(void 0,j)}},p.runIfEnterPrev=function(P){p.runIfEnter(P,p.prev)},p.runIfEnterNext=function(P){p.runIfEnter(P,p.next)},p.runIfEnterJumpPrev=function(P){p.runIfEnter(P,p.jumpPrev)},p.runIfEnterJumpNext=function(P){p.runIfEnter(P,p.jumpNext)},p.handleGoTO=function(P){(P.keyCode===c.ENTER||P.type==="click")&&p.handleChange(p.state.currentInputValue)};var h=b.onChange!==u,A="current"in b;A&&!h&&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,R(v,void 0,b)),p.state={current:E,currentInputValue:E,pageSize:v},p}return Object(W.a)(_,[{key:"componentDidUpdate",value:function(p,h){var A=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(A,"-item-").concat(h.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(p){var h=p.target.value,A=R(void 0,this.state,this.props),E=this.state.currentInputValue,v;return h===""?v=h:isNaN(Number(h))?v=E:h>=A?v=A:v=Number(h),v}},{key:"getShowSizeChanger",value:function(){var p=this.props,h=p.showSizeChanger,A=p.total,E=p.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:A>E}},{key:"renderPrev",value:function(p){var h=this.props,A=h.prevIcon,E=h.itemRender,v=E(p,"prev",this.getItemIcon(A,"prev page")),P=!this.hasPrev();return Object(H.isValidElement)(v)?Object(H.cloneElement)(v,{disabled:P}):v}},{key:"renderNext",value:function(p){var h=this.props,A=h.nextIcon,E=h.itemRender,v=E(p,"next",this.getItemIcon(A,"next page")),P=!this.hasNext();return Object(H.isValidElement)(v)?Object(H.cloneElement)(v,{disabled:P}):v}},{key:"render",value:function(){var p=this,h=this.props,A=h.prefixCls,E=h.className,v=h.style,P=h.disabled,x=h.hideOnSinglePage,C=h.total,j=h.locale,B=h.showQuickJumper,w=h.showLessItems,Y=h.showTitle,$=h.showTotal,oe=h.simple,de=h.itemRender,Fe=h.showPrevNextJumpers,Ae=h.jumpPrevIcon,Re=h.jumpNextIcon,Me=h.selectComponentClass,Be=h.selectPrefixCls,pe=h.pageSizeOptions,fe=this.state,ne=fe.current,xe=fe.pageSize,ce=fe.currentInputValue;if(x===!0&&C<=xe)return null;var Pe=R(void 0,this.state,this.props),He=[],ke=null,Ve=null,et=null,le=null,_e=null,Ce=B&&B.goButton,De=w?1:2,tt=ne-1>0?ne-1:0,ct=ne+1<Pe?ne+1:Pe,ft=Object.keys(this.props).reduce(function(ie,ae){return(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(ie[ae]=p.props[ae]),ie},{});if(oe)return Ce&&(typeof Ce=="boolean"?_e=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},j.jump_to_confirm):_e=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ce),_e=n.a.createElement("li",{title:Y?"".concat(j.jump_to).concat(ne,"/").concat(Pe):null,className:"".concat(A,"-simple-pager")},_e)),n.a.createElement("ul",Object(Z.a)({className:y()(A,"".concat(A,"-simple"),Object(z.a)({},"".concat(A,"-disabled"),P),E),style:v,ref:this.savePaginationNode},ft),n.a.createElement("li",{title:Y?j.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:y()("".concat(A,"-prev"),Object(z.a)({},"".concat(A,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(tt)),n.a.createElement("li",{title:Y?"".concat(ne,"/").concat(Pe):null,className:"".concat(A,"-simple-pager")},n.a.createElement("input",{type:"text",value:ce,disabled:P,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(A,"-slash")},"/"),Pe),n.a.createElement("li",{title:Y?j.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:y()("".concat(A,"-next"),Object(z.a)({},"".concat(A,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ct)),_e);if(Pe<=3+De*2){var ut={locale:j,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:Y,itemRender:de};Pe||He.push(n.a.createElement(f,Object(Z.a)({},ut,{key:"noPager",page:Pe,className:"".concat(A,"-disabled")})));for(var xt=1;xt<=Pe;xt+=1){var bt=ne===xt;He.push(n.a.createElement(f,Object(Z.a)({},ut,{key:xt,page:xt,active:bt})))}}else{var Ne=w?j.prev_3:j.prev_5,Oe=w?j.next_3:j.next_5;Fe&&(ke=n.a.createElement("li",{title:Y?Ne:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:y()("".concat(A,"-jump-prev"),Object(z.a)({},"".concat(A,"-jump-prev-custom-icon"),!!Ae))},de(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ae,"prev page"))),Ve=n.a.createElement("li",{title:Y?Oe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:y()("".concat(A,"-jump-next"),Object(z.a)({},"".concat(A,"-jump-next-custom-icon"),!!Re))},de(this.getJumpNextPage(),"jump-next",this.getItemIcon(Re,"next page")))),le=n.a.createElement(f,{locale:j,last:!0,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Pe,page:Pe,active:!1,showTitle:Y,itemRender:de}),et=n.a.createElement(f,{locale:j,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:Y,itemRender:de});var nt=Math.max(1,ne-De),lt=Math.min(ne+De,Pe);ne-1<=De&&(lt=1+De*2),Pe-ne<=De&&(nt=Pe-De*2);for(var Ke=nt;Ke<=lt;Ke+=1){var Xe=ne===Ke;He.push(n.a.createElement(f,{locale:j,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ke,page:Ke,active:Xe,showTitle:Y,itemRender:de}))}ne-1>=De*2&&ne!==1+2&&(He[0]=Object(H.cloneElement)(He[0],{className:"".concat(A,"-item-after-jump-prev")}),He.unshift(ke)),Pe-ne>=De*2&&ne!==Pe-2&&(He[He.length-1]=Object(H.cloneElement)(He[He.length-1],{className:"".concat(A,"-item-before-jump-next")}),He.push(Ve)),nt!==1&&He.unshift(et),lt!==Pe&&He.push(le)}var Se=null;$&&(Se=n.a.createElement("li",{className:"".concat(A,"-total-text")},$(C,[C===0?0:(ne-1)*xe+1,ne*xe>C?C:ne*xe])));var ge=!this.hasPrev()||!Pe,Ee=!this.hasNext()||!Pe;return n.a.createElement("ul",Object(Z.a)({className:y()(A,E,Object(z.a)({},"".concat(A,"-disabled"),P)),style:v,unselectable:"unselectable",ref:this.savePaginationNode},ft),Se,n.a.createElement("li",{title:Y?j.prev_page:null,onClick:this.prev,tabIndex:ge?null:0,onKeyPress:this.runIfEnterPrev,className:y()("".concat(A,"-prev"),Object(z.a)({},"".concat(A,"-disabled"),ge)),"aria-disabled":ge},this.renderPrev(tt)),He,n.a.createElement("li",{title:Y?j.next_page:null,onClick:this.next,tabIndex:Ee?null:0,onKeyPress:this.runIfEnterNext,className:y()("".concat(A,"-next"),Object(z.a)({},"".concat(A,"-disabled"),Ee)),"aria-disabled":Ee},this.renderNext(ct)),n.a.createElement(d,{disabled:P,locale:j,rootPrefixCls:A,selectComponentClass:Me,selectPrefixCls:Be,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ne,pageSize:xe,pageSizeOptions:pe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ce}))}}],[{key:"getDerivedStateFromProps",value:function(p,h){var A={};if("current"in p&&(A.current=p.current,p.current!==h.current&&(A.currentInputValue=A.current)),"pageSize"in p&&p.pageSize!==h.pageSize){var E=h.current,v=R(p.pageSize,h,p);E=E>v?v:E,"current"in p||(A.current=E,A.currentInputValue=E),A.pageSize=p.pageSize}return A}}]),_}(n.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:u,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:u,locale:o.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var T=S},"6RRn":function(Ye,se,U){"use strict";var Z=U("wCXF"),z=U("n6Qo");U.d(se,"b",function(){return z.a});var N=U("IBYe"),V=U("6eGT"),W=U("hW8S");U.d(se,"a",function(){return W.a}),se.c=Z.b},"6UM0":function(Ye,se,U){var Z,z;(function(){var N;(function(){"use strict";var W=[function(n,D,y){var m=y(1).Beautifier,f=y(5).Options;function c(l,d){var o=new m(l,d);return o.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new f}},function(n,D,y){var m=y(2).Output,f=y(3).Token,c=y(4),l=y(5).Options,d=y(7).Tokenizer,o=y(7).line_starters,u=y(7).positionable_operators,a=y(7).TOKEN;function i(w,Y){return Y.indexOf(w)!==-1}function R(w){return w.replace(/^\s+/g,"")}function S(w){for(var Y={},$=0;$<w.length;$++)Y[w[$].replace(/-/g,"_")]=w[$];return Y}function T(w,Y){return w&&w.type===a.RESERVED&&w.text===Y}function I(w,Y){return w&&w.type===a.RESERVED&&i(w.text,Y)}var O=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],b=S(_),p=[b.before_newline,b.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function A(w,Y){if(Y.multiline_frame||Y.mode===h.ForInitializer||Y.mode===h.Conditional)return;w.remove_indent(Y.start_line_index)}function E(w){w=w.replace(c.allLineBreaks,`
|
|
`);for(var Y=[],$=w.indexOf(`
|
|
`);$!==-1;)Y.push(w.substring(0,$)),w=w.substring($+1),$=w.indexOf(`
|
|
`);return w.length&&Y.push(w),Y}function v(w){return w===h.ArrayLiteral}function P(w){return i(w,[h.Expression,h.ForInitializer,h.Conditional])}function x(w,Y){for(var $=0;$<w.length;$++){var oe=w[$].trim();if(oe.charAt(0)!==Y)return!1}return!0}function C(w,Y){for(var $=0,oe=w.length,de;$<oe;$++)if(de=w[$],de&&de.indexOf(Y)!==0)return!1;return!0}function j(w,Y){Y=Y||{},this._source_text=w||"",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 l(Y)}j.prototype.create_flags=function(w,Y){var $=0;w&&($=w.indentation_level,!this._output.just_added_newline()&&w.line_indent_level>$&&($=w.line_indent_level));var oe={mode:Y,parent:w,last_token:w?w.last_token:new f(a.START_BLOCK,""),last_word:w?w.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:$,alignment:0,line_indent_level:w?w.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},j.prototype._reset=function(w){var Y=w.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var $=new d(w,this._options);return this._tokens=$.tokenize(),w},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w,Y=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
|
|
`,Y&&c.lineBreak.test(Y||"")&&($=Y.match(c.lineBreak)[0]));for(var oe=this._tokens.next();oe;)this.handle_token(oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=oe,oe=this._tokens.next();return w=this._output.get_code($),w},j.prototype.handle_token=function(w,Y){w.type===a.START_EXPR?this.handle_start_expr(w):w.type===a.END_EXPR?this.handle_end_expr(w):w.type===a.START_BLOCK?this.handle_start_block(w):w.type===a.END_BLOCK?this.handle_end_block(w):w.type===a.WORD?this.handle_word(w):w.type===a.RESERVED?this.handle_word(w):w.type===a.SEMICOLON?this.handle_semicolon(w):w.type===a.STRING?this.handle_string(w):w.type===a.EQUALS?this.handle_equals(w):w.type===a.OPERATOR?this.handle_operator(w):w.type===a.COMMA?this.handle_comma(w):w.type===a.BLOCK_COMMENT?this.handle_block_comment(w,Y):w.type===a.COMMENT?this.handle_comment(w,Y):w.type===a.DOT?this.handle_dot(w):w.type===a.EOF?this.handle_eof(w):w.type===a.UNKNOWN?this.handle_unknown(w,Y):this.handle_unknown(w,Y)},j.prototype.handle_whitespace_and_comments=function(w,Y){var $=w.newlines,oe=this._options.keep_array_indentation&&v(this._flags.mode);if(w.comments_before)for(var de=w.comments_before.next();de;)this.handle_whitespace_and_comments(de,Y),this.handle_token(de,Y),de=w.comments_before.next();if(oe)for(var Fe=0;Fe<$;Fe+=1)this.print_newline(Fe>0,Y);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,Y);for(var Ae=1;Ae<$;Ae+=1)this.print_newline(!0,Y)}};var B=["async","break","continue","return","throw","yield"];j.prototype.allow_wrap_or_preserved_newline=function(w,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&w.newlines||Y,oe=i(this._flags.last_token.text,u)||i(w.text,u);if(oe){var de=i(this._flags.last_token.text,u)&&i(this._options.operator_position,p)||i(w.text,u);$=$&&de}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(I(this._flags.last_token,B))return;this._output.set_wrap_point()}},j.prototype.print_newline=function(w,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&T($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(w)&&(this._flags.multiline_frame=!0)},j.prototype.print_token_line_indentation=function(w){this._output.just_added_newline()&&(this._options.keep_array_indentation&&w.newlines&&(w.text==="["||v(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(w.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))},j.prototype.print_token=function(w){if(this._output.raw){this._output.add_raw_token(w);return}if(this._options.comma_first&&w.previous&&w.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(w),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(w),this._output.non_breaking_space=!0,this._output.add_token(w.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},j.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.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))},j.prototype.set_mode=function(w){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,w),this._flags=this.create_flags(this._previous_flags,w),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&A(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||I(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(w){var Y=!1;return Y=Y||I(this._flags.last_token,["var","let","const"])&&w.type===a.WORD,Y=Y||T(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&I(this._flags.last_token,B)&&!w.newlines,Y=Y||T(this._flags.last_token,"else")&&!(T(w,"if")&&!w.comments_before),Y=Y||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),Y=Y||this._flags.last_token.type===a.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(w.text==="--"||w.text==="++")&&this._last_last_text!=="function"&&w.type!==a.WORD&&w.type!==a.RESERVED,Y=Y||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||I(this._flags.last_token,["get","set"])),Y?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(w,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w,I(w,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w);var Y=h.Expression;if(w.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){I(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(w),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=h.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())),i(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=h.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=h.Conditional):i(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&w.whitespace_before===""?this._output.space_before_token=!1:(i(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var oe=this._tokens.peek(-4);I($,["async","function"])||$.text==="*"&&I(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(oe.text==="{"||oe.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(w);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&i(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===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(w,w.newlines),this.print_token(w),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(w,w.text==="]"&&v(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.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(w),this.restore_mode(),A(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(w){this.handle_whitespace_and_comments(w);var Y=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):$&&(i($.text,[":",","])&&i(Y.type,[a.STRING,a.WORD,a.RESERVED])||i(Y.text,["get","set","..."])&&i($.type,[a.WORD,a.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i($.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):i(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||I(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(I(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var oe=!Y.comments_before&&Y.text==="}",de=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Fe=0,Ae=null;this._flags.inline_frame=!0;do if(Fe+=1,Ae=this._tokens.peek(Fe-1),Ae.newlines){this._flags.inline_frame=!1;break}while(Ae.type!==a.EOF&&!(Ae.type===a.END_BLOCK&&Ae.opened===w))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(de||this._flags.last_token.type===a.EQUALS||I(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===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(w),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(w),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(w){for(this.handle_whitespace_and_comments(w);this._flags.mode===h.Statement;)this.restore_mode();var Y=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(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(w)},j.prototype.handle_word=function(w){if(w.type===a.RESERVED){if(i(w.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)w.type=a.WORD;else if(w.text==="import"&&i(this._tokens.peek().text,["(","."]))w.type=a.WORD;else if(i(w.text,["as","from"])&&!this._flags.import_block)w.type=a.WORD;else if(this._flags.mode===h.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(w.type=a.WORD)}}if(this.start_of_statement(w)?I(this._flags.last_token,["var","let","const"])&&w.type===a.WORD&&(this._flags.declaration_statement=!0):w.newlines&&!P(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!I(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(w),this.print_newline()):this.handle_whitespace_and_comments(w),this._flags.do_block&&!this._flags.do_while)if(T(w,"while")){this._output.space_before_token=!0,this.print_token(w),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&&T(w,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&I(w,["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(w),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w)),T(w,"function")){(i(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(i(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!w.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?I(this._flags.last_token,["get","set","new","export"])||I(this._flags.last_token,B)?this._output.space_before_token=!0:T(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===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(P(this._flags.mode)||v(this._flags.mode))||this.print_newline(),this.print_token(w),this._flags.last_word=w.text;return}var $="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":I(w,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===h.BlockStatement?$="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&P(this._flags.mode)?$="SPACE":this._flags.last_token.type===a.STRING?$="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&i(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),I(w,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),I(w,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var oe=this._output.current_line;oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?I(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&I(w,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!I(w,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(w,"if")&&T(w.previous,"else")?this._output.space_before_token=!0:this.print_newline()):I(w,o)&&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():$==="SPACE"&&(this._output.space_before_token=!0);w.previous&&(w.previous.type===a.WORD||w.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(w),this._flags.last_word=w.text,w.type===a.RESERVED&&(w.text==="do"?this._flags.do_block=!0:w.text==="if"?this._flags.if_block=!0:w.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(w,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(w){this.start_of_statement(w)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(w);for(var Y=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&T(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(w)},j.prototype.handle_string=function(w){w.text.startsWith("`")&&w.newlines===0&&w.whitespace_before===""&&(w.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(w)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(w),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w):w.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(w.previous.text==="]"||w.previous.text===")")&&w.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(w)},j.prototype.handle_equals=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0},j.prototype.handle_comma=function(w){this.handle_whitespace_and_comments(w,!0),this.print_token(w),this._output.space_before_token=!0,this._flags.declaration_statement?(P(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)},j.prototype.handle_operator=function(w){var Y=w.text==="*"&&(I(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),$=i(w.text,["-","+"])&&(i(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||i(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(w)){var oe=!Y;this.handle_whitespace_and_comments(w,oe)}if(w.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(w);return}if(w.text==="::"){this.print_token(w);return}if(this._flags.last_token.type===a.OPERATOR&&i(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(w),w.text===":"&&this._flags.in_case){this.print_token(w),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.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 de=!0,Fe=!0,Ae=!1;if(w.text===":"?this._flags.ternary_depth===0?de=!1:(this._flags.ternary_depth-=1,Ae=!0):w.text==="?"&&(this._flags.ternary_depth+=1),!$&&!Y&&this._options.preserve_newlines&&i(w.text,u)){var Re=w.text===":",Me=Re&&Ae,Be=Re&&!Ae;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Be,this.print_token(w),(!Re||Me)&&this.allow_wrap_or_preserved_newline(w),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Re||Me?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(w):this._output.space_before_token=!1,this.print_token(w),this._output.space_before_token=!0;return;case b.preserve_newline:Be||this.allow_wrap_or_preserved_newline(w),de=!(this._output.just_added_newline()||Be),this._output.space_before_token=de,this.print_token(w),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(w),de=!1;var pe=this._tokens.peek();Fe=pe&&i(pe.type,[a.WORD,a.RESERVED])}else if(w.text==="...")this.allow_wrap_or_preserved_newline(w),de=this._flags.last_token.type===a.START_BLOCK,Fe=!1;else if(i(w.text,["--","++","!","~"])||$){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(w),de=!1,Fe=!1,w.newlines&&(w.text==="--"||w.text==="++"||w.text==="~")){var fe=I(this._flags.last_token,O)&&w.newlines;fe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(fe,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(de=!0),this._flags.last_token.type===a.RESERVED?de=!0:this._flags.last_token.type===a.END_EXPR?de=!(this._flags.last_token.text==="]"&&(w.text==="--"||w.text==="++")):this._flags.last_token.type===a.OPERATOR&&(de=i(w.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(w.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(Fe=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||de,this.print_token(w),this._output.space_before_token=Fe},j.prototype.handle_block_comment=function(w,Y){if(this._output.raw){this._output.add_raw_token(w),w.directives&&w.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(w.directives){this.print_newline(!1,Y),this.print_token(w),w.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(w.text)&&!w.newlines){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0;return}else this.print_block_commment(w,Y)},j.prototype.print_block_commment=function(w,Y){var $=E(w.text),oe,de=!1,Fe=!1,Ae=w.whitespace_before,Re=Ae.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(w),this._output.add_token($[0]),this.print_newline(!1,Y),$.length>1){for($=$.slice(1),de=x($,"*"),Fe=C($,Ae),de&&(this._flags.alignment=1),oe=0;oe<$.length;oe++)de?(this.print_token_line_indentation(w),this._output.add_token(R($[oe]))):Fe&&$[oe]?(this.print_token_line_indentation(w),this._output.add_token($[oe].substring(Re))):(this._output.current_line.set_indent(-1),this._output.add_token($[oe])),this.print_newline(!1,Y);this._flags.alignment=0}},j.prototype.handle_comment=function(w,Y){w.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(w),this.print_newline(!1,Y)},j.prototype.handle_dot=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),I(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(w,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(w)},j.prototype.handle_unknown=function(w,Y){this.print_token(w),w.text[w.text.length-1]===`
|
|
`&&this.print_newline(!1,Y)},j.prototype.handle_eof=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w)},n.exports.Beautifier=j},function(n){function D(f){this.__parent=f,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 f=new D(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},D.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},D.prototype.has_match=function(f){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(f))return!0;return!1},D.prototype.set_indent=function(f,c){this.is_empty()&&(this.__indent_count=f||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 f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__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(f){this.__items.push(f);var c=f.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=f.length-c:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},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 f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function y(f,c){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),c=c||"",f.indent_level>0&&(c=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(f,c){var l=this.__base_string_length;return c=c||0,f<0&&(l=0),l+=f*this.__indent_size,l+=c,l},y.prototype.get_indent_string=function(f,c){var l=this.__base_string;return c=c||0,f<0&&(f=0,l=""),c+=f*this.__indent_size,this.__ensure_cache(c),l+=this.__cache[c],l},y.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var f=this.__cache.length,c=0,l="";this.__indent_size&&f>=this.__indent_size&&(c=Math.floor(f/this.__indent_size),f-=c*this.__indent_size,l=new Array(c+1).join(this.__indent_string)),f&&(l+=new Array(f+1).join(" ")),this.__cache.push(l)};function m(f,c){this.__indent_cache=new y(f,c),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.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()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(f,c){return this.__indent_cache.get_indent_string(f,c)},m.prototype.get_indent_size=function(f,c){return this.__indent_cache.get_indent_size(f,c)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(f){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 l=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(l=l.replace(/[\n]/g,f)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(f,c){return f=f||0,c=c||0,this.next_line.set_indent(f,c),this.__lines.length>1?(this.current_line.set_indent(f,c),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(f){for(var c=0;c<f.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(f){for(var c=this.__lines.length;f<c;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(f,c){for(var l=this.__lines.length-2;l>=0;){var d=this.__lines[l];if(d.is_empty())break;if(d.item(0).indexOf(f)!==0&&d.item(-1)!==c){this.__lines.splice(l+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},n.exports.Output=m},function(n){function D(y,m,f,c){this.type=y,this.text=m,this.comments_before=null,this.newlines=f||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 y="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",l="(?:\\\\u[0-9a-fA-F]{4}|["+y+f+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+m+f+c+"])*";D.identifier=new RegExp(l+d,"g"),D.identifierStart=new RegExp(l),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+f+c+"])+");var o=/[\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,y){var m=y(6).Options,f=["before-newline","after-newline","preserve-newline"];function c(l){m.call(this,l,"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 o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<o.length;u++)o[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[u];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",f),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new m,n.exports.Options=c},function(n){function D(f,c){this.raw_options=y(f,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(f,c){var l=this.raw_options[f],d=c||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(d=l.concat()):typeof l=="string"&&(d=l.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(f,c){var l=this.raw_options[f],d=l===void 0?!!c:!!l;return d},D.prototype._get_characters=function(f,c){var l=this.raw_options[f],d=c||"";return typeof l=="string"&&(d=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(f,c){var l=this.raw_options[f];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(l,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(f,c,l){var d=this._get_selection_list(f,c,l);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[f]+"'");return d[0]},D.prototype._get_selection_list=function(f,c,l){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[c[0]],!this._is_valid_selection(l,c))throw new Error("Invalid Default Value!");var d=this._get_array(f,l);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[f]+"'");return d},D.prototype._is_valid_selection=function(f,c){return f.length&&c.length&&!f.some(function(l){return c.indexOf(l)===-1})};function y(f,c){var l={};f=m(f);var d;for(d in f)d!==c&&(l[d]=f[d]);if(c&&f[c])for(d in f[c])l[d]=f[c][d];return l}function m(f){var c={},l;for(l in f){var d=l.replace(/-/g,"_");c[d]=f[l]}return c}n.exports.Options=D,n.exports.normalizeOpts=m,n.exports.mergeOpts=y},function(n,D,y){var m=y(8).InputScanner,f=y(9).Tokenizer,c=y(9).TOKEN,l=y(13).Directives,d=y(4),o=y(12).Pattern,u=y(14).TemplatablePattern;function a(x,C){return C.indexOf(x)!==-1}var i={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},R=new l(/\/\*/,/\*\//),S=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,I=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var b=new RegExp(_),p="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=p.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),A=new RegExp("^(?:"+h.join("|")+")$"),E,v=function(x,C){f.call(this,x,C),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new o(this._input),B=new u(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(d.identifier).matching(d.identifierMatch),number:j.matching(S),punct:j.matching(b),comment:j.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:j.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:j.matching(/<!--/),html_comment_end:j.matching(/-->/),include:j.starting_with(/#include/).until_after(d.lineBreak),shebang:j.starting_with(/#!/).until_after(d.lineBreak),xml:j.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};v.prototype=new f,v.prototype._is_comment=function(x){return x.type===i.COMMENT||x.type===i.BLOCK_COMMENT||x.type===i.UNKNOWN},v.prototype._is_opening=function(x){return x.type===i.START_BLOCK||x.type===i.START_EXPR},v.prototype._is_closing=function(x,C){return(x.type===i.END_BLOCK||x.type===i.END_EXPR)&&C&&(x.text==="]"&&C.text==="["||x.text===")"&&C.text==="("||x.text==="}"&&C.text==="{")},v.prototype._reset=function(){E=!1},v.prototype._get_next_token=function(x,C){var j=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(i.EOF,""):(j=j||this._read_non_javascript(B),j=j||this._read_string(B),j=j||this._read_word(x),j=j||this._read_singles(B),j=j||this._read_comment(B),j=j||this._read_regexp(B,x),j=j||this._read_xml(B,x),j=j||this._read_punctuation(),j=j||this._create_token(i.UNKNOWN,this._input.next()),j)},v.prototype._read_word=function(x){var C;if(C=this.__patterns.identifier.read(),C!=="")return C=C.replace(d.allLineBreaks,`
|
|
`),!(x.type===i.DOT||x.type===i.RESERVED&&(x.text==="set"||x.text==="get"))&&A.test(C)?(C==="in"||C==="of")&&(x.type===i.WORD||x.type===i.STRING)?this._create_token(i.OPERATOR,C):this._create_token(i.RESERVED,C):this._create_token(i.WORD,C);if(C=this.__patterns.number.read(),C!=="")return this._create_token(i.WORD,C)},v.prototype._read_singles=function(x){var C=null;return x==="("||x==="["?C=this._create_token(i.START_EXPR,x):x===")"||x==="]"?C=this._create_token(i.END_EXPR,x):x==="{"?C=this._create_token(i.START_BLOCK,x):x==="}"?C=this._create_token(i.END_BLOCK,x):x===";"?C=this._create_token(i.SEMICOLON,x):x==="."&&I.test(this._input.peek(1))?C=this._create_token(i.DOT,x):x===","&&(C=this._create_token(i.COMMA,x)),C&&this._input.next(),C},v.prototype._read_punctuation=function(){var x=this.__patterns.punct.read();if(x!=="")return x==="="?this._create_token(i.EQUALS,x):x==="?."?this._create_token(i.DOT,x):this._create_token(i.OPERATOR,x)},v.prototype._read_non_javascript=function(x){var C="";if(x==="#"){if(this._is_first_token()&&(C=this.__patterns.shebang.read(),C))return this._create_token(i.UNKNOWN,C.trim()+`
|
|
`);if(C=this.__patterns.include.read(),C)return this._create_token(i.UNKNOWN,C.trim()+`
|
|
`);x=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(T)){do x=this._input.next(),j+=x;while(this._input.hasNext()&&x!=="#"&&x!=="=");return x==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(j+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(j+="{}",this._input.next(),this._input.next())),this._create_token(i.WORD,j)}this._input.back()}else if(x==="<"&&this._is_first_token()){if(C=this.__patterns.html_comment_start.read(),C){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)C+=this._input.next();return E=!0,this._create_token(i.COMMENT,C)}}else if(E&&x==="-"&&(C=this.__patterns.html_comment_end.read(),C))return E=!1,this._create_token(i.COMMENT,C);return null},v.prototype._read_comment=function(x){var C=null;if(x==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var B=R.get_directives(j);B&&B.ignore==="start"&&(j+=R.readIgnored(this._input)),j=j.replace(d.allLineBreaks,`
|
|
`),C=this._create_token(i.BLOCK_COMMENT,j),C.directives=B}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),C=this._create_token(i.COMMENT,j))}return C},v.prototype._read_string=function(x){if(x==="`"||x==="'"||x==='"'){var C=this._input.next();return this.has_char_escapes=!1,x==="`"?C+=this._read_string_recursive("`",!0,"${"):C+=this._read_string_recursive(x),this.has_char_escapes&&this._options.unescape_strings&&(C=P(C)),this._input.peek()===x&&(C+=this._input.next()),C=C.replace(d.allLineBreaks,`
|
|
`),this._create_token(i.STRING,C)}return null},v.prototype._allow_regexp_or_xml=function(x){return x.type===i.RESERVED&&a(x.text,["return","case","throw","else","do","typeof","yield"])||x.type===i.END_EXPR&&x.text===")"&&x.opened.previous.type===i.RESERVED&&a(x.opened.previous.text,["if","while","for"])||a(x.type,[i.COMMENT,i.START_EXPR,i.START_BLOCK,i.START,i.END_BLOCK,i.OPERATOR,i.EQUALS,i.EOF,i.SEMICOLON,i.COMMA])},v.prototype._read_regexp=function(x,C){if(x==="/"&&this._allow_regexp_or_xml(C)){for(var j=this._input.next(),B=!1,w=!1;this._input.hasNext()&&(B||w||this._input.peek()!==x)&&!this._input.testChar(d.newline);)j+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?w=!0:this._input.peek()==="]"&&(w=!1)),this._input.next();return this._input.peek()===x&&(j+=this._input.next(),j+=this._input.read(d.identifier)),this._create_token(i.STRING,j)}return null},v.prototype._read_xml=function(x,C){if(this._options.e4x&&x==="<"&&this._allow_regexp_or_xml(C)){var j="",B=this.__patterns.xml.read_match();if(B){for(var w=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=w.indexOf("{")===0,$=0;B;){var oe=!!B[1],de=B[2],Fe=!!B[B.length-1]||de.slice(0,8)==="![CDATA[";if(!Fe&&(de===w||Y&&de.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--$:++$),j+=B[0],$<=0)break;B=this.__patterns.xml.read_match()}return B||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(d.allLineBreaks,`
|
|
`),this._create_token(i.STRING,j)}}return null};function P(x){for(var C="",j=0,B=new m(x),w=null;B.hasNext();)if(w=B.match(/([\s]|[^\\]|\\\\)+/g),w&&(C+=w[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")w=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")w=B.match(/u([0-9A-Fa-f]{4})/g);else{C+="\\",B.hasNext()&&(C+=B.next());continue}if(!w)return x;if(j=parseInt(w[1],16),j>126&&j<=255&&w[0].indexOf("x")===0)return x;if(j>=0&&j<32){C+="\\"+w[0];continue}else j===34||j===39||j===92?C+="\\"+String.fromCharCode(j):C+=String.fromCharCode(j)}return C}v.prototype._read_string_recursive=function(x,C,j){var B,w;x==="'"?w=this.__patterns.single_quote:x==='"'?w=this.__patterns.double_quote:x==="`"?w=this.__patterns.template_text:x==="}"&&(w=this.__patterns.template_expression);for(var Y=w.read(),$="";this._input.hasNext();){if($=this._input.next(),$===x||!C&&d.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),$+=this._input.next()):j&&(j==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),j===$&&(x==="`"?$+=this._read_string_recursive("}",C,"`"):$+=this._read_string_recursive("`",C,"${"),this._input.hasNext()&&($+=this._input.next())));$+=w.read(),Y+=$}return Y},n.exports.Tokenizer=v,n.exports.TOKEN=i,n.exports.positionable_operators=O.slice(),n.exports.line_starters=p.slice()},function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var f=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(f=this.__input.charAt(m)),f},y.prototype.__match=function(m,f){m.lastIndex=f;var c=m.exec(this.__input);return c&&!(D&&m.sticky)&&(c.index!==f&&(c=null)),c},y.prototype.test=function(m,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(m,f):!1},y.prototype.testChar=function(m,f){var c=this.peek(f);return m.lastIndex=0,c!==null&&m.test(c)},y.prototype.match=function(m){var f=this.__match(m,this.__position);return f?this.__position+=f[0].length:f=null,f},y.prototype.read=function(m,f,c){var l="",d;return m&&(d=this.match(m),d&&(l+=d[0])),f&&(d||!m)&&(l+=this.readUntil(f,c)),l},y.prototype.readUntil=function(m,f){var c="",l=this.__position;m.lastIndex=this.__position;var d=m.exec(this.__input);return d?(l=d.index,f&&(l+=d[0].length)):l=this.__input_length,c=this.__input.substring(this.__position,l),this.__position=l,c},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,f){var c=null,l="g";return f&&D&&(l="y"),typeof m=="string"&&m!==""?c=new RegExp(m,l):m&&(c=new RegExp(m.source,l)),c},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var f=this.__position,c=this.readUntilAfter(m);return this.__position=f,c},y.prototype.lookBack=function(m){var f=this.__position-1;return f>=m.length&&this.__input.substring(f-m.length,f).toLowerCase()===m},n.exports.InputScanner=y},function(n,D,y){var m=y(8).InputScanner,f=y(3).Token,c=y(10).TokenStream,l=y(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(u,a){this._input=new m(u),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var u,a=new f(d.START,""),i=null,R=[],S=new c;a.type!==d.EOF;){for(u=this._get_next_token(a,i);this._is_comment(u);)S.add(u),u=this._get_next_token(a,i);S.isEmpty()||(u.comments_before=S,S=new c),u.parent=i,this._is_opening(u)?(R.push(i),i=u):i&&this._is_closing(u,i)&&(u.opened=i,i.closed=u,i=R.pop(),u.parent=i),u.previous=a,a.next=u,this.__tokens.add(u),a=u}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(u,a){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(d.RAW,i):this._create_token(d.EOF,"")},o.prototype._is_comment=function(u){return!1},o.prototype._is_opening=function(u){return!1},o.prototype._is_closing=function(u,a){return!1},o.prototype._create_token=function(u,a){var i=new f(u,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return i},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=o,n.exports.TOKEN=d},function(n){function D(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}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 y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},D.prototype.peek=function(y){var m=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(m=this.__tokens[y]),m},D.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},n.exports.TokenStream=D},function(n,D,y){var m=y(12).Pattern;function f(c,l){m.call(this,c,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}f.prototype=new m,f.prototype.__set_whitespace_patterns=function(c,l){c+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},f.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 l=this.__split(this._newline_regexp,c);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return c},f.prototype.matching=function(c,l){var d=this._create();return d.__set_whitespace_patterns(c,l),d._update(),d},f.prototype._create=function(){return new f(this._input,this)},f.prototype.__split=function(c,l){c.lastIndex=0;for(var d=0,o=[],u=c.exec(l);u;)o.push(l.substring(d,u.index)),d=u.index+u[0].length,u=c.exec(l);return d<l.length?o.push(l.substring(d,l.length)):o.push(""),o},n.exports.WhitespacePattern=f},function(n){function D(y,m){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}D.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(y){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(y),m._update(),m},D.prototype.until=function(y){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(y),m._update(),m},D.prototype.starting_with=function(y){var m=this._create();return m._starting_pattern=this._input.get_regexp(y,!0),m._update(),m},D.prototype.matching=function(y){var m=this._create();return m._match_pattern=this._input.get_regexp(y,!0),m._update(),m},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},n.exports.Pattern=D},function(n){function D(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}D.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(y);f;)m[f[1]]=f[2],f=this.__directive_pattern.exec(y);return m},D.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},function(n,D,y){var m=y(12).Pattern,f={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(l,d){m.call(this,l,d),this.__template_pattern=null,this._disabled=Object.assign({},f),this._excluded=Object.assign({},f),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 o=new m(l);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new m,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(l){var d=this._create();return d._disabled[l]=!0,d._update(),d},c.prototype.read_options=function(l){var d=this._create();for(var o in f)d._disabled[o]=l.templating.indexOf(o)===-1;return d._update(),d},c.prototype.exclude=function(l){var d=this._create();return d._excluded[l]=!0,d._update(),d},c.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=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),l+=d,d=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},c.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},c.prototype._read_template=function(){var l="",d=this._input.peek();if(d==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},n.exports.TemplatablePattern=c}],M={};function K(n){var D=M[n];if(D!==void 0)return D.exports;var y=M[n]={exports:{}};return W[n](y,y.exports,K),y.exports}var H=K(0);N=H})();var V=N;!(Z=[],z=function(){return{js_beautify:V}}.apply(se,Z),z!==void 0&&(Ye.exports=z))})()},"6eGT":function(Ye,se,U){"use strict";function Z(z){return null}se.a=Z},"746U":function(Ye,se,U){"use strict";U.d(se,"f",function(){return Z}),U.d(se,"l",function(){return z}),U.d(se,"k",function(){return N}),U.d(se,"j",function(){return V}),U.d(se,"g",function(){return W}),U.d(se,"m",function(){return M}),U.d(se,"h",function(){return K}),U.d(se,"n",function(){return H}),U.d(se,"c",function(){return n}),U.d(se,"a",function(){return D}),U.d(se,"i",function(){return y}),U.d(se,"o",function(){return m}),U.d(se,"e",function(){return l}),U.d(se,"d",function(){return d}),U.d(se,"p",function(){return o}),U.d(se,"b",function(){return u});function Z(a){return Array.isArray(a)}function z(a){return typeof a=="string"}function N(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function V(a){return typeof a=="number"&&!isNaN(a)}function W(a){return a===!0||a===!1}function M(a){return typeof a=="undefined"}function K(a){return!H(a)}function H(a){return M(a)||a===null}function n(a,i){if(!a)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function D(a){if(H(a))throw new Error("Assertion Failed: argument is undefined or null");return a}function y(a){return typeof a=="function"}function m(a,i){const R=Math.min(a.length,i.length);for(let S=0;S<R;S++)f(a[S],i[S])}function f(a,i){if(z(i)){if(typeof a!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(y(i)){try{if(a instanceof i)return}catch(R){}if(!H(a)&&a.constructor===i)return;if(i.length===1&&i.call(void 0,a)===!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(a){let i=[],R=Object.getPrototypeOf(a);for(;Object.prototype!==R;)i=i.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return i}function l(a){const i=[];for(const R of c(a))typeof a[R]=="function"&&i.push(R);return i}function d(a,i){const R=T=>function(){const I=Array.prototype.slice.call(arguments,0);return i(T,I)};let S={};for(const T of a)S[T]=R(T);return S}function o(a){return a===null?void 0:a}function u(a,i="Unreachable"){throw new Error(i)}},"7Cbv":function(Ye,se,U){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z=new Uint8Array(16);function N(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(z)}var V=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function W(f){return typeof f=="string"&&V.test(f)}for(var M=W,K=[],H=0;H<256;++H)K.push((H+256).toString(16).substr(1));function n(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(K[f[c+0]]+K[f[c+1]]+K[f[c+2]]+K[f[c+3]]+"-"+K[f[c+4]]+K[f[c+5]]+"-"+K[f[c+6]]+K[f[c+7]]+"-"+K[f[c+8]]+K[f[c+9]]+"-"+K[f[c+10]]+K[f[c+11]]+K[f[c+12]]+K[f[c+13]]+K[f[c+14]]+K[f[c+15]]).toLowerCase();if(!M(l))throw TypeError("Stringified UUID is invalid");return l}var D=n;function y(f,c,l){f=f||{};var d=f.random||(f.rng||N)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,c){l=l||0;for(var o=0;o<16;++o)c[l+o]=d[o];return c}return D(d)}var m=se.a=y},"7ZXX":function(Ye,se,U){Ye.exports=U.p+"static/err.6e7c5817.png"},"7ahc":function(Ye,se,U){"use strict";U.d(se,"a",function(){return R});var Z=U("k1fw"),z=U("0Owb"),N=U("+L6B"),V=U("2/Rp"),W=U("y8nQ"),M=U("Vl3Y"),K=U("tJVT"),H=U("OaEy"),n=U("2fM7"),D=U("q1tI"),y=U.n(D),m=U("VrN/"),f=U.n(m),c=U("p77/"),l=U.n(c),d=U("c5Ni"),o=U.n(d),u=n.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},i={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};se.b=function(S){var T=S.callback,I=S.onCancel,O=Object(D.useState)("python"),_=Object(K.a)(O,2),b=_[0],p=_[1];function h(E){p(i[E][1])}function A(E){T(E)}return y.a.createElement(M.a,Object(z.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:A}),y.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(n.a,{onChange:h},Object.keys(i).map(function(E){return y.a.createElement(u,{key:E,value:E},i[E][0])}))),y.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(R,{mode:b})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(V.a,{type:"ghost",onClick:I},"\u53D6\u6D88")))};function R(S){var T=S.value,I=S.onChange,O=S.mode,_=S.options,b=_===void 0?{}:_,p=Object(D.useRef)(),h=Object(D.useState)(),A=Object(K.a)(h,2),E=A[0],v=A[1];return Object(D.useEffect)(function(){if(E){function P(x){var C=x.getValue();I&&I(C)}return E.on("change",P),function(){E.off("change",P)}}},[E,I]),Object(D.useEffect)(function(){E&&E.setOption("mode",O)},[E,O]),Object(D.useEffect)(function(){E&&((T!==E.getValue()||T==="")&&setTimeout(function(){E.setValue(T||" ")},300))},[E,T]),Object(D.useEffect)(function(){if(p.current&&!E){var P=f.a.fromTextArea(p.current,Object(Z.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));v(P)}},[p.current,E]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:p}))}},"7ixt":function(Ye,se,U){"use strict";U.d(se,"a",function(){return N});var Z={adjustX:1,adjustY:1},z=[0,0],N={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:z}},V=N},"7v3h":function(Ye,se,U){Ye.exports=U.p+"static/empty2.dd73f390.png"},"8/bI":function(Ye,se,U){Ye.exports=U.p+"static/empty.8918e228.png"},"815F":function(Ye,se,U){"use strict";U.d(se,"e",function(){return K}),U.d(se,"c",function(){return n}),U.d(se,"d",function(){return D}),U.d(se,"a",function(){return m}),U.d(se,"f",function(){return f}),U.d(se,"b",function(){return c});var Z=U("KQm4"),z=U("VTBJ"),N=U("Ff2n"),V=U("Zm9Q"),W=U("Kwbf"),M=U("OZM5");function K(l,d){return l!=null?l:d}function H(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function o(u){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(u||[]).forEach(function(i){var R=i.key,S=i.children;Object(W.a)(R!=null,"Tree node must have a certain key: [".concat(a).concat(R,"]"));var T=String(R);Object(W.a)(!d.has(T)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(T)),d.set(T,!0),o(S,"".concat(a).concat(T," > "))})}o(l)}function n(l){function d(o){var u=Object(V.a)(o);return u.map(function(a){if(!Object(M.i)(a))return Object(W.a)(!a,"Tree/TreeNode can only accept TreeNode as children."),null;var i=a.key,R=a.props,S=R.children,T=Object(N.a)(R,["children"]),I=Object(z.a)({key:i},T),O=d(S);return O.length&&(I.children=O),I}).filter(function(a){return a})}return d(l)}function D(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=new Set(d===!0?[]:d),u=[];function a(i){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(S,T){var I=Object(M.h)(R?R.pos:"0",T),O=K(S.key,I),_=Object(z.a)(Object(z.a)({},S),{},{parent:R,pos:I,children:null,data:S,isStart:[].concat(Object(Z.a)(R?R.isStart:[]),[T===0]),isEnd:[].concat(Object(Z.a)(R?R.isEnd:[]),[T===i.length-1])});return u.push(_),d===!0||o.has(O)?_.children=a(S.children||[],_):_.children=[],_})}return a(l),u}function y(l,d,o){var u;o?typeof o=="string"?u=function(R){return R[o]}:typeof o=="function"&&(u=function(R){return o(R)}):u=function(R,S){return K(R.key,S)};function a(i,R,S){var T=i?i.children:l,I=i?Object(M.h)(S.pos,R):"0";if(i){var O=u(i,I),_={node:i,index:R,pos:I,key:O,parentPos:S.node?S.pos:null,level:S.level+1};d(_)}T&&T.forEach(function(b,p){a(b,p,{node:i,pos:I,level:S?S.level+1:-1})})}a(null)}function m(l){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=d.initWrapper,u=d.processEntity,a=d.onProcessFinished,i=arguments.length>2?arguments[2]:void 0,R={},S={},T={posEntities:R,keyEntities:S};return o&&(T=o(T)||T),y(l,function(I){var O=I.node,_=I.index,b=I.pos,p=I.key,h=I.parentPos,A=I.level,E={node:O,index:_,key:p,pos:b,level:A},v=K(p,b);R[b]=E,S[v]=E,E.parent=R[h],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),u&&u(E,T)},i),a&&a(T),T}function f(l,d){var o=d.expandedKeys,u=d.selectedKeys,a=d.loadedKeys,i=d.loadingKeys,R=d.checkedKeys,S=d.halfCheckedKeys,T=d.dragOverNodeKey,I=d.dropPosition,O=d.keyEntities,_=O[l],b={eventKey:l,expanded:o.indexOf(l)!==-1,selected:u.indexOf(l)!==-1,loaded:a.indexOf(l)!==-1,loading:i.indexOf(l)!==-1,checked:R.indexOf(l)!==-1,halfChecked:S.indexOf(l)!==-1,pos:String(_?_.pos:""),dragOver:T===l&&I===0,dragOverGapTop:T===l&&I===-1,dragOverGapBottom:T===l&&I===1};return b}function c(l){var d=l.data,o=l.expanded,u=l.selected,a=l.checked,i=l.loaded,R=l.loading,S=l.halfChecked,T=l.dragOver,I=l.dragOverGapTop,O=l.dragOverGapBottom,_=l.pos,b=l.active,p=Object(z.a)(Object(z.a)({},d),{},{expanded:o,selected:u,checked:a,loaded:i,loading:R,halfChecked:S,dragOver:T,dragOverGapTop:I,dragOverGapBottom:O,pos:_,active:b});return"props"in p||Object.defineProperty(p,"props",{get:function(){return Object(W.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),l}}),p}},"8EBN":function(Ye,se,U){(function(Z){Z(U("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 z=0;z<Z.modeInfo.length;z++){var N=Z.modeInfo[z];N.mimes&&(N.mime=N.mimes[0])}Z.findModeByMIME=function(V){V=V.toLowerCase();for(var W=0;W<Z.modeInfo.length;W++){var M=Z.modeInfo[W];if(M.mime==V)return M;if(M.mimes){for(var K=0;K<M.mimes.length;K++)if(M.mimes[K]==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 W=0;W<Z.modeInfo.length;W++){var M=Z.modeInfo[W];if(M.ext){for(var K=0;K<M.ext.length;K++)if(M.ext[K]==V)return M}}},Z.findModeByFileName=function(V){for(var W=0;W<Z.modeInfo.length;W++){var M=Z.modeInfo[W];if(M.file&&M.file.test(V))return M}var K=V.lastIndexOf("."),H=K>-1&&V.substring(K+1,V.length);if(H)return Z.findModeByExtension(H)},Z.findModeByName=function(V){V=V.toLowerCase();for(var W=0;W<Z.modeInfo.length;W++){var M=Z.modeInfo[W];if(M.name.toLowerCase()==V)return M;if(M.alias){for(var K=0;K<M.alias.length;K++)if(M.alias[K].toLowerCase()==V)return M}}}})},"8HAY":function(Ye,se,U){"use strict";U.d(se,"a",function(){return W}),U.d(se,"b",function(){return M}),U.d(se,"d",function(){return K}),U.d(se,"e",function(){return H}),U.d(se,"c",function(){return n});var Z=U("MI8n"),z=U("pmY6"),N=U("3/fG"),V=function(D,y,m,f){function c(l){return l instanceof m?l:new m(function(d){d(l)})}return new(m||(m=Promise))(function(l,d){function o(i){try{a(f.next(i))}catch(R){d(R)}}function u(i){try{a(f.throw(i))}catch(R){d(R)}}function a(i){i.done?l(i.value):c(i.value).then(o,u)}a((f=f.apply(D,y||[])).next())})};class W extends z.a{constructor(D,y="",m="",f=!0,c){super();this._onDidChange=this._register(new Z.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=y,this._cssClass=m,this._enabled=f,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,y){return V(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class M extends z.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,y){return V(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let m;try{yield this.runAction(D,y)}catch(f){m=f}this._onDidRun.fire({action:D,error:m})})}runAction(D,y){return V(this,void 0,void 0,function*(){yield D.run(y)})}}class K extends W{constructor(D){super(K.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class H{constructor(D,y,m,f){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=y,this.class=f,this._actions=m}get actions(){return this._actions}dispose(){}run(){return V(this,void 0,void 0,function*(){})}}class n extends W{constructor(){super(n.ID,N.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(Ye,se,U){Ye.exports={button:"button___1wy9m"}},"9Bee":function(Ye,se,U){"use strict";var Z=U("DYRE"),z=U("zeV3"),N=U("+L6B"),V=U("2/Rp"),W=U("k1fw"),M=U("9og8"),K=U("tJVT"),H=U("WmNS"),n=U.n(H),D=U("q1tI"),y=U.n(D),m=U("vg9a"),f=U("DlQD"),c=U.n(f),l=U("rUJ1");function d(Q,L){var k=Q.match(/^(\s+)(?:```)/);if(k===null)return L;var G=k[1];return L.split(`
|
|
`).map(function(te){var J=te.match(/^\s+/);if(J===null)return te;var Ie=Object(K.a)(J,1),at=Ie[0];return at.length>=G.length?te.slice(G.length):te}).join(`
|
|
`)}var o=[],u=["<ul>"],a=new c.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,u=["<ul>"]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(Q,L,k,G){if(L>=Q.length||Q[L].level<=k)return L;var te=Q[L];G.push("<li><a href='#"+te.anchor+"'>"+te.text+"</a>"),L++;var J=[];return L=T(Q,L,te.level,J),J.length>0&&(G.push("<ul>"),J.forEach(function(Ie){G.push(Ie)}),G.push("</ul>")),G.push("</li>"),L=T(Q,L,k,G),L}function I(){return T(o,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(L){var k=i.exec(L);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(L){var k=this.rules.block.fences.exec(L);if(k){var G=k[0],te=d(G,k[3]||""),J=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(J)>=0){var Ie=p(),at=te;te=Ie,h[Ie]={type:"block",expression:at}}return{type:"code",raw:G,lang:J,text:te}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,p=function(){return"__special_katext_id_".concat(b++,"__")},h={};function A(){return h}function E(){b=0,h={}}function v(Q){return Q=Q.replace(_,function(L,k){var G=p();return h[G]={type:"inline",expression:k},G}),Q}var P=a.listitem;a.listitem=function(Q){return P(v(Q))};var x=a.paragraph;a.paragraph=function(Q){return x(v(Q))};var C=a.tablecell;a.tablecell=function(Q,L){return C(v(Q),L)},a.code=function(Q,L,k){var G=(L||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"<p class='editormd-tex'>".concat(Q,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(k?Q:Object(l.escape)(Q,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(k?Q:Object(l.escape)(Q,!0))+"</code></pre>"},a.heading=function(Q,L,k){var G=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:G,level:L,text:Q}),"<h"+L+' id="'+G+'">'+Q+"</h"+L+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:a});var j=c.a,B=U("SJMd"),w=U("ulZh"),Y=U.n(w),$=U("m3rI"),oe=U("Oy/b"),de=U("p5ED"),Fe=U("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 Ae=function(Q,L){return(Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var te in G)Object.prototype.hasOwnProperty.call(G,te)&&(k[te]=G[te])})(Q,L)};function Re(Q,L){function k(){this.constructor=Q}Ae(Q,L),Q.prototype=L===null?Object.create(L):(k.prototype=L.prototype,new k)}function Me(Q,L,k,G){return new(k||(k=Promise))(function(te,J){function Ie(Ft){try{St(G.next(Ft))}catch(ye){J(ye)}}function at(Ft){try{St(G.throw(Ft))}catch(ye){J(ye)}}function St(Ft){var ye;Ft.done?te(Ft.value):(ye=Ft.value,ye instanceof k?ye:new k(function(Ut){Ut(ye)})).then(Ie,at)}St((G=G.apply(Q,L||[])).next())})}function Be(Q,L){var k,G,te,J,Ie={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return J={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function at(St){return function(Ft){return function(ye){if(k)throw new TypeError("Generator is already executing.");for(;Ie;)try{if(k=1,G&&(te=2&ye[0]?G.return:ye[0]?G.throw||((te=G.return)&&te.call(G),0):G.next)&&!(te=te.call(G,ye[1])).done)return te;switch(G=0,te&&(ye=[2&ye[0],te.value]),ye[0]){case 0:case 1:te=ye;break;case 4:return Ie.label++,{value:ye[1],done:!1};case 5:Ie.label++,G=ye[1],ye=[0];continue;case 7:ye=Ie.ops.pop(),Ie.trys.pop();continue;default:if(!(te=Ie.trys,(te=te.length>0&&te[te.length-1])||ye[0]!==6&&ye[0]!==2)){Ie=0;continue}if(ye[0]===3&&(!te||ye[1]>te[0]&&ye[1]<te[3])){Ie.label=ye[1];break}if(ye[0]===6&&Ie.label<te[1]){Ie.label=te[1],te=ye;break}if(te&&Ie.label<te[2]){Ie.label=te[2],Ie.ops.push(ye);break}te[2]&&Ie.ops.pop(),Ie.trys.pop();continue}ye=L.call(Q,Ie)}catch(Ut){ye=[6,Ut],G=0}finally{k=te=0}if(5&ye[0])throw ye[1];return{value:ye[0]?ye[1]:void 0,done:!0}}([St,Ft])}}}function pe(){for(var Q=0,L=0,k=arguments.length;L<k;L++)Q+=arguments[L].length;var G=Array(Q),te=0;for(L=0;L<k;L++)for(var J=arguments[L],Ie=0,at=J.length;Ie<at;Ie++,te++)G[te]=J[Ie];return G}var fe=function(){function Q(){}return Q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Q.setAttributes=function(L,k){for(var G=0,te=k;G<te.length;G++){var J=te[G],Ie=J[0],at=J[1];L.setAttribute(Ie,at)}},Q.createRect=function(L,k,G){var te=document.createElementNS("http://www.w3.org/2000/svg","rect");return te.setAttribute("width",L.toString()),te.setAttribute("height",k.toString()),G&&Q.setAttributes(te,G),te},Q.createLine=function(L,k,G,te,J){var Ie=document.createElementNS("http://www.w3.org/2000/svg","line");return Ie.setAttribute("x1",L.toString()),Ie.setAttribute("y1",k.toString()),Ie.setAttribute("x2",G.toString()),Ie.setAttribute("y2",te.toString()),J&&Q.setAttributes(Ie,J),Ie},Q.createPolygon=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",L),k&&Q.setAttributes(G,k),G},Q.createCircle=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(L/2).toString()),G.setAttribute("cy",(L/2).toString()),G.setAttribute("r",L.toString()),k&&Q.setAttributes(G,k),G},Q.createEllipse=function(L,k,G){var te=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return te.setAttribute("cx",(L/2).toString()),te.setAttribute("cy",(k/2).toString()),te.setAttribute("rx",(L/2).toString()),te.setAttribute("ry",(k/2).toString()),G&&Q.setAttributes(te,G),te},Q.createGroup=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&Q.setAttributes(k,L),k},Q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Q.createMarker=function(L,k,G,te,J,Ie,at){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return Q.setAttributes(St,[["id",L],["orient",k],["markerWidth",G.toString()],["markerHeight",te.toString()],["refX",J.toString()],["refY",Ie.toString()]]),St.appendChild(at),St},Q.createText=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),L&&Q.setAttributes(k,L),k},Q.createTSpan=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=L,k&&Q.setAttributes(G,k),G},Q.createImage=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&Q.setAttributes(k,L),k},Q.createPoint=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=L,G.y=k,G},Q.createPath=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",L),k&&Q.setAttributes(G,k),G},Q}(),ne=function(){function Q(){}return Q.addKey=function(L){Q.key=L},Object.defineProperty(Q,"isLicensed",{get:function(){return!!Q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Q.key)},enumerable:!1,configurable:!0}),Q}(),xe=function(){function Q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Q.prototype.rasterize=function(L,k,G){var te=this;return new Promise(function(J){var Ie=G!==void 0?G:document.createElement("canvas");L===null&&(te.markersOnly=!0,te.naturalSize=!1);var at=document.createElementNS("http://www.w3.org/2000/svg","svg");at.setAttribute("xmlns","http://www.w3.org/2000/svg"),at.setAttribute("width",k.width.baseVal.valueAsString),at.setAttribute("height",k.height.baseVal.valueAsString),at.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),at.innerHTML=k.innerHTML,te.naturalSize===!0?(at.width.baseVal.value=L.naturalWidth,at.height.baseVal.value=L.naturalHeight):te.width!==void 0&&te.height!==void 0&&(at.width.baseVal.value=te.width,at.height.baseVal.value=te.height),Ie.width=at.width.baseVal.value,Ie.height=at.height.baseVal.value;var St=at.outerHTML,Ft=Ie.getContext("2d");te.markersOnly!==!0&&Ft.drawImage(L,0,0,Ie.width,Ie.height);var ye=window.URL,Ut=new Image(Ie.width,Ie.height);Ut.setAttribute("crossOrigin","anonymous");var $t=new Blob([St],{type:"image/svg+xml"}),Sn=ye.createObjectURL($t);Ut.onload=function(){Ft.drawImage(Ut,0,0),ye.revokeObjectURL(Sn);var Hn=Ie.toDataURL(te.imageType,te.imageQuality);J(Hn)},Ut.src=Sn})},Q}(),ce=function(){},Pe=function(){function Q(L){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(Q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Q.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(Q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Q.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},Q.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},Q.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new He("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ke("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ke("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Q.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Q}(),He=function(Q,L){this.selector=Q,this.style=L},ke=function(Q,L){this.localName=Q,this.style=L},Ve=function(){function Q(L,k,G,te,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=L,this.displayMode=k,this.markerItems=G,this.uiStyleSettings=te,this.styles=J,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Q.prototype.show=function(L){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",this.uiContainer.appendChild(G),this.addActionButton(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(J){var Ie=document.createElement("div");Ie.className=""+k.toolbarButtonStyleClass.name,Ie.setAttribute("data-type-name",J.typeName),Ie.innerHTML=J.icon,Ie.addEventListener("click",function(){k.markerToolbarButtonClicked(Ie,J)}),k.buttons.push(Ie),k.markerButtons.push(Ie)}),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 te=document.createElement("div");te.className=this.toolbarBlockStyleClass.name,te.style.whiteSpace="nowrap",te.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(te),this.addActionButton(te,'<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(te,'<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()},Q.prototype.addButtonClickListener=function(L){this.buttonClickListeners.push(L)},Q.prototype.removeButtonClickListener=function(L){this.buttonClickListeners.indexOf(L)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(L),1)},Q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var L=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<L||k===L&&this.markerButtons.length-1===L?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===L&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},Q.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")},Q.prototype.resetButtonStyles=function(){var L=this;this.buttons.forEach(function(k){k.className=k.className.replace(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:L.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name)})},Q.prototype.addActionButton=function(L,k,G){var te=this,J=document.createElement("div");switch(J.className=""+this.toolbarButtonStyleClass.name,J.innerHTML=k,J.setAttribute("data-action",G),J.addEventListener("click",function(){te.actionToolbarButtonClicked(J,G)}),G){case"select":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":J.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":J.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":J.style.fill=this.uiStyleSettings.closeButtonColor}L.appendChild(J),this.buttons.push(J)},Q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ke("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 ke("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ke("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ke("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 ke("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ke("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ke("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ke("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Q.prototype.markerToolbarButtonClicked=function(L,k){this.setActiveButton(L),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Q.prototype.actionToolbarButtonClicked=function(L,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Q.prototype.setActiveButton=function(L){this.resetButtonStyles(),L.className=L.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),L.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Q.prototype.setActiveMarkerButton=function(L){var k=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===L});k&&this.setActiveButton(k)},Q.prototype.setCurrentMarker=function(L){var k=this;this.currentMarker=L,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){k.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},Q}(),et=function(){function Q(L,k,G,te){this.panels=[],this.panelButtons=[],this.markerjsContainer=L,this.displayMode=k,this.uiStyleSettings=G,this.styles=te,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Q.prototype.addStyles=function(){var L;this.toolboxStyleClass=this.styles.addClass(new ke("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 ke("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ke("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ke("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ke("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 ke("toolbox-panel-row_colors",`
|
|
background-color: `+((L=this.uiStyleSettings.toolboxBackgroundColor)!==null&&L!==void 0?L:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ke("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
padding: `+k+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ke("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ke("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Q.prototype.show=function(L){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Q.prototype.setPanelButtons=function(L){var k,G,te=this;this.panels=L,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var Ie;J.uiStyleSettings=te.uiStyleSettings;var at=document.createElement("div");at.className=te.toolboxButtonStyleClass.name+" "+((Ie=te.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:te.toolboxButtonStyleColorsClass.name),at.innerHTML=J.icon,at.title=J.title,at.addEventListener("click",function(){te.panelButtonClick(J)}),te.panelButtons.push(at),te.buttonRow.appendChild(at)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Q.prototype.panelButtonClick=function(L){var k=this,G=-1;if(L!==this.activePanel){G=this.panels.indexOf(L),this.panelRow.innerHTML="";var te=L.getUi();te.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(te),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=L}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,Ie){var at,St;J.className=k.toolboxButtonStyleClass.name+" "+(Ie===G?""+((at=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&at!==void 0?at:k.toolboxActiveButtonStyleColorsClass.name):""+((St=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&St!==void 0?St:k.toolboxButtonStyleColorsClass.name))})},Q}(),le=function(Q,L){this.title=Q,this.icon=L},_e=function(Q){function L(k,G,te,J){var Ie=Q.call(this,k,J||'<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 Ie.colors=[],Ie.addTransparent=!1,Ie.colorBoxes=[],Ie.colors=G,Ie.currentColor=te,Ie.setCurrentColor=Ie.setCurrentColor.bind(Ie),Ie.getColorBox=Ie.getColorBox.bind(Ie),Ie}return Re(L,Q),L.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(te){var J=k.getColorBox(te);G.appendChild(J),k.colorBoxes.push(J)}),G},L.prototype.getColorBox=function(k){var G=this,te=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-te,Ie=document.createElement("div");Ie.style.display="inline-block",Ie.style.boxSizing="content-box",Ie.style.width=J-2+"px",Ie.style.height=J-2+"px",Ie.style.padding="1px",Ie.style.marginRight="2px",Ie.style.marginBottom="2px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.borderRadius=(J+2)/2+"px",Ie.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){G.setCurrentColor(k,Ie)});var at=document.createElement("div");return at.style.display="inline-block",at.style.width=J-2+"px",at.style.height=J-2+"px",at.style.backgroundColor=k,at.style.borderRadius=J/2+"px",k==="transparent"&&(at.style.fill=this.uiStyleSettings.toolboxAccentColor,at.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>`),Ie.appendChild(at),Ie},L.prototype.setCurrentColor=function(k,G){var te=this;this.currentColor=k,this.colorBoxes.forEach(function(J){J.style.borderColor=J===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},L}(le),Ce=function(){function Q(L,k,G){this._state="new",this._isSelected=!1,this._container=L,this._overlayContainer=k,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Q.prototype.ownsTarget=function(L){return!1},Object.defineProperty(Q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Q.prototype.pointerDown=function(L,k){},Q.prototype.dblClick=function(L,k){},Q.prototype.manipulate=function(L){},Q.prototype.pointerUp=function(L){this.stateChanged()},Q.prototype.dispose=function(){},Q.prototype.addMarkerVisualToContainer=function(L){this.container.childNodes.length>0?this.container.insertBefore(L,this.container.childNodes[0]):this.container.appendChild(L)},Q.prototype.getState=function(){return{typeName:Q.typeName,state:this.state,notes:this.notes}},Q.prototype.restoreState=function(L){this._state=L.state,this.notes=L.notes},Q.prototype.scale=function(L,k){},Q.prototype.colorChanged=function(L){this.onColorChanged&&this.onColorChanged(L),this.stateChanged()},Q.prototype.fillColorChanged=function(L){this.onFillColorChanged&&this.onFillColorChanged(L),this.stateChanged()},Q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var L=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),L.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(L)&&this.onStateChanged(this)}},Q.typeName="MarkerBase",Q}(),De=function(){function Q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Q.prototype.findGripByVisual=function(L){return this.topLeft.ownsTarget(L)?this.topLeft:this.topCenter.ownsTarget(L)?this.topCenter:this.topRight.ownsTarget(L)?this.topRight:this.centerLeft.ownsTarget(L)?this.centerLeft:this.centerRight.ownsTarget(L)?this.centerRight:this.bottomLeft.ownsTarget(L)?this.bottomLeft:this.bottomCenter.ownsTarget(L)?this.bottomCenter:this.bottomRight.ownsTarget(L)?this.bottomRight:void 0},Q}(),tt=function(){function Q(){this.GRIP_SIZE=10,this.visual=fe.createGroup(),this.visual.appendChild(fe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(fe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Q.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},Q}(),ct=function(){function Q(){}return Q.toITransformMatrix=function(L){return{a:L.a,b:L.b,c:L.c,d:L.d,e:L.e,f:L.f}},Q.toSVGMatrix=function(L,k){return L.a=k.a,L.b=k.b,L.c=k.c,L.d=k.d,L.e=k.e,L.f=k.f,L},Q}(),ft=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(fe.createTransform()),J.setupControlBox(),J}return Re(L,Q),Object.defineProperty(L.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var G=fe.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(k){return!!Q.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var te=this.unrotatePoint(k);if(this.manipulationStartX=te.x,this.manipulationStartY=te.y,this.offsetX=te.x-this.left,this.offsetY=te.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ie=this.container.transform.baseVal.getItem(0);Ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},L.prototype.pointerUp=function(k){var G=this.state;Q.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},L.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},L.prototype.manipulate=function(k){var G=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(k)},L.prototype.resize=function(k){var G=this.manipulationStartLeft,te=this.manipulationStartWidth,J=this.manipulationStartTop,Ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+k.x-this.manipulationStartX,te=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:te=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+k.y-this.manipulationStartY,Ie=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ie=this.manipulationStartHeight+k.y-this.manipulationStartY}te>=0?(this.left=G,this.width=te):(this.left=G+te,this.width=-te),Ie>=0?(this.top=J,this.height=Ie):(this.top=J+Ie,this.height=-Ie),this.setSize()},L.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},L.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var G=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},L.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},L.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM(),te=fe.createPoint(k.x,k.y);return{x:(te=te.matrixTransform(G)).x,y:te.y}},L.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM();G=G.inverse();var te=fe.createPoint(k.x,k.y);return{x:(te=te.matrixTransform(G)).x,y:te.y}},L.prototype.select=function(){Q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){Q.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=fe.createGroup();var k=fe.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=fe.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=fe.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"},L.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,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()},L.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()},L.prototype.createGrip=function(){var k=new tt;return k.visual.transform.baseVal.appendItem(fe.createTransform()),this.controlBox.appendChild(k.visual),k},L.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,G=-k/2,te=G,J=(this.width+this.CB_DISTANCE)/2-k/2,Ie=(this.height+this.CB_DISTANCE)/2-k/2,at=this.height+this.CB_DISTANCE-k/2,St=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,G,te),this.positionGrip(this.controlGrips.topCenter.visual,J,te),this.positionGrip(this.controlGrips.topRight.visual,St,te),this.positionGrip(this.controlGrips.centerLeft.visual,G,Ie),this.positionGrip(this.controlGrips.centerRight.visual,St,Ie),this.positionGrip(this.controlGrips.bottomLeft.visual,G,at),this.positionGrip(this.controlGrips.bottomCenter.visual,J,at),this.positionGrip(this.controlGrips.bottomRight.visual,St,at),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,te-3*this.CB_DISTANCE)},L.prototype.positionGrip=function(k,G,te){var J=k.transform.baseVal.getItem(0);J.setTranslate(G,te),k.transform.baseVal.replaceItem(J,0)},L.prototype.hideControlBox=function(){this.controlBox.style.display="none"},L.prototype.showControlBox=function(){this.controlBox.style.display=""},L.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ct.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ct.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Q.prototype.getState.call(this))},L.prototype.restoreState=function(k){Q.prototype.restoreState.call(this,k);var G=k;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ct.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ct.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},L.prototype.scale=function(k,G){Q.prototype.scale.call(this,k,G);var te=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:te.x*k,y:te.y*G});this.left=J.x,this.top=J.y,this.width=this.width*k,this.height=this.height*G,this.adjustControlBox()},L}(Ce),ut=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return Re(L,Q),L.prototype.ownsTarget=function(k){return!(!Q.prototype.ownsTarget.call(this,k)&&k!==this.visual)},L.prototype.createVisual=function(){this.visual=fe.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)},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.manipulate=function(k){Q.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Q.prototype.resize.call(this,k),this.setSize()},L.prototype.setSize=function(){Q.prototype.setSize.call(this),fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(k){Q.prototype.pointerUp.call(this,k),this.setSize()},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&fe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},L.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&fe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&fe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&fe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Q.prototype.getState.call(this))},L.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),Q.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,G){Q.prototype.scale.call(this,k,G),this.setSize()},L.title="Rectangle marker",L}(ft),xt=function(Q){function L(k,G,te,J){var Ie=Q.call(this,k,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ie.widths=[],Ie.widthBoxes=[],Ie.widths=G,Ie.currentWidth=te,Ie.setCurrentWidth=Ie.setCurrentWidth.bind(Ie),Ie}return Re(L,Q),L.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(te){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=te===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentWidth(te,J)}),G.appendChild(J);var Ie=document.createElement("div");Ie.innerText=te.toString(),Ie.style.marginRight="5px",J.appendChild(Ie);var at=document.createElement("div");at.style.minHeight="20px",at.style.flexGrow="2",at.style.display="flex",at.style.alignItems="center";var St=document.createElement("hr");St.style.minWidth="20px",St.style.border="0px",St.style.borderTop=te+"px solid "+k.uiStyleSettings.toolboxColor,St.style.flexGrow="2",at.appendChild(St),J.appendChild(at),k.widthBoxes.push(J)}),G},L.prototype.setCurrentWidth=function(k,G){var te=this;this.currentWidth=k,this.widthBoxes.forEach(function(J){J.style.borderColor=J===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},L}(le),bt=function(Q){function L(k,G,te,J){var Ie=Q.call(this,k,J||'<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 Ie.styles=[],Ie.styleBoxes=[],Ie.styles=G,Ie.currentStyle=te,Ie.setCurrentStyle=Ie.setCurrentStyle.bind(Ie),Ie}return Re(L,Q),L.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(te){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/k.styles.length-5+"%",J.style.borderColor=te===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentStyle(te,J)}),G.appendChild(J);var Ie=document.createElement("div");Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.overflow="hidden";var at=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(te!==""?'stroke-dasharray="'+te+'"':"")+` />
|
|
</svg>`;Ie.innerHTML=at,J.appendChild(Ie),k.styleBoxes.push(J)}),G},L.prototype.setCurrentStyle=function(k,G){var te=this;this.currentStyle=k,this.styleBoxes.forEach(function(J){J.style.borderColor=J===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},L}(le),Ne=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.strokeColor=te.defaultColor,J.strokeWidth=te.defaultStrokeWidth,J.strokeDasharray=te.defaultStrokeDasharray,J.strokePanel=new _e("Line color",te.defaultColorSet,te.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new xt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new bt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Re(L,Q),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Q.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="FrameMarker",L.title="Frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',L}(ut),Oe=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},nt=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return Re(L,Q),L.prototype.ownsTarget=function(k){return!!Q.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.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(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},L.prototype.pointerUp=function(k){var G=this.state;Q.prototype.pointerUp.call(this,k),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(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},L.prototype.adjustVisual=function(){},L.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},L.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},L.prototype.select=function(){Q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){Q.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=fe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){this.positionGrips()},L.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},L.prototype.createGrip=function(){var k=new tt;return k.visual.transform.baseVal.appendItem(fe.createTransform()),this.controlBox.appendChild(k.visual),k},L.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},L.prototype.positionGrip=function(k,G,te){var J=k.transform.baseVal.getItem(0);J.setTranslate(G,te),k.transform.baseVal.replaceItem(J,0)},L.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Q.prototype.getState.call(this))},L.prototype.restoreState=function(k){Q.prototype.restoreState.call(this,k);var G=k;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},L.prototype.scale=function(k,G){Q.prototype.scale.call(this,k,G),this.x1=this.x1*k,this.y1=this.y1*G,this.x2=this.x2*k,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},L}(Ce),lt=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=te.defaultColor,J.strokeWidth=te.defaultStrokeWidth,J.strokeDasharray=te.defaultStrokeDasharray,J.strokePanel=new _e("Line color",te.defaultColorSet,te.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new xt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new bt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Re(L,Q),L.prototype.ownsTarget=function(k){return!(!Q.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.selectorLine=fe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=fe.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)},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},L.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()),fe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),fe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Q.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Q.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},L.typeName="LineMarker",L.title="Line marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',L}(nt),Ke=function(Q){function L(k,G,te,J){var Ie=Q.call(this,k,J||'<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 Ie.fonts=[],Ie.fontBoxes=[],Ie.fonts=G,Ie.currentFont=te,Ie.setCurrentFont=Ie.setCurrentFont.bind(Ie),Ie}return Re(L,Q),L.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(te){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/k.fonts.length-5+"%",J.style.borderColor=te===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentFont(te,J)}),G.appendChild(J);var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.fontFamily=te,Ie.style.overflow="hidden";var at=document.createElement("div");at.style.whiteSpace="nowrap",at.style.overflow="hidden",at.style.textOverflow="ellipsis",at.innerHTML="The quick brown fox jumps over the lazy dog",Ie.appendChild(at),J.appendChild(Ie),k.fontBoxes.push(J)}),G},L.prototype.setCurrentFont=function(k,G){var te=this;this.currentFont=k,this.fontBoxes.forEach(function(J){J.style.borderColor=J===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},L}(le),Xe=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=te.defaultColor,J.fontFamily=te.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new _e("Color",te.defaultColorSet,te.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new Ke("Font",te.defaultFontFamilies,te.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return Re(L,Q),L.prototype.ownsTarget=function(k){if(Q.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(te){te===k&&(G=!0)}),G},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.bgRectangle=fe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=fe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(fe.createTransform()),this.textElement.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.renderText=function(){var k=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(G){k.textElement.appendChild(fe.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},L.prototype.getTextScale=function(){var k=this.textElement.getBBox(),G=1;if(k.width>0&&k.height>0){var te=(1*this.width-this.width*this.padding*2/100)/k.width,J=(1*this.height-this.height*this.padding*2/100)/k.height;G=Math.min(te,J)}return G},L.prototype.getTextPosition=function(k){var G=this.textElement.getBBox(),te=0,J=0;return G.width>0&&G.height>0&&(te=(this.width-G.width*k)/2,J=this.height/2-G.height*k/2),{x:te,y:J}},L.prototype.sizeText=function(){var k=this.textElement.getBBox(),G=this.getTextScale(),te=this.getTextPosition(G);te.y-=k.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+te.x+"px, "+te.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(te.x,te.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},L.prototype.manipulate=function(k){Q.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},L.prototype.resize=function(k){Q.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},L.prototype.setSize=function(){Q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},L.prototype.pointerUp=function(k){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),Q.prototype.pointerUp.call(this,k),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},L.prototype.showTextEditor=function(){var k=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(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&G>.9;)G-=.1,k.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var te=G.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(te)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},L.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),te=this.textElement.getBBox(),J={x:te.width*k,y:te.height*k};G.x-=J.x/2,G.y-=J.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},L.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},L.prototype.select=function(){Q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},L.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Q.prototype.deselect.call(this)},L.prototype.dblClick=function(k,G){Q.prototype.dblClick.call(this,k,G),this.showTextEditor()},L.prototype.setColor=function(k){this.textElement&&fe.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},L.prototype.setFont=function(k){this.textElement&&fe.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},L.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},L.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Q.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var G=k;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),Q.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,G){Q.prototype.scale.call(this,k,G),this.setSize(),this.sizeText(),this.positionTextEditor()},L.typeName="TextMarker",L.title="Text marker",L.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>',L}(ft),Se=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=te.defaultColor,J.lineWidth=te.defaultStrokeWidth,J.pixelRatio=te.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new _e("Color",te.defaultColorSet,te.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new xt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return Re(L,Q),L.prototype.ownsTarget=function(k){return!(!Q.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.drawingImage=fe.createImage(),this.visual.appendChild(this.drawingImage);var k=fe.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,G){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(k.x,k.y),this.drawing=!0):Q.prototype.pointerDown.call(this,k,G)},L.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Q.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Q.prototype.resize.call(this,k),fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Q.prototype.pointerUp.call(this,k)},L.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)},L.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Q.prototype.select.call(this)},L.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Q.prototype.deselect.call(this)},L.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],te=G[0],J=G[1],Ie=G[2],at=G[3],St=!1,Ft=0;Ft<this.canvasElement.height;Ft++)for(var ye=0;ye<this.canvasElement.width;ye++)k.data[Ft*this.canvasElement.width*4+4*ye+3]>0&&(St=!0,Ft<J&&(J=Ft),ye<te&&(te=ye),Ft>at&&(at=Ft),ye>Ie&&(Ie=ye));if(St){this.left=te/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(Ie-te)/this.pixelRatio,this.height=(at-J)/this.pixelRatio;var Ut=document.createElement("canvas");Ut.width=Ie-te,Ut.height=at-J,Ut.getContext("2d").putImageData(this.canvasContext.getImageData(te,J,Ie-te,at-J),0,0),this.drawingImgUrl=Ut.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},L.prototype.setDrawingImage=function(){fe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},L.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},L.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Q.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){this.createVisual(),Q.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},L.prototype.scale=function(k,G){Q.prototype.scale.call(this,k,G),this.setDrawingImage()},L.typeName="FreehandMarker",L.title="Freehand marker",L.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>',L}(ft),ge=function(Q){function L(k,G,te){var J=Q.call(this,k,te||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return J.typeBoxes=[],J.currentType=G,J.setCurrentType=J.setCurrentType.bind(J),J}return Re(L,Q),L.prototype.getUi=function(){var k=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var te=function(at){var St="both";switch(at){case 0:St="both";break;case 1:St="start";break;case 2:St="end";break;case 3:St="none"}var Ft=document.createElement("div");if(Ft.style.display="flex",Ft.style.flexGrow="2",Ft.style.alignItems="center",Ft.style.justifyContent="space-between",Ft.style.padding="5px",Ft.style.borderWidth="2px",Ft.style.borderStyle="solid",Ft.style.borderColor=St===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Ft.addEventListener("click",function(){k.setCurrentType(St,Ft)}),G.appendChild(Ft),St==="both"||St==="start"){var ye=document.createElement("div");ye.style.display="flex",ye.style.alignItems="center",ye.style.minHeight="20px",ye.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ye.style.marginLeft="5px",Ft.appendChild(ye)}var Ut=document.createElement("div");Ut.style.display="flex",Ut.style.alignItems="center",Ut.style.minHeight="20px",Ut.style.flexGrow="2";var $t=document.createElement("hr");if($t.style.minWidth="20px",$t.style.border="0px",$t.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),$t.style.flexGrow="2",Ut.appendChild($t),Ft.appendChild(Ut),St==="both"||St==="end"){var Sn=document.createElement("div");Sn.style.display="flex",Sn.style.alignItems="center",Sn.style.minHeight="20px",Sn.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Sn.style.marginRight="5px",Ft.appendChild(Sn)}J.typeBoxes.push(Ft)},J=this,Ie=0;Ie<4;Ie++)te(Ie);return G},L.prototype.setCurrentType=function(k,G){var te=this;this.currentType=k,this.typeBoxes.forEach(function(J){J.style.borderColor=J===G?te.uiStyleSettings!==void 0?te.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},L}(le),Ee=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ge("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return Re(L,Q),L.prototype.ownsTarget=function(k){return!(!Q.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},L.prototype.getArrowPoints=function(k,G){var te=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return k-te/2+","+(G+J/2)+" "+k+","+(G-J/2)+" "+(k+te/2)+","+(G+J/2)},L.prototype.createTips=function(){this.arrow1=fe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=fe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.arrow2)},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(Q.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",fe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),fe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var te=this.arrow2.transform.baseVal.getItem(0);te.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(te,0)}},L.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Q.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Q.prototype.restoreState.call(this,k);var G=k;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},L.typeName="ArrowMarker",L.title="Arrow marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',L}(lt),ie=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.fillColor=te.defaultFillColor,J.strokeWidth=0,J.fillPanel=new _e("Color",te.defaultColorSet,te.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return Re(L,Q),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Q.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="CoverMarker",L.title="Cover marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',L}(ut),ae=function(Q){function L(k,G,te,J){var Ie=Q.call(this,k,J||'<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 Ie.opacities=[],Ie.opacityBoxes=[],Ie.opacities=G,Ie.currentOpacity=te,Ie.setCurrentOpacity=Ie.setCurrentOpacity.bind(Ie),Ie}return Re(L,Q),L.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function(te){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=te===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){k.setCurrentOpacity(te,J)}),G.appendChild(J);var Ie=document.createElement("div");Ie.innerText=100*te+"%",J.appendChild(Ie),k.opacityBoxes.push(J)}),G},L.prototype.setCurrentOpacity=function(k,G){var te=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},L}(le),he=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=te.defaultHighlightColor,J.strokeWidth=0,J.opacity=te.defaultHighlightOpacity,J.fillPanel=new _e("Color",te.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new ae("Opacity",te.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Re(L,Q),L.prototype.setOpacity=function(k){this.opacity=k,this.visual&&fe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Q.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="HighlightMarker",L.title="Highlight marker",L.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>',L}(ie),ve='<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(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=te.defaultStrokeColor,J.bgColor=te.defaultFillColor,J.fontFamily=te.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new _e("Text color",te.defaultColorSet,J.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>'),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new _e("Fill color",te.defaultColorSet,J.bgColor,ve),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new Ke("Font",te.defaultFontFamilies,te.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new tt,J.tipGrip.visual.transform.baseVal.appendItem(fe.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return Re(L,Q),L.prototype.ownsTarget=function(k){return Q.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},L.prototype.createTip=function(){fe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=fe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},L.prototype.pointerDown=function(k,G){this.state==="new"&&Q.prototype.pointerDown.call(this,k,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Q.prototype.pointerDown.call(this,k,G)},L.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Q.prototype.pointerUp.call(this,k);else{var G=this.state==="creating";Q.prototype.pointerUp.call(this,k),this.setTipPoints(G),this.positionTip()}},L.prototype.manipulate=function(k){if(this.tipMoving){var G=this.unrotatePoint(k);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else Q.prototype.manipulate.call(this,k)},L.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(fe.setAttributes(this.bgRectangle,[["fill",k]]),fe.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},L.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},L.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var G=Math.min(this.height/2,15),te=this.height/5;k&&(this.tipPosition={x:G+te/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:0},this.tipBase2Position={x:G+te,y:0}):(this.tipBase1Position={x:0,y:G},this.tipBase2Position={x:0,y:G+te}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-te,y:0},this.tipBase2Position={x:this.width-G,y:0}):(this.tipBase1Position={x:this.width,y:G},this.tipBase2Position={x:this.width,y:G+te}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-te,y:this.height},this.tipBase2Position={x:this.width-G,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-G-te},this.tipBase2Position={x:this.width,y:this.height-G}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:this.height},this.tipBase2Position={x:G+te,y:this.height}):(this.tipBase1Position={x:0,y:this.height-G},this.tipBase2Position={x:0,y:this.height-G-te})},L.prototype.resize=function(k){Q.prototype.resize.call(this,k),this.positionTip()},L.prototype.positionTip=function(){fe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.positionTip(),Q.prototype.select.call(this)},L.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Q.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var G=k;this.bgColor=G.bgColor,this.tipPosition=G.tipPosition,Q.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},L.prototype.scale=function(k,G){Q.prototype.scale.call(this,k,G),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*G},this.positionTip()},L.typeName="CalloutMarker",L.title="Callout marker",L.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>',L}(Xe),Ge=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=te.defaultColor,J.strokeWidth=te.defaultStrokeWidth,J.strokeDasharray=te.defaultStrokeDasharray,J.fillColor=te.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new _e("Line color",pe(te.defaultColorSet,["transparent"]),te.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new _e("Fill color",pe(te.defaultColorSet,["transparent"]),J.fillColor,ve),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new xt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new bt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new ae("Opacity",te.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Re(L,Q),L.prototype.ownsTarget=function(k){return!(!Q.prototype.ownsTarget.call(this,k)&&k!==this.visual)},L.prototype.createVisual=function(){this.visual=fe.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)},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.manipulate=function(k){Q.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Q.prototype.resize.call(this,k),this.setSize()},L.prototype.setSize=function(){Q.prototype.setSize.call(this),fe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},L.prototype.pointerUp=function(k){Q.prototype.pointerUp.call(this,k),this.setSize()},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&fe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},L.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&fe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&fe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&fe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.setOpacity=function(k){this.opacity=k,this.visual&&fe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Q.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),Q.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,G){Q.prototype.scale.call(this,k,G),this.setSize()},L.typeName="EllipseMarker",L.title="Ellipse marker",L.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>',L}(ft),ot=function(Q){function L(k,G,te){return Q.call(this,k,G,te)||this}return Re(L,Q),Object.defineProperty(L.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(k){return!(!Q.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},L.prototype.createTips=function(){this.tip1=fe.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(fe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=fe.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(fe.createTransform()),this.visual.appendChild(this.tip2)},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(Q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(fe.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()]]),fe.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 k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var te=this.tip2.transform.baseVal.getItem(0);te.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(te,0)}},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Q.prototype.getState.call(this);return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Q.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},L.typeName="MeasurementMarker",L.title="Measurement marker",L.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>',L}(lt),Tt=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.strokePanel.colors=te.defaultColorSet,J.fillColor="transparent",J}return Re(L,Q),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Q.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="EllipseFrameMarker",L.title="Ellipse frame marker",L.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>',L}(Ge),Ot=function(){function Q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Q.prototype.addUndoStep=function(L){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(L)||(this.undoStack.push(L),JSON.stringify(this.lastRedoStep)!==JSON.stringify(L)&&this.redoStack.splice(0,this.redoStack.length))},Q.prototype.replaceLastUndoStep=function(L){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=L)},Q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Q.prototype.undo=function(){if(this.undoStack.length>1){var L=this.undoStack.pop();return L!==void 0&&this.redoStack.push(L),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Q}(),wt=function(Q){function L(k,G,te){var J=Q.call(this,k,G,te)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=te.defaultColor,J.strokeWidth=te.defaultStrokeWidth,J.strokeDasharray=te.defaultStrokeDasharray,J.strokePanel=new _e("Line color",te.defaultColorSet,te.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new xt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new bt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Re(L,Q),L.prototype.ownsTarget=function(k){return!(!Q.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},L.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.selectorCurve=fe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=fe.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)},L.prototype.pointerDown=function(k,G){Q.prototype.pointerDown.call(this,k,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},L.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),fe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),fe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setupControlBox=function(){Q.prototype.setupControlBox.call(this),this.curveControlLine1=fe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=fe.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)},L.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Q.prototype.addControlGrips.call(this)},L.prototype.positionGrips=function(){Q.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/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()))},L.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Q.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Q.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},L.prototype.scale=function(k,G){this.curveX=this.curveX*k,this.curveY=this.curveY*G,Q.prototype.scale.call(this,k,G)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Q.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Q.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},L.typeName="CurveMarker",L.title="Curve marker",L.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>',L}(nt),vt=function(){function Q(L,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=L,this.cancelable=k}return Object.defineProperty(Q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Q.prototype.preventDefault=function(){this._defaultPrevented=!0},Q}(),qe=function(Q){function L(k,G,te){var J=Q.call(this,k,!1)||this;return J.dataUrl=G,J.state=te,J}return Re(L,Q),L}(vt),Qe=function(Q){function L(k,G,te){te===void 0&&(te=!1);var J=Q.call(this,k,te)||this;return J.marker=G,J}return Re(L,Q),L}(vt),Ue=function(){function Q(){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 Q.prototype.addEventListener=function(L,k){this[L].push(k)},Q.prototype.removeEventListener=function(L,k){var G=this[L].indexOf(k);G>-1&&this[L].splice(G,1)},Q}(),ue=function(){function Q(L){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Oe,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=Q.instanceCounter++,this.styles=new Pe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=L,this.targetRoot=document.body,this.width=L.clientWidth,this.height=L.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(Q.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ne,Se,Ee,Xe,Tt,Ge,he,Te,ot,ie,lt,wt]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,Se,Ee,Xe,Ge,he,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,Se,Ee,Xe,he]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(L){var k=this;this._availableMarkerTypes.splice(0),L.forEach(function(G){if(typeof G=="string"){var te=k.ALL_MARKER_TYPES.find(function(J){return J.typeName===G});te!==void 0&&k._availableMarkerTypes.push(te)}else k._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(L){this._zoomLevel=L,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(Q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Q.prototype.show=function(){var L=this;this.styles.styleSheetRoot===void 0&&ce.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ce.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new vt(L))})},Q.prototype.render=function(){return Me(this,void 0,void 0,function(){var L;return Be(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(L=new xe).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.markersOnly=this.renderMarkersOnly,L.width=this.renderWidth,L.height=this.renderHeight,[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Q.prototype.close=function(L){var k=this;if(L===void 0&&(L=!1),this.isOpen){var G=!1;L||this.eventListeners.beforeclose.forEach(function(te){var J=new vt(k,!0);te(J),J.defaultPrevented&&(G=!0)}),G||(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(te){return te(new vt(k))}),this.detachEvents(),this._isOpen=!1)}},Q.prototype.addMarkersToToolbar=function(){for(var L,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];(L=this._availableMarkerTypes).push.apply(L,k)},Q.prototype.addRenderEventListener=function(L){this.addEventListener("render",function(k){L(k.dataUrl,k.state)})},Q.prototype.removeRenderEventListener=function(L){},Q.prototype.addCloseEventListener=function(L){this.addEventListener("close",function(){L()})},Q.prototype.removeCloseEventListener=function(L){},Q.prototype.setupResizeObserver=function(){var L=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return L.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Q.prototype.onPopupTargetResize=function(){var L=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/L>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*L:this.editorCanvas.clientWidth,G=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/L;this.resize(k,G)},Q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Q.prototype.resize=function(L,k){this._isResizing=!0;var G=L/this.imageWidth,te=k/this.imageHeight;this.imageWidth=Math.round(L),this.imageHeight=Math.round(k),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(G,te),this._isResizing=!1},Q.prototype.scaleMarkers=function(L,k){var G,te=this;this._currentMarker&&this._currentMarker instanceof Xe?this._currentMarker.scale(L,k):(G=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==te._currentMarker&&J.scale(L,k)}),G!==void 0&&this.setCurrentMarker(G)},Q.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"},Q.prototype.setTopLeft=function(){var L=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=L.left-k.left,this.top=L.top-k.top},Q.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)},Q.prototype.addDefs=function(){for(var L,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];this.defs=fe.createDefs(),this.addDefsToImage(),(L=this.defs).append.apply(L,k)},Q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Q.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)},Q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Q.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)},Q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Q.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)},Q.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 L=document.createElement("a");L.href="https://markerjs.com/",L.target="_blank",L.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>',L.title="Powered by marker.js",L.style.display="grid",L.style.alignItems="center",L.style.justifyItems="center",L.style.padding="3px",L.style.width="20px",L.style.height="20px",this.logoUI.appendChild(L),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Q.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")},Q.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"},Q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Q.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 L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"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 Ve(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 et(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Q.prototype.removeMarker=function(L){this.markerImage.removeChild(L.container),this.markers.indexOf(L)>-1&&this.markers.splice(this.markers.indexOf(L),1),L.dispose()},Q.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())},Q.prototype.toolbarButtonClicked=function(L,k){if(L==="marker"&&k!==void 0)this.createNewMarker(k);else if(L==="action")switch(k){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()}},Q.prototype.deleteSelectedMarker=function(){var L=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(te){var J=new Qe(L,L._currentMarker,!0);te(J),J.defaultPrevented&&(k=!0)}),!k){var G=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(te){return te(new Qe(L,G))})}}},Q.prototype.clear=function(){var L=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ie){var at=new Qe(L,void 0,!0);Ie(at),at.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var G=function(Ie){var at=te.markers[Ie];te.setCurrentMarker(te.markers[Ie]),te._currentMarker.dispose(),te.markerImage.removeChild(te._currentMarker.container),te.markers.splice(te.markers.indexOf(te._currentMarker),1),te.eventListeners.markerdelete.forEach(function(St){return St(new Qe(L,at))})},te=this,J=this.markers.length-1;J>=0;J--)G(J);this.addUndoStep()}},Object.defineProperty(Q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Q.prototype.showNotesEditor=function(){var L;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=(L=this._currentMarker.notes)!==null&&L!==void 0?L:"",this.overlayContainer.appendChild(this.notesArea))},Q.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)},Q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Q.prototype.addUndoStep=function(){var L=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===k.width&&G.height===k.height){var te=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),te<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new vt(L))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(J){return J(new vt(L))})}},Q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Q.prototype.undoStep=function(){var L=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new vt(L))}))},Q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Q.prototype.redoStep=function(){var L=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new vt(L))}))},Q.prototype.stepZoom=function(){var L=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=L<this.zoomSteps.length-1?this.zoomSteps[L+1]:this.zoomSteps[0]},Q.prototype.panTo=function(L){this.contentDiv.scrollBy({left:this.prevPanPoint.x-L.x,top:this.prevPanPoint.y-L.y}),this.prevPanPoint=L},Q.prototype.startRenderAndClose=function(){return Me(this,void 0,void 0,function(){var L,k,G=this;return Be(this,function(te){switch(te.label){case 0:return[4,this.render()];case 1:return L=te.sent(),k=this.getState(),this.eventListeners.render.forEach(function(J){return J(new qe(G,L,k))}),this.close(!0),[2]}})})},Q.prototype.getState=function(L){L===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(G){return k.markers.push(G.getState())}),k},Q.prototype.restoreState=function(L){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);L.markers.forEach(function(G){var te=k._availableMarkerTypes.find(function(Ie){return Ie.typeName===G.typeName});if(te!==void 0){var J=k.addNewMarker(te);J.restoreState(G),k.markers.push(J)}}),L.width&&L.height&&(L.width!==this.imageWidth||L.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/L.width,this.imageHeight/L.height),this.eventListeners.restorestate.forEach(function(G){return G(new vt(k))})},Q.prototype.addNewMarker=function(L){var k=fe.createGroup();return this.markerImage.appendChild(k),new L(k,this.overlayContainer,this.settings)},Q.prototype.createNewMarker=function(L){var k,G=this;(k=typeof L=="string"?this._availableMarkerTypes.find(function(te){return te.typeName===L}):L)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),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(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(te){return te(new Qe(G,G._currentMarker))}))},Q.prototype.markerCreated=function(L){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(L),this.setCurrentMarker(L),L instanceof Se&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Se):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(G){return G(new Qe(k,k._currentMarker))})},Q.prototype.colorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=L,this.settings.defaultStrokeColor=L)},Q.prototype.fillColorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=L)},Q.prototype.markerStateChanged=function(L){var k=this;this.eventListeners.markerchange.forEach(function(G){return G(new Qe(k,L))})},Q.prototype.setCurrentMarker=function(L){var k=this;this._currentMarker!==L&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(G){return G(new Qe(k,k._currentMarker))})),this._currentMarker=L,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(G){return G(new Qe(k,k._currentMarker))}))},Q.prototype.onPointerDown=function(L){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||L.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(L.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:L.clientX,y:L.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY))},Q.prototype.onDblClick=function(L){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(G){return G.ownsTarget(L.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target):this.setCurrentMarker()}},Q.prototype.onPointerMove=function(L){this.touchPoints!==1&&L.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||L.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(L.clientX,L.clientY)):this.zoomLevel>1&&this.panTo({x:L.clientX,y:L.clientY}))},Q.prototype.onPointerUp=function(L){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(L.clientX,L.clientY)),this.isDragging=!1,this.addUndoStep()},Q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Q.prototype.onKeyUp=function(L){this._currentMarker===void 0||this.notesArea!==void 0||L.key!=="Delete"&&L.key!=="Backspace"||this.deleteSelectedMarker()},Q.prototype.clientToLocalCoordinates=function(L,k){var G=this.markerImage.getBoundingClientRect();return{x:(L-G.left)/this.zoomLevel,y:(k-G.top)/this.zoomLevel}},Q.prototype.onWindowResize=function(){this.positionUI()},Q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"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()},Q.prototype.addLicenseKey=function(L){ne.addKey(L)},Q.prototype.addEventListener=function(L,k){this.eventListeners.addEventListener(L,k)},Q.prototype.removeEventListener=function(L,k){this.eventListeners.removeEventListener(L,k)},Q.prototype.renderState=function(L){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(L),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Q.prototype.focus=function(){var L=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new vt(L))}))},Q.prototype.blur=function(){var L=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new vt(L))}))},Q.instanceCounter=0,Q}();/* **********************************
|
|
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 me=function(Q,L){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var te in G)Object.prototype.hasOwnProperty.call(G,te)&&(k[te]=G[te])})(Q,L)};function $e(Q,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function k(){this.constructor=Q}me(Q,L),Q.prototype=L===null?Object.create(L):(k.prototype=L.prototype,new k)}function je(Q,L,k,G){return new(k||(k=Promise))(function(te,J){function Ie(Ft){try{St(G.next(Ft))}catch(ye){J(ye)}}function at(Ft){try{St(G.throw(Ft))}catch(ye){J(ye)}}function St(Ft){var ye;Ft.done?te(Ft.value):(ye=Ft.value,ye instanceof k?ye:new k(function(Ut){Ut(ye)})).then(Ie,at)}St((G=G.apply(Q,L||[])).next())})}function Je(Q,L){var k,G,te,J,Ie={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return J={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function at(St){return function(Ft){return function(ye){if(k)throw new TypeError("Generator is already executing.");for(;Ie;)try{if(k=1,G&&(te=2&ye[0]?G.return:ye[0]?G.throw||((te=G.return)&&te.call(G),0):G.next)&&!(te=te.call(G,ye[1])).done)return te;switch(G=0,te&&(ye=[2&ye[0],te.value]),ye[0]){case 0:case 1:te=ye;break;case 4:return Ie.label++,{value:ye[1],done:!1};case 5:Ie.label++,G=ye[1],ye=[0];continue;case 7:ye=Ie.ops.pop(),Ie.trys.pop();continue;default:if(!(te=Ie.trys,(te=te.length>0&&te[te.length-1])||ye[0]!==6&&ye[0]!==2)){Ie=0;continue}if(ye[0]===3&&(!te||ye[1]>te[0]&&ye[1]<te[3])){Ie.label=ye[1];break}if(ye[0]===6&&Ie.label<te[1]){Ie.label=te[1],te=ye;break}if(te&&Ie.label<te[2]){Ie.label=te[2],Ie.ops.push(ye);break}te[2]&&Ie.ops.pop(),Ie.trys.pop();continue}ye=L.call(Q,Ie)}catch(Ut){ye=[6,Ut],G=0}finally{k=te=0}if(5&ye[0])throw ye[1];return{value:ye[0]?ye[1]:void 0,done:!0}}([St,Ft])}}}var mt=function(){function Q(){}return Q.addKey=function(L){Q.key=L},Object.defineProperty(Q,"isLicensed",{get:function(){return!!Q.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Q.key)},enumerable:!1,configurable:!0}),Q}(),We=function(){function Q(){}return Q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Q.setAttributes=function(L,k){for(var G=0,te=k;G<te.length;G++){var J=te[G],Ie=J[0],at=J[1];L.setAttribute(Ie,at)}},Q.createRect=function(L,k,G){var te=document.createElementNS("http://www.w3.org/2000/svg","rect");return te.setAttribute("width",L.toString()),te.setAttribute("height",k.toString()),G&&Q.setAttributes(te,G),te},Q.createLine=function(L,k,G,te,J){var Ie=document.createElementNS("http://www.w3.org/2000/svg","line");return Ie.setAttribute("x1",L.toString()),Ie.setAttribute("y1",k.toString()),Ie.setAttribute("x2",G.toString()),Ie.setAttribute("y2",te.toString()),J&&Q.setAttributes(Ie,J),Ie},Q.createPolygon=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",L),k&&Q.setAttributes(G,k),G},Q.createCircle=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(L/2).toString()),G.setAttribute("cy",(L/2).toString()),G.setAttribute("r",L.toString()),k&&Q.setAttributes(G,k),G},Q.createEllipse=function(L,k,G){var te=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return te.setAttribute("cx",(L/2).toString()),te.setAttribute("cy",(k/2).toString()),te.setAttribute("rx",(L/2).toString()),te.setAttribute("ry",(k/2).toString()),G&&Q.setAttributes(te,G),te},Q.createGroup=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&Q.setAttributes(k,L),k},Q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Q.createMarker=function(L,k,G,te,J,Ie,at){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return Q.setAttributes(St,[["id",L],["orient",k],["markerWidth",G.toString()],["markerHeight",te.toString()],["refX",J.toString()],["refY",Ie.toString()]]),St.appendChild(at),St},Q.createText=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),L&&Q.setAttributes(k,L),k},Q.createTSpan=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=L,k&&Q.setAttributes(G,k),G},Q.createImage=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&Q.setAttributes(k,L),k},Q.createPoint=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=L,G.y=k,G},Q.createPath=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",L),k&&Q.setAttributes(G,k),G},Q.createElement=function(L,k){var G=document.createElementNS("http://www.w3.org/2000/svg",L);return k&&Q.setAttributes(G,k),G},Q.getHollowRectanglePath=function(L,k,G,te,J,Ie,at,St){return"M"+L+","+k+"V"+(k+te)+"H"+(L+G)+"V"+k+"H"+J+"V"+Ie+"H"+(J+at)+"V"+(Ie+St)+"H"+J+"V"+k+"Z"},Q}(),it=function(){function Q(L){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(Q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Q.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(Q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Q.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},Q.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},Q.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new st("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new dt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new dt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Q.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Q}(),st=function(Q,L){this.selector=Q,this.style=L},dt=function(Q,L){this.localName=Q,this.style=L},Et=function(){function Q(){this.blocks=[],this.display=""}return Q.prototype.addButtonBlock=function(L){L.className=this.blockClassName,L.buttonClassName=this.buttonClassName,L.buttonColorsClassName=this.buttonColorsClassName,L.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(L)},Q.prototype.addElementBlock=function(L){L.className===void 0&&(L.className=this.blockClassName),this.blocks.push(L)},Q.prototype.getUI=function(){var L=document.createElement("div");return L.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,L.style.display=this.display,this.blocks.forEach(function(k){return L.appendChild(k.getUI())}),L},Q}(),jt=function(){function Q(){}return Q.prototype.getUI=function(){var L=document.createElement("div");if(L.className=this.className,this.minWidth!==void 0&&(L.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":L.style.justifyContent="flex-start";break;case"center":L.style.justifyContent="center";break;case"end":L.style.justifyContent="flex-end"}return L.style.whiteSpace="nowrap",L},Q}(),en=function(Q){function L(){var k=Q!==null&&Q.apply(this,arguments)||this;return k.buttons=[],k}return $e(L,Q),L.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},L.prototype.getUI=function(){var k=Q.prototype.getUI.call(this);return this.buttons.forEach(function(G){return k.appendChild(G.getUI())}),k},L}(jt),Yt=function(){function Q(L,k){this._isActive=!1,this._isHidden=!1,this._icon=L,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Q.prototype,"icon",{get:function(){return this._icon},set:function(L){this._icon=L,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isActive",{get:function(){return this._isActive},set:function(L){this._isActive=L,this.adjustClassName()},enumerable:!1,configurable:!0}),Q.prototype.getUI=function(){var L=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 L.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Q.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,"")))},Q.prototype.hide=function(){this._isHidden=!0},Q}(),Ct=function(Q){function L(){var k=Q!==null&&Q.apply(this,arguments)||this;return k.elements=[],k}return $e(L,Q),L.prototype.addElement=function(k){this.elements.push(k)},L.prototype.getUI=function(){var k=Q.prototype.getUI.call(this);return this.elements.forEach(function(G){return k.appendChild(G)}),k},L}(jt),pn=function(){function Q(L,k){this.horizontal=L,this.vertical=k}return Object.defineProperty(Q.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Q.prototype.getVerticalLength=function(L){return L/this.ratio},Q.prototype.getHorizontalLength=function(L){return L*this.ratio},Q}(),Rt=function(){function Q(){}return Q.getIcon=function(L,k){if(L>0&&k>0){var G=new pn(L,k),te=G.ratio>=1?20:G.getHorizontalLength(20),J=G.ratio<1?20:G.getVerticalLength(20),Ie=document.createElementNS("http://www.w3.org/2000/svg","svg");Ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ie);var at=We.createDefs();Ie.appendChild(at);var St=We.createElement("clipPath",[["id","text-bg-clip"]]);at.appendChild(St);var Ft=We.createPath(We.getHollowRectanglePath((24-te)/2,(24-J)/2,te,J,(24-te)/2+2,(24-J)/2+2,te-4,J-4));Ie.appendChild(Ft);var ye=We.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ye.appendChild(We.createTSpan(L+":"+k)),Ie.appendChild(ye);var Ut=ye.getBBox();We.setAttributes(ye,[["x",((24-Ut.width)/2).toString()],["y",((24-Ut.height)/2-Ut.y).toString()]]);var $t=We.createPath(We.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ut.width))/2,(24-Math.ceil(Ut.height))/2,Math.ceil(Ut.width),Math.ceil(Ut.height)));return St.appendChild($t),We.setAttributes(Ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ie),Ie.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>'},Q}(),zt=function(Q){function L(k,G,te){var J=Q.call(this,k,G)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=te,J}return $e(L,Q),L.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(G){G.className=k.className,G.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(G.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},L.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},L.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},L.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},L.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},L.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},L}(Yt),Pt=function(){function Q(L,k){this.GRIP_SIZE=10,this.color=L,this.fillColor=k,this.visual=We.createGroup(),this.visual.appendChild(We.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(We.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Q.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},Q.prototype.setCenter=function(L,k){this.visual.childNodes.forEach(function(G){return We.setAttributes(G,[["cx",L.toString()],["cy",k.toString()]])})},Q}(),qt=function(){function Q(L,k,G,te){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=L,this.canvasHeight=k,this.margin=G,this.container=te,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(Q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(L){this._aspectRatio=L,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.gridContainer&&We.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(L){this._zoomFactor=L,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Q.prototype.open=function(){var L=this;this.cropShadeElement=We.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=We.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(We.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(We.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(G){return L.gridContainer.appendChild(G)}),this.verticalGridLines.forEach(function(G){return L.gridContainer.appendChild(G)}),this.cropRectElement=We.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Q.prototype.setCropRectangle=function(L){this.cropRect=L;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),We.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var G=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,Ie){var at=k.y+G*(Ie+1);We.setAttributes(J,[["x1",""+k.x],["y1",""+at],["x2",""+(k.x+k.width)],["y2",""+at]])});var te=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,Ie){var at=k.x+te*(Ie+1);We.setAttributes(J,[["x1",""+at],["y1",""+k.y],["x2",""+at],["y2",""+(k.y+k.height)]])}),We.setAttributes(this.cropShadeElement,[["d",We.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Q.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)},Q.prototype.clientToLocalCoordinates=function(L,k){var G=this.container.getBoundingClientRect();return{x:L-G.left+this.margin,y:k-G.top+this.margin}},Q.prototype.onPointerDown=function(L){this.container.setPointerCapture(L.pointerId),this.previousPoint=this.clientToLocalCoordinates(L.clientX,L.clientY),this.cropRectElement===L.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(L.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(L.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(L.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(L.target)&&(this.activeGrip=this.bottomRightGrip)},Q.prototype.onPointerMove=function(L){if(this.isMoving)this.move(this.clientToLocalCoordinates(L.clientX,L.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(L.clientX,L.clientY);this.resize(k)}L.preventDefault()},Q.prototype.onPointerUp=function(L){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(L.pointerId)},Q.prototype.move=function(L){var k=L.x-this.previousPoint.x,G=L.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,G=-G/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+G),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=L},Q.prototype.resize=function(L){var k=Object.assign({},this.cropRect),G=L.x-this.previousPoint.x,te=L.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+G<this.margin&&(G=this.margin-k.x),k.x+=G,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+G>this.canvasWidth*this.zoomFactor&&(G=this.canvasWidth*this.zoomFactor-k.width),k.width+=G}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(G),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=te,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=te}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=L,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var L=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,G=this.aspectRatio.getHorizontalLength(this.cropRect.height),te=this.aspectRatio.getVerticalLength(this.cropRect.width);G/this.canvasWidth<te/this.canvasHeight?this.cropRect.width=G:this.cropRect.height=te,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=L-this.cropRect.width/2,this.cropRect.y=k-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)}},Q.prototype.getRescaledRect=function(L,k,G,te,J,Ie){var at=G/L,St=te/k;return{x:(J.x-Ie)*at+Ie,y:(J.y-Ie)*St+Ie,width:J.width*at,height:J.height*St}},Q.prototype.scaleCanvas=function(L,k){var G=this.getRescaledRect(this.canvasWidth,this.canvasHeight,L,k,this.cropRect,this.margin);this.canvasWidth=L,this.canvasHeight=k,this.onCropChange&&this.onCropChange(G),this.setCropRectangle(G)},Q}(),yn=function(){function Q(L){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=L,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(Q.prototype,"angle",{get:function(){return this._angle},set:function(L){this._angle=L,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Q.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},Q.prototype.onPointerDown=function(L){this.controlContainer.setPointerCapture(L.pointerId),this.isDragging=!0,this.previousPoint={x:L.clientX,y:L.clientY}},Q.prototype.onPointerMove=function(L){this.isDragging&&(this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.previousPoint.x=L.clientX)},Q.prototype.onPointerUp=function(L){this.isDragging&&this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(L.pointerId)},Q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var L=this.angleLabelText.getBBox();We.setAttributes(this.angleLabelElement,[["x",((this.width-L.width)/2).toString()],["y",(this.height/2).toString()]])}},Q.prototype.positionScaleShape=function(){if(this.scaleShape){var L=this.scaleShape.transform.baseVal.getItem(0);L.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(L,0)}},Q.prototype.getVisual=function(){var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("width",this.width+"px"),L.setAttribute("height",this.height+"px"),L.setAttribute("viewBox","0 0 "+this.width+" "+this.height),L.style.flexShrink="0",document.body.appendChild(L);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,G=1;G<=this.width/5+10;G++){var te=G%5==0?this.height/3:this.height/6;k+="h4v"+-te+"h1v"+te}k+="v1H0Z",this.scaleShape=We.createPath(k);var J=We.createTransform();this.scaleShape.transform.baseVal.appendItem(J),L.appendChild(this.scaleShape),this.angleLabelElement=We.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=We.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ie=We.createTSpan("");return Ie.innerHTML="°",this.angleLabelElement.appendChild(Ie),L.appendChild(this.angleLabelElement),document.body.removeChild(L),L},Q}(),wn=function(){function Q(){this.naturalSize=!1,this.imageType="image/png"}return Q.prototype.rasterize=function(L,k,G,te,J,Ie,at){var St=this;return new Promise(function(Ft){var ye=document.createElement("canvas");ye.width=L.width.baseVal.value-2*te,ye.height=L.height.baseVal.value-2*te;var Ut=1,$t=1;St.naturalSize===!0?(Ut=k.naturalWidth/(L.width.baseVal.value-2*te)/Ie,$t=k.naturalHeight/(L.height.baseVal.value-2*te)/at,ye.width=k.naturalWidth/Ie,ye.height=k.naturalHeight/at):St.width!==void 0&&St.height!==void 0&&(Ut=St.width/G.width,$t=St.height/G.height,ye.width*=Ut,ye.height*=$t);var Sn=ye.getContext("2d");Sn.translate(ye.width/2,ye.height/2),Sn.rotate(J*Math.PI/180),Sn.scale(Ie,at),Sn.translate(-ye.width/2,-ye.height/2),Sn.drawImage(k,0,0,ye.width,ye.height);var Hn=document.createElement("canvas");Hn.width=G.width*Ut,Hn.height=G.height*$t,Hn.getContext("2d").putImageData(Sn.getImageData((G.x-te)*Ut,(G.y-te)*$t,G.width*Ut,G.height*$t),0,0),Ft(Hn.toDataURL(St.imageType,St.imageQuality))})},Q}(),yt=function(){function Q(L){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=Q.instanceCounter++,this.styles=new it(this.instanceNo),this.target=L,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(Q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(L){this._zoomToCropEnabled=L,L?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(L){this._gridLines=L,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(L){this._rotationAngle=L,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"aspectRatio",{get:function(){var L;return(L=this._aspectRatio)!==null&&L!==void 0?L:this.aspectRatios[0]},set:function(L){this._aspectRatio=L},enumerable:!1,configurable:!0}),Q.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},Q.prototype.show=function(){this.showUI(),this.open()},Q.prototype.close=function(L){L===void 0&&(L=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),L||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Q.prototype.addRenderEventListener=function(L){this.renderEventListeners.push(L)},Q.prototype.removeRenderEventListener=function(L){this.renderEventListeners.indexOf(L)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(L),1)},Q.prototype.addCloseEventListener=function(L){this.closeEventListeners.push(L)},Q.prototype.removeCloseEventListener=function(L){this.closeEventListeners.indexOf(L)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(L),1)},Q.prototype.setupResizeObserver=function(){var L=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.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))},Q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var L=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/L>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*L:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,G=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/L;this.resize(k,G)}},Q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Q.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",We.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Q.prototype.resize=function(L,k){this.imageWidth=Math.round(L),this.imageHeight=Math.round(k),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()},Q.prototype.setEditingTarget=function(){var L=document.createElement("canvas");L.width=this.target.naturalWidth,L.height=this.target.naturalHeight,L.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=L.toDataURL();We.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},Q.prototype.setTopLeft=function(){var L=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=L.left-k.left-this.CANVAS_MARGIN,this.top=L.top-k.top-this.CANVAS_MARGIN},Q.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=We.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=We.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=We.createGroup(),this.editingTargetRotationScaleContainer=We.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var L=We.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(L);var k=We.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=We.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)},Q.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Q.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=We.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new qt(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()},Q.prototype.zoomToCrop=function(){if(this.cropRect){var L=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,k=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=L+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-L+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Q.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)},Q.prototype.cropRectChanged=function(L){this.cropRect=L,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Q.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Q.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"},Q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Q.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 L=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>L+this.CANVAS_MARGIN?this.target.offsetTop-(L+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"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},Q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Q.prototype.addTopToolbar=function(){var L=this;this.topToolbar=new Et,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 k=new en;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var G=[];this.aspectRatios.forEach(function($t){var Sn=new Yt(Rt.getIcon($t.horizontal,$t.vertical),$t.horizontal===0&&$t.vertical===0?"FREE":$t.horizontal+":"+$t.vertical);Sn.onClick=function(){return L.ratioButtonClicked($t)},G.push(Sn)}),this.aspectRatioButton=new zt(Rt.getIcon(0,0),"Aspect ratio",G),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var te=new Yt('<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");te.isActive=this.isGridVisible,te.onClick=function(){L.isGridVisible=!L.isGridVisible,te.isActive=L.isGridVisible},k.addButton(te);var J=new Yt('<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(J.isActive=this.zoomToCropEnabled,J.onClick=function(){L.zoomToCropEnabled=!L.zoomToCropEnabled,J.isActive=L.zoomToCropEnabled},k.addButton(J),!mt.isLicensed){var Ie=new Ct;this.topToolbar.addElementBlock(Ie);var at=document.createElement("div");at.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var St=document.createElement("a");St.style.color="currentColor",St.href="https://markerjs.com/products/cropro",St.target="_blank",St.innerHTML='<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>',at.appendChild(St),Ie.addElement(at)}var Ft=new en;Ft.minWidth=3*this.toolbarHeight+"px",Ft.contentAlign="end",this.topToolbar.addButtonBlock(Ft);var ye=new Yt('<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");ye.onClick=this.startRenderAndClose,Ft.addButton(ye),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ye.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ut=new Yt('<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");Ut.onClick=this.close,Ft.addButton(Ut),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ut.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Q.prototype.addBottomToolbar=function(){var L=this;this.bottomToolbar=new Et,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 k=new en;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var G=new Yt('<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");G.onClick=this.rotateLeftButtonClicked,k.addButton(G);var te=new Yt('<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");te.onClick=this.rotateRightButtonClicked,k.addButton(te);var J=new Ct;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),this.straightener=new yn("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(Ft){L.rotateBy(Ft),L.straightener.angle=L.rotationAngle},J.addElement(this.straightener.getUI());var Ie=new en;Ie.minWidth=2*this.toolbarHeight+"px",Ie.contentAlign="end",this.bottomToolbar.addButtonBlock(Ie);var at=new Yt('<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");at.onClick=this.flipHorizontallyButtonClicked,Ie.addButton(at);var St=new Yt('<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");St.onClick=this.flipVerticallyButtonClicked,Ie.addButton(St)},Q.prototype.ratioButtonClicked=function(L){this.aspectRatio=L,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Rt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new pn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Q.prototype.restoreState=function(L){if(L){var k=this.cropLayer.getRescaledRect(L.width,L.height,this.imageWidth,this.imageHeight,L.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=L.flippedHorizontally,this.flippedVertically=L.flippedVertically,this.applyFlip(),this.rotationAngle=L.rotationAngle,this.applyRotation()}},Q.prototype.clientToLocalCoordinates=function(L,k){var G=this.cropImage.getBoundingClientRect();return{x:L-G.left,y:k-G.top}},Q.prototype.onWindowResize=function(){this.positionUI()},Q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var L=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=L+"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()},Q.prototype.rotateLeftButtonClicked=function(){var L=this.rotationAngle-90;this.rotationAngle%90!=0&&(L+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(L)},Q.prototype.rotateRightButtonClicked=function(){var L=this.rotationAngle+90;this.rotationAngle%90!=0&&(L-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(L)},Q.prototype.rotateTo=function(L){L=(L=L>180?L-360:L)<=-180?L+360:L,this.rotationAngle=L,this.applyRotation()},Q.prototype.rotateBy=function(L){this.rotateTo((this.rotationAngle+L)%360)},Q.prototype.applyRotation=function(){var L=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var G=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/G.width,this.imageHeight/G.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=L},Q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Q.prototype.startRenderAndClose=function(){return je(this,void 0,void 0,function(){var L,k;return Je(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return L=G.sent(),k=this.getState(),this.renderEventListeners.forEach(function(te){return te(L,k)}),this.close(!0),[2]}})})},Q.prototype.render=function(){return je(this,void 0,void 0,function(){var L;return Je(this,function(k){switch(k.label){case 0:return(L=new wn).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.width=this.renderWidth,L.height=this.renderHeight,this.unzoomFromCrop(),We.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,L.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 k.sent(),[4,L.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,k.sent()]}})})},Q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new dt("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 dt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new dt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var L=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new dt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*L)+`px;
|
|
height: `+(this.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new dt("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 dt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new dt("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 dt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new dt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},Q.instanceCounter=0,Q}(),Vt=U("8hTe"),Mn=U.n(Vt),Un=/<pre[^>]*>/g;function Pn(Q){var L=document.createElement("div");return L.innerHTML=Q,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var Vn=se.a=function(Q){var L=Q.value,k=L===void 0?"":L,G=Q.edit,te=G===void 0?!1:G,J=Q.className,Ie=Q.showTextOnly,at=Q.showLines,St=Q.replaces,Ft=Q.zoomImg,ye=Q.hasMask,Ut=Q.style,$t=Ut===void 0?{}:Ut,Sn=Q.stylesPrev,Hn=Sn===void 0?{}:Sn,Kn=String(k),In=Object(D.useRef)(),pr=Object(D.useRef)(),ur=Object(D.useState)(""),Bn=Object(K.a)(ur,2),cr=Bn[0],Ar=Bn[1],Cr=Object(D.useState)("office"),Yn=Object(K.a)(Cr,2),Wr=Yn[0],Pr=Yn[1],yr=function(){var sn=new yt(pr.current);sn.displayMode="popup",sn.addRenderEventListener(function(){var Ln=Object(M.a)(n.a.mark(function un(Rn){var bn;return n.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return In.current.style.display="none",jn.next=3,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Rn}});case 3:bn=jn.sent,bn!=null&&bn.id&&St(pr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(bn==null?void 0:bn.id,"?type=").concat(bn.content_type));case 5:case"end":return jn.stop()}},un)}));return function(un){return Ln.apply(this,arguments)}}()),sn.show()},Qr=function(){var sn=new ue(pr.current);sn.settings.displayMode="popup",sn.addEventListener("render",function(){var Ln=Object(M.a)(n.a.mark(function un(Rn){var bn;return n.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:if(In.current.style.display="none",!pr.current){jn.next=6;break}return jn.next=4,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Rn.dataUrl}});case 4:bn=jn.sent,bn!=null&&bn.id&&St(pr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(bn==null?void 0:bn.id,"?type=").concat(bn.content_type));case 6:case"end":return jn.stop()}},un)}));return function(un){return Ln.apply(this,arguments)}}()),sn.show(),window.markerArea=sn},br=Object(D.useMemo)(function(){In.current&&(In.current.style.zIndex=-1);try{var _n=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,sn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ln=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kn=Kn.replace(_n,"("+$.a.API_SERVER+"/api/attachments/").replace(sn,'"'+$.a.API_SERVER+"/api/attachments/").replace(Ln,'"'+$.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(Or){}var un=j(Kn),Rn=A();if(Kn.match(/\[TOC\]/)&&(un=un.replace("<p>[TOC]</p>",I()),R()),un=un.replace(/(__special_katext_id_\d+__)/g,function(Or,jn){var Xn=Rn[jn],Kr=Xn.type,Rr=Xn.expression;return Object(oe.renderToString)(Pn(Rr)||"",{displayMode:Kr==="block",throwOnError:!1,output:"html"})}),un=un.replace(/▁/g,"\u2581\u2581\u2581"),E(),Ie){var bn=document.createElement("div");return bn.innerHTML=un,bn.innerText}return setTimeout(function(){return Hr()},500),un},[Kn]),dr=Object(D.useRef)();S.WebkitLineClamp=at,at&&($t=Object(W.a)(Object(W.a)({},$t),S));function Nr(_n){var sn=_n.target;if(sn.tagName.toUpperCase()==="IMG"){if(Ft){var Ln=sn.getAttribute("src");Ar(Ln),Pr("image")}}else if(sn.tagName.toUpperCase()==="A"){var un=sn.getAttribute("href");if(un.indexOf("office")>-1)_n.preventDefault(),Ar(un),Pr("office");else if(un.indexOf("application/pdf")>-1)_n.preventDefault(),Ar(un),Pr("pdf");else if(un.indexOf("text/html")>-1)_n.preventDefault(),Ar(un),Pr("html");else if(un.startsWith("#")){_n.preventDefault();var Rn=document.getElementById(un.replace("#",""));Rn&&Rn.scrollIntoView(!0)}}}var Hr=function(){var sn,Ln=(sn=dr.current)===null||sn===void 0?void 0:sn.querySelectorAll("video");Ln==null||Ln.forEach(function(un){if(un.oncontextmenu=function(){return!1},un.src.indexOf(".m3u8")>-1&&!un.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var Rn=new Y.a;Rn.loadSource(un.src),Rn.attachMedia(un)}}})};Object(D.useEffect)(function(){if(dr.current&&br&&(br.match(Un)&&window.PR.prettyPrint()),dr.current)return dr.current.addEventListener("click",Nr),function(){dr.current.removeEventListener("click",Nr),E(),R()}},[br,dr.current,Nr]);var Er=function(sn){if(!te)return;sn.target.nodeName==="IMG"?(In.current.style.zIndex=1,In.current.style.display="flex",In.current.style.width=sn.target.clientWidth+"px",In.current.style.height=sn.target.clientHeight+"px",In.current.style.top=sn.target.offsetTop+"px",In.current.style.left=sn.target.offsetLeft+"px",pr.current.src=sn.target.getAttribute("src")):In.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:dr,style:Object(W.a)({},$t),className:"".concat(J||""," markdown-body ").concat(Mn.a.mdBody),onMouseOver:Er,dangerouslySetInnerHTML:{__html:br}}),y.a.createElement("div",{ref:In,className:Mn.a.button},y.a.createElement(z.a,null,y.a.createElement(V.a,{onClick:function(){return yr()}},"\u88C1\u526A"),y.a.createElement(V.a,{onClick:function(){return Qr()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:pr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(de.a,{close:!0,data:cr,type:cr!=null&&cr.length?Wr:"",style:Object(W.a)({},Hn),onClose:function(){return Ar("")}}))}},"9GDu":function(Ye,se,U){Ye.exports={flex_box_center:"flex_box_center___2Dduc",flex_space_between:"flex_space_between___2Le2r",flex_box_vertical_center:"flex_box_vertical_center___2KZsK",flex_box_center_end:"flex_box_center_end___1aosz",flex_box_column:"flex_box_column___cFN2D",bg:"bg___ka_0p",title:"title___3M9-E",questionIcons:"questionIcons___VjWTs",green:"green___2q3Jn",orange:"orange___KXt8o",greenTip:"greenTip___1nV5h",redTip:"redTip___3QDm4",orangeTip:"orangeTip___3F21W",pollDesc:"pollDesc___3Jb8Y",answered:"answered___1tbR8",unanswer:"unanswer___2Jts9",anchor:"anchor___3_nBp",answerFlag:"answerFlag___32KcB",flagActive:"flagActive___3ac8b",flagHalf:"flagHalf___1AvT6",answerStudentFlag:"answerStudentFlag___UbvlB",answerStudentActive:"answerStudentActive___27het",questionItem:"questionItem___3nBk4",itemType:"itemType___3NNh-",itemFlag:"itemFlag___2fz1F",answerWrap:"answerWrap___23vJg",answerSubjective:"answerSubjective___1i3N-",otherInput:"otherInput___gQ5U6",submitButton:"submitButton___RAvWu",randomFlag:"randomFlag___1J_UJ",answerTrue:"answerTrue___1cUgp",answerFalse:"answerFalse___Q16xV",answerHalf:"answerHalf___2I-fp",renderHtml:"renderHtml___1O15z",simpleText:"simpleText___1-h1E",answerYes:"answerYes___3w-7A",answerNo:"answerNo___2TuuH",answerInfo:"answerInfo___3KPDJ",answerSheet:"answerSheet___1UuGf",active:"active___2njWQ",countDown:"countDown___ViVY-",red:"red___RmODq",fold:"fold___ZVRBm",cardList:"cardList___1KJD0",iframe:"iframe___8V6GW"}},"9VGf":function(Ye,se,U){"use strict";U.d(se,"a",function(){return N});var Z=U("q1tI"),z=U.n(Z);function N(V,W){var M=Object(Z.useRef)();Object(Z.useEffect)(function(){M.current=V}),Object(Z.useEffect)(function(){function K(){M.current()}if(W!==null){var H=setInterval(K,W);return function(){return clearInterval(H)}}},[W])}},"A/g1":function(Ye,se){Ye.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjEtMDctMDJUMTk6Mzg6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmVkYzRhODM0LTVjNWQtNDQ1My04MDYzLWNkNzcwODQyODg5ZSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjQ4MTE0OTVlLTVkMDctZTk0YS1iNWEwLWYxOWJmZmM0NGUyNyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmMwNjQyYzA1LTg5MzQtNDdlYy04MTFiLTlkYjdhZGNkYjFiMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YzA2NDJjMDUtODkzNC00N2VjLTgxMWItOWRiN2FkY2RiMWIwIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjM4OjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZWRjNGE4MzQtNWM1ZC00NDUzLTgwNjMtY2Q3NzA4NDI4ODllIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5fJkpyAAAGoElEQVRogc2abWxbVxnH/8+59/rdTpx2GW3UNWJJV7Ylaxp3LUFsWgJDiI5R8bK2GppAmsgQLKQthS8IEJ9okibrREf3gX2Y1K2bxAoDtog60RBSVxKnWUO7kpSppXJZK2ja2HFi33vPw4cmpbN9r++1k8Lv2znnf577f+zje95Mhw4dQqUkwljpF7kuv0EdHkm1HklRr6TQq2tn5xcklwhIMnMSQJIJxykTiSce+1am0mer5XacqM7uDJjiqbAuWlvSygrBnmKyxcoI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"},BU3w:function(Ye,se,U){"use strict";U.d(se,"a",function(){return M});var Z=U("MNnm"),z="rc-util-key";function N(K){if(K.attachTo)return K.attachTo;var H=document.querySelector("head");return H||document.body}function V(K){var H,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var D=document.createElement("style");if((H=n.csp)===null||H===void 0?void 0:H.nonce){var y;D.nonce=(y=n.csp)===null||y===void 0?void 0:y.nonce}D.innerHTML=K;var m=N(n),f=m.firstChild;return n.prepend&&m.prepend?m.prepend(D):n.prepend&&f?m.insertBefore(D,f):m.appendChild(D),D}var W=new Map;function M(K,H){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=N(n);if(!W.has(D)){var y=V("",n),m=y.parentNode;W.set(D,m),m.removeChild(y)}var f=Array.from(W.get(D).children).find(function(u){return u.tagName==="STYLE"&&u[z]===H});if(f){var c,l;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&f.nonce!==((l=n.csp)===null||l===void 0?void 0:l.nonce)){var d;f.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return f.innerHTML!==K&&(f.innerHTML=K),f}var o=V(K,n);return o[z]=H,o}},Bd2K:function(Ye,se,U){(function(Z){Z(U("VrN/"),U("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(n,D,y){if(y!=Z.Init&&y&&n.removeKeyMap("autoCloseTags"),!D)return;var m={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(m["'/'"]=function(f){return M(f)}),(typeof D!="object"||D.whenOpening!==!1)&&(m["'>'"]=function(f){return V(f)}),n.addKeyMap(m)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["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(),y=[],m=n.getOption("autoCloseTags"),f=0;f<D.length;f++){if(!D[f].empty())return Z.Pass;var c=D[f].head,l=n.getTokenAt(c),d=Z.innerMode(n.getMode(),l.state),o=d.state,u=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(o),a=u&&u.name;if(!a)return Z.Pass;var i=d.mode.configuration=="html",R=typeof m=="object"&&m.dontCloseTags||i&&z,S=typeof m=="object"&&m.indentTags||i&&N;l.end>c.ch&&(a=a.slice(0,a.length-l.end+c.ch));var T=a.toLowerCase();if(!a||l.type=="string"&&(l.end!=c.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&u.close||l.string.indexOf("/")==c.ch-l.start-1||R&&K(R,T)>-1||H(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(o)||[],a,c,!0))return Z.Pass;var I=typeof m=="object"&&m.emptyTags;if(I&&K(I,a)>-1){y[f]={text:"/>",newPos:Z.Pos(c.line,c.ch+2)};continue}var O=S&&K(S,T)>-1;y[f]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+a+">",newPos:O?Z.Pos(c.line+1,0):Z.Pos(c.line,c.ch+1)}}for(var _=typeof m=="object"&&m.dontIndentOnAutoClose,f=D.length-1;f>=0;f--){var b=y[f];n.replaceRange(b.text,D[f].head,D[f].anchor,"+insert");var p=n.listSelections().slice(0);p[f]={head:b.newPos,anchor:b.newPos},n.setSelections(p),!_&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function W(n,D){for(var y=n.listSelections(),m=[],f=D?"/":"</",c=n.getOption("autoCloseTags"),l=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<y.length;d++){if(!y[d].empty())return Z.Pass;var o=y[d].head,u=n.getTokenAt(o),a=Z.innerMode(n.getMode(),u.state),i=a.state;if(D&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=o.ch-1))return Z.Pass;var R,S=a.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(S&&a.mode.name=="javascript")R=f+"script";else if(S&&a.mode.name=="css")R=f+"style";else{var T=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(i);if(!T||T.length&&H(n,T,T[T.length-1],o))return Z.Pass;R=f+T[T.length-1]}n.getLine(o.line).charAt(u.end)!=">"&&(R+=">"),m[d]=R}if(n.replaceSelections(m),y=n.listSelections(),!l)for(var d=0;d<y.length;d++)(d==y.length-1||y[d].head.line<y[d+1].head.line)&&n.indentLine(y[d].head.line)}function M(n){return n.getOption("disableInput")?Z.Pass:W(n,!0)}Z.commands.closeTag=function(n){return W(n)};function K(n,D){if(n.indexOf)return n.indexOf(D);for(var y=0,m=n.length;y<m;++y)if(n[y]==D)return y;return-1}function H(n,D,y,m,f){if(!Z.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,m.line+500),l=Z.scanForClosingTag(n,m,null,c);if(!l||l.tag!=y)return!1;for(var d=f?1:0,o=D.length-1;o>=0&&D[o]==y;o--)++d;m=l.to;for(var o=1;o<d;o++){var u=Z.scanForClosingTag(n,m,null,c);if(!u||u.tag!=y)return!1;m=u.to}return!0}})},BjJ7:function(Ye,se,U){"use strict";U.d(se,"d",function(){return z}),U.d(se,"c",function(){return N}),U.d(se,"e",function(){return V}),U.d(se,"b",function(){return W}),U.d(se,"a",function(){return K});var Z=U("m3rI");function z(H){var n=!0;if(H.length>0){for(var D=0;D<H.length;D++)if(H[D].compile_success==0||!H[D].compile_success){n=!1;break}}else n=!1;return n}function N(H){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],y=0;y<H.length;y++){var m=H[y],f=n?"".concat(n,"/").concat(m.name):"".concat(m.name);D.push({title:m.name,isLeaf:!(m.type==="tree"),key:f})}return D}function V(H,n,D){for(var y=0;y<H.length;y++){var m=H[y];if(m.key===n){m.children=D;break}m.children&&V(m.children,n,D)}return H}function W(H,n,D){var y;return function(){var m=this,f=arguments,c=function(){y=null,D||H.apply(m,f)},l=D&&!y;clearTimeout(y),y=setTimeout(c,n),l&&H.apply(m,f)}}var M=!0,K=Z.a.API_SERVER},BlwA:function(Ye,se,U){"use strict";var Z=U("9og8"),z=U("miYZ"),N=U("tsqr"),V=U("tJVT"),W=U("WmNS"),M=U.n(W),K=U("q1tI"),H=U.n(K),n=U("Ty5D"),D=U("ErOA"),y=U("m3rI"),m=U("DR4n"),f=U.n(m),c=function(o,u){for(var a=o.split(","),i=a[0].match(/:(.*?);/)[1],R=atob(a[1]),S=R.length,T=new Uint8Array(S);S--;)T[S]=R.charCodeAt(S);return new Blob([T],{type:i})},l=Object(K.forwardRef)(function(d,o){var u=d.time,a=d.number,i=d.supportCamera,R=d.take_photo,S=d.update,T=d.id,I=Object(K.useRef)(),O=Object(K.useRef)(),_=Object(n.i)(),b=Object(K.useState)([]),p=Object(V.a)(b,2),h=p[0],A=p[1],E=Object(K.useState)(0),v=Object(V.a)(E,2),P=v[0],x=v[1],C=Object(K.useState)(""),j=Object(V.a)(C,2),B=j[0],w=j[1],Y=Object(K.useState)(),$=Object(V.a)(Y,2),oe=$[0],de=$[1],Fe=Object(K.useState)(0),Ae=Object(V.a)(Fe,2),Re=Ae[0],Me=Ae[1];Object(K.useEffect)(function(){return fe(),function(){xe(),Be()}},[]),Object(K.useEffect)(function(){P===2&&u&&a>0&&(pe(),Me(1))},[u]),Object(K.useEffect)(function(){if(Re===0)return;if(Re===2)clearInterval(oe);else{var Pe=0,He=setInterval(function(){h.includes(Pe)&&ne(),Pe++},1e3);de(He)}return function(){return clearInterval(oe)}},[Re]),Object(K.useImperativeHandle)(o,function(){return{handlePhoto:ne}});var Be=function(){Me(2)},pe=function(){var He=u/a,ke=[];function Ve(et,le){return parseInt(Math.floor(Math.random()*(le-et+1))+et)}new Array(a).fill(0).map(function(et,le){R?ke.push(Ve(He*le,He*(le+1))):le==0?ke.push(0):ke.push(Ve(He*le,He*(le+1)))}),h=ke,A([].concat(ke)),console.log(ke)},fe=function(){navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(He){var ke=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return ke?new Promise(function(Ve,et){ke.call(navigator,He,Ve,et)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({video:{width:640,height:480}}).then(function(He){i&&i(2),x(2),"srcObject"in I.current?I.current.srcObject=He:I.current.src=window.URL.createObjectURL(He),I.current.onloadedmetadata=function(ke){I.current.play()},I.current.addEventListener("ended",function(){console.log("\u64AD\u653E\u7ED3\u675F"),Be(),N.b.error({content:"\u60A8\u5DF2\u7ECF\u5173\u95ED\u4E86\u6444\u50CF\u5934\uFF0C\u8BF7\u572810\u79D2\u949F\u5185\u6062\u590D\u6444\u50CF\u5934\uFF0C\u5426\u5219\u5C06\u63A8\u51FA\u8003\u8BD5",duration:10,key:9998})},!1)}).catch(function(He){x(1),i&&i(1),He.message==="Permission denied"||He.name==="NotAllowedError"?N.b.error("\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"):N.b.error("\u6444\u50CF\u5934\u83B7\u53D6\u5931\u8D25\uFF0C\u6216\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"),console.log("errname: "+He.name),console.log("err: "+He.message)})},ne=function(){try{O.current.width=I.current.videoWidth,O.current.height=I.current.videoHeight;var He=O.current.getContext("2d");He.drawImage(I.current,0,0,O.current.width,O.current.height),w(O.current.toDataURL("image/png")),ce(O.current.toDataURL("image/png"))}catch(ke){}},xe=function(){try{var He=I.current.srcObject,ke=He.getTracks();ke.forEach(function(Ve){Ve.stop()}),I.current.srcObject=null}catch(Ve){}},ce=function(){var Pe=Object(Z.a)(M.a.mark(function He(ke){var Ve,et;return M.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:Ve=new FormData,Ve.append("file",c(ke,"1")),Ve.append("1","123"),et=new window.XMLHttpRequest,et.withCredentials=!0,et.addEventListener("load",function(Ce){var De=JSON.parse(Ce.target.responseText);Object(D.a)("/api/exercises/".concat(T,"/upload_photo.json"),{method:"post",body:{attachment_id:De.id}})},!1),et.addEventListener("error",function(Ce){console.error(Ce)},!1),et.open("POST","".concat(y.a.API_SERVER,"/api/attachments.json")),et.send(Ve);case 9:case"end":return _e.stop()}},He)}));return function(ke){return Pe.apply(this,arguments)}}();return H.a.createElement(H.a.Fragment,null,P!==3&&H.a.createElement("aside",{className:f.a.video,id:"screenshot"},P===0&&H.a.createElement("span",null,"\u6B63\u5728\u5F00\u542F\u6444\u50CF\u5934..."),P===1&&H.a.createElement("span",null,"\u6444\u50CF\u5934\u5F00\u542F\u5931\u8D25"),P===2&&H.a.createElement("div",null,H.a.createElement("video",{width:"288",ref:I,autoPlay:!0}),H.a.createElement("canvas",{style:{display:"none"},ref:O}))))});se.a=l},"C+DQ":function(Ye,se,U){},"C/vA":function(Ye,se,U){"use strict";U.d(se,"a",function(){return Z});function Z(z){const N=this;let V=!1,W;return function(){return V||(V=!0,W=z.apply(N,arguments)),W}}},"Cg/j":function(Ye,se,U){"use strict";U.d(se,"b",function(){return Z}),U.d(se,"a",function(){return z}),U.d(se,"c",function(){return V}),U.d(se,"d",function(){return W});var Z;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function K(H){return H[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=K})(Z||(Z={}));const z=V("instantiationService");function N(M,K,H,n){K[Z.DI_TARGET]===K?K[Z.DI_DEPENDENCIES].push({id:M,index:H,optional:n}):(K[Z.DI_DEPENDENCIES]=[{id:M,index:H,optional:n}],K[Z.DI_TARGET]=K)}function V(M){if(Z.serviceIds.has(M))return Z.serviceIds.get(M);const K=function(H,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(K,H,D,!1)};return K.toString=()=>M,Z.serviceIds.set(M,K),K}function W(M){return function(K,H,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(M,K,n,!0)}}},DR4n:function(Ye,se,U){Ye.exports={flex_box_center:"flex_box_center___2zmmW",flex_space_between:"flex_space_between___3nCIw",flex_box_vertical_center:"flex_box_vertical_center___1PFij",flex_box_center_end:"flex_box_center_end___2FA05",flex_box_column:"flex_box_column___2k0kx",video:"video___1mYnG"}},DlQD:function(Ye,se,U){(function(Z,z){Ye.exports=z()})(this,function(){"use strict";function Z(Se,ge){for(var Ee=0;Ee<ge.length;Ee++){var ie=ge[Ee];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(Se,ie.key,ie)}}function z(Se,ge,Ee){return ge&&Z(Se.prototype,ge),Ee&&Z(Se,Ee),Se}function N(Se,ge){if(!Se)return;if(typeof Se=="string")return V(Se,ge);var Ee=Object.prototype.toString.call(Se).slice(8,-1);if(Ee==="Object"&&Se.constructor&&(Ee=Se.constructor.name),Ee==="Map"||Ee==="Set")return Array.from(Se);if(Ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ee))return V(Se,ge)}function V(Se,ge){(ge==null||ge>Se.length)&&(ge=Se.length);for(var Ee=0,ie=new Array(ge);Ee<ge;Ee++)ie[Ee]=Se[Ee];return ie}function W(Se,ge){var Ee;if(typeof Symbol=="undefined"||Se[Symbol.iterator]==null){if(Array.isArray(Se)||(Ee=N(Se))||ge&&Se&&typeof Se.length=="number"){Ee&&(Se=Ee);var ie=0;return function(){return ie>=Se.length?{done:!0}:{done:!1,value:Se[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 Ee=Se[Symbol.iterator](),Ee.next.bind(Ee)}function M(Se,ge){return ge={exports:{}},Se(ge,ge.exports),ge.exports}var K=M(function(Se){function ge(){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 Ee(ie){Se.exports.defaults=ie}Se.exports={defaults:ge(),getDefaults:ge,changeDefaults:Ee}}),H=K.defaults,n=K.getDefaults,D=K.changeDefaults,y=/[&<>"']/,m=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(ge){return l[ge]};function o(Se,ge){if(ge){if(y.test(Se))return Se.replace(m,d)}else if(f.test(Se))return Se.replace(c,d);return Se}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(Se){return Se.replace(u,function(ge,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var i=/(^|[^\[])\^/g;function R(Se,ge){Se=Se.source||Se,ge=ge||"";var Ee={replace:function(ae,he){return he=he.source||he,he=he.replace(i,"$1"),Se=Se.replace(ae,he),Ee},getRegex:function(){return new RegExp(Se,ge)}};return Ee}var S=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function I(Se,ge,Ee){if(Se){var ie;try{ie=decodeURIComponent(a(Ee)).replace(S,"").toLowerCase()}catch(ae){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}ge&&!T.test(Ee)&&(Ee=h(ge,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(ae){return null}return Ee}var O={},_=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,p=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(Se,ge){O[" "+Se]||(_.test(Se)?O[" "+Se]=Se+"/":O[" "+Se]=P(Se,"/",!0)),Se=O[" "+Se];var Ee=Se.indexOf(":")===-1;return ge.substring(0,2)==="//"?Ee?ge:Se.replace(b,"$1")+ge:ge.charAt(0)==="/"?Ee?ge:Se.replace(p,"$1")+ge:Se+ge}var A={exec:function(){}};function E(Se){for(var ge=1,Ee,ie;ge<arguments.length;ge++){Ee=arguments[ge];for(ie in Ee)Object.prototype.hasOwnProperty.call(Ee,ie)&&(Se[ie]=Ee[ie])}return Se}function v(Se,ge){var Ee=Se.replace(/\|/g,function(he,ve,Te){for(var Ge=!1,ot=ve;--ot>=0&&Te[ot]==="\\";)Ge=!Ge;return Ge?"|":" |"}),ie=Ee.split(/ \|/),ae=0;if(ie.length>ge)ie.splice(ge);else for(;ie.length<ge;)ie.push("");for(;ae<ie.length;ae++)ie[ae]=ie[ae].trim().replace(/\\\|/g,"|");return ie}function P(Se,ge,Ee){var ie=Se.length;if(ie===0)return"";for(var ae=0;ae<ie;){var he=Se.charAt(ie-ae-1);if(he===ge&&!Ee)ae++;else if(he!==ge&&Ee)ae++;else break}return Se.substr(0,ie-ae)}function x(Se,ge){if(Se.indexOf(ge[1])===-1)return-1;for(var Ee=Se.length,ie=0,ae=0;ae<Ee;ae++)if(Se[ae]==="\\")ae++;else if(Se[ae]===ge[0])ie++;else if(Se[ae]===ge[1]&&(ie--,ie<0))return ae;return-1}function C(Se){Se&&Se.sanitize&&!Se.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 j={escape:o,unescape:a,edit:R,cleanUrl:I,resolveUrl:h,noopTest:A,merge:E,splitCells:v,rtrim:P,findClosingBracket:x,checkSanitizeDeprecation:C},B=K.defaults,w=j.rtrim,Y=j.splitCells,$=j.escape,oe=j.findClosingBracket;function de(Se,ge,Ee){var ie=ge.href,ae=ge.title?$(ge.title):null,he=Se[1].replace(/\\([\[\]])/g,"$1");return Se[0].charAt(0)!=="!"?{type:"link",raw:Ee,href:ie,title:ae,text:he}:{type:"image",raw:Ee,href:ie,title:ae,text:$(he)}}function Fe(Se,ge){var Ee=Se.match(/^(\s+)(?:```)/);if(Ee===null)return ge;var ie=Ee[1];return ge.split(`
|
|
`).map(function(ae){var he=ae.match(/^\s+/);if(he===null)return ae;var ve=he[0];return ve.length>=ie.length?ae.slice(ie.length):ae}).join(`
|
|
`)}var Ae=function(){function Se(Ee){this.options=Ee||B}var ge=Se.prototype;return ge.space=function(ie){var ae=this.rules.block.newline.exec(ie);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},ge.code=function(ie,ae){var he=this.rules.block.code.exec(ie);if(he){var ve=ae[ae.length-1];if(ve&&ve.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var Te=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:w(Te,`
|
|
`)}}},ge.fences=function(ie){var ae=this.rules.block.fences.exec(ie);if(ae){var he=ae[0],ve=Fe(he,ae[3]||"");return{type:"code",raw:he,lang:ae[2]?ae[2].trim():ae[2],text:ve}}},ge.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]}},ge.nptable=function(ie){var ae=this.rules.block.nptable.exec(ie);if(ae){var he={type:"table",header:Y(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(he.header.length===he.align.length){var ve=he.align.length,Te;for(Te=0;Te<ve;Te++)/^ *-+: *$/.test(he.align[Te])?he.align[Te]="right":/^ *:-+: *$/.test(he.align[Te])?he.align[Te]="center":/^ *:-+ *$/.test(he.align[Te])?he.align[Te]="left":he.align[Te]=null;for(ve=he.cells.length,Te=0;Te<ve;Te++)he.cells[Te]=Y(he.cells[Te],he.header.length);return he}}},ge.hr=function(ie){var ae=this.rules.block.hr.exec(ie);if(ae)return{type:"hr",raw:ae[0]}},ge.blockquote=function(ie){var ae=this.rules.block.blockquote.exec(ie);if(ae){var he=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:he}}},ge.list=function(ie){var ae=this.rules.block.list.exec(ie);if(ae){for(var he=ae[0],ve=ae[2],Te=ve.length>1,Ge=ve[ve.length-1]===")",ot={type:"list",raw:he,ordered:Te,start:Te?+ve.slice(0,-1):"",loose:!1,items:[]},Tt=ae[0].match(this.rules.block.item),Ot=!1,wt,vt,qe,Qe,Ue,ue,me,$e=Tt.length,je=0;je<$e;je++)wt=Tt[je],he=wt,vt=wt.length,wt=wt.replace(/^ *([*+-]|\d+[.)]) */,""),~wt.indexOf(`
|
|
`)&&(vt-=wt.length,wt=this.options.pedantic?wt.replace(/^ {1,4}/gm,""):wt.replace(new RegExp("^ {1,"+vt+"}","gm"),"")),je!==$e-1&&(qe=this.rules.block.bullet.exec(Tt[je+1])[0],(Te?qe.length===1||!Ge&&qe[qe.length-1]===")":qe.length>1||this.options.smartLists&&qe!==ve)&&(Qe=Tt.slice(je+1).join(`
|
|
`),ot.raw=ot.raw.substring(0,ot.raw.length-Qe.length),je=$e-1)),Ue=Ot||/\n\n(?!\s*$)/.test(wt),je!==$e-1&&(Ot=wt.charAt(wt.length-1)===`
|
|
`,Ue||(Ue=Ot)),Ue&&(ot.loose=!0),ue=/^\[[ xX]\] /.test(wt),me=void 0,ue&&(me=wt[1]!==" ",wt=wt.replace(/^\[[ xX]\] +/,"")),ot.items.push({type:"list_item",raw:he,task:ue,checked:me,loose:Ue,text:wt});return ot}},ge.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]):$(ae[0]):ae[0]}},ge.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 he=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:ae[0],href:ae[2],title:ae[3]}}},ge.table=function(ie){var ae=this.rules.block.table.exec(ie);if(ae){var he={type:"table",header:Y(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(he.header.length===he.align.length){he.raw=ae[0];var ve=he.align.length,Te;for(Te=0;Te<ve;Te++)/^ *-+: *$/.test(he.align[Te])?he.align[Te]="right":/^ *:-+: *$/.test(he.align[Te])?he.align[Te]="center":/^ *:-+ *$/.test(he.align[Te])?he.align[Te]="left":he.align[Te]=null;for(ve=he.cells.length,Te=0;Te<ve;Te++)he.cells[Te]=Y(he.cells[Te].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},ge.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]}},ge.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]}},ge.text=function(ie,ae){var he=this.rules.block.text.exec(ie);if(he){var ve=ae[ae.length-1];return ve&&ve.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[0]}}},ge.escape=function(ie){var ae=this.rules.inline.escape.exec(ie);if(ae)return{type:"escape",raw:ae[0],text:$(ae[1])}},ge.tag=function(ie,ae,he){var ve=this.rules.inline.tag.exec(ie);if(ve)return!ae&&/^<a /i.test(ve[0])?ae=!0:ae&&/^<\/a>/i.test(ve[0])&&(ae=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(ve[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ve[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:ve[0],inLink:ae,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):$(ve[0]):ve[0]}},ge.link=function(ie){var ae=this.rules.inline.link.exec(ie);if(ae){var he=oe(ae[2],"()");if(he>-1){var ve=ae[0].indexOf("!")===0?5:4,Te=ve+ae[1].length+he;ae[2]=ae[2].substring(0,he),ae[0]=ae[0].substring(0,Te).trim(),ae[3]=""}var Ge=ae[2],ot="";if(this.options.pedantic){var Tt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ge);Tt?(Ge=Tt[1],ot=Tt[3]):ot=""}else ot=ae[3]?ae[3].slice(1,-1):"";Ge=Ge.trim().replace(/^<([\s\S]*)>$/,"$1");var Ot=de(ae,{href:Ge&&Ge.replace(this.rules.inline._escapes,"$1"),title:ot&&ot.replace(this.rules.inline._escapes,"$1")},ae[0]);return Ot}},ge.reflink=function(ie,ae){var he;if((he=this.rules.inline.reflink.exec(ie))||(he=this.rules.inline.nolink.exec(ie))){var ve=(he[2]||he[1]).replace(/\s+/g," ");if(ve=ae[ve.toLowerCase()],!ve||!ve.href){var Te=he[0].charAt(0);return{type:"text",raw:Te,text:Te}}var Ge=de(he,ve,he[0]);return Ge}},ge.strong=function(ie,ae,he){he===void 0&&(he="");var ve=this.rules.inline.strong.start.exec(ie);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*ie.length);var Te=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var Ge;(ve=Te.exec(ae))!=null;)if(Ge=this.rules.inline.strong.middle.exec(ae.slice(0,ve.index+3)),Ge)return{type:"strong",raw:ie.slice(0,Ge[0].length),text:ie.slice(2,Ge[0].length-2)}}},ge.em=function(ie,ae,he){he===void 0&&(he="");var ve=this.rules.inline.em.start.exec(ie);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*ie.length);var Te=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var Ge;(ve=Te.exec(ae))!=null;)if(Ge=this.rules.inline.em.middle.exec(ae.slice(0,ve.index+2)),Ge)return{type:"em",raw:ie.slice(0,Ge[0].length),text:ie.slice(1,Ge[0].length-1)}}},ge.codespan=function(ie){var ae=this.rules.inline.code.exec(ie);if(ae){var he=ae[2].replace(/\n/g," "),ve=/[^ ]/.test(he),Te=he.startsWith(" ")&&he.endsWith(" ");return ve&&Te&&(he=he.substring(1,he.length-1)),he=$(he,!0),{type:"codespan",raw:ae[0],text:he}}},ge.br=function(ie){var ae=this.rules.inline.br.exec(ie);if(ae)return{type:"br",raw:ae[0]}},ge.del=function(ie){var ae=this.rules.inline.del.exec(ie);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},ge.autolink=function(ie,ae){var he=this.rules.inline.autolink.exec(ie);if(he){var ve,Te;return he[2]==="@"?(ve=$(this.options.mangle?ae(he[1]):he[1]),Te="mailto:"+ve):(ve=$(he[1]),Te=ve),{type:"link",raw:he[0],text:ve,href:Te,tokens:[{type:"text",raw:ve,text:ve}]}}},ge.url=function(ie,ae){var he;if(he=this.rules.inline.url.exec(ie)){var ve,Te;if(he[2]==="@")ve=$(this.options.mangle?ae(he[0]):he[0]),Te="mailto:"+ve;else{var Ge;do Ge=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Ge!==he[0]);ve=$(he[0]),he[1]==="www."?Te="http://"+ve:Te=ve}return{type:"link",raw:he[0],text:ve,href:Te,tokens:[{type:"text",raw:ve,text:ve}]}}},ge.inlineText=function(ie,ae,he){var ve=this.rules.inline.text.exec(ie);if(ve){var Te;return ae?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):$(ve[0]):ve[0]:Te=$(this.options.smartypants?he(ve[0]):ve[0]),{type:"text",raw:ve[0],text:Te}}},Se}(),Re=j.noopTest,Me=j.edit,Be=j.merge,pe={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:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Me(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Me(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Me(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=/<!--(?!-?>)[\s\S]*?-->/,pe.html=Me(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Me(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=Me(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Be({},pe),pe.gfm=Be({},pe.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*|$)"}),pe.gfm.nptable=Me(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=Me(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=Be({},pe.normal,{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:Re,paragraph:Me(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var fe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,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:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};fe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",fe.punctuation=Me(fe.punctuation).replace(/punctuation/g,fe._punctuation).getRegex(),fe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",fe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",fe.em.start=Me(fe.em.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.middle=Me(fe.em.middle).replace(/punctuation/g,fe._punctuation).replace(/overlapSkip/g,fe._overlapSkip).getRegex(),fe.em.endAst=Me(fe.em.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.endUnd=Me(fe.em.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.start=Me(fe.strong.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.middle=Me(fe.strong.middle).replace(/punctuation/g,fe._punctuation).replace(/blockSkip/g,fe._blockSkip).getRegex(),fe.strong.endAst=Me(fe.strong.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.endUnd=Me(fe.strong.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.blockSkip=Me(fe._blockSkip,"g").getRegex(),fe.overlapSkip=Me(fe._overlapSkip,"g").getRegex(),fe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,fe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,fe._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])?)+(?![-_])/,fe.autolink=Me(fe.autolink).replace("scheme",fe._scheme).replace("email",fe._email).getRegex(),fe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,fe.tag=Me(fe.tag).replace("comment",pe._comment).replace("attribute",fe._attribute).getRegex(),fe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,fe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,fe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,fe.link=Me(fe.link).replace("label",fe._label).replace("href",fe._href).replace("title",fe._title).getRegex(),fe.reflink=Me(fe.reflink).replace("label",fe._label).getRegex(),fe.reflinkSearch=Me(fe.reflinkSearch,"g").replace("reflink",fe.reflink).replace("nolink",fe.nolink).getRegex(),fe.normal=Be({},fe),fe.pedantic=Be({},fe.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:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",fe._label).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fe._label).getRegex()}),fe.gfm=Be({},fe.normal,{escape:Me(fe.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),fe.gfm.url=Me(fe.gfm.url,"i").replace("email",fe.gfm._extended_email).getRegex(),fe.breaks=Be({},fe.gfm,{br:Me(fe.br).replace("{2,}","*").getRegex(),text:Me(fe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:pe,inline:fe},xe=K.defaults,ce=ne.block,Pe=ne.inline;function He(Se){return Se.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 ke(Se){var ge="",Ee,ie,ae=Se.length;for(Ee=0;Ee<ae;Ee++)ie=Se.charCodeAt(Ee),Math.random()>.5&&(ie="x"+ie.toString(16)),ge+="&#"+ie+";";return ge}var Ve=function(){function Se(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||xe,this.options.tokenizer=this.options.tokenizer||new Ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:ce.normal,inline:Pe.normal};this.options.pedantic?(ie.block=ce.pedantic,ie.inline=Pe.pedantic):this.options.gfm&&(ie.block=ce.gfm,this.options.breaks?ie.inline=Pe.breaks:ie.inline=Pe.gfm),this.tokenizer.rules=ie}Se.lex=function(ie,ae){var he=new Se(ae);return he.lex(ie)};var ge=Se.prototype;return ge.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},ge.blockTokens=function(ie,ae,he){ae===void 0&&(ae=[]),he===void 0&&(he=!0),ie=ie.replace(/^ +$/gm,"");for(var ve,Te,Ge,ot;ie;){if(ve=this.tokenizer.space(ie)){ie=ie.substring(ve.raw.length),ve.type&&ae.push(ve);continue}if(ve=this.tokenizer.code(ie,ae)){ie=ie.substring(ve.raw.length),ve.type?ae.push(ve):(ot=ae[ae.length-1],ot.raw+=`
|
|
`+ve.raw,ot.text+=`
|
|
`+ve.text);continue}if(ve=this.tokenizer.fences(ie)){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.heading(ie)){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.nptable(ie)){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.hr(ie)){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.blockquote(ie)){ie=ie.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],he),ae.push(ve);continue}if(ve=this.tokenizer.list(ie)){for(ie=ie.substring(ve.raw.length),Ge=ve.items.length,Te=0;Te<Ge;Te++)ve.items[Te].tokens=this.blockTokens(ve.items[Te].text,[],!1);ae.push(ve);continue}if(ve=this.tokenizer.html(ie)){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(he&&(ve=this.tokenizer.def(ie))){ie=ie.substring(ve.raw.length),this.tokens.links[ve.tag]||(this.tokens.links[ve.tag]={href:ve.href,title:ve.title});continue}if(ve=this.tokenizer.table(ie)){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.lheading(ie)){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(he&&(ve=this.tokenizer.paragraph(ie))){ie=ie.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.text(ie,ae)){ie=ie.substring(ve.raw.length),ve.type?ae.push(ve):(ot=ae[ae.length-1],ot.raw+=`
|
|
`+ve.raw,ot.text+=`
|
|
`+ve.text);continue}if(ie){var Tt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(Tt);break}else throw new Error(Tt)}}return ae},ge.inline=function(ie){var ae,he,ve,Te,Ge,ot,Tt=ie.length;for(ae=0;ae<Tt;ae++){ot=ie[ae];switch(ot.type){case"paragraph":case"text":case"heading":{ot.tokens=[],this.inlineTokens(ot.text,ot.tokens);break}case"table":{for(ot.tokens={header:[],cells:[]},Te=ot.header.length,he=0;he<Te;he++)ot.tokens.header[he]=[],this.inlineTokens(ot.header[he],ot.tokens.header[he]);for(Te=ot.cells.length,he=0;he<Te;he++)for(Ge=ot.cells[he],ot.tokens.cells[he]=[],ve=0;ve<Ge.length;ve++)ot.tokens.cells[he][ve]=[],this.inlineTokens(Ge[ve],ot.tokens.cells[he][ve]);break}case"blockquote":{this.inline(ot.tokens);break}case"list":{for(Te=ot.items.length,he=0;he<Te;he++)this.inline(ot.items[he].tokens);break}}}return ie},ge.inlineTokens=function(ie,ae,he,ve,Te){ae===void 0&&(ae=[]),he===void 0&&(he=!1),ve===void 0&&(ve=!1),Te===void 0&&(Te="");var Ge,ot=ie,Tt;if(this.tokens.links){var Ot=Object.keys(this.tokens.links);if(Ot.length>0)for(;(Tt=this.tokenizer.rules.inline.reflinkSearch.exec(ot))!=null;)Ot.includes(Tt[0].slice(Tt[0].lastIndexOf("[")+1,-1))&&(ot=ot.slice(0,Tt.index)+"["+"a".repeat(Tt[0].length-2)+"]"+ot.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Tt=this.tokenizer.rules.inline.blockSkip.exec(ot))!=null;)ot=ot.slice(0,Tt.index)+"["+"a".repeat(Tt[0].length-2)+"]"+ot.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Ge=this.tokenizer.escape(ie)){ie=ie.substring(Ge.raw.length),ae.push(Ge);continue}if(Ge=this.tokenizer.tag(ie,he,ve)){ie=ie.substring(Ge.raw.length),he=Ge.inLink,ve=Ge.inRawBlock,ae.push(Ge);continue}if(Ge=this.tokenizer.link(ie)){ie=ie.substring(Ge.raw.length),Ge.type==="link"&&(Ge.tokens=this.inlineTokens(Ge.text,[],!0,ve)),ae.push(Ge);continue}if(Ge=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Ge.raw.length),Ge.type==="link"&&(Ge.tokens=this.inlineTokens(Ge.text,[],!0,ve)),ae.push(Ge);continue}if(Ge=this.tokenizer.strong(ie,ot,Te)){ie=ie.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],he,ve),ae.push(Ge);continue}if(Ge=this.tokenizer.em(ie,ot,Te)){ie=ie.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],he,ve),ae.push(Ge);continue}if(Ge=this.tokenizer.codespan(ie)){ie=ie.substring(Ge.raw.length),ae.push(Ge);continue}if(Ge=this.tokenizer.br(ie)){ie=ie.substring(Ge.raw.length),ae.push(Ge);continue}if(Ge=this.tokenizer.del(ie)){ie=ie.substring(Ge.raw.length),Ge.tokens=this.inlineTokens(Ge.text,[],he,ve),ae.push(Ge);continue}if(Ge=this.tokenizer.autolink(ie,ke)){ie=ie.substring(Ge.raw.length),ae.push(Ge);continue}if(!he&&(Ge=this.tokenizer.url(ie,ke))){ie=ie.substring(Ge.raw.length),ae.push(Ge);continue}if(Ge=this.tokenizer.inlineText(ie,ve,He)){ie=ie.substring(Ge.raw.length),Te=Ge.raw.slice(-1),ae.push(Ge);continue}if(ie){var wt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(wt);break}else throw new Error(wt)}}return ae},z(Se,null,[{key:"rules",get:function(){return{block:ce,inline:Pe}}}]),Se}(),et=K.defaults,le=j.cleanUrl,_e=j.escape,Ce=function(){function Se(Ee){this.options=Ee||et}var ge=Se.prototype;return ge.code=function(ie,ae,he){var ve=(ae||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(ie,ve);Te!=null&&Te!==ie&&(he=!0,ie=Te)}return ve?'<pre><code class="'+this.options.langPrefix+_e(ve,!0)+'">'+(he?ie:_e(ie,!0))+`</code></pre>
|
|
`:"<pre><code>"+(he?ie:_e(ie,!0))+`</code></pre>
|
|
`},ge.blockquote=function(ie){return`<blockquote>
|
|
`+ie+`</blockquote>
|
|
`},ge.html=function(ie){return ie},ge.heading=function(ie,ae,he,ve){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+ve.slug(he)+'">'+ie+"</h"+ae+`>
|
|
`:"<h"+ae+">"+ie+"</h"+ae+`>
|
|
`},ge.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ge.list=function(ie,ae,he){var ve=ae?"ol":"ul",Te=ae&&he!==1?' start="'+he+'"':"";return"<"+ve+Te+`>
|
|
`+ie+"</"+ve+`>
|
|
`},ge.listitem=function(ie){return"<li>"+ie+`</li>
|
|
`},ge.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ge.paragraph=function(ie){return"<p>"+ie+`</p>
|
|
`},ge.table=function(ie,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ie+`</thead>
|
|
`+ae+`</table>
|
|
`},ge.tablerow=function(ie){return`<tr>
|
|
`+ie+`</tr>
|
|
`},ge.tablecell=function(ie,ae){var he=ae.header?"th":"td",ve=ae.align?"<"+he+' align="'+ae.align+'">':"<"+he+">";return ve+ie+"</"+he+`>
|
|
`},ge.strong=function(ie){return"<strong>"+ie+"</strong>"},ge.em=function(ie){return"<em>"+ie+"</em>"},ge.codespan=function(ie){return"<code>"+ie+"</code>"},ge.br=function(){return this.options.xhtml?"<br/>":"<br>"},ge.del=function(ie){return"<del>"+ie+"</del>"},ge.link=function(ie,ae,he){if(ie=le(this.options.sanitize,this.options.baseUrl,ie),ie===null)return he;var ve='<a href="'+_e(ie)+'"';return ae&&(ve+=' title="'+ae+'"'),ve+=">"+he+"</a>",ve},ge.image=function(ie,ae,he){if(ie=le(this.options.sanitize,this.options.baseUrl,ie),ie===null)return he;var ve='<img src="'+ie+'" alt="'+he+'"';return ae&&(ve+=' title="'+ae+'"'),ve+=this.options.xhtml?"/>":">",ve},ge.text=function(ie){return ie},Se}(),De=function(){function Se(){}var ge=Se.prototype;return ge.strong=function(ie){return ie},ge.em=function(ie){return ie},ge.codespan=function(ie){return ie},ge.del=function(ie){return ie},ge.html=function(ie){return ie},ge.text=function(ie){return ie},ge.link=function(ie,ae,he){return""+he},ge.image=function(ie,ae,he){return""+he},ge.br=function(){return""},Se}(),tt=function(){function Se(){this.seen={}}var ge=Se.prototype;return ge.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 he=ae;do this.seen[he]++,ae=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Se}(),ct=K.defaults,ft=j.unescape,ut=function(){function Se(Ee){this.options=Ee||ct,this.options.renderer=this.options.renderer||new Ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new tt}Se.parse=function(ie,ae){var he=new Se(ae);return he.parse(ie)};var ge=Se.prototype;return ge.parse=function(ie,ae){ae===void 0&&(ae=!0);var he="",ve,Te,Ge,ot,Tt,Ot,wt,vt,qe,Qe,Ue,ue,me,$e,je,Je,mt,We,it=ie.length;for(ve=0;ve<it;ve++){Qe=ie[ve];switch(Qe.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline(Qe.tokens),Qe.depth,ft(this.parseInline(Qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code(Qe.text,Qe.lang,Qe.escaped);continue}case"table":{for(vt="",wt="",ot=Qe.header.length,Te=0;Te<ot;Te++)wt+=this.renderer.tablecell(this.parseInline(Qe.tokens.header[Te]),{header:!0,align:Qe.align[Te]});for(vt+=this.renderer.tablerow(wt),qe="",ot=Qe.cells.length,Te=0;Te<ot;Te++){for(Ot=Qe.tokens.cells[Te],wt="",Tt=Ot.length,Ge=0;Ge<Tt;Ge++)wt+=this.renderer.tablecell(this.parseInline(Ot[Ge]),{header:!1,align:Qe.align[Ge]});qe+=this.renderer.tablerow(wt)}he+=this.renderer.table(vt,qe);continue}case"blockquote":{qe=this.parse(Qe.tokens),he+=this.renderer.blockquote(qe);continue}case"list":{for(Ue=Qe.ordered,ue=Qe.start,me=Qe.loose,ot=Qe.items.length,qe="",Te=0;Te<ot;Te++)je=Qe.items[Te],Je=je.checked,mt=je.task,$e="",je.task&&(We=this.renderer.checkbox(Je),me?je.tokens.length>0&&je.tokens[0].type==="text"?(je.tokens[0].text=We+" "+je.tokens[0].text,je.tokens[0].tokens&&je.tokens[0].tokens.length>0&&je.tokens[0].tokens[0].type==="text"&&(je.tokens[0].tokens[0].text=We+" "+je.tokens[0].tokens[0].text)):je.tokens.unshift({type:"text",text:We}):$e+=We),$e+=this.parse(je.tokens,me),qe+=this.renderer.listitem($e,mt,Je);he+=this.renderer.list(qe,Ue,ue);continue}case"html":{he+=this.renderer.html(Qe.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(Qe.tokens));continue}case"text":{for(qe=Qe.tokens?this.parseInline(Qe.tokens):Qe.text;ve+1<it&&ie[ve+1].type==="text";)Qe=ie[++ve],qe+=`
|
|
`+(Qe.tokens?this.parseInline(Qe.tokens):Qe.text);he+=ae?this.renderer.paragraph(qe):qe;continue}default:{var st='Token with "'+Qe.type+'" type was not found.';if(this.options.silent){console.error(st);return}else throw new Error(st)}}}return he},ge.parseInline=function(ie,ae){ae=ae||this.renderer;var he="",ve,Te,Ge=ie.length;for(ve=0;ve<Ge;ve++){Te=ie[ve];switch(Te.type){case"escape":{he+=ae.text(Te.text);break}case"html":{he+=ae.html(Te.text);break}case"link":{he+=ae.link(Te.href,Te.title,this.parseInline(Te.tokens,ae));break}case"image":{he+=ae.image(Te.href,Te.title,Te.text);break}case"strong":{he+=ae.strong(this.parseInline(Te.tokens,ae));break}case"em":{he+=ae.em(this.parseInline(Te.tokens,ae));break}case"codespan":{he+=ae.codespan(Te.text);break}case"br":{he+=ae.br();break}case"del":{he+=ae.del(this.parseInline(Te.tokens,ae));break}case"text":{he+=ae.text(Te.text);break}default:{var ot='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(ot);return}else throw new Error(ot)}}}return he},Se}(),xt=j.merge,bt=j.checkSanitizeDeprecation,Ne=j.escape,Oe=K.getDefaults,nt=K.changeDefaults,lt=K.defaults;function Ke(Se,ge,Ee){if(typeof Se=="undefined"||Se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Se)+", string expected");if(typeof ge=="function"&&(Ee=ge,ge=null),ge=xt({},Ke.defaults,ge||{}),bt(ge),Ee){var ie=ge.highlight,ae;try{ae=Ve.lex(Se,ge)}catch(Ge){return Ee(Ge)}var he=function(ot){var Tt;if(!ot)try{Tt=ut.parse(ae,ge)}catch(Ot){ot=Ot}return ge.highlight=ie,ot?Ee(ot):Ee(null,Tt)};if(!ie||ie.length<3)return he();if(delete ge.highlight,!ae.length)return he();var ve=0;Ke.walkTokens(ae,function(Ge){Ge.type==="code"&&(ve++,setTimeout(function(){ie(Ge.text,Ge.lang,function(ot,Tt){if(ot)return he(ot);Tt!=null&&Tt!==Ge.text&&(Ge.text=Tt,Ge.escaped=!0),ve--,ve===0&&he()})},0))}),ve===0&&he();return}try{var Te=Ve.lex(Se,ge);return ge.walkTokens&&Ke.walkTokens(Te,ge.walkTokens),ut.parse(Te,ge)}catch(Ge){if(Ge.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ge.silent)return"<p>An error occurred:</p><pre>"+Ne(Ge.message+"",!0)+"</pre>";throw Ge}}Ke.options=Ke.setOptions=function(Se){return xt(Ke.defaults,Se),nt(Ke.defaults),Ke},Ke.getDefaults=Oe,Ke.defaults=lt,Ke.use=function(Se){var ge=xt({},Se);if(Se.renderer&&function(){var ie=Ke.defaults.renderer||new Ce,ae=function(Te){var Ge=ie[Te];ie[Te]=function(){for(var ot=arguments.length,Tt=new Array(ot),Ot=0;Ot<ot;Ot++)Tt[Ot]=arguments[Ot];var wt=Se.renderer[Te].apply(ie,Tt);return wt===!1&&(wt=Ge.apply(ie,Tt)),wt}};for(var he in Se.renderer)ae(he);ge.renderer=ie}(),Se.tokenizer&&function(){var ie=Ke.defaults.tokenizer||new Ae,ae=function(Te){var Ge=ie[Te];ie[Te]=function(){for(var ot=arguments.length,Tt=new Array(ot),Ot=0;Ot<ot;Ot++)Tt[Ot]=arguments[Ot];var wt=Se.tokenizer[Te].apply(ie,Tt);return wt===!1&&(wt=Ge.apply(ie,Tt)),wt}};for(var he in Se.tokenizer)ae(he);ge.tokenizer=ie}(),Se.walkTokens){var Ee=Ke.defaults.walkTokens;ge.walkTokens=function(ie){Se.walkTokens(ie),Ee&&Ee(ie)}}Ke.setOptions(ge)},Ke.walkTokens=function(Se,ge){for(var Ee=W(Se),ie;!(ie=Ee()).done;){var ae=ie.value;ge(ae);switch(ae.type){case"table":{for(var he=W(ae.tokens.header),ve;!(ve=he()).done;){var Te=ve.value;Ke.walkTokens(Te,ge)}for(var Ge=W(ae.tokens.cells),ot;!(ot=Ge()).done;)for(var Tt=ot.value,Ot=W(Tt),wt;!(wt=Ot()).done;){var vt=wt.value;Ke.walkTokens(vt,ge)}break}case"list":{Ke.walkTokens(ae.items,ge);break}default:ae.tokens&&Ke.walkTokens(ae.tokens,ge)}}},Ke.Parser=ut,Ke.parser=ut.parse,Ke.Renderer=Ce,Ke.TextRenderer=De,Ke.Lexer=Ve,Ke.lexer=Ve.lex,Ke.Tokenizer=Ae,Ke.Slugger=tt,Ke.parse=Ke;var Xe=Ke;return Xe})},E7E6:function(Ye,se){Ye.exports="data:image/png;base64,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"},ELLl:function(Ye,se,U){(function(Z){Z(U("VrN/"))})(function(Z){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(l,d,o){o&&o!=Z.Init&&(l.removeKeyMap(W),l.state.closeBrackets=null),d&&(M(V(d,"pairs")),l.state.closeBrackets=d,l.addKeyMap(W))});function V(l,d){return d=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[d]!=null?l[d]:z[d]}var W={Backspace:n,Enter:D};function M(l){for(var d=0;d<l.length;d++){var o=l.charAt(d),u="'"+o+"'";W[u]||(W[u]=K(o))}}M(z.pairs+"`");function K(l){return function(d){return m(d,l)}}function H(l){var d=l.state.closeBrackets;if(!d||d.override)return d;var o=l.getModeAt(l.getCursor());return o.closeBrackets||d}function n(l){var d=H(l);if(!d||l.getOption("disableInput"))return Z.Pass;for(var o=V(d,"pairs"),u=l.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return Z.Pass;var i=f(l,u[a].head);if(!i||o.indexOf(i)%2!=0)return Z.Pass}for(var a=u.length-1;a>=0;a--){var R=u[a].head;l.replaceRange("",N(R.line,R.ch-1),N(R.line,R.ch+1),"+delete")}}function D(l){var d=H(l),o=d&&V(d,"explode");if(!o||l.getOption("disableInput"))return Z.Pass;for(var u=l.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return Z.Pass;var i=f(l,u[a].head);if(!i||o.indexOf(i)%2!=0)return Z.Pass}l.operation(function(){var R=l.lineSeparator()||`
|
|
`;l.replaceSelection(R+R,null),l.execCommand("goCharLeft"),u=l.listSelections();for(var S=0;S<u.length;S++){var T=u[S].head.line;l.indentLine(T,null,!0),l.indentLine(T+1,null,!0)}})}function y(l){var d=Z.cmpPos(l.anchor,l.head)>0;return{anchor:new N(l.anchor.line,l.anchor.ch+(d?-1:1)),head:new N(l.head.line,l.head.ch+(d?1:-1))}}function m(l,d){var o=H(l);if(!o||l.getOption("disableInput"))return Z.Pass;var u=V(o,"pairs"),a=u.indexOf(d);if(a==-1)return Z.Pass;for(var i=V(o,"closeBefore"),R=V(o,"triples"),S=u.charAt(a+1)==d,T=l.listSelections(),I=a%2==0,O,_=0;_<T.length;_++){var b=T[_],p=b.head,h,A=l.getRange(p,N(p.line,p.ch+1));if(I&&!b.empty())h="surround";else if((S||!I)&&A==d)S&&c(l,p)?h="both":R.indexOf(d)>=0&&l.getRange(p,N(p.line,p.ch+3))==d+d+d?h="skipThree":h="skip";else if(S&&p.ch>1&&R.indexOf(d)>=0&&l.getRange(N(p.line,p.ch-2),p)==d+d){if(p.ch>2&&/\bstring/.test(l.getTokenTypeAt(N(p.line,p.ch-2))))return Z.Pass;h="addFour"}else if(S){var E=p.ch==0?" ":l.getRange(N(p.line,p.ch-1),p);if(!Z.isWordChar(A)&&E!=d&&!Z.isWordChar(E))h="both";else return Z.Pass}else if(I&&(A.length===0||/\s/.test(A)||i.indexOf(A)>-1))h="both";else return Z.Pass;if(!O)O=h;else if(O!=h)return Z.Pass}var v=a%2?u.charAt(a-1):d,P=a%2?d:u.charAt(a+1);l.operation(function(){if(O=="skip")l.execCommand("goCharRight");else if(O=="skipThree")for(var x=0;x<3;x++)l.execCommand("goCharRight");else if(O=="surround"){for(var C=l.getSelections(),x=0;x<C.length;x++)C[x]=v+C[x]+P;l.replaceSelections(C,"around"),C=l.listSelections().slice();for(var x=0;x<C.length;x++)C[x]=y(C[x]);l.setSelections(C)}else O=="both"?(l.replaceSelection(v+P,null),l.triggerElectric(v+P),l.execCommand("goCharLeft")):O=="addFour"&&(l.replaceSelection(v+v+v+v,"before"),l.execCommand("goCharRight"))})}function f(l,d){var o=l.getRange(N(d.line,d.ch-1),N(d.line,d.ch+1));return o.length==2?o:null}function c(l,d){var o=l.getTokenAt(N(d.line,d.ch+1));return/\bstring/.test(o.type)&&o.start==d.ch&&(d.ch==0||!/\bstring/.test(l.getTokenTypeAt(d)))}})},FOrL:function(Ye,se,U){Ye.exports=U.p+"static/nodata.a6b3f948.png"},FPkq:function(Ye,se,U){Ye.exports=U.p+"static/qrCode.dd0fe9b2.png"},FWmy:function(Ye,se,U){"use strict";U.d(se,"a",function(){return Z});function Z(z,N){if(!z)throw new Error(N?`Assertion failed (${N})`:"Assertion Failed")}},GABl:function(Ye,se){Ye.exports="data:image/png;base64,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"},Gytx:function(Ye,se){Ye.exports=function(Z,z,N,V){var W=N?N.call(V,Z,z):void 0;if(W!==void 0)return!!W;if(Z===z)return!0;if(typeof Z!="object"||!Z||typeof z!="object"||!z)return!1;var M=Object.keys(Z),K=Object.keys(z);if(M.length!==K.length)return!1;for(var H=Object.prototype.hasOwnProperty.bind(z),n=0;n<M.length;n++){var D=M[n];if(!H(D))return!1;var y=Z[D],m=z[D];if(W=N?N.call(V,y,m,D):void 0,W===!1||W===void 0&&y!==m)return!1}return!0}},HmJG:function(Ye,se,U){},HpTS:function(Ye,se,U){Ye.exports=U.p+"static/small_program.f74069ec.png"},I8Z2:function(Ye,se,U){"use strict";U.d(se,"a",function(){return V}),U.d(se,"b",function(){return f}),U.d(se,"c",function(){return l});var Z=U("q1tI"),z=function(){var d=function(o,u){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var R in i)i.hasOwnProperty(R)&&(a[R]=i[R])},d(o,u)};return function(o,u){d(o,u);function a(){this.constructor=o}o.prototype=u===null?Object.create(u):(a.prototype=u.prototype,new a)}}(),N=Z.createContext(null),V=function(d){z(o,d);function o(){return d!==null&&d.apply(this,arguments)||this}return o.prototype.render=function(){return Z.createElement(N.Provider,{value:this.props.store},this.props.children)},o}(Z.Component),W=U("Gytx"),M=U.n(W),K=U("2mql"),H=U.n(K),n=function(){var d=function(o,u){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var R in i)i.hasOwnProperty(R)&&(a[R]=i[R])},d(o,u)};return function(o,u){d(o,u);function a(){this.constructor=o}o.prototype=u===null?Object.create(u):(a.prototype=u.prototype,new a)}}(),D=function(){return D=Object.assign||function(d){for(var o,u=1,a=arguments.length;u<a;u++){o=arguments[u];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(d[i]=o[i])}return d},D.apply(this,arguments)};function y(d){return d.displayName||d.name||"Component"}var m=function(){return{}};function f(d,o){o===void 0&&(o={});var u=!!d,a=d||m;return function(R){var S=function(I){n(O,I);function O(_,b){var p=I.call(this,_,b)||this;return p.unsubscribe=null,p.handleChange=function(){if(!p.unsubscribe)return;var h=a(p.store.getState(),p.props);p.setState({subscribed:h})},p.store=p.context,p.state={subscribed:a(p.store.getState(),_),store:p.store,props:_},p}return O.getDerivedStateFromProps=function(_,b){return d&&d.length===2&&_!==b.props?{subscribed:a(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(){u&&(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(R,D({},_,{ref:this.props.miniStoreForwardedRef}))},O.displayName="Connect("+y(R)+")",O.contextType=N,O}(Z.Component);if(o.forwardRef){var T=Z.forwardRef(function(I,O){return Z.createElement(S,D({},I,{miniStoreForwardedRef:O}))});return H()(T,R)}return H()(S,R)}}var c=function(){return c=Object.assign||function(d){for(var o,u=1,a=arguments.length;u<a;u++){o=arguments[u];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(d[i]=o[i])}return d},c.apply(this,arguments)};function l(d){var o=d,u=[];function a(S){o=c(c({},o),S);for(var T=0;T<u.length;T++)u[T]()}function i(){return o}function R(S){return u.push(S),function(){var I=u.indexOf(S);u.splice(I,1)}}return{setState:a,getState:i,subscribe:R}}},IBYe:function(Ye,se,U){"use strict";function Z(z){return null}se.a=Z},J66h:function(Ye,se,U){(function(Z){var z,N;(function(V,W){Ye.exports=W(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Z!="undefined"?Z:this,function(V){"use strict";V=V||{};var W=V.Base64,M="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H=function(v){for(var P={},x=0,C=v.length;x<C;x++)P[v.charAt(x)]=x;return P}(K),n=String.fromCharCode,D=function(v){if(v.length<2){var P=v.charCodeAt(0);return P<128?v:P<2048?n(192|P>>>6)+n(128|P&63):n(224|P>>>12&15)+n(128|P>>>6&63)+n(128|P&63)}else{var P=65536+(v.charCodeAt(0)-55296)*1024+(v.charCodeAt(1)-56320);return n(240|P>>>18&7)+n(128|P>>>12&63)+n(128|P>>>6&63)+n(128|P&63)}},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(v){return v.replace(y,D)},f=function(v){var P=[0,2,1][v.length%3],x=v.charCodeAt(0)<<16|(v.length>1?v.charCodeAt(1):0)<<8|(v.length>2?v.charCodeAt(2):0),C=[K.charAt(x>>>18),K.charAt(x>>>12&63),P>=2?"=":K.charAt(x>>>6&63),P>=1?"=":K.charAt(x&63)];return C.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,f)},l=function(v){return c(m(String(v)))},d=function(v){return v.replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,"")},o=function(v,P){return P?d(l(v)):l(v)},u=function(v){return o(v,!0)},a;V.Uint8Array&&(a=function(v,P){for(var x="",C=0,j=v.length;C<j;C+=3){var B=v[C],w=v[C+1],Y=v[C+2],$=B<<16|w<<8|Y;x+=K.charAt($>>>18)+K.charAt($>>>12&63)+(typeof w!="undefined"?K.charAt($>>>6&63):"=")+(typeof Y!="undefined"?K.charAt($&63):"=")}return P?d(x):x});var i=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=function(v){switch(v.length){case 4:var P=(7&v.charCodeAt(0))<<18|(63&v.charCodeAt(1))<<12|(63&v.charCodeAt(2))<<6|63&v.charCodeAt(3),x=P-65536;return n((x>>>10)+55296)+n((x&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))}},S=function(v){return v.replace(i,R)},T=function(v){var P=v.length,x=P%4,C=(P>0?H[v.charAt(0)]<<18:0)|(P>1?H[v.charAt(1)]<<12:0)|(P>2?H[v.charAt(2)]<<6:0)|(P>3?H[v.charAt(3)]:0),j=[n(C>>>16),n(C>>>8&255),n(C&255)];return j.length-=[0,0,2,1][x],j.join("")},I=V.atob&&typeof V.atob=="function"?function(v){return V.atob(v)}:function(v){return v.replace(/\S{1,4}/g,T)},O=function(v){return I(String(v).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(v){return S(I(v))},b=function(v){return String(v).replace(/[-_]/g,function(P){return P=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},p=function(v){return _(b(v))},h;V.Uint8Array&&(h=function(v){return Uint8Array.from(O(b(v)),function(P){return P.charCodeAt(0)})});var A=function(){var v=V.Base64;return V.Base64=W,v};if(V.Base64={VERSION:M,atob:O,btoa:c,fromBase64:p,toBase64:o,utob:m,encode:o,encodeURI:u,btou:S,decode:p,noConflict:A,fromUint8Array:a,toUint8Array:h},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 p(this)})),Object.defineProperty(String.prototype,"toBase64",E(function(v){return o(this,v)})),Object.defineProperty(String.prototype,"toBase64URI",E(function(){return o(this,!0)}))}}return V.Meteor&&(Base64=V.Base64),Ye.exports?Ye.exports.Base64=V.Base64:!(z=[],N=function(){return V.Base64}.apply(se,z),N!==void 0&&(Ye.exports=N)),{Base64:V.Base64}})}).call(this,U("IyRk"))},JWDV:function(Ye,se,U){Ye.exports=U.p+"static/charpter-white.5fa14f93.svg"},JYp7:function(Ye,se,U){"use strict";U.d(se,"a",function(){return Z});var Z;(function(z){function N(i){return i&&typeof i=="object"&&typeof i[Symbol.iterator]=="function"}z.is=N;const V=Object.freeze([]);function W(){return V}z.empty=W;function*M(i){yield i}z.single=M;function K(i){return i||V}z.from=K;function H(i){return!i||i[Symbol.iterator]().next().done===!0}z.isEmpty=H;function n(i){return i[Symbol.iterator]().next().value}z.first=n;function D(i,R){for(const S of i)if(R(S))return!0;return!1}z.some=D;function y(i,R){for(const S of i)if(R(S))return S;return}z.find=y;function*m(i,R){for(const S of i)R(S)&&(yield S)}z.filter=m;function*f(i,R){let S=0;for(const T of i)yield R(T,S++)}z.map=f;function*c(...i){for(const R of i)for(const S of R)yield S}z.concat=c;function*l(i){for(const R of i)for(const S of R)yield S}z.concatNested=l;function d(i,R,S){let T=S;for(const I of i)T=R(T,I);return T}z.reduce=d;function*o(i,R,S=i.length){for(R<0&&(R+=i.length),S<0?S+=i.length:S>i.length&&(S=i.length);R<S;R++)yield i[R]}z.slice=o;function u(i,R=Number.POSITIVE_INFINITY){const S=[];if(R===0)return[S,i];const T=i[Symbol.iterator]();for(let I=0;I<R;I++){const O=T.next();if(O.done)return[S,z.empty()];S.push(O.value)}return[S,{[Symbol.iterator](){return T}}]}z.consume=u;function a(i,R,S=(T,I)=>T===I){const T=i[Symbol.iterator](),I=R[Symbol.iterator]();for(;;){const O=T.next(),_=I.next();if(O.done!==_.done)return!1;if(O.done)return!0;if(!S(O.value,_.value))return!1}}z.equals=a})(Z||(Z={}))},JeFH:function(Ye,se){Ye.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r48eigdtz+TUKIF05GOSL3JKSUDwN4SALYXBRQwqzIrUNBvQ1DAIYm4BHAJxMz0TPOLoJu9BFClJxsglVVVWXGx8d/IYTIOl4rsSCnGvNzarCvIghLAl5NoN6WuKVPAu4dkMjtXyuEeP1kk6NJDpJSHgTQ8+Ht5Xj5UBWoqBhNQAsFP/6dwi2alIlTYq1caEY/IUT5zyGYlLIvgD4AugLIgm0zF3qgaccDgcCbMTExu1v6Xinl6YDc/lWxiWvWF6E04BiYxxUEQK0lcUe/BNx9qlLQFUKIt38mOVIAnA6gG4AugM104Qe0ajo1gA+FEHTwVhc96CoAbzy9txJP7KpAPKWKWFRQrCawZEoHZHnN4yEFVbX65DZeIKW8DVI+DiHimrtVSnlCCDFUCHGihc+TYJl7jwf1DlOW5KHWltCiLqSCfndqIm7vlwDLsi41DOP9Nm6z1cullL0BLATAP1tavxZCvNTqw5iDpJSnwrZ2rC60tKvXFTayOCc/AXGGwNIpHdDRCOZA9/QXQtASfrIlpdQg5TYpxMDXDlVhf7mJ/DoLZQEbNabEnf0TMbVTLL+PCHJZy15kL5EQk6ctK8De8mATWaige09LxC19lYIuMQxj7k8mROhBUsrbAfydOW/pd3XIr7VQXG+jImjjtHYePHlmMmDb7wpdv/yHfDcV5Idt7c0NalmTl+Sh2pTh8OYqiF5FBXXwWEeh6acKIWp+yMPbco2U9icS4pyJSwuwsywQDrM1lsQDA5JwW78EPu4iIcS8lhUkHwfw+1s3l2LesRrE6o2jARV032mJuLlv689qy94bRRwpL2YIe3F/Fe7bVqYiEqMs82CvBAOrpmQA0vpUaAZry1ZXCMXZS22ISVM/L8CBSlPFbnfRg/53FCQfAXD/7VtKMTen4XB5qDf38eO+AUm0+usMw3j1exR0GYB3nttXicd2VSDu/0ZB/WCZuzaU2NqMNYUKZHFRQR3jdKyclgGvZa0XhjGqVe2EYbZlzYGm3fmbjSX47EQtYiIEaxTiPNa3IQ/6SUOc46nyUgDvRh8uFXRlNx+eGKKg8d1CiDktCRYIBM7wGPrW5flBce36IgVuIldkiANwsRDiox9ySG25RkqZEIpInRiRGKKFAGwJtPNqWD4tE8nC3AXNOEMIYbX2bLcOugbA63N2V+CpvZWNLK8RSPCYx6ErFPdzgIRBsK2tn+ebuG5Dw+HWWRLnZsXhxWEERnhMCHH/93hQMqzggaP1RuovPs9TsDpSRZEgAcAvhRAftHZAP+ZzadurLCHGTl5agMNVTkRyz3HxlA7o7LVyoOk/KJe7ChoKyE0Lj9fhpk0ljT0oBLs/m9QBp8SYuSEF/eQwW0oZDyuYc7BWb3/usjyY0qmiA7bEqLQYvD0mlWf1ohDixu9RkICUGwJCDJu4OB/HaixERrn/RZj9NIDbZq4vxvLcOnWeVBBR5fzsTPT3WaXQPb2FEEWtGYBSUHV1dYd4r+fA7hrNf8HyfBCgu5bHB//UhaqUkoVIOoBhAPrRBmzbLtSAWyul1mnSkjzk19nqcIO2xMBkLxZOSCP6eU/oOvNMRI6UQgjBbaolpXwZwHUz1hRhXWF9ozBHBf2UhaqUMgYA+T3Wb8Nh2+2haWUASDBf/PDX5XjpYFU4ItHo3hmThuFJMgiPt4sQIu/7ZOFnrgcZsO3tFdBOzV6Up2BhZKFKzX+cnYFTfXZFdV2gt9/v/1FUjySdBDkLltUVUqbD8BjRFsRYfeGqQmwvCSiYTKG6+XR8PjkDBuQ2CLEItt0NQrSDgAe2TIG0bWh6IYTYzLINwB/u31qG149UNwrXVND1Pf340xlJ/NofTfXU19f39Xq9s2Gb/WHLTjA8ityLXm8crsa928rCe6i3JF4a3h5TM3UJ3fMEbDsTQhB3xwOaH9KKhRAVEPpRAK8KIdaEQ7S07XkQ4oJzlxcqmBtZgfPQPhiXjiGJdn2IizvWmmtGfy6lZFW9RwKxJC4Lak10idPw6M5yFNbb+GXXeFzcNV7ddsvmEnx8rFbBZKKf9FgNi7LTkRLTUHrSy/k3opWgDSRqzt8BnABkp1cPVeOB7eVNFBQBOO4RQjzZVjlCXsrcdUlREDhaaSIzVmDZd3X49EQtuvkN/On0JFU7rs6rw9Xri8NnSQN5cnA7XO6QtY0WQ0CpBcTrjoUBKCAb0aAgKWfT8m7cVIKFx53DcRfDzH9Gp2F0CiQML0HC/rYKpmgcK7hnY4kUV68rUjH53yPb456vSrG33MRV3X145uxk9di/7KrA0/scsELj8BsCn2WnI8unozJo48ZNpThYaeLBgYnYWFiPuTm1qgh8a0wqvJBFsILJK4ulPnNdUSNDI+C4oHMcnh2qAMd/CyEeaqscIQV9CuAXF64sxLqCekUd8bQe31WBjDgNyyZloFO8joMVJs5fUYiAdMAKEd0fByTiJqcOwz8PVOH1w1U4MyUGl54Shxs3l6qQPOesZIzLYItHnBGpoGvpVpGH426ervmv4e0xrRNDrhgshNjWVsEU/LTMfTlBvePUJXmqsv7nsBS8eaQaq/LrMSkzFm+Odto17x2twV1fliojoSKJguaPT0PfJI8SctLnBYoE/duZyYoxeOVQNXonGlg5NQMeKbfBtjKP1GkdiOSCIbDB51KOiR1i8dpI9T1/F0Lc0VY5Qgr6C4B7fr2xRBXE/9UlHqPSY3DP1jL4DIF549JwajuPYkKmLisI51N6ENn0+weoEKsMcfaucozJiFVsyTXrihXyZBg8t5MHEPrASAWNAbD6g6M1uCN0OO7m+WAexi9PUSFoLGPjjxLMNldYQh9PtmBPWQCzB7XDzrIg3jlag8EpHiwYn6YKu/UF9bhibTGMUMyiF707JhVnp3ph2sD0lYX4orgejw9uh5wqCy8erELfRAMrpmRAk3I5YPtroA9lPs0LgQ3ul4hwWGoM3h+bSsDxutB1GmWbl5TySgBv/m1PpTrg4WkxuKG3Hzdsckj+N0elYkxGjArPF6wsxI5SJ2XwHGd08+GvTk2Hlw86bMPZqTGKgmI4DNAZRrTHtEwD0IwBkQrqBjO4f0s5PJeuLmwCTx8+PQmzevn53POFECQD27yklH8D8NvrNhRj/rFaxSxz46y9uvsNLMpOQ5JXw+FKE+etKAzXMTzYV4a3x6SOTnS+bE0RluXW4bFB7VBYZ+Mf+yrRN8nAyikZENL6BEJUAtrl01cUYnvocHgfQzUtm+ESkB8LoV3YZiEcpDgYtvXVkrwgfrWhGF19BmYPSsJvNpWi0rTxzFnJ4XxKL1sUKv7pwdM6xeFfw1WIxYff1uCWLaUYlOzBg6cn4ep1xUqJLzUo6LRIBfnJBp8IGllTluaiNlQB80G86bd9E3DPaYqmv0YI8caPFGwmgNfo2k/srsDlp8Qr6/n91jKkxmjq4Dr79CahgbnjqQYPBhmPD3Nq8OczklAdlHhyTwX6JXlCCpLzIcQOAA+wplsQkU9p0V18uvI0XVqrhWaM+5FyJMMyD3xTr6VOXZoHQwhVSN/5ZamqvR6MyDN/+roc/wpB7UYeDCgjo1JoNGwiXrWuSHGhLSlIwLLWB3R9+ITF+ar76OIEKmhmD5/bibxTCEFPaPOSUp4FaW9ZeCKAK9cWIjszFtf38mPWphIFBOaOS1PJngfJ5LorhCb5/Q8NTMKveysPxj1fluLFA1UqxFF5j+wsR/8kD9ZOy2SIWwCHwnl99s4KPLu/gRlhqGwf49AticLeAaExn7ZKt0QLKqXkWa0L6vqIMZ/l43BVEO+NTsXsXRXYURpU3OEDpzt55pWDVXjwawdN0oO5zwUT0lTk2FJUjwtWFqFPoqFY7l+uLkKVaePVkak4p0NUiOPDpGW9BU2bcdGqQnxV3AC1eQjnd47D8w76mS2EuK/N2nFCQxos8+CROi3pmT3lGJcRi3GZMThQEYTf0NAtwQjDYoaOz79zqnAq6Na+CfiD48F4dl8l3v6mBvcPSFR55aUDVciM1/HyiPZU0GIIQVZ7Fa8hSnRJUwIO/j97W508P5xuaU5WaVkvQdOuZzTgc6/p4VP1I/dDUjQjTle3LT5Ri1kbHXaGhpcVr6tQ7vdoCuUxb9Eo7+yfgPu3laOo3sJ9A5MwJt3DQqIBxSkFSevPgPbHyDqE/67olvQYvD1a0S0vCyFm/UgFMe0vAHBOa/f/cVsZXjvsFJqKMO3uwxODneRKS9SEaJQnSeqSlARAmuVvsM0ja4tsjZ7q1nSN6Ra7HLpBuoX1RpuXlJKMxluhcqzF+1lwX7LaKSu4Rw6tUEHpcboqIUwpm5C6vFYA3wEYFD3Vo6B2dGhwkqsXn2Wn8VsWCE2b3maJQjdIy3oWmnbzoUoTu0sD4J8Mp2VBG+MzY1U9xPX8/ipVxFJBTK6/6BSHf4aSKwWl0tgrMm2pckCiV7iCPsueECwz51Cd3v6cz3PDvB6fy+v/MyYNo5Jhw/D2FUKw5d/mFQgEzvZ4PBtKA7bOsMYocLTKVF6UYGi4f2CiYq+P11j4xfICVAUdVpvjBJ9MSEP3BIdEoWyUg+iNy+fRVLiHo6Ah0QrKZu76z5Fqlbjd0MB7WXitmJoBr5QbhaaNaLNEroKkZKv3+ivWOkhMF05Di0ZwVmqMgtr8+8c5DsJhLUQPJpR9zyFMwVKAwIAWqLwJAt0SdLwxJg0+2NugaUMh7a8qpDYgmrpiuH5uaAqmdyYiFMOEQw+1eUkpR3IqjWiUYcqlxnig3Ne8cakYmhajCutpywuVEfIafv7h2FSckeLF8WoLszYWozhgKzaEi2TJY4OSMaFDDEzTHButIDabdq8sssQ16xoof35hokdg2bQOSBXBQ8Lw9mqzRA0Kuo1h6IHtZSAdE2kEGaR0JqarMECGYMba4jBhyuRKwpR10ltHqnHXV2WID6EY7o/UysppHZCpBQ/C8PRh11IKfdoUNiErzHBNRc8jFUNwYprmVI/Hs+THyCKl7MjWxs4qzXfhinwVwtzD5HfMGZKMy7rFK2WRcXDhPg3qjVGpGJsRg9waC5OXFaAiKMPhmt7E8uFXPX1sUJ4TraBUwsd9NVry+cvyQHjDC9xqfmF2Jnr7ZAU0/WYyF5ZlBXVdZ+uBtHkhgJLWUJGUcjyAFe+G2ILIBO4RAgsmpKJ3ogeHKkyct7IAAduxSCZXwvAEj8CSUOL1hhTkTh4tntwBXY3AMeGN6SKlfB7AjVeuLcaagrpwnHc6tAm4zxm9eoZgIiQiaT1WmoW5ublFHTt2/N62vpTSoJdWSW1g9uI8VY+5XsTvuK1vAn4fAjXXbyjGkhDgoQeTaiLlRDZl2rJCfFcbgZhNiQcGJuGGPgqxXhKtIC9sc0exbfSZuCgX5cGG+QTGblbgrFuaLCtILZZBEzmAthuatgXAJgC7opt7UsosWOb+rytF/EUr8xs11BTnNyoVozNiUFRnYeryQpTUO77PeM7kSnS0pSigilXG9EgD+nRSB/SMDeZB92ax+0p67O4vy/Du0eowt8jDu7RrPJ46y+H9Gi9m7WA9OH+uaQcgxVZo2kYAXzU3TSSl/A/Ht/5rdRE2FzW0NqiECzvH4x9Dne+4f1sZXncBjynxyKAkXNvTr8IzywnSVW5rnB70+9DkkRoNa7LFEB2TvSQfR6ut8HwCFXR1D78q9MgxsQ3AhMeDIyLJ8nnQJUFHsoMunWWrIRNO4XDQYzWngVQNIe2vK0P5gUx2ZL311JBkXNotXiXPc1YUKhDBz0kiMrn2SDAUPD1vRUGYZ6MH8WvnT8xEvzirCIansxr9Bd5+anclntxbEQ6HlKN/Oy+u6BavWHQeJnOyz9CQGqujY7yBLgkecIgozJ1bZiU0fSOEmA/gUyHEtxRPSnkngDkPbCvHq4cb+j7MmUNDlBIP+B97SQk5I200kDv7JeAuZzYPl68pwvqIvlXU5zObKsiy3oCmXXXxKvJdgUYQkBqnYoii3EUrpiAMN0keTYUi4nomyKEZcch05+5tcz804zXCdABPsKl2yaoibClusDxu7u7+ibijv8P2snDbVFQfhslMroNSvMirtVTiLQ84YcWN//MmZGCAzy6F4ekCgHPmq9/5pgZ3R9RCym4kFI0ULQc/Y5jlQTIf9kr04Mz2XgzPiMOApJDlUVm6MS8YDD7r8XiINFa/d7RGuOQun+H2sBiSmRvfP1qjWAYCnqiiHzdvLlG0l9s9iKr5rm+qIOlM1xCZfBLVdmgmJoT/ycX5lnSUyAezah+c4sW5WfGY2iUOPgVx7G+gaXyFZURkrcMHcXNXdPPhLyEy8abNJVgQ2jyN4/WR7RUUJ2SdtrxAQVh6l2svH43PwOl+uxyGh72nNNjmvpWFtrhmXWGTWqM1WYhc6W18NsEIPZdM+PSufvTya4AVtKF7lsK2sr8utz00aNdQ3AERNySvyqvDNaG+ED32vKw4vODMWOCh0ESvm4sV493bj/sHKibixuYUdAOAF6Lbtc0JFIlcmvvchcG8jo2sy06Jx8zeCfCFYke0dTOsTciMxb9HOW0HjiO/dMgJHRTs6RAJGc0Su8Yxd3w6BiXKSuieHirxm8HDe2q0xOlRbfwmYT0CgbUkJ5VFKEwyl3u8oU8CBrRzapnSehtTlxegIMScu6Dq4/FpiiPcWRoE2RlmUxrayLQYvBMqGUj0so8UqaAbeoWpojuaU9D5DOccvPtzqFBsbtOM26xhyoO2StbMEU0eFnEjvYqxmXCZMHdkeoxqa7PKdhc3f1o7L+YTTgsWq5V4dKez+Wg+jiTjyvw6lQe5qDR2fc9MlNUwPD0BFMO29hVYeveJi3OV10VNYYW/l8+vNKkAp6qPGqdrJD4Pn8aSYAjF7nOgkgn+stVF2BgBFKhQth0IeFjvqGLVlGCEcUqGdAX93/3GKRkiFeS25W3bvrc5BZ0NyM3zcupw65aSJtOZ7mEwRr8wNEX1c5Z8V4ttJQGF+qIH1qOVSyUxIb86IgUDkr3IXpoftjx3uI+MBS2VdPxvv2iI3bf2ScAfHHiMO74oxQffNgw48t73xqbj7CS7FoaX7zB9J01zY0DXh41flN8IykbuiV5Lqp9Tn5wJZIf0WLXDn5IiakmpjA40mut6+vDIoHaNvJ33Rno8cyVzZm6t81wW/Qx/CR5NFevkHd0ZPj7zVz39iqlnBGxOQd3ZF9pQCmPGmoIw/IsUyn0Dgl/S1e+4OamOJSfqlJD7Kkz1by1ZIjcxOdTZvDTC8sLt7YnpCmxExu7oZtdjO8rx3IHGEzPvjk3DsCRZF1LQCWnbH0GIC5ubs3DlIay9JwKYENZTSQuP1SqPYK0SPQDp3suQReiwYnK6Ipdd5oOfc78kc2/qk6A8k/0twmlGHRofzy4zTse24gAuWeNEESqD913bw1E6gEeaU1AKK+QDofk0WmZzoYskH2sWkqiRix7yRVFAdQpzqhvPpbnXEUGNSY/BW6NTG1meS2Z+NC4NA5I9qhN58aoiFbvJVU3uGItXRjj5iQz2wzsahkIYUt4Zm47h7WR4sEVKSV7uZhUO8xxmPHrR0i/uEo+nQ/MQkZ/nVJsKIr//bU2TQXxe5+6XHs9zohLckTUe9KyefjzseEIYTtMrvRoUpUWU+E2liXNXFKIuNGTJ+8iMk00g2m1OQSxWdxbZRm8Wq6QhmnNzh85oh8u6NZ5QIXTlLNjf91Y2mex0hWdTikPst/ZLULxaZIs9Eq19W+Vsntczdg9J8aqeEXNeJFfH51JBb49Jx4hkOwAjhm8B5kgp2RZ59M4vStUhRw/T8z4a1NntY/DBuNQmhsgcee/WMhURmosGBA0MjQuz05SXTF3mhDFeq1o0WXF4PoTWIuE0IwV5xbNSvYpc5dyCO+qmFNTdh8cc5v6pZvO6NM11AV0fOWFRPk5E0BCR1sUH3d43Ab8L0Rn8jNwS0R/Hj2itzT2c3tPDb+DDcWmqixqJcHh9ZPeU4YZwmuiI1trDr+PT7HR10Gvz63HVuoa5BSrorTHpGJksAzC8bCN868zhNWXnI+Wg5XcO0Uh+TmiGPOONQ9X4y+4K1cJuLsRxP/Tqv4eQJf9OApjhkddHd08f3F6OV0KIVPWwhrXHlE6xSt5zlheGR4R5rld392G2o6B/NK8g254LIS4i8thd1vQ9G94ZNcKkRlypnCNVZpO3CsKhzZJIi9Xx0vAUDGmvKlirPGjrfJ8nt9ZhFLhB9x0efgeti/PNZKzTYjUsmZiu6ivuiwMZbkihBb/ltBGCIQUdlVKy7/QJhzMeCnU1o0McrZmTOJ9mp6GLz1Dv8/x5RznmH69VRWtz0YP38JDZRAzxbWpMj/ex00tERtRK7yL7QWNlRGEbh0Uw5XpySDtc0d2nDI811JchUoDyX9XNh8edWvCF5hUk5XOcvKRFrA1ZRLRgbmh4dWQKnttXpV6fpBVHDjy691Agbur0ZA/+OiQZpyWzWwjONbAiunJGhOU5yMiP/z4jSVX6v95UonIRn8HD+mBMKrr4DQe6rnD6LG67Qs3uJUsTHhXiqKCz+eotK3WGmOZCHDfCZ88dm6qg9h+3l6mhlehXVyKNjAq9q38iZjkt+BO2bc/RNDw1L6c+jHzpmWkxDjtPg/oop0bVOxSYaeOWvn4FILhmbSjG4ojuccRw5cstKehBAH+6dUsp5kW8qxOpJB4eebgOcbqi0psLaS6lQgqI3NftpybB7zAmfHn3N7ZtX6tp2ov0vGdCg4pU5PSsOLzqzK6pxR81CNJrTaB9aFiY0JXexbEqV0Fvjk7D2BSYMLx80fmIlLIXrODedSVSvzLiXZ1oY6MVD2znwd4KE7Wm3fQtw1CByetGcMhlQJIaEwPkIUCws3oIZvDYvlo9gQM3zE0uA7F0UrpiIbiIbflfre30fZw5WuAPX5XhzW8cQleh1VPinTfxgH+3pKDf8E2C1tgEKoDJO9JruDGGG1oQc8yUjnG4rlcC+iTqpHlKoWlU/nMceJdSjgawhvnk42M1yIo3kBqroXeiF0NTlZftA+R+SMpix4PDj0KvghBZpo0uVNCByqCK+QpcjErD+BRuKIY56JDk/LcZPLCnRk+avjyv0UsB0Uri/Sw4Iw+EMjBSsBgelOLBzB5+nNfZfYXWfh/Q7uJvRvAHMyDlF3UQgx7dXoZYQ1NcXlqsgeyOsTTKenBWAjYhbxxs6YemG3B+EGQY5xo4ekbPZF7j/OEcR0FzW1IQmeCPommI5iyPnkQlURgqhxU26Y3JHeNwXhcfsuL4/p9pQTdIzfP9ngPuc6SU3AU7mo0bgCYrXg/Hi2dETrHyXVa+HS2l5Ft21+6usMBuhMtidE/UECdlDYSggk6oV1psa893Qb3rlCW54ZepouXg37l3d0aAfzL/cNSYZcT0LvEYnuqyvnIrIChHo/dbZYjDbPxslSFLAfGUEIIcZ3gppTpvd6zLqweOVZuI0TUVDRgSOzjVy5yWFKSmTNn6vv2LxlMx7jdEMtiZcbR6h/kdmh7nkIlctlUCiLnQNL7Xs7W5g6mrq+sTExNDg6gM9eE5xFEM4HhLL4pJKYdwvg5msCsgg4AwFceueyptKZ/XNO3pkIdqkPaXVdAGjfwkt1FTzeXveCAN7QYNp/gMDEzxYFhaLAaneaH8xTY5hrvasu1/5ebmzuvcuXOTn8KRUpLZ5sQpWVD+EgvfAKEcBWQ1mjUK554XYFvnw7YEhAhCSr6pYULTv2R6aklBAwC5Y3uJief2VyqtEoHGG5rT/4nVVN+EPaCsBB0pkT0gyyyDpq+HEB8DWNTSa/PNbbgt/yal5NkxyzI90VRVdI3+HSFpmyuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(Ye,se,U){Ye.exports=U.p+"static/qrcode.2267e4d5.png"},LdHM:function(Ye,se,U){"use strict";U.d(se,"b",function(){return i}),U.d(se,"a",function(){return S});var Z=U("1OyB"),z=U("vuIU"),N=U("Ji7U"),V=U("LK+K"),W=U("q1tI"),M=U("rePB"),K=U("Ff2n"),H=U("ODXe"),n=U("4IlW"),D=U("bX4T"),y=U("YrtM"),m=U("TSYQ"),f=U.n(m),c=U("+nKL"),l=U("8OUc"),d=function(Y,$){var oe=Y.prefixCls,de=Y.id,Fe=Y.flattenOptions,Ae=Y.childrenAsData,Re=Y.values,Me=Y.searchValue,Be=Y.multiple,pe=Y.defaultActiveFirstOption,fe=Y.height,ne=Y.itemHeight,xe=Y.notFoundContent,ce=Y.open,Pe=Y.menuItemSelectedIcon,He=Y.virtual,ke=Y.onSelect,Ve=Y.onToggleOpen,et=Y.onActiveValue,le=Y.onScroll,_e=Y.onMouseEnter,Ce="".concat(oe,"-item"),De=Object(y.a)(function(){return Fe},[ce,Fe],function(Xe,Se){return Se[0]&&Xe[1]!==Se[1]}),tt=W.useRef(null),ct=function(Se){Se.preventDefault()},ft=function(Se){tt.current&&tt.current.scrollTo({index:Se})},ut=function(Se){for(var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=De.length,ie=0;ie<Ee;ie+=1){var ae=(Se+ie*ge+Ee)%Ee,he=De[ae],ve=he.group,Te=he.data;if(!ve&&!Te.disabled)return ae}return-1},xt=W.useState(function(){return ut(0)}),bt=Object(H.a)(xt,2),Ne=bt[0],Oe=bt[1],nt=function(Se){Oe(Se);var ge=De[Se];if(!ge){et(null,-1);return}et(ge.data.value,Se)};W.useEffect(function(){nt(pe!==!1?ut(0):-1)},[De.length,Me]),W.useEffect(function(){var Xe=setTimeout(function(){if(!Be&&ce&&Re.size===1){var Se=Array.from(Re)[0],ge=De.findIndex(function(Ee){var ie=Ee.data;return ie.value===Se});nt(ge),ft(ge)}});return function(){return clearTimeout(Xe)}},[ce]);var lt=function(Se){Se!==void 0&&ke(Se,{selected:!Re.has(Se)}),Be||Ve(!1)};if(W.useImperativeHandle($,function(){return{onKeyDown:function(Se){var ge=Se.which;switch(ge){case n.a.UP:case n.a.DOWN:{var Ee=0;if(ge===n.a.UP?Ee=-1:ge===n.a.DOWN&&(Ee=1),Ee!==0){var ie=ut(Ne+Ee,Ee);ft(ie),nt(ie)}break}case n.a.ENTER:{var ae=De[Ne];ae&&!ae.data.disabled?lt(ae.data.value):lt(void 0),ce&&Se.preventDefault();break}case n.a.ESC:Ve(!1)}},onKeyUp:function(){},scrollTo:function(Se){ft(Se)}}}),De.length===0)return W.createElement("div",{role:"listbox",id:"".concat(de,"_list"),className:"".concat(Ce,"-empty"),onMouseDown:ct},xe);function Ke(Xe){var Se=De[Xe];if(!Se)return null;var ge=Se.data||{},Ee=ge.value,ie=ge.label,ae=ge.children,he=Object(D.a)(ge,!0),ve=Ae?ae:ie;return Se?W.createElement("div",Object.assign({"aria-label":typeof ve=="string"?ve:null},he,{key:Xe,role:"option",id:"".concat(de,"_list_").concat(Xe),"aria-selected":Re.has(Ee)}),Ee):null}return W.createElement(W.Fragment,null,W.createElement("div",{role:"listbox",id:"".concat(de,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ke(Ne-1),Ke(Ne),Ke(Ne+1)),W.createElement(c.a,{itemKey:"key",ref:tt,data:De,height:fe,itemHeight:ne,fullHeight:!1,onMouseDown:ct,onScroll:le,virtual:He,onMouseEnter:_e},function(Xe,Se){var ge,Ee=Xe.group,ie=Xe.groupOption,ae=Xe.data,he=ae.label,ve=ae.key;if(Ee)return W.createElement("div",{className:f()(Ce,"".concat(Ce,"-group"))},he!==void 0?he:ve);var Te=ae.disabled,Ge=ae.value,ot=ae.title,Tt=ae.children,Ot=ae.style,wt=ae.className,vt=Object(K.a)(ae,["disabled","value","title","children","style","className"]),qe=Re.has(Ge),Qe="".concat(Ce,"-option"),Ue=f()(Ce,Qe,wt,(ge={},Object(M.a)(ge,"".concat(Qe,"-grouped"),ie),Object(M.a)(ge,"".concat(Qe,"-active"),Ne===Se&&!Te),Object(M.a)(ge,"".concat(Qe,"-disabled"),Te),Object(M.a)(ge,"".concat(Qe,"-selected"),qe),ge)),ue=Ae?Tt:he,me=!Pe||typeof Pe=="function"||qe;return W.createElement("div",Object.assign({},vt,{"aria-selected":qe,className:Ue,title:ot,onMouseMove:function(){if(Ne===Se||Te)return;nt(Se)},onClick:function(){Te||lt(Ge)},style:Ot}),W.createElement("div",{className:"".concat(Qe,"-content")},ue||Ge),W.isValidElement(Pe)||qe,me&&W.createElement(l.a,{className:"".concat(Ce,"-option-state"),customizeIcon:Pe,customizeIconProps:{isSelected:qe}},qe?"\u2713":null))}))},o=W.forwardRef(d);o.displayName="OptionList";var u=o,a=function(){return null};a.isSelectOption=!0;var i=a,R=function(){return null};R.isSelectOptGroup=!0;var S=R,T=U("VTBJ"),I=U("Zm9Q");function O(w){var Y=w.key,$=w.props,oe=$.children,de=$.value,Fe=Object(K.a)($,["children","value"]);return Object(T.a)({key:Y,value:de!==void 0?de:Y,children:oe},Fe)}function _(w){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(I.a)(w).map(function($,oe){if(!W.isValidElement($)||!$.type)return null;var de=$.type.isSelectOptGroup,Fe=$.key,Ae=$.props,Re=Ae.children,Me=Object(K.a)(Ae,["children"]);return Y||!de?O($):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Fe===null?oe:Fe,"__"),label:Fe},Me),{},{options:_(Re)})}).filter(function($){return $})}var b=U("2Qr1"),p=U("qNPg"),h=U("U8pU"),A=U("Kwbf"),E=U("WKfj");function v(w){var Y=w.mode,$=w.options,oe=w.children,de=w.backfill,Fe=w.allowClear,Ae=w.placeholder,Re=w.getInputElement,Me=w.showSearch,Be=w.onSearch,pe=w.defaultOpen,fe=w.autoFocus,ne=w.labelInValue,xe=w.value,ce=w.inputValue,Pe=w.optionLabelProp,He=Y==="multiple"||Y==="tags",ke=Me!==void 0?Me:He||Y==="combobox",Ve=$||_(oe);if(Object(A.a)(Y!=="tags"||Ve.every(function(Ce){return!Ce.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var et=Ve.some(function(Ce){return Ce.options?Ce.options.some(function(De){return typeof("value"in De?De.value:De.key)=="number"}):typeof("value"in Ce?Ce.value:Ce.key)=="number"});Object(A.a)(!et,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)(Y!=="combobox"||!Pe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)(Y==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(A.a)(Y==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(A.b)(Y!=="combobox"||!Re||!Fe||!Ae,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Be&&!ke&&Y!=="combobox"&&Y!=="tags"&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!pe||fe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),xe!=null){var le=Object(E.d)(xe);Object(A.a)(!ne||le.every(function(Ce){return Object(h.a)(Ce)==="object"&&("key"in Ce||"value"in Ce)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(A.a)(!He||Array.isArray(xe),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var _e=null;Object(I.a)(oe).some(function(Ce){if(!W.isValidElement(Ce)||!Ce.type)return!1;var De=Ce.type;if(De.isSelectOption)return!1;if(De.isSelectOptGroup){var tt=Object(I.a)(Ce.props.children).every(function(ct){return!W.isValidElement(ct)||!Ce.type||ct.type.isSelectOption?!0:(_e=ct.type,!1)});return!tt}return _e=De,!0}),_e&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(_e.displayName||_e.name||_e,"`.")),Object(A.a)(ce===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=v,x=Object(p.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:_,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:P,fillOptionsWithMissingValue:b.a}),C=function(w){Object(N.a)($,w);var Y=Object(V.a)($);function $(){var oe;return Object(Z.a)(this,$),oe=Y.apply(this,arguments),oe.selectRef=W.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(z.a)($,[{key:"render",value:function(){return W.createElement(x,Object.assign({ref:this.selectRef},this.props))}}]),$}(W.Component);C.Option=i,C.OptGroup=S;var j=C,B=se.c=j},M8RZ:function(Ye,se,U){"use strict";U.d(se,"a",function(){return n});var Z=U("fWQN"),z=U("mtLc"),N=U("yKVA"),V=U("879j"),W=U("q1tI"),M=U.n(W),K=U("i8i4"),H=U.n(K),n=function(D){Object(N.a)(m,D);var y=Object(V.a)(m);function m(f){var c;Object(Z.a)(this,m),c=y.call(this,f);var l=window.document;return c.node=l.createElement("div"),l.body.appendChild(c.node),c}return Object(z.a)(m,[{key:"render",value:function(){var c=this.props.children;return Object(K.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(M.a.Component)},MI8n:function(Ye,se,U){"use strict";U.d(se,"c",function(){return W}),U.d(se,"b",function(){return n}),U.d(se,"e",function(){return D}),U.d(se,"a",function(){return y}),U.d(se,"d",function(){return m}),U.d(se,"f",function(){return f});var Z=U("/cxE"),z=U("pmY6"),N=U("24hK"),V=U("5Y4S"),W;(function(c){c.None=()=>z.a.None;function l(v){return(P,x=null,C)=>{let j=!1,B;return B=v(w=>j?void 0:(B?B.dispose():j=!0,P.call(x,w)),null,C),j&&B.dispose(),B}}c.once=l;function d(v,P){return S((x,C=null,j)=>v(B=>x.call(C,P(B)),null,j))}c.map=d;function o(v,P){return S((x,C=null,j)=>v(B=>{P(B),x.call(C,B)},null,j))}c.forEach=o;function u(v,P){return S((x,C=null,j)=>v(B=>P(B)&&x.call(C,B),null,j))}c.filter=u;function a(v){return v}c.signal=a;function i(...v){return(P,x=null,C)=>Object(z.e)(...v.map(j=>j(B=>P.call(x,B),null,C)))}c.any=i;function R(v,P,x){let C=x;return d(v,j=>(C=P(C,j),C))}c.reduce=R;function S(v){let P;const x=new n({onFirstListenerAdd(){P=v(x.fire,x)},onLastListenerRemove(){P.dispose()}});return x.event}function T(v,P,x=100,C=!1,j){let B,w,Y,$=0;const oe=new n({leakWarningThreshold:j,onFirstListenerAdd(){B=v(de=>{$++,w=P(w,de),C&&!Y&&(oe.fire(w),w=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Fe=w;w=void 0,Y=void 0,(!C||$>1)&&oe.fire(Fe),$=0},x)})},onLastListenerRemove(){B.dispose()}});return oe.event}c.debounce=T;function I(v,P=(x,C)=>x===C){let x=!0,C;return u(v,j=>{const B=x||!P(j,C);return x=!1,C=j,B})}c.latch=I;function O(v,P){return[c.filter(v,P),c.filter(v,x=>!P(x))]}c.split=O;function _(v,P=!1,x=[]){let C=x.slice(),j=v(Y=>{C?C.push(Y):w.fire(Y)});const B=()=>{C&&C.forEach(Y=>w.fire(Y)),C=null},w=new n({onFirstListenerAdd(){j||(j=v(Y=>w.fire(Y)))},onFirstListenerDidAdd(){C&&(P?setTimeout(B):B())},onLastListenerRemove(){j&&j.dispose(),j=null}});return w.event}c.buffer=_;class b{constructor(v){this.event=v}map(v){return new b(d(this.event,v))}forEach(v){return new b(o(this.event,v))}filter(v){return new b(u(this.event,v))}reduce(v,P){return new b(R(this.event,v,P))}latch(){return new b(I(this.event))}debounce(v,P=100,x=!1,C){return new b(T(this.event,v,P,x,C))}on(v,P,x){return this.event(v,P,x)}once(v,P,x){return l(this.event)(v,P,x)}}function p(v){return new b(v)}c.chain=p;function h(v,P,x=C=>C){const C=(...Y)=>w.fire(x(...Y)),j=()=>v.on(P,C),B=()=>v.removeListener(P,C),w=new n({onFirstListenerAdd:j,onLastListenerRemove:B});return w.event}c.fromNodeEventEmitter=h;function A(v,P,x=C=>C){const C=(...Y)=>w.fire(x(...Y)),j=()=>v.addEventListener(P,C),B=()=>v.removeEventListener(P,C),w=new n({onFirstListenerAdd:j,onLastListenerRemove:B});return w.event}c.fromDOMEventEmitter=A;function E(v){return new Promise(P=>l(v)(P))}c.toPromise=E})(W||(W={}));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 K=-1;class H{constructor(c,l=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let l=K;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||c<l)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),o=this._stacks.get(d)||0;if(this._stacks.set(d,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let u,a=0;for(const[i,R]of this._stacks)(!u||a<R)&&(u=i,a=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${a}):`),console.warn(u)}return()=>{const u=this._stacks.get(d)||0;this._stacks.set(d,u-1)}}}class n{constructor(c){var l;this._disposed=!1,this._options=c,this._leakageMon=K>0?new H(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(c,l,d)=>{var o;this._listeners||(this._listeners=new N.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(l?[c,l]:c);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,l);const i=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),R=Object(z.i)(()=>{if(i&&i(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const S=this._listeners&&!this._listeners.isEmpty();S||this._options.onLastListenerRemove(this)}});return d instanceof z.b?d.add(R):Array.isArray(d)&&d.push(R),R}),this._event}fire(c){var l,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new N.a);for(let o of this._listeners)this._deliveryQueue.push([o,c]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,u]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,u):o[0].call(o[1],u)}catch(a){Object(Z.f)(a)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,l,d,o,u;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||o===void 0||o.call(d),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class D extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new N.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 y extends D{constructor(c){var l;super(c);this._delay=(l=c.delay)!==null&&l!==void 0?l:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class m{constructor(){this.buffers=[]}wrapEvent(c){return(l,d,o)=>c(u=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>l.call(d,u)):l.call(d,u)},void 0,o)}bufferEvents(c){const l=[];this.buffers.push(l);const d=c();return this.buffers.pop(),l.forEach(o=>o()),d}}class f{constructor(){this.listening=!1,this.inputEvent=W.None,this.inputEventListener=z.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(c){this.inputEvent=c,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=c(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ye,se,U){"use strict";(function(Z,z){U.d(se,"b",function(){return d}),U.d(se,"i",function(){return i}),U.d(se,"f",function(){return R}),U.d(se,"d",function(){return S}),U.d(se,"g",function(){return T}),U.d(se,"h",function(){return I}),U.d(se,"c",function(){return O}),U.d(se,"k",function(){return _}),U.d(se,"j",function(){return b}),U.d(se,"a",function(){return p}),U.d(se,"e",function(){return E});var N;const V="en";let W=!1,M=!1,K=!1,H=!1,n=!1,D=!1,y=!1,m,f=V,c,l;const d=typeof self=="object"?self:typeof Z=="object"?Z:{};let o;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?o=d.vscode.process:typeof z!="undefined"&&(o=z);const u=typeof((N=o==null?void 0:o.versions)===null||N===void 0?void 0:N.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!u)l=navigator.userAgent,W=l.indexOf("Windows")>=0,M=l.indexOf("Macintosh")>=0,y=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=l.indexOf("Linux")>=0,D=!0,m=navigator.language,f=m;else if(typeof o=="object"){W=o.platform==="win32",M=o.platform==="darwin",K=o.platform==="linux",H=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=V,f=V;const v=o.env.VSCODE_NLS_CONFIG;if(v)try{const P=JSON.parse(v),x=P.availableLanguages["*"];m=P.locale,f=x||V,c=P._translationsConfigFile}catch(P){}n=!0}else console.error("Unable to resolve platform.");let a=0;M?a=1:W?a=3:K&&(a=2);const i=W,R=M,S=K,T=n,I=D,O=y,_=l,b=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let x=[];d.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let B=0,w=x.length;B<w;B++){const Y=x[B];if(Y.id===j.data.vscodeSetImmediateId){x.splice(B,1),Y.callback();return}}});let C=0;return j=>{const B=++C;x.push({id:B,callback:j}),d.postMessage({vscodeSetImmediateId:B},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const P=Promise.resolve();return x=>P.then(x)}(),p=M||y?2:W?1:3;let h=!0,A=!1;function E(){if(!A){A=!0;const v=new Uint8Array(2);v[0]=1,v[1]=2;const P=new Uint16Array(v.buffer);h=P[0]===(2<<8)+1}return h}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(Ye,se,U){"use strict";U.d(se,"C",function(){return Z}),U.d(se,"v",function(){return N}),U.d(se,"s",function(){return V}),U.d(se,"t",function(){return W}),U.d(se,"U",function(){return M}),U.d(se,"J",function(){return K}),U.d(se,"O",function(){return H}),U.d(se,"p",function(){return n}),U.d(se,"T",function(){return D}),U.d(se,"q",function(){return y}),U.d(se,"N",function(){return m}),U.d(se,"M",function(){return f}),U.d(se,"Q",function(){return c}),U.d(se,"u",function(){return l}),U.d(se,"x",function(){return d}),U.d(se,"I",function(){return o}),U.d(se,"f",function(){return u}),U.d(se,"h",function(){return a}),U.d(se,"g",function(){return i}),U.d(se,"i",function(){return R}),U.d(se,"G",function(){return S}),U.d(se,"H",function(){return T}),U.d(se,"r",function(){return I}),U.d(se,"R",function(){return O}),U.d(se,"d",function(){return _}),U.d(se,"e",function(){return b}),U.d(se,"E",function(){return p}),U.d(se,"F",function(){return h}),U.d(se,"j",function(){return A}),U.d(se,"z",function(){return E}),U.d(se,"K",function(){return P}),U.d(se,"L",function(){return x}),U.d(se,"m",function(){return j}),U.d(se,"k",function(){return w}),U.d(se,"A",function(){return $}),U.d(se,"a",function(){return oe}),U.d(se,"n",function(){return de}),U.d(se,"l",function(){return Fe}),U.d(se,"D",function(){return Ae}),U.d(se,"B",function(){return Re}),U.d(se,"b",function(){return Me}),U.d(se,"S",function(){return Be}),U.d(se,"o",function(){return pe}),U.d(se,"P",function(){return fe}),U.d(se,"w",function(){return ne}),U.d(se,"c",function(){return xe}),U.d(se,"y",function(){return He});function Z(le){return!le||typeof le!="string"?!0:le.trim().length===0}const z=/{(\d+)}/g;function N(le,..._e){return _e.length===0?le:le.replace(z,function(Ce,De){const tt=parseInt(De,10);return isNaN(tt)||tt<0||tt>=_e.length?Ce:_e[tt]})}function V(le){return le.replace(/[<>&]/g,function(_e){switch(_e){case"<":return"<";case">":return">";case"&":return"&";default:return _e}})}function W(le){return le.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(le,_e=" "){const Ce=K(le,_e);return H(Ce,_e)}function K(le,_e){if(!le||!_e)return le;const Ce=_e.length;if(Ce===0||le.length===0)return le;let De=0;for(;le.indexOf(_e,De)===De;)De=De+Ce;return le.substring(De)}function H(le,_e){if(!le||!_e)return le;const Ce=_e.length,De=le.length;if(Ce===0||De===0)return le;let tt=De,ct=-1;for(;!(ct=le.lastIndexOf(_e,tt-1),ct===-1||ct+Ce!==tt);){if(ct===0)return"";tt=ct}return le.substring(0,tt)}function n(le){return le.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(le){return le.replace(/\*/g,"")}function y(le,_e,Ce={}){if(!le)throw new Error("Cannot create regex from empty string");_e||(le=W(le)),Ce.wholeWord&&(/\B/.test(le.charAt(0))||(le="\\b"+le),/\B/.test(le.charAt(le.length-1))||(le=le+"\\b"));let De="";return Ce.global&&(De+="g"),Ce.matchCase||(De+="i"),Ce.multiline&&(De+="m"),Ce.unicode&&(De+="u"),new RegExp(le,De)}function m(le){if(le.source==="^"||le.source==="^$"||le.source==="$"||le.source==="^\\s*$")return!1;const _e=le.exec("");return!!(_e&&le.lastIndex===0)}function f(le){return(le.global?"g":"")+(le.ignoreCase?"i":"")+(le.multiline?"m":"")+(le.unicode?"u":"")}function c(le){return le.split(/\r\n|\r|\n/)}function l(le){for(let _e=0,Ce=le.length;_e<Ce;_e++){const De=le.charCodeAt(_e);if(De!==32&&De!==9)return _e}return-1}function d(le,_e=0,Ce=le.length){for(let De=_e;De<Ce;De++){const tt=le.charCodeAt(De);if(tt!==32&&tt!==9)return le.substring(_e,De)}return le.substring(_e,Ce)}function o(le,_e=le.length-1){for(let Ce=_e;Ce>=0;Ce--){const De=le.charCodeAt(Ce);if(De!==32&&De!==9)return Ce}return-1}function u(le,_e){return le<_e?-1:le>_e?1:0}function a(le,_e,Ce=0,De=le.length,tt=0,ct=_e.length){for(;Ce<De&&tt<ct;Ce++,tt++){let xt=le.charCodeAt(Ce),bt=_e.charCodeAt(tt);if(xt<bt)return-1;if(xt>bt)return 1}const ft=De-Ce,ut=ct-tt;return ft<ut?-1:ft>ut?1:0}function i(le,_e){return R(le,_e,0,le.length,0,_e.length)}function R(le,_e,Ce=0,De=le.length,tt=0,ct=_e.length){for(;Ce<De&&tt<ct;Ce++,tt++){let xt=le.charCodeAt(Ce),bt=_e.charCodeAt(tt);if(xt===bt)continue;if(xt>=128||bt>=128)return a(le.toLowerCase(),_e.toLowerCase(),Ce,De,tt,ct);S(xt)&&(xt-=32),S(bt)&&(bt-=32);const Ne=xt-bt;if(Ne===0)continue;return Ne}const ft=De-Ce,ut=ct-tt;return ft<ut?-1:ft>ut?1:0}function S(le){return le>=97&&le<=122}function T(le){return le>=65&&le<=90}function I(le,_e){return le.length===_e.length&&R(le,_e)===0}function O(le,_e){const Ce=_e.length;return _e.length>le.length?!1:R(le,_e,0,Ce)===0}function _(le,_e){let Ce,De=Math.min(le.length,_e.length);for(Ce=0;Ce<De;Ce++)if(le.charCodeAt(Ce)!==_e.charCodeAt(Ce))return Ce;return De}function b(le,_e){let Ce,De=Math.min(le.length,_e.length);const tt=le.length-1,ct=_e.length-1;for(Ce=0;Ce<De;Ce++)if(le.charCodeAt(tt-Ce)!==_e.charCodeAt(ct-Ce))return Ce;return De}function p(le){return 55296<=le&&le<=56319}function h(le){return 56320<=le&&le<=57343}function A(le,_e){return(le-55296<<10)+(_e-56320)+65536}function E(le,_e,Ce){const De=le.charCodeAt(Ce);if(p(De)&&Ce+1<_e){const tt=le.charCodeAt(Ce+1);if(h(tt))return A(De,tt)}return De}function v(le,_e){const Ce=le.charCodeAt(_e-1);if(h(Ce)&&_e>1){const De=le.charCodeAt(_e-2);if(p(De))return A(De,Ce)}return Ce}function P(le,_e){const Ce=ce.getInstance(),De=_e,tt=le.length,ct=E(le,tt,_e);_e+=ct>=65536?2:1;let ft=Ce.getGraphemeBreakType(ct);for(;_e<tt;){const ut=E(le,tt,_e),xt=Ce.getGraphemeBreakType(ut);if(xe(ft,xt))break;_e+=ut>=65536?2:1,ft=xt}return _e-De}function x(le,_e){const Ce=ce.getInstance(),De=_e,tt=v(le,_e);_e-=tt>=65536?2:1;let ct=Ce.getGraphemeBreakType(tt);for(;_e>0;){const ft=v(le,_e),ut=Ce.getGraphemeBreakType(ft);if(xe(ut,ct))break;_e-=ft>=65536?2:1,ct=ut}return De-_e}const C=/(?:[\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 j(le){return C.test(le)}const B=/(?:[\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 w(le){return B.test(le)}const Y=/^[\t\n\r\x20-\x7E]*$/;function $(le){return Y.test(le)}const oe=/[\u2028\u2029]/;function de(le){return oe.test(le)}function Fe(le){for(let _e=0,Ce=le.length;_e<Ce;_e++)if(Ae(le.charCodeAt(_e)))return!0;return!1}function Ae(le){return le=+le,le>=11904&&le<=55215||le>=63744&&le<=64255||le>=65281&&le<=65374}function Re(le){return le>=127462&&le<=127487||le===8986||le===8987||le===9200||le===9203||le>=9728&&le<=10175||le===11088||le===11093||le>=127744&&le<=128591||le>=128640&&le<=128764||le>=128992&&le<=129003||le>=129280&&le<=129535||le>=129648&&le<=129750}const Me=String.fromCharCode(65279);function Be(le){return!!(le&&le.length>0&&le.charCodeAt(0)===65279)}function pe(le,_e=!1){return le?(_e&&(le=le.replace(/\\./g,"")),le.toLowerCase()!==le):!1}function fe(le){const _e=90-65+1;return le=le%(2*_e),le<_e?String.fromCharCode(97+le):String.fromCharCode(65+le-_e)}function ne(le){const _e=ce.getInstance();return _e.getGraphemeBreakType(le)}function xe(le,_e){return le===0?_e!==5&&_e!==7:le===2&&_e===3?!1:le===4||le===2||le===3||(_e===4||_e===2||_e===3)?!0:le===8&&(_e===8||_e===9||_e===11||_e===12)||((le===11||le===9)&&(_e===9||_e===10)||((le===12||le===10)&&_e===10||(_e===5||_e===13||(_e===7||(le===1||le===13&&_e===14)))))?!1:!(le===6&&_e===6)}class ce{constructor(){this._data=Pe()}static getInstance(){return ce._INSTANCE||(ce._INSTANCE=new ce),ce._INSTANCE}getGraphemeBreakType(le){if(le<32)return le===10?3:le===13?2:4;if(le<127)return 0;const _e=this._data,Ce=_e.length/3;let De=1;for(;De<=Ce;)if(le<_e[3*De])De=2*De;else if(le>_e[3*De+1])De=2*De+1;else return _e[3*De+2];return 0}}ce._INSTANCE=null;function Pe(){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 He(le,_e){if(le===0)return 0;const Ce=ke(le,_e);if(Ce!==void 0)return Ce;const De=v(_e,le);return le-=Ve(De),le}function ke(le,_e){let Ce=v(_e,le);for(le-=Ve(Ce);et(Ce)||Ce===65039||Ce===8419;){if(le===0)return;Ce=v(_e,le),le-=Ve(Ce)}if(!Re(Ce))return;if(le>=0){const De=v(_e,le);De===8205&&(le-=Ve(De))}return le}function Ve(le){return le>=65536?2:1}function et(le){return 127995<=le&&le<=127999}},Nmxd:function(Ye,se){Ye.exports="data:image/png;base64,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"},NvD2:function(Ye,se,U){"use strict";U.d(se,"a",function(){return M});var Z=U("Kwbf");function z(K,H){var n=new Set;return K.forEach(function(D){H.has(D)||n.add(D)}),n}function N(K){var H=K||{},n=H.disabled,D=H.disableCheckbox,y=H.checkable;return!!(n||D)||y===!1}function V(K,H,n,D){for(var y=new Set(K),m=new Set,f=0;f<=n;f+=1){var c=H.get(f)||new Set;c.forEach(function(u){var a=u.key,i=u.node,R=u.children,S=R===void 0?[]:R;y.has(a)&&!D(i)&&S.filter(function(T){return!D(T.node)}).forEach(function(T){y.add(T.key)})})}for(var l=new Set,d=n;d>=0;d-=1){var o=H.get(d)||new Set;o.forEach(function(u){var a=u.parent,i=u.node;if(D(i)||!u.parent||l.has(u.parent.key))return;if(D(u.parent.node)){l.add(a.key);return}var R=!0,S=!1;(a.children||[]).filter(function(T){return!D(T.node)}).forEach(function(T){var I=T.key,O=y.has(I);R&&!O&&(R=!1),!S&&(O||m.has(I))&&(S=!0)}),R&&y.add(a.key),S&&m.add(a.key),l.add(a.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(z(m,y))}}function W(K,H,n,D,y){for(var m=new Set(K),f=new Set(H),c=0;c<=D;c+=1){var l=n.get(c)||new Set;l.forEach(function(a){var i=a.key,R=a.node,S=a.children,T=S===void 0?[]:S;!m.has(i)&&!f.has(i)&&!y(R)&&T.filter(function(I){return!y(I.node)}).forEach(function(I){m.delete(I.key)})})}f=new Set;for(var d=new Set,o=D;o>=0;o-=1){var u=n.get(o)||new Set;u.forEach(function(a){var i=a.parent,R=a.node;if(y(R)||!a.parent||d.has(a.parent.key))return;if(y(a.parent.node)){d.add(i.key);return}var S=!0,T=!1;(i.children||[]).filter(function(I){return!y(I.node)}).forEach(function(I){var O=I.key,_=m.has(O);S&&!_&&(S=!1),!T&&(_||f.has(O))&&(T=!0)}),S||m.delete(i.key),T&&f.add(i.key),d.add(i.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(z(f,m))}}function M(K,H,n,D){var y=[],m;D?m=D:m=N;var f=new Set(K.filter(function(o){var u=!!n[o];return u||y.push(o),u})),c=new Map,l=0;Object.keys(n).forEach(function(o){var u=n[o],a=u.level,i=c.get(a);i||(i=new Set,c.set(a,i)),i.add(u),l=Math.max(l,a)}),Object(Z.a)(!y.length,"Tree missing follow keys: ".concat(y.slice(0,100).map(function(o){return"'".concat(o,"'")}).join(", ")));var d;return H===!0?d=V(f,c,l,m):d=W(f,H.halfCheckedKeys,c,l,m),d}},OLES:function(Ye,se,U){"use strict";var Z=U("U8pU"),z=U("VTBJ"),N=U("Ff2n"),V=U("q1tI"),W=U("uciX"),M=U("7ixt"),K=function(f){var c=f.overlay,l=f.prefixCls,d=f.id,o=f.overlayInnerStyle;return V.createElement("div",{className:"".concat(l,"-inner"),id:d,role:"tooltip",style:o},typeof c=="function"?c():c)},H=K,n=function(f,c){var l=f.overlayClassName,d=f.trigger,o=d===void 0?["hover"]:d,u=f.mouseEnterDelay,a=u===void 0?0:u,i=f.mouseLeaveDelay,R=i===void 0?.1:i,S=f.overlayStyle,T=f.prefixCls,I=T===void 0?"rc-tooltip":T,O=f.children,_=f.onVisibleChange,b=f.afterVisibleChange,p=f.transitionName,h=f.animation,A=f.placement,E=A===void 0?"right":A,v=f.align,P=v===void 0?{}:v,x=f.destroyTooltipOnHide,C=x===void 0?!1:x,j=f.defaultVisible,B=f.getTooltipContainer,w=f.overlayInnerStyle,Y=Object(N.a)(f,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),$=Object(V.useRef)(null);Object(V.useImperativeHandle)(c,function(){return $.current});var oe=Object(z.a)({},Y);"visible"in f&&(oe.popupVisible=f.visible);var de=function(){var Be=f.arrowContent,pe=Be===void 0?null:Be,fe=f.overlay,ne=f.id;return[V.createElement("div",{className:"".concat(I,"-arrow"),key:"arrow"},pe),V.createElement(H,{key:"content",prefixCls:I,id:ne,overlay:fe,overlayInnerStyle:w})]},Fe=!1,Ae=!1;if(typeof C=="boolean")Fe=C;else if(C&&Object(Z.a)(C)==="object"){var Re=C.keepParent;Fe=Re===!0,Ae=Re===!1}return V.createElement(W.a,Object.assign({popupClassName:l,prefixCls:I,popup:de,action:o,builtinPlacements:M.a,popupPlacement:E,ref:$,popupAlign:P,getPopupContainer:B,onPopupVisibleChange:_,afterPopupVisibleChange:b,popupTransitionName:p,popupAnimation:h,defaultPopupVisible:j,destroyPopupOnHide:Fe,autoDestroy:Ae,mouseLeaveDelay:R,popupStyle:S,mouseEnterDelay:a},oe),O)},D=Object(V.forwardRef)(n),y=se.a=D},OZM5:function(Ye,se,U){"use strict";U.d(se,"b",function(){return D}),U.d(se,"a",function(){return y}),U.d(se,"k",function(){return m}),U.d(se,"h",function(){return f}),U.d(se,"i",function(){return c}),U.d(se,"g",function(){return l}),U.d(se,"c",function(){return d}),U.d(se,"d",function(){return o}),U.d(se,"j",function(){return i}),U.d(se,"e",function(){return R}),U.d(se,"f",function(){return S});var Z=U("KQm4"),z=U("U8pU"),N=U("Ff2n"),V=U("q1tI"),W=U.n(V),M=U("Kwbf"),K=U("WaYH"),H=.25,n=2;function D(T,I){var O=T.slice(),_=O.indexOf(I);return _>=0&&O.splice(_,1),O}function y(T,I){var O=T.slice();return O.indexOf(I)===-1&&O.push(I),O}function m(T){return T.split("-")}function f(T,I){return"".concat(T,"-").concat(I)}function c(T){return T&&T.type&&T.type.isTreeNode}function l(T,I){var O=[T],_=I[T];function b(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];p.forEach(function(h){var A=h.key,E=h.children;O.push(A),b(E)})}return b(_.children),O}function d(T,I){var O=T.clientY,_=I.selectHandle.getBoundingClientRect(),b=_.top,p=_.bottom,h=_.height,A=Math.max(h*H,n);return O<=b+A?-1:O>=p-A?1:0}function o(T,I){if(!T)return;var O=I.multiple;return O?T.slice():T.length?[T[0]]:T}var u=function(I){return I};function a(T,I){if(!T)return[];var O=I||{},_=O.processProps,b=_===void 0?u:_,p=Array.isArray(T)?T:[T];return p.map(function(h){var A=h.children,E=Object(N.a)(h,["children"]),v=a(A,I);return W.a.createElement(K.a,Object.assign({},b(E)),v)})}function i(T){if(!T)return null;var I;if(Array.isArray(T))I={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(z.a)(T)==="object")I={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return I}function R(T,I){var O=new Set;function _(b){if(O.has(b))return;var p=I[b];if(!p)return;O.add(b);var h=p.parent,A=p.node;if(A.disabled)return;h&&_(h.key)}return(T||[]).forEach(function(b){_(b)}),Object(Z.a)(O)}function S(T){var I={};return Object.keys(T).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(I[O]=T[O])}),I}},Ohmc:function(Ye,se,U){Ye.exports=U.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Ye,se,U){"use strict";var Z=U("2qtc"),z=U("kLXV"),N=U("rAM+"),V=U("miYZ"),W=U("tsqr"),M=U("9og8"),K=U("tJVT"),H=U("jrin"),n=U("WmNS"),D=U.n(n),y=U("q1tI"),m=U.n(y),f=U("VrN/"),c=U.n(f),l=U("bdgK"),d=U("p77/"),o=U("Bd2K"),u=U("ELLl"),a=U("19Vz"),i=U("lZu9"),R=U("+NIl"),S=U("kSUc"),T=U("9Bee"),I=function(Te){var Ge=Te.value,ot=Ge===void 0?"":Ge,Tt=Te.className,Ot=Te.showTextOnly,wt=Te.showLines,vt=Te.style,qe=vt===void 0?{}:vt,Qe=Object(y.useMemo)(function(){return""},[ot]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:Qe}}))},O=U("0Owb"),_=U("dejd"),b=U("C+DQ"),p=U("1vsH"),h=U("m3rI"),A=[{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 Ge=Te.onActionCallback,ot=Te.title,Tt=Te.icon,Ot=Te.actionName,wt=Te.className,vt=wt===void 0?"":wt,qe=Te.children;function Qe(){Ge(Ot)}return m.a.createElement("a",{title:ot,className:vt,onClick:Qe},m.a.createElement("i",{className:"md-iconfont ".concat(Tt)}),qe)}var v=function(Te){var Ge=Te.watch,ot=Te.showNullButton,Tt=Te.onActionCallback,Ot=Te.fullScreen,wt=Te.insertTemp,vt=Te.hidetoolBar,qe=Te.uuid,Qe=Te.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(p.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(p.F)("_educoder_session"),"&key=").concat(qe,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var Ue=[].concat(A,[{title:"".concat(Ge?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ge?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!vt&&Ue.map(function(ue,me){return m.a.createElement("li",{key:me},ue.actionName?m.a.createElement(E,Object(O.a)({},ue,{onActionCallback:Tt})):m.a.createElement("span",{className:"v-line"}))}),ot?m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Tt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,wt&&m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(wt),onActionCallback:Tt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.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:Tt})))},P=U("M8RZ"),x=U("+L6B"),C=U("2/Rp"),j=U("y8nQ"),B=U("Vl3Y"),w=U("5NDa"),Y=U("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},oe=function(Te){var Ge=Te.callback,ot=Te.onCancel;function Tt(Ot){Ge(Ot)}return m.a.createElement(B.a,Object(O.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Tt}),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(Y.a,null)),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(Y.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(C.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},de=U("7ahc"),Fe=U("HmJG"),Ae=U("BjJ7"),Re=B.a.useForm,Me={width:280,marginRight:10},Be={labelCol:{span:5},wrapperCol:{span:19}},pe=function(Te){var Ge=Te.callback,ot=Te.onCancel,Tt=Re(),Ot=Object(K.a)(Tt,1),wt=Ot[0];function vt(Ue){Ge(Ue)}function qe(Ue,ue){if(Ue.status===-1){W.b.error(Ue.message);return}wt.setFieldsValue({src:"/api/attachments/".concat(Ue.id),type:ue.type})}function Qe(Ue){var ue=Ue.target.files[0];ne(ue,qe)}return m.a.createElement(B.a,Object(O.a)({form:wt},Be,{className:"upload-image-panel",onFinish:vt}),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(Y.a,{style:Me})),m.a.createElement(fe,{onFileChange:Qe}))),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(Y.a,{style:{width:264}})),m.a.createElement(B.a.Item,{style:{textAlign:"right"}},m.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(C.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))};function fe(Te){var Ge=Te.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ge}))}function ne(Te,Ge){if(!Te)throw new String("\u6CA1\u6709\u6587\u4EF6");var ot=new FormData;ot.append("editormd-image-file",Te),ot.append("file_param_name","editormd-image-file"),ot.append("byxhr","true");var Tt=new window.XMLHttpRequest;Tt.withCredentials=!0,Tt.addEventListener("load",function(Ot){Ge(JSON.parse(Ot.target.responseText),Te)},!1),Tt.addEventListener("error",function(Ot){console.error(Ot)},!1),Tt.open("POST","".concat(Ae.a,"/api/attachments.json")),Tt.send(ot)}var xe=U("giR+"),ce=U("fyUT"),Pe=U("7Kak"),He=U("9yH6"),ke=He.a.Group,Ve={margin:"0 8px"},et=function(Te){var Ge=Te.callback,ot=Te.onCancel;function Tt(Ot){Ge(Ot)}return m.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Tt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Ve},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Ve},"\u884C\u6570"),m.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(ce.a,null)),m.a.createElement("span",{style:Ve},"\u5217\u6570"),m.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(ce.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Ve},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(B.a.Item,{name:"align"},m.a.createElement(ke,null,m.a.createElement(He.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(He.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(He.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(He.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(C.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},le=U("ErOA"),_e=U("7Cbv"),Ce="link",De="upload-image",tt="code-block",ct="add-table",ft="------------",ut={default:ft,left:":".concat(ft),center:":".concat(ft,":"),right:"".concat(ft,":")},xt=U("9VGf"),bt,Ne;function Oe(){}var nt=0,lt=1e4,Ke="\u2581",Xe=`
|
|
**\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 Se(Te){return/^\d+$/.test(Te)?"".concat(Te,"px"):Te}var ge=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ee=ge?"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=(bt={},Object(H.a)(bt,Ee+"-B","bold"),Object(H.a)(bt,Ee+"-I","italic"),bt),he=(Ne={},Object(H.a)(Ne,Ce,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(Ne,tt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(Ne,De,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(Ne,ct,"\u6DFB\u52A0\u8868\u683C"),Ne),ve=se.a=function(Te){var Ge=Te.defaultValue,ot=Ge===void 0?"":Ge,Tt=Te.onChange,Ot=Te.width,wt=Ot===void 0?"100%":Ot,vt=Te.height,qe=vt===void 0?400:vt,Qe=Te.miniToolbar,Ue=Qe===void 0?!1:Qe,ue=Te.isFocus,me=ue===void 0?!1:ue,$e=Te.watch,je=Te.insertTemp,Je=Te.mode,mt=Je===void 0?"markdown":Je,We=Te.id,it=We===void 0?"markdown-editor-id":We,st=Te.showResizeBar,dt=st===void 0?!1:st,Et=Te.noStorage,jt=Et===void 0?!1:Et,en=Te.showNullButton,Yt=en===void 0?!1:en,Ct=Te.hidetoolBar,pn=Ct===void 0?!1:Ct,Rt=Te.fullScreen,zt=Rt===void 0?!1:Rt,Pt=Te.onBlur,qt=Te.onCMBeforeChange,yn=Te.onFullScreen,wn=Te.className,yt=wn===void 0?"":wn,Vt=Te.disablePaste,Mn=Vt===void 0?!1:Vt,Un=Te.placeholder,Pn=Un===void 0?"":Un,Vn=Te.values,Q=Vn===void 0?"":Vn,L=Object(y.useState)(null),k=Object(K.a)(L,2),G=k[0],te=k[1],J=Object(y.useState)(ot),Ie=Object(K.a)(J,2),at=Ie[0],St=Ie[1],Ft=Object(y.useState)($e),ye=Object(K.a)(Ft,2),Ut=ye[0],$t=ye[1],Sn=Object(y.useState)(zt),Hn=Object(K.a)(Sn,2),Kn=Hn[0],In=Hn[1],pr=Object(y.useState)(""),ur=Object(K.a)(pr,2),Bn=ur[0],cr=ur[1],Ar=Object(y.useState)(0),Cr=Object(K.a)(Ar,2),Yn=Cr[0],Wr=Cr[1],Pr=Object(y.useState)(qe),yr=Object(K.a)(Pr,2),Qr=yr[0],br=yr[1],dr=Object(y.useState)(!1),Nr=Object(K.a)(dr,2),Hr=Nr[0],Er=Nr[1],_n=Object(y.useRef)(Object(_e.a)()),sn=Object(y.useRef)(!1),Ln=Object(y.useRef)(),un=Object(y.useRef)(),Rn=Object(y.useRef)(),bn=Object(y.useRef)(),Or=Object(y.useRef)(),jn=function(){var Gt=Object(M.a)(D.a.mark(function tn(){var Xt,on;return D.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return An.next=2,Object(le.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:_n.current}});case 2:on=An.sent,on!=null&&(Xt=on.attachments)!==null&&Xt!==void 0&&Xt.length&&(console.log("cm:",G,un),on.attachments.map(function(hn){hn.content_type.indexOf("image")>-1?G.replaceSelection(".concat(hn.content_type,")")):hn.content_type.indexOf("video")>-1?G.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):hn.content_type.indexOf("pdf")>-1?G.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,'&disposition=inline" target="_blank">').concat(hn.name,"</a>")):G.replaceSelection("[".concat(hn.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,")"))}));case 4:case"end":return An.stop()}},tn)}));return function(){return Gt.apply(this,arguments)}}();Object(y.useEffect)(function(){St(Q),G==null||G.setValue(Q)},[Q]),Object(y.useEffect)(function(){yn==null||yn(Kn)},[Kn]),Object(y.useEffect)(function(){if(un.current){var Gt=c.a.fromTextArea(un.current,{mode:mt,lineNumbers:!Ue,lineWrapping:!0,value:ot,autoCloseTags:!0,autoCloseBrackets:!0});me&&Gt.focus();function tn(Xt,on){if(Mn){on.preventDefault();return}var dn=on.clipboardData;if(dn){var An=dn.types.toString(),hn=dn.items;if(An==="Files"||dn.types.indexOf("Files")>-1){if(on.preventDefault(),mt=="stex")return;try{var kn,qn=hn[1];((kn=hn[0])===null||kn===void 0?void 0:kn.kind)==="file"&&(qn=hn[0]);var ln=qn.getAsFile(),rn=ln.name.split(".").pop();ne(ln,function(mn){if(mn.id){var Qn,Gn,an;(ln==null||((Qn=ln.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Gt.replaceSelection(".concat(mn.content_type,")")):(ln==null||((Gn=ln.type)===null||Gn===void 0)?void 0:Gn.indexOf("video"))>-1?Gt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(ln==null||((an=ln.type)===null||an===void 0)?void 0:an.indexOf("pdf"))>-1?Gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(ln.type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):ie.includes(rn)?Gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(ln.name,"</a>")):Gt.replaceSelection("[".concat(ln.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(mn.content_type,")"))}else(mn==null?void 0:mn.status)===401&&(document.location.href="/user/login")})}catch(mn){W.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Gt.on("paste",tn),Gt.on("dragleave",function(Xt,on){Rn.current.classList.remove("mouse-hover-md")}),Gt.on("dragover",function(Xt,on){Rn.current.classList.add("mouse-hover-md")}),Gt.on("drop",function(Xt,on){Rn.current.classList.add("mouse-hover-md");var dn;if(dn=on.dataTransfer.files,dn.length>0){on.preventDefault(),on.stopPropagation();for(var An=function(qn){var ln=dn[qn],rn=ln.name.split(".").pop();ne(ln,function(mn){if(mn.id){var Qn,Gn,an;(ln==null||((Qn=ln.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Gt.replaceSelection(".concat(mn.content_type,")")):(ln==null||((Gn=ln.type)===null||Gn===void 0)?void 0:Gn.indexOf("video"))>-1?Gt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(ln==null||((an=ln.type)===null||an===void 0)?void 0:an.indexOf("pdf"))>-1?Gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(ln.type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):ie.includes(rn)?Gt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(ln.name,"</a>")):Gt.replaceSelection("[".concat(ln.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(mn.content_type,")"))}else(mn==null?void 0:mn.status)===401&&(document.location.href="/user/login")})},hn=0;hn<dn.length;hn++)An(hn)}}),te(Gt),function(){Gt.off("paste",tn)}}},[]);var Xn=Object(y.useCallback)(function(){if(Rn.current)try{}catch(Gt){console.log(Gt,"---- to set md editor body height")}},[Qr,Rn,Kn]);Object(y.useEffect)(function(){function Gt(){var Xt=new l.default(function(on){var dn=Object(N.a)(on),An;try{for(dn.s();!(An=dn.n()).done;){var hn=An.value;(hn.target.offsetHeight>0||hn.target.offsetWidth>0)&&(Xn(),G.setSize("100%","100%"),G.refresh())}}catch(kn){dn.e(kn)}finally{dn.f()}});return Xt.observe(un.current.parentElement),Xt}if(G){var tn=Gt();return function(){tn.unobserve(un.current.parentElement)}}},[G,Xn]),Object(y.useEffect)(function(){if(G){for(var Gt=[],tn=function(){var hn=on[Xt];dn=Object(K.a)(hn,2);var kn=dn[0],qn=dn[1],ln=Object(H.a)({},kn,function(){Kr(qn)});Gt.push(ln),G.addKeyMap(ln)},Xt=0,on=Object.entries(ae);Xt<on.length;Xt++){var dn;tn()}return Ln.current=setInterval(function(){sn.current&&jn()},4e3),function(){clearInterval(Ln.current);var An=Object(N.a)(Gt),hn;try{for(An.s();!(hn=An.n()).done;){var kn=hn.value;G.removeKeyMap(kn)}}catch(qn){An.e(qn)}finally{An.f()}}}},[G]),Object(y.useEffect)(function(){zt!==Kn&&In(zt)},[zt]),Object(xt.a)(function(){if(!jt&&Yn>0){var Gt=new Date().getTime(),tn=window.sessionStorage.getItem(it);Gt>=Yn+lt&&(!tn||tn!==at)&&(window.sessionStorage.setItem(it,at),Er(!0))}},lt),Object(y.useEffect)(function(){$t($e)},[G,$e]),Object(y.useEffect)(function(){G&&(me&&G.focus())},[G,me]),Object(y.useEffect)(function(){if(Ut&&G){var Gt=G.getScrollerElement();function tn(Xt){var on=Xt.target;if(Or.current){var dn=on.scrollTop/on.scrollHeight;Or.current.scrollTop=Or.current.scrollHeight*dn}}return Gt.addEventListener("scroll",tn),function(){Gt.removeEventListener("scroll",tn)}}},[G,Ut]),Object(y.useEffect)(function(){if(G&&qt){function Gt(tn,Xt){qt(tn,Xt)}return G.on("beforeChange",Gt),function(){G.off("beforeChange",Gt)}}},[G,qt]),Object(y.useEffect)(function(){if(G&&Pt){function Gt(){Pt(G.getValue())}return G.on("blur",Gt),function(){G.off("blur",Gt)}}},[G,Pt]),Object(y.useEffect)(function(){if(G){function Gt(tn){var Xt=tn.getValue();St(Xt),Wr(new Date().getTime()),tn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Tt&&Tt(Xt)}return G.on("change",Gt),function(){G.off("change",Gt)}}},[G,Tt]),Object(y.useEffect)(function(){G&&(ot==null?(G.setValue(""),St("")):ot!==G.getValue()&&(G.setValue(ot),St(ot),G.setCursor(G.lineCount(),0)))},[G,ot]);var Kr=Object(y.useCallback)(function(Gt){var tn=G.getCursor(),Xt=G.getSelection(),on=Xt.split(`
|
|
`);switch(Gt){case"bold":return G.replaceSelection("**"+Xt+"**"),Xt===""&&G.setCursor(tn.line,tn.ch+2),G.focus();case"italic":return G.replaceSelection("*"+Xt+"*"),Xt===""&&G.setCursor(tn.line,tn.ch+1),G.focus();case"code":return G.replaceSelection("`"+Xt+"`"),Xt===""&&G.setCursor(tn.line,tn.ch+1),G.focus();case"inline-latex":return G.replaceSelection("`$$"+Xt+"$$`"),Xt===""&&G.setCursor(tn.line,tn.ch+3),G.focus();case"latex":return G.replaceSelection("```latex\n"+Xt+"\n```"),G.setCursor(tn.line+1,Xt.length+1),G.focus();case"line-break":return G.replaceSelection(`<br/>
|
|
`),G.focus();case"list-ul":return Xt===""?G.replaceSelection("- "+Xt):G.replaceSelection(on.map(function(dn){return dn===""?"":"- ".concat(dn)}).join(`
|
|
`)),G.focus();case"list-ol":return Xt===""?G.replaceSelection("1. "+Xt):G.replaceSelection(on.map(function(dn,An){return dn===""?"":"".concat(An+1,". ").concat(dn)}).join(`
|
|
`)),G.focus();case"add-null-ch":return Xt===""&&G.setCursor(tn.line,tn.ch+1),G.replaceSelection(Ke),G.focus();case"inster-template-1":return Xt===""&&G.setCursor(tn.line,tn.ch),G.replaceSelection(Xe),G.focus();case"eraser":return G.setValue(""),G.focus();case"trigger-watch":return $t(!Ut),G.focus();case"trigger-full-screen":return In(!Kn),G.focus();case Ce:cr(Ce);return;case tt:cr(tt);return;case De:cr(De);return;case ct:cr(ct);return;default:throw new Error}},[G,Ut,Kn]),Rr=Object(y.useCallback)(function(Gt){cr("");switch(Bn){case Ce:var tn=Gt.title,Xt=Gt.link;return G.replaceSelection("[".concat(tn,"](").concat(Xt,")")),G.focus();case tt:var on=Gt.language,dn=Gt.content;return G.replaceSelection(["```"+on,dn,"```"].join(`
|
|
`)),G.focus();case De:var An=Gt.src,hn=Gt.alt;return hn?G.replaceSelection(".concat(An,' "').concat(hn,'" )')):G.replaceSelection("")),G.focus();case ct:for(var kn=Gt.row,qn=Gt.col,ln=Gt.align,rn=`
|
|
`,mn=0;mn<kn;mn++){for(var Qn=[],Gn=[],an=0;an<qn;an++)mn===1&&Gn.push(ut[ln]),Qn.push(" ");mn===1&&(rn+="| ".concat(Gn.join(" | "),` |
|
|
`)),rn+="| ".concat(Qn.join(qn===1?"":" | "),` |
|
|
`)}return G.replaceSelection(rn+`
|
|
`),G.focus();default:throw new Error}},[G,Bn]),Gr=Object(y.useMemo)(function(){switch(Bn){case Ce:return m.a.createElement(oe,{callback:Rr,onCancel:Ir});case tt:return m.a.createElement(de.b,{callback:Rr,onCancel:Ir});case De:return m.a.createElement(pe,{callback:Rr,onCancel:Ir});case ct:return m.a.createElement(et,{callback:Rr,onCancel:Ir});default:return null}},[Bn]);function Ir(){cr("")}Object(y.useEffect)(function(){if(bn.current){var Gt=bn.current,tn=!1,Xt=0;function on(hn){tn=!0,Xt=hn.pageY}function dn(){tn=!1}function An(hn){if(tn){var kn=hn.pageY-Xt;kn<0&&(kn=0),kn>300&&(kn=300);var qn=qe+kn+"px";br(qn)}}return Gt.addEventListener("mousedown",on),document.addEventListener("mousemove",An),document.addEventListener("mouseup",dn),function(){Gt.removeEventListener("mousedown",on),document.removeEventListener("mousemove",An),document.removeEventListener("mouseup",dn)}}},[G,bn]),Object(y.useEffect)(function(){br(qe)},[qe]);var Dr=Se(wt),jr=Se(Qr),_r={width:Dr,height:jr},zr=Object(y.useMemo)(function(){if(Yn){var Gt=new Date(Yn),tn=Gt.getHours(),Xt=Gt.getMinutes(),on=Gt.getSeconds();return tn=tn<10?"0"+tn:tn,Xt=Xt<10?"0"+Xt:Xt,on=on<10?"0"+on:on,"".concat(tn,":").concat(Xt,":").concat(on)}return 0},[Yn]);function Jr(){window.sessionStorage.removeItem(it),Er(!1),Wr(0)}function sr(){Er(!1),Wr(0),G.setValue(window.sessionStorage.getItem(it))}function ri(Gt,tn){var Xt=G.getValue();Xt=Xt.replace(Gt,tn),St(Xt),G==null||G.setValue(Xt)}return m.a.createElement(y.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Rn},m.a.createElement("div",{className:"markdown-editor-container ".concat(yt," ").concat(Ut?"on-preview":""," ").concat(Ue?"mini":""," ").concat(Kn?"full-screen":""),style:_r},m.a.createElement(v,{insertTemp:je,watch:Ut,fullScreen:Kn,showNullButton:Yt,onActionCallback:Kr,hidetoolBar:pn,uuid:_n.current,setOpenPhones:function(){sn.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:un,placeholder:Pn})),Ut?m.a.createElement("div",{ref:Or,className:"preview-container"},mt==="stex"&&m.a.createElement(I,{value:at}),mt!=="stex"&&m.a.createElement(T.a,{edit:!0,value:at,replaces:ri})):null))),dt?m.a.createElement("a",{ref:bn,className:"editor-resize"}):null,m.a.createElement(P.a,null,he[Bn]?m.a.createElement(z.a,{centered:!0,title:he[Bn],visible:!0,onCancel:Ir,footer:null,className:"markdown-popup-form"},Gr):null))}},RMFE:function(Ye,se){Ye.exports="data:image/png;base64,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"},"SA+Z":function(Ye,se,U){var Z=U("wTVA"),z=U("EbDI"),N=U("ZhPi"),V=U("wkBT");function W(M){return Z(M)||z(M)||N(M)||V()}Ye.exports=W,Ye.exports.__esModule=!0,Ye.exports.default=Ye.exports},SJMd:function(Ye,se){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var U,Z,z,N=!1,V,W;window.PR_SHOULD_USE_CONTINUATION=!0;var M,K;(function(){var H=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"],y=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[y,"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"],f=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[y,"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"],l="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=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="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",u=[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"],a=[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"],i=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,c,f,d,o,u,a,i],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",I="kwd",O="com",_="typ",b="lit",p="pun",h="pln",A="tag",E="dec",v="src",P="atn",x="atv",C="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(ke){for(var Ve=0,et=!1,le=!1,_e=0,Ce=ke.length;_e<Ce;++_e){var De=ke[_e];if(De.ignoreCase)le=!0;else if(/[a-z]/i.test(De.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){et=!0,le=!1;break}}var tt={b:8,t:9,n:10,v:11,f:12,r:13};function ct(Ne){var Oe=Ne.charCodeAt(0);if(Oe!==92)return Oe;var nt=Ne.charAt(1);return Oe=tt[nt],Oe||("0"<=nt&&nt<="7"?parseInt(Ne.substring(1),8):nt==="u"||nt==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function ft(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var Oe=String.fromCharCode(Ne);return Oe==="\\"||Oe==="-"||Oe==="]"||Oe==="^"?"\\"+Oe:Oe}function ut(Ne){var Oe=Ne.substring(1,Ne.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")),nt=[],lt=Oe[0]==="^",Ke=["["];lt&&Ke.push("^");for(var Xe=lt?1:0,Se=Oe.length;Xe<Se;++Xe){var ge=Oe[Xe];if(/\\[bdsw]/i.test(ge))Ke.push(ge);else{var Ee=ct(ge),ie;Xe+2<Se&&Oe[Xe+1]==="-"?(ie=ct(Oe[Xe+2]),Xe+=2):ie=Ee,nt.push([Ee,ie]),ie<65||Ee>122||(ie<65||Ee>90||nt.push([Math.max(65,Ee)|32,Math.min(ie,90)|32]),ie<97||Ee>122||nt.push([Math.max(97,Ee)&~32,Math.min(ie,122)&~32]))}}nt.sort(function(Te,Ge){return Te[0]-Ge[0]||Ge[1]-Te[1]});for(var ae=[],he=[],Xe=0;Xe<nt.length;++Xe){var ve=nt[Xe];ve[0]<=he[1]+1?he[1]=Math.max(he[1],ve[1]):ae.push(he=ve)}for(var Xe=0;Xe<ae.length;++Xe){var ve=ae[Xe];Ke.push(ft(ve[0])),ve[1]>ve[0]&&(ve[1]+1>ve[0]&&Ke.push("-"),Ke.push(ft(ve[1])))}return Ke.push("]"),Ke.join("")}function xt(Ne){for(var Oe=Ne.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")),nt=Oe.length,lt=[],Ke=0,Xe=0;Ke<nt;++Ke){var Se=Oe[Ke];if(Se==="(")++Xe;else if(Se.charAt(0)==="\\"){var ge=+Se.substring(1);ge&&(ge<=Xe?lt[ge]=-1:Oe[Ke]=ft(ge))}}for(var Ke=1;Ke<lt.length;++Ke)lt[Ke]===-1&&(lt[Ke]=++Ve);for(var Ke=0,Xe=0;Ke<nt;++Ke){var Se=Oe[Ke];if(Se==="(")++Xe,lt[Xe]||(Oe[Ke]="(?:");else if(Se.charAt(0)==="\\"){var ge=+Se.substring(1);ge&&ge<=Xe&&(Oe[Ke]="\\"+lt[ge])}}for(var Ke=0;Ke<nt;++Ke)Oe[Ke]==="^"&&Oe[Ke+1]!=="^"&&(Oe[Ke]="");if(Ne.ignoreCase&&et)for(var Ke=0;Ke<nt;++Ke){var Se=Oe[Ke],Ee=Se.charAt(0);Se.length>=2&&Ee==="["?Oe[Ke]=ut(Se):Ee!=="\\"&&(Oe[Ke]=Se.replace(/[a-zA-Z]/g,function(he){var ve=he.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Oe.join("")}for(var bt=[],_e=0,Ce=ke.length;_e<Ce;++_e){var De=ke[_e];if(De.global||De.multiline)throw new Error(""+De);bt.push("(?:"+xt(De)+")")}return new RegExp(bt.join("|"),le?"gi":"g")}function w(ke,Ve){var et=/(?:^|\s)nocode(?:\s|$)/,le=[],_e=0,Ce=[],De=0;function tt(ct){var ft=ct.nodeType;if(ft==1){if(et.test(ct.className))return;for(var ut=ct.firstChild;ut;ut=ut.nextSibling)tt(ut);var xt=ct.nodeName.toLowerCase();(xt==="br"||xt==="li")&&(le[De]=`
|
|
`,Ce[De<<1]=_e++,Ce[De++<<1|1]=ct)}else if(ft==3||ft==4){var bt=ct.nodeValue;bt.length&&(Ve?bt=bt.replace(/\r\n?/g,`
|
|
`):bt=bt.replace(/[ \t\r\n]+/g," "),le[De]=bt,Ce[De<<1]=_e,_e+=bt.length,Ce[De++<<1|1]=ct)}}return tt(ke),{sourceCode:le.join("").replace(/\n$/,""),spans:Ce}}function Y(ke,Ve,et,le,_e){if(!et)return;var Ce={sourceNode:ke,pre:1,langExtension:null,numberLines:null,sourceCode:et,spans:null,basePos:Ve,decorations:null};le(Ce),_e.push.apply(_e,Ce.decorations)}var $=/\S/;function oe(ke){for(var Ve=void 0,et=ke.firstChild;et;et=et.nextSibling){var le=et.nodeType;Ve=le===1?Ve?ke:et:le===3&&$.test(et.nodeValue)?ke:Ve}return Ve===ke?void 0:Ve}function de(ke,Ve){var et={},le;(function(){for(var De=ke.concat(Ve),tt=[],ct={},ft=0,ut=De.length;ft<ut;++ft){var xt=De[ft],bt=xt[3];if(bt)for(var Ne=bt.length;--Ne>=0;)et[bt.charAt(Ne)]=xt;var Oe=xt[1],nt=""+Oe;ct.hasOwnProperty(nt)||(tt.push(Oe),ct[nt]=null)}tt.push(/[\0-\uffff]/),le=B(tt)})();var _e=Ve.length,Ce=function(De){for(var tt=De.sourceCode,ct=De.basePos,ft=De.sourceNode,ut=[ct,h],xt=0,bt=tt.match(le)||[],Ne={},Oe=0,nt=bt.length;Oe<nt;++Oe){var lt=bt[Oe],Ke=Ne[lt],Xe=void 0,Se;if(typeof Ke=="string")Se=!1;else{var ge=et[lt.charAt(0)];if(ge)Xe=lt.match(ge[1]),Ke=ge[0];else{for(var Ee=0;Ee<_e;++Ee)if(ge=Ve[Ee],Xe=lt.match(ge[1]),Xe){Ke=ge[0];break}Xe||(Ke=h)}Se=Ke.length>=5&&Ke.substring(0,5)==="lang-",Se&&!(Xe&&typeof Xe[1]=="string")&&(Se=!1,Ke=v),Se||(Ne[lt]=Ke)}var ie=xt;if(xt+=lt.length,!Se)ut.push(ct+ie,Ke);else{var ae=Xe[1],he=lt.indexOf(ae),ve=he+ae.length;Xe[2]&&(ve=lt.length-Xe[2].length,he=ve-ae.length);var Te=Ke.substring(5);Y(ft,ct+ie,lt.substring(0,he),Ce,ut),Y(ft,ct+ie+he,ae,fe(Te,ae),ut),Y(ft,ct+ie+ve,lt.substring(ve),Ce,ut)}}De.decorations=ut};return Ce}function Fe(ke){var Ve=[],et=[];ke.tripleQuotedStrings?Ve.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ke.multiLineStrings?Ve.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ve.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ke.verbatimStrings&&et.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var le=ke.hashComments;le&&(ke.cStyleComments?(le>1?Ve.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ve.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),et.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ve.push([O,/^#[^\r\n]*/,null,"#"])),ke.cStyleComments&&(et.push([O,/^\/\/[^\r\n]*/,null]),et.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=ke.regexLiterals;if(_e){var Ce=_e>1?"":`
|
|
\r`,De=Ce?".":"[\\S\\s]",tt="/(?=[^/*"+Ce+"])(?:[^/\\x5B\\x5C"+Ce+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+Ce+"]|\\x5C"+De+")*(?:\\x5D|$))+/";et.push(["lang-regex",RegExp("^"+j+"("+tt+")")])}var ct=ke.types;ct&&et.push([_,ct]);var ft=(""+ke.keywords).replace(/^ | $/g,"");ft.length&&et.push([I,new RegExp("^(?:"+ft.replace(/[\s,]+/g,"|")+")\\b"),null]),Ve.push([h,/^\s+/,null,` \r
|
|
\xA0`]);var ut="^.[^\\s\\w.$@'\"`/\\\\]*";return ke.regexLiterals&&(ut+="(?!s*/)"),et.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[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"],[h,/^\\[\s\S]?/,null],[p,new RegExp(ut),null]),de(Ve,et)}var Ae=Fe({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(ke,Ve,et){for(var le=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Ce=ke.ownerDocument,De=Ce.createElement("li");ke.firstChild;)De.appendChild(ke.firstChild);var tt=[De];function ct(Oe){var nt=Oe.nodeType;if(nt==1&&!le.test(Oe.className))if(Oe.nodeName==="br")ft(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var lt=Oe.firstChild;lt;lt=lt.nextSibling)ct(lt);else if((nt==3||nt==4)&&et){var Ke=Oe.nodeValue,Xe=Ke.match(_e);if(Xe){var Se=Ke.substring(0,Xe.index);Oe.nodeValue=Se;var ge=Ke.substring(Xe.index+Xe[0].length);if(ge){var Ee=Oe.parentNode;Ee.insertBefore(Ce.createTextNode(ge),Oe.nextSibling)}ft(Oe),Se||Oe.parentNode.removeChild(Oe)}}}function ft(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function nt(Xe,Se){var ge=Se?Xe.cloneNode(!1):Xe,Ee=Xe.parentNode;if(Ee){var ie=nt(Ee,1),ae=Xe.nextSibling;ie.appendChild(ge);for(var he=ae;he;he=ae)ae=he.nextSibling,ie.appendChild(he)}return ge}for(var lt=nt(Oe.nextSibling,0),Ke;(Ke=lt.parentNode)&&Ke.nodeType===1;)lt=Ke;tt.push(lt)}for(var ut=0;ut<tt.length;++ut)ct(tt[ut]);Ve===(Ve|0)&&tt[0].setAttribute("value",Ve);var xt=Ce.createElement("ol");xt.className="linenums";for(var bt=Math.max(0,Ve-1|0)||0,ut=0,Ne=tt.length;ut<Ne;++ut)De=tt[ut],De.className="L"+(ut+bt)%10,De.firstChild||De.appendChild(Ce.createTextNode("\xA0")),xt.appendChild(De);ke.appendChild(xt)}function Me(ke){var Ve=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ve=Ve&&+Ve[1]<=8;var et=/\n/g,le=ke.sourceCode,_e=le.length,Ce=0,De=ke.spans,tt=De.length,ct=0,ft=ke.decorations,ut=ft.length,xt=0;ft[ut]=_e;var bt,Ne;for(Ne=bt=0;Ne<ut;)ft[Ne]!==ft[Ne+2]?(ft[bt++]=ft[Ne++],ft[bt++]=ft[Ne++]):Ne+=2;for(ut=bt,Ne=bt=0;Ne<ut;){for(var Oe=ft[Ne],nt=ft[Ne+1],lt=Ne+2;lt+2<=ut&&ft[lt+1]===nt;)lt+=2;ft[bt++]=Oe,ft[bt++]=nt,Ne=lt}ut=ft.length=bt;var Ke=ke.sourceNode,Xe="";Ke&&(Xe=Ke.style.display,Ke.style.display="none");try{for(var Se=null;ct<tt;){var ge=De[ct],Ee=De[ct+2]||_e,ie=ft[xt+2]||_e,lt=Math.min(Ee,ie),ae=De[ct+1],he;if(ae.nodeType!==1&&(he=le.substring(Ce,lt))){Ve&&(he=he.replace(et,"\r")),ae.nodeValue=he;var ve=ae.ownerDocument,Te=ve.createElement("span");Te.className=ft[xt+1];var Ge=ae.parentNode;Ge.replaceChild(Te,ae),Te.appendChild(ae),Ce<Ee&&(De[ct+1]=ae=ve.createTextNode(le.substring(lt,Ee)),Ge.insertBefore(ae,Te.nextSibling))}Ce=lt,Ce>=Ee&&(ct+=2),Ce>=ie&&(xt+=2)}}finally{Ke&&(Ke.style.display=Xe)}}var Be={};function pe(ke,Ve){for(var et=Ve.length;--et>=0;){var le=Ve[et];Be.hasOwnProperty(le)?H.console&&console.warn("cannot override language handler %s",le):Be[le]=ke}}function fe(ke,Ve){return ke&&Be.hasOwnProperty(ke)||(ke=/^\s*</.test(Ve)?"default-markup":"default-code"),Be[ke]}pe(Ae,["default-code"]),pe(de([],[[h,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[p,/^(?:<[%?]|[%?]>)/],["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"]),pe(de([[h,/^[\s]+/,null,` \r
|
|
`],[x,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[A,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[p,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),pe(de([],[[x,/^[\s\S]+/]]),["uq.val"]),pe(Fe({keywords:m,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),pe(Fe({keywords:"null,true,false"}),["json"]),pe(Fe({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),pe(Fe({keywords:f,cStyleComments:!0}),["java"]),pe(Fe({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Fe({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Fe({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Fe({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Fe({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Fe({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(de([],[[T,/^[\s\S]+/]]),["regex"]);function ne(ke){var Ve=ke.langExtension;try{var et=w(ke.sourceNode,ke.pre),le=et.sourceCode;ke.sourceCode=le,ke.spans=et.spans,ke.basePos=0,fe(Ve,le)(ke),Me(ke)}catch(_e){H.console&&console.log(_e&&_e.stack||_e)}}function xe(ke,Ve,et){var le=et||!1,_e=Ve||null,Ce=document.createElement("div");Ce.innerHTML="<pre>"+ke+"</pre>",Ce=Ce.firstChild,le&&Re(Ce,le,!0);var De={langExtension:_e,numberLines:le,sourceNode:Ce,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(De),Ce.innerHTML}function ce(ke,Ve){var et=Ve||document.body,le=et.ownerDocument||document;function _e(ge){return et.getElementsByTagName(ge)}for(var Ce=[_e("pre"),_e("code"),_e("xmp")],De=[],tt=0;tt<Ce.length;++tt)for(var ct=0,ft=Ce[tt].length;ct<ft;++ct)De.push(Ce[tt][ct]);Ce=null;var ut=Date;ut.now||(ut={now:function(){return+new Date}});var xt=0,bt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,Oe=/\bprettyprinted\b/,nt=/pre|xmp/i,lt=/^code$/i,Ke=/^(?:pre|code|xmp)$/i,Xe={};function Se(){for(var ge=H.PR_SHOULD_USE_CONTINUATION?ut.now()+250:Infinity;xt<De.length&&ut.now()<ge;xt++){for(var Ee=De[xt],ie=Xe,ae=Ee;ae=ae.previousSibling;){var he=ae.nodeType,ve=(he===7||he===8)&&ae.nodeValue;if(ve?!/^\??prettify\b/.test(ve):he!==3||/\S/.test(ae.nodeValue))break;if(ve){ie={},ve.replace(/\b(\w+)=([\w:.%+-]+)/g,function($e,je,Je){ie[je]=Je});break}}var Te=Ee.className;if((ie!==Xe||Ne.test(Te))&&!Oe.test(Te)){for(var Ge=!1,ot=Ee.parentNode;ot;ot=ot.parentNode){var Tt=ot.tagName;if(Ke.test(Tt)&&ot.className&&Ne.test(ot.className)){Ge=!0;break}}if(!Ge){Ee.className+=" prettyprinted";var Ot=ie.lang;if(!Ot){Ot=Te.match(bt);var wt;!Ot&&(wt=oe(Ee))&<.test(wt.tagName)&&(Ot=wt.className.match(bt)),Ot&&(Ot=Ot[1])}var vt;if(nt.test(Ee.tagName))vt=1;else{var qe=Ee.currentStyle,Qe=le.defaultView,Ue=qe?qe.whiteSpace:Qe&&Qe.getComputedStyle?Qe.getComputedStyle(Ee,null).getPropertyValue("white-space"):0;vt=Ue&&Ue.substring(0,3)==="pre"}var ue=ie.linenums;(ue=ue==="true"||+ue)||(ue=Te.match(/\blinenums\b(?::(\d+))?/),ue=ue?ue[1]&&ue[1].length?+ue[1]:!0:!1),ue&&Re(Ee,ue,vt);var me={langExtension:Ot,sourceNode:Ee,numberLines:ue,pre:vt,sourceCode:null,basePos:null,spans:null,decorations:null};ne(me)}}}xt<De.length?H.setTimeout(Se,250):typeof ke=="function"&&ke()}Se()}var Pe=H.PR={createSimpleLexer:de,registerLangHandler:pe,sourceDecorator:Fe,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:x,PR_COMMENT:O,PR_DECLARATION:E,PR_KEYWORD:I,PR_LITERAL:b,PR_NOCODE:C,PR_PLAIN:h,PR_PUNCTUATION:p,PR_SOURCE:v,PR_STRING:T,PR_TAG:A,PR_TYPE:_,prettyPrintOne:N?H.prettyPrintOne=xe:M=xe,prettyPrint:K=N?H.prettyPrint=ce:K=ce},He=H.define;typeof He=="function"&&He.amd&&He("google-code-prettify",[],function(){return Pe})})()},SMhR:function(Ye,se){Ye.exports="data:image/png;base64,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"},T8No:function(Ye,se,U){"use strict";U.d(se,"a",function(){return K}),U.d(se,"e",function(){return H}),U.d(se,"c",function(){return p}),U.d(se,"b",function(){return h}),U.d(se,"d",function(){return A}),U.d(se,"f",function(){return P});var Z=U("MNsG"),z=U("N0LK"),N=U("Cg/j");let V=Z.k||"";const W=new Map;W.set("false",!1),W.set("true",!0),W.set("isMac",Z.f),W.set("isLinux",Z.d),W.set("isWindows",Z.i),W.set("isWeb",Z.h),W.set("isMacNative",Z.f&&!Z.h),W.set("isEdge",V.indexOf("Edg/")>=0),W.set("isFirefox",V.indexOf("Firefox")>=0),W.set("isChrome",V.indexOf("Chrome")>=0),W.set("isSafari",V.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class K{static has(C){return m.create(C)}static equals(C,j){return f.create(C,j)}static regex(C,j){return T.create(C,j)}static not(C){return o.create(C)}static and(...C){return _.create(C,null)}static or(...C){return b.create(C,null,!0)}static deserialize(C,j=!1){return C?this._deserializeOrExpression(C,j):void 0}static _deserializeOrExpression(C,j){let B=C.split("||");return b.create(B.map(w=>this._deserializeAndExpression(w,j)),null,!0)}static _deserializeAndExpression(C,j){let B=C.split("&&");return _.create(B.map(w=>this._deserializeOne(w,j)),null)}static _deserializeOne(C,j){if(C=C.trim(),C.indexOf("!=")>=0){let B=C.split("!=");return d.create(B[0].trim(),this._deserializeValue(B[1],j))}if(C.indexOf("==")>=0){let B=C.split("==");return f.create(B[0].trim(),this._deserializeValue(B[1],j))}if(C.indexOf("=~")>=0){let B=C.split("=~");return T.create(B[0].trim(),this._deserializeRegexValue(B[1],j))}if(C.indexOf(" in ")>=0){let B=C.split(" in ");return c.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(C)){const B=C.split(">=");return i.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(C)){const B=C.split(">");return a.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(C)){const B=C.split("<=");return S.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(C)){const B=C.split("<");return R.create(B[0].trim(),B[1].trim())}return/^\!\s*/.test(C)?o.create(C.substr(1).trim()):m.create(C)}static _deserializeValue(C,j){if(C=C.trim(),C==="true")return!0;if(C==="false")return!1;let B=/^'([^']*)'$/.exec(C);return B?B[1].trim():C}static _deserializeRegexValue(C,j){if(Object(z.C)(C)){if(j)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let B=C.indexOf("/"),w=C.lastIndexOf("/");if(B===w||B<0){if(j)throw new Error(`bad regexp-value '${C}', missing /-enclosure`);return console.warn(`bad regexp-value '${C}', missing /-enclosure`),null}let Y=C.slice(B+1,w),$=C[w+1]==="i"?"i":"";try{return new RegExp(Y,$)}catch(oe){if(j)throw new Error(`bad regexp-value '${C}', parse error: ${oe}`);return console.warn(`bad regexp-value '${C}', parse error: ${oe}`),null}}}function H(C,j){const B=C?C.substituteConstants():void 0,w=j?j.substituteConstants():void 0;return!B&&!w?!0:!B||!w?!1:B.equals(w)}function n(C,j){return C.cmp(j)}class D{constructor(){this.type=0}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!1}serialize(){return"false"}keys(){return[]}negate(){return y.INSTANCE}}D.INSTANCE=new D;class y{constructor(){this.type=1}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}y.INSTANCE=new y;class m{constructor(C,j){this.key=C,this.negated=j,this.type=2}static create(C,j=null){const B=W.get(C);return typeof B=="boolean"?B?y.INSTANCE:D.INSTANCE:new m(C,j)}cmp(C){return C.type!==this.type?this.type-C.type:E(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=W.get(this.key);return typeof C=="boolean"?C?y.INSTANCE:D.INSTANCE:this}evaluate(C){return!!C.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this)),this.negated}}class f{constructor(C,j,B){this.key=C,this.value=j,this.negated=B,this.type=4}static create(C,j,B=null){if(typeof j=="boolean")return j?m.create(C,B):o.create(C,B);const w=W.get(C);if(typeof w=="boolean"){const Y=w?"true":"false";return j===Y?y.INSTANCE:D.INSTANCE}return new f(C,j,B)}cmp(C){return C.type!==this.type?this.type-C.type:v(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=W.get(this.key);if(typeof C=="boolean"){const j=C?"true":"false";return this.value===j?y.INSTANCE:D.INSTANCE}return this}evaluate(C){return C.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(C,j){this.key=C,this.valueKey=j,this.type=10,this.negated=null}static create(C,j){return new c(C,j)}cmp(C){return C.type!==this.type?this.type-C.type:v(this.key,this.valueKey,C.key,C.valueKey)}equals(C){return C.type===this.type?this.key===C.key&&this.valueKey===C.valueKey:!1}substituteConstants(){return this}evaluate(C){const j=C.getValue(this.valueKey),B=C.getValue(this.key);return Array.isArray(j)?j.indexOf(B)>=0:typeof B=="string"&&typeof j=="object"&&j!==null?M.call(j,B):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=l.create(this)),this.negated}}class l{constructor(C){this._actual=C,this.type=11}static create(C){return new l(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(C,j,B){this.key=C,this.value=j,this.negated=B,this.type=5}static create(C,j,B=null){if(typeof j=="boolean")return j?o.create(C,B):m.create(C,B);const w=W.get(C);if(typeof w=="boolean"){const Y=w?"true":"false";return j===Y?D.INSTANCE:y.INSTANCE}return new d(C,j,B)}cmp(C){return C.type!==this.type?this.type-C.type:v(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=W.get(this.key);if(typeof C=="boolean"){const j=C?"true":"false";return this.value===j?D.INSTANCE:y.INSTANCE}return this}evaluate(C){return C.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class o{constructor(C,j){this.key=C,this.negated=j,this.type=3}static create(C,j=null){const B=W.get(C);return typeof B=="boolean"?B?D.INSTANCE:y.INSTANCE:new o(C,j)}cmp(C){return C.type!==this.type?this.type-C.type:E(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=W.get(this.key);return typeof C=="boolean"?C?D.INSTANCE:y.INSTANCE:this}evaluate(C){return!C.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function u(C,j){if(typeof C=="string"){const B=parseFloat(C);isNaN(B)||(C=B)}return typeof C=="string"||typeof C=="number"?j(C):D.INSTANCE}class a{constructor(C,j,B){this.key=C,this.value=j,this.negated=B,this.type=12}static create(C,j,B=null){return u(j,w=>new a(C,w,B))}cmp(C){return C.type!==this.type?this.type-C.type:v(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.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 i{constructor(C,j,B){this.key=C,this.value=j,this.negated=B,this.type=13}static create(C,j,B=null){return u(j,w=>new i(C,w,B))}cmp(C){return C.type!==this.type?this.type-C.type:v(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.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 R{constructor(C,j,B){this.key=C,this.value=j,this.negated=B,this.type=14}static create(C,j,B=null){return u(j,w=>new R(C,w,B))}cmp(C){return C.type!==this.type?this.type-C.type:v(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class S{constructor(C,j,B){this.key=C,this.value=j,this.negated=B,this.type=15}static create(C,j,B=null){return u(j,w=>new S(C,w,B))}cmp(C){return C.type!==this.type?this.type-C.type:v(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class T{constructor(C,j){this.key=C,this.regexp=j,this.type=7,this.negated=null}static create(C,j){return new T(C,j)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.key<C.key)return-1;if(this.key>C.key)return 1;const j=this.regexp?this.regexp.source:"",B=C.regexp?C.regexp.source:"";return j<B?-1:j>B?1:0}equals(C){if(C.type===this.type){const j=this.regexp?this.regexp.source:"",B=C.regexp?C.regexp.source:"";return this.key===C.key&&j===B}return!1}substituteConstants(){return this}evaluate(C){let j=C.getValue(this.key);return this.regexp?this.regexp.test(j):!1}serialize(){const C=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${C}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this)),this.negated}}class I{constructor(C){this._actual=C,this.type=8}static create(C){return new I(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(C){let j=null;for(let B=0,w=C.length;B<w;B++){const Y=C[B].substituteConstants();if(C[B]!==Y&&j===null){j=[];for(let $=0;$<B;$++)j[$]=C[$]}j!==null&&(j[B]=Y)}return j===null?C:j}class _{constructor(C,j){this.expr=C,this.negated=j,this.type=6}static create(C,j){return _._normalizeArr(C,j)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let j=0,B=this.expr.length;j<B;j++){const w=n(this.expr[j],C.expr[j]);if(w!==0)return w}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let j=0,B=this.expr.length;j<B;j++)if(!this.expr[j].equals(C.expr[j]))return!1;return!0}return!1}substituteConstants(){const C=O(this.expr);return C===this.expr?this:_.create(C,this.negated)}evaluate(C){for(let j=0,B=this.expr.length;j<B;j++)if(!this.expr[j].evaluate(C))return!1;return!0}static _normalizeArr(C,j){const B=[];let w=!1;for(const Y of C){if(!Y)continue;if(Y.type===1){w=!0;continue}if(Y.type===0)return D.INSTANCE;if(Y.type===6){B.push(...Y.expr);continue}B.push(Y)}if(B.length===0&&w)return y.INSTANCE;if(B.length===0)return;if(B.length===1)return B[0];B.sort(n);for(let Y=1;Y<B.length;Y++)B[Y-1].equals(B[Y])&&(B.splice(Y,1),Y--);if(B.length===1)return B[0];for(;B.length>1;){const Y=B[B.length-1];if(Y.type!==9)break;B.pop();const $=B.pop(),oe=B.length===0,de=b.create(Y.expr.map(Fe=>_.create([Fe,$],null)),null,oe);de&&(B.push(de),B.sort(n))}return B.length===1?B[0]:new _(B,j)}serialize(){return this.expr.map(C=>C.serialize()).join(" && ")}keys(){const C=[];for(let j of this.expr)C.push(...j.keys());return C}negate(){if(!this.negated){const C=[];for(let j of this.expr)C.push(j.negate());this.negated=b.create(C,this,!0)}return this.negated}}class b{constructor(C,j){this.expr=C,this.negated=j,this.type=9}static create(C,j,B){return b._normalizeArr(C,j,B)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let j=0,B=this.expr.length;j<B;j++){const w=n(this.expr[j],C.expr[j]);if(w!==0)return w}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let j=0,B=this.expr.length;j<B;j++)if(!this.expr[j].equals(C.expr[j]))return!1;return!0}return!1}substituteConstants(){const C=O(this.expr);return C===this.expr?this:b.create(C,this.negated,!1)}evaluate(C){for(let j=0,B=this.expr.length;j<B;j++)if(this.expr[j].evaluate(C))return!0;return!1}static _normalizeArr(C,j,B){let w=[],Y=!1;if(C){for(let $=0,oe=C.length;$<oe;$++){const de=C[$];if(!de)continue;if(de.type===0){Y=!0;continue}if(de.type===1)return y.INSTANCE;if(de.type===9){w=w.concat(de.expr);continue}w.push(de)}if(w.length===0&&Y)return D.INSTANCE;w.sort(n)}if(w.length===0)return;if(w.length===1)return w[0];for(let $=1;$<w.length;$++)w[$-1].equals(w[$])&&(w.splice($,1),$--);if(w.length===1)return w[0];if(B){for(let $=0;$<w.length;$++)for(let oe=$+1;oe<w.length;oe++)P(w[$],w[oe])&&(w.splice(oe,1),oe--);if(w.length===1)return w[0]}return new b(w,j)}serialize(){return this.expr.map(C=>C.serialize()).join(" || ")}keys(){const C=[];for(let j of this.expr)C.push(...j.keys());return C}negate(){if(!this.negated){let C=[];for(let j of this.expr)C.push(j.negate());for(;C.length>1;){const j=C.shift(),B=C.shift(),w=[];for(const $ of x(j))for(const oe of x(B))w.push(_.create([$,oe],null));const Y=C.length===0;C.unshift(b.create(w,null,Y))}this.negated=C[0]}return this.negated}}class p extends m{constructor(C,j,B){super(C,null);this._defaultValue=j,typeof B=="object"?p._info.push(Object.assign(Object.assign({},B),{key:C})):B!==!0&&p._info.push({key:C,description:B,type:j!=null?typeof j:void 0})}static all(){return p._info.values()}bindTo(C){return C.createKey(this.key,this._defaultValue)}getValue(C){return C.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(C){return f.create(this.key,C)}}p._info=[];const h=Object(N.c)("contextKeyService"),A="setContext";function E(C,j){return C<j?-1:C>j?1:0}function v(C,j,B,w){return C<B?-1:C>B?1:j<w?-1:j>w?1:0}function P(C,j){if(j.type===6&&C.type!==9&&C.type!==6){for(const Y of j.expr)if(C.equals(Y))return!0}const B=C.negate(),w=x(B).concat(x(j));w.sort(n);for(let Y=0;Y<w.length;Y++){const $=w[Y],oe=$.negate();for(let de=Y+1;de<w.length;de++){const Fe=w[de];if(oe.equals(Fe))return!0}}return!1}function x(C){return C.type===9?C.expr:[C]}},TGq3:function(Ye,se,U){Ye.exports=U.p+"static/lockclose.365036e8.svg"},TXwP:function(Ye,se,U){var Z,z;(function(){var N;(function(){"use strict";var W=[,,function(n){function D(f){this.__parent=f,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 f=new D(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},D.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},D.prototype.has_match=function(f){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(f))return!0;return!1},D.prototype.set_indent=function(f,c){this.is_empty()&&(this.__indent_count=f||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 f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__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(f){this.__items.push(f);var c=f.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=f.length-c:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},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 f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function y(f,c){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),c=c||"",f.indent_level>0&&(c=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(f,c){var l=this.__base_string_length;return c=c||0,f<0&&(l=0),l+=f*this.__indent_size,l+=c,l},y.prototype.get_indent_string=function(f,c){var l=this.__base_string;return c=c||0,f<0&&(f=0,l=""),c+=f*this.__indent_size,this.__ensure_cache(c),l+=this.__cache[c],l},y.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var f=this.__cache.length,c=0,l="";this.__indent_size&&f>=this.__indent_size&&(c=Math.floor(f/this.__indent_size),f-=c*this.__indent_size,l=new Array(c+1).join(this.__indent_string)),f&&(l+=new Array(f+1).join(" ")),this.__cache.push(l)};function m(f,c){this.__indent_cache=new y(f,c),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.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()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(f,c){return this.__indent_cache.get_indent_string(f,c)},m.prototype.get_indent_size=function(f,c){return this.__indent_cache.get_indent_size(f,c)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(f){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 l=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(l=l.replace(/[\n]/g,f)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(f,c){return f=f||0,c=c||0,this.next_line.set_indent(f,c),this.__lines.length>1?(this.current_line.set_indent(f,c),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(f){for(var c=0;c<f.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(f){for(var c=this.__lines.length;f<c;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(f,c){for(var l=this.__lines.length-2;l>=0;){var d=this.__lines[l];if(d.is_empty())break;if(d.item(0).indexOf(f)!==0&&d.item(-1)!==c){this.__lines.splice(l+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},n.exports.Output=m},,,,function(n){function D(f,c){this.raw_options=y(f,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(f,c){var l=this.raw_options[f],d=c||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(d=l.concat()):typeof l=="string"&&(d=l.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(f,c){var l=this.raw_options[f],d=l===void 0?!!c:!!l;return d},D.prototype._get_characters=function(f,c){var l=this.raw_options[f],d=c||"";return typeof l=="string"&&(d=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(f,c){var l=this.raw_options[f];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(l,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(f,c,l){var d=this._get_selection_list(f,c,l);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[f]+"'");return d[0]},D.prototype._get_selection_list=function(f,c,l){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[c[0]],!this._is_valid_selection(l,c))throw new Error("Invalid Default Value!");var d=this._get_array(f,l);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[f]+"'");return d},D.prototype._is_valid_selection=function(f,c){return f.length&&c.length&&!f.some(function(l){return c.indexOf(l)===-1})};function y(f,c){var l={};f=m(f);var d;for(d in f)d!==c&&(l[d]=f[d]);if(c&&f[c])for(d in f[c])l[d]=f[c][d];return l}function m(f){var c={},l;for(l in f){var d=l.replace(/-/g,"_");c[d]=f[l]}return c}n.exports.Options=D,n.exports.normalizeOpts=m,n.exports.mergeOpts=y},,function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var f=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(f=this.__input.charAt(m)),f},y.prototype.__match=function(m,f){m.lastIndex=f;var c=m.exec(this.__input);return c&&!(D&&m.sticky)&&(c.index!==f&&(c=null)),c},y.prototype.test=function(m,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(m,f):!1},y.prototype.testChar=function(m,f){var c=this.peek(f);return m.lastIndex=0,c!==null&&m.test(c)},y.prototype.match=function(m){var f=this.__match(m,this.__position);return f?this.__position+=f[0].length:f=null,f},y.prototype.read=function(m,f,c){var l="",d;return m&&(d=this.match(m),d&&(l+=d[0])),f&&(d||!m)&&(l+=this.readUntil(f,c)),l},y.prototype.readUntil=function(m,f){var c="",l=this.__position;m.lastIndex=this.__position;var d=m.exec(this.__input);return d?(l=d.index,f&&(l+=d[0].length)):l=this.__input_length,c=this.__input.substring(this.__position,l),this.__position=l,c},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,f){var c=null,l="g";return f&&D&&(l="y"),typeof m=="string"&&m!==""?c=new RegExp(m,l):m&&(c=new RegExp(m.source,l)),c},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var f=this.__position,c=this.readUntilAfter(m);return this.__position=f,c},y.prototype.lookBack=function(m){var f=this.__position-1;return f>=m.length&&this.__input.substring(f-m.length,f).toLowerCase()===m},n.exports.InputScanner=y},,,,,function(n){function D(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}D.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(y);f;)m[f[1]]=f[2],f=this.__directive_pattern.exec(y);return m},D.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},,function(n,D,y){var m=y(16).Beautifier,f=y(17).Options;function c(l,d){var o=new m(l,d);return o.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new f}},function(n,D,y){var m=y(17).Options,f=y(2).Output,c=y(8).InputScanner,l=y(13).Directives,d=new l(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,a=/\s/,i=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(I,O){this._source_text=I||"",this._options=new m(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"]}T.prototype.eatString=function(I){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(I.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},T.prototype.eatWhitespace=function(I){for(var O=a.test(this._input.peek()),_=0;a.test(this._input.peek());)this._ch=this._input.next(),I&&this._ch===`
|
|
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return O},T.prototype.foundNestedPseudoClass=function(){for(var I=0,O=1,_=this._input.peek(O);_;){if(_==="{")return!0;if(_==="(")I+=1;else if(_===")"){if(I===0)return!1;I-=1}else if(_===";"||_==="}")return!1;O++,_=this._input.peek(O)}return!1},T.prototype.print_string=function(I){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(I)},T.prototype.preserveSingleSpace=function(I){I&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var I=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
`,I&&o.test(I||"")&&(O=I.match(o)[0])),I=I.replace(u,`
|
|
`);var _=I.match(/^[\t ]*/)[0];this._output=new f(this._options,_),this._input=new c(I),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,p=!1,h=!1,A=!1,E=!1,v=!1,P=!1,x=this._ch,C=!1,j,B,w;j=this._input.read(i),B=j!=="",w=x,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),x=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(R),$=d.get_directives(Y);$&&$.ignore==="start"&&(Y+=d.readIgnored(this._input)),this.print_string(Y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);oe.match(/[ :]$/)&&(oe=this.eatString(": ").replace(/\s$/,""),this.print_string(oe),this._output.space_before_token=!0),oe=oe.replace(/\s$/,""),oe==="extend"?E=!0:oe==="import"&&(v=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(A=!0)):!p&&b===0&&oe.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),A?(A=!1,p=this._indentLevel>=this._nestedLevel):p=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&p&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(w==="("?this._output.space_before_token=!1:w!==","&&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(),w==="{"&&this._output.trim(!0),v=!1,E=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),p=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var de=0;de<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;de++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[de])){C=!0;break}(p||A)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&b===0?(this.print_string(":"),h||(h=!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 Fe=w==='"'||w==="'";this.preserveSingleSpace(Fe||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")C=!1,b===0?(h&&(this.outdent(),h=!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 Ae=!1;this._input.lookBack("with")&&(Ae=!0),this.preserveSingleSpace(B||Ae),this.print_string(this._ch),h&&w==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||P)&&b===0&&!v&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&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&&a.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),a.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 Re=w==='"'||w==="'";this.preserveSingleSpace(Re||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&C&&this._output.add_new_line()}var Me=this._output.get_code(O);return Me},n.exports.Beautifier=T},function(n,D,y){var m=y(6).Options;function f(c){m.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 l=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||l;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<d.length;o++)d[o]!=="expand"?this.brace_style="collapse":this.brace_style=d[o]}f.prototype=new m,n.exports.Options=f}],M={};function K(n){var D=M[n];if(D!==void 0)return D.exports;var y=M[n]={exports:{}};return W[n](y,y.exports,K),y.exports}var H=K(15);N=H})();var V=N;!(Z=[],z=function(){return{css_beautify:V}}.apply(se,Z),z!==void 0&&(Ye.exports=z))})()},Vhoy:function(Ye,se,U){"use strict";U.d(se,"d",function(){return V}),U.d(se,"e",function(){return W}),U.d(se,"c",function(){return M}),U.d(se,"b",function(){return K}),U.d(se,"a",function(){return H});var Z=U("MI8n");class z{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 N=new z,V=N;function W(n,D){return new K(n,D)}function M(n){return n?n.replace(/\$\((.*?)\)/g,(D,y)=>` ${y} `).trim():""}class K{constructor(n,D,y){this.id=n,this.definition=D,this.description=y,N.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var H;(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 y(c){if(c instanceof K)return["codicon","codicon-"+c.id];const l=D.exec(c.id);if(!l)return y(K.error);let[,d,o]=l;const u=["codicon","codicon-"+d];return o&&u.push("codicon-modifier-"+o.substr(1)),u}n.asClassNameArray=y;function m(c){return y(c).join(" ")}n.asClassName=m;function f(c){return"."+y(c).join(".")}n.asCSSSelector=f})(H||(H={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(Ye,se,U){(function(Z,z){Ye.exports=z()})(this,function(){"use strict";var Z=navigator.userAgent,z=navigator.platform,N=/gecko\/\d/i.test(Z),V=/MSIE \d/.test(Z),W=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),M=/Edge\/(\d+)/.exec(Z),K=V||W||M,H=K&&(V?document.documentMode||6:+(M||W)[1]),n=!M&&/WebKit\//.test(Z),D=n&&/Qt\/\d+\.\d+/.test(Z),y=!M&&/Chrome\//.test(Z),m=/Opera\//.test(Z),f=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),l=/PhantomJS/.test(Z),d=!M&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),o=/Android/.test(Z),u=d||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),a=d||/Mac/.test(z),i=/\bCrOS\b/.test(Z),R=/win/i.test(z),S=m&&Z.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(m=!1,n=!0);var T=a&&(D||m&&(S==null||S<12.11)),I=N||K&&H>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var s=e.className,r=O(t).exec(s);if(r){var g=s.slice(r.index+r[0].length);e.className=s.slice(0,r.index)+(g?r[1]+g:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function p(e,t){return b(e).appendChild(t)}function h(e,t,s,r){var g=document.createElement(e);if(s&&(g.className=s),r&&(g.style.cssText=r),typeof t=="string")g.appendChild(document.createTextNode(t));else if(t)for(var F=0;F<t.length;++F)g.appendChild(t[F]);return g}function A(e,t,s,r){var g=h(e,t,s,r);return g.setAttribute("role","presentation"),g}var E;document.createRange?E=function(e,t,s,r){var g=document.createRange();return g.setEnd(r||e,s),g.setStart(e,t),g}:E=function(e,t,s){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(g){return r}return r.collapse(!0),r.moveEnd("character",s),r.moveStart("character",t),r};function v(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function x(e,t){var s=e.className;O(t).test(s)||(e.className+=(s?" ":"")+t)}function C(e,t){for(var s=e.split(" "),r=0;r<s.length;r++)s[r]&&!O(s[r]).test(t)&&(t+=" "+s[r]);return t}var j=function(e){e.select()};d?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(j=function(e){try{e.select()}catch(t){}});function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function w(e,t,s){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(s!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Y(e,t,s,r,g){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var F=r||0,X=g||0;;){var q=e.indexOf(" ",F);if(q<0||q>=t)return X+(t-F);X+=q-F,X+=s-X%s,F=q+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var s=+new Date+e;(!this.id||s<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=s)};function oe(e,t){for(var s=0;s<e.length;++s)if(e[s]==t)return s;return-1}var de=50,Fe={toString:function(){return"CodeMirror.Pass"}},Ae={scroll:!1},Re={origin:"*mouse"},Me={origin:"+move"};function Be(e,t,s){for(var r=0,g=0;;){var F=e.indexOf(" ",r);F==-1&&(F=e.length);var X=F-r;if(F==e.length||g+X>=t)return r+Math.min(X,t-g);if(g+=F-r,g+=s-g%s,r=F+1,g>=t)return r}}var pe=[""];function fe(e){for(;pe.length<=e;)pe.push(ne(pe)+" ");return pe[e]}function ne(e){return e[e.length-1]}function xe(e,t){for(var s=[],r=0;r<e.length;r++)s[r]=t(e[r],r);return s}function ce(e,t,s){for(var r=0,g=s(t);r<e.length&&s(e[r])<=g;)r++;e.splice(r,0,t)}function Pe(){}function He(e,t){var s;return Object.create?s=Object.create(e):(Pe.prototype=e,s=new Pe),t&&w(t,s),s}var ke=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ve(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ke.test(e))}function et(e,t){return t?t.source.indexOf("\\w")>-1&&Ve(e)?!0:t.test(e):Ve(e)}function le(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var _e=/[\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 Ce(e){return e.charCodeAt(0)>=768&&_e.test(e)}function De(e,t,s){for(;(s<0?t>0:t<e.length)&&Ce(e.charAt(t));)t+=s;return t}function tt(e,t,s){for(var r=t>s?-1:1;;){if(t==s)return t;var g=(t+s)/2,F=r<0?Math.ceil(g):Math.floor(g);if(F==t)return e(F)?t:s;e(F)?s=F:t=F+r}}function ct(e,t,s,r){if(!e)return r(t,s,"ltr",0);for(var g=!1,F=0;F<e.length;++F){var X=e[F];(X.from<s&&X.to>t||t==s&&X.to==t)&&(r(Math.max(X.from,t),Math.min(X.to,s),X.level==1?"rtl":"ltr",F),g=!0)}g||r(t,s,"ltr")}var ft=null;function ut(e,t,s){var r;ft=null;for(var g=0;g<e.length;++g){var F=e[g];if(F.from<t&&F.to>t)return g;F.to==t&&(F.from!=F.to&&s=="before"?r=g:ft=g),F.from==t&&(F.from!=F.to&&s!="before"?r=g:ft=g)}return r!=null?r:ft}var xt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function s(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 r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,F=/[LRr]/,X=/[Lb1n]/,q=/[1n]/;function ee(re,we,Le){this.level=re,this.from=we,this.to=Le}return function(re,we){var Le=we=="ltr"?"L":"R";if(re.length==0||we=="ltr"&&!r.test(re))return!1;for(var Ze=re.length,ze=[],ht=0;ht<Ze;++ht)ze.push(s(re.charCodeAt(ht)));for(var _t=0,At=Le;_t<Ze;++_t){var Dt=ze[_t];Dt=="m"?ze[_t]=At:At=Dt}for(var Bt=0,Lt=Le;Bt<Ze;++Bt){var Ht=ze[Bt];Ht=="1"&&Lt=="r"?ze[Bt]="n":F.test(Ht)&&(Lt=Ht,Ht=="r"&&(ze[Bt]="R"))}for(var nn=1,Zt=ze[0];nn<Ze-1;++nn){var fn=ze[nn];fn=="+"&&Zt=="1"&&ze[nn+1]=="1"?ze[nn]="1":fn==","&&Zt==ze[nn+1]&&(Zt=="1"||Zt=="n")&&(ze[nn]=Zt),Zt=fn}for(var Dn=0;Dn<Ze;++Dn){var ir=ze[Dn];if(ir==",")ze[Dn]="N";else if(ir=="%"){var Fn=void 0;for(Fn=Dn+1;Fn<Ze&&ze[Fn]=="%";++Fn);for(var kr=Dn&&ze[Dn-1]=="!"||Fn<Ze&&ze[Fn]=="1"?"1":"N",Tr=Dn;Tr<Fn;++Tr)ze[Tr]=kr;Dn=Fn-1}}for(var Jn=0,wr=Le;Jn<Ze;++Jn){var lr=ze[Jn];wr=="L"&&lr=="1"?ze[Jn]="L":F.test(lr)&&(wr=lr)}for(var tr=0;tr<Ze;++tr)if(g.test(ze[tr])){var Zn=void 0;for(Zn=tr+1;Zn<Ze&&g.test(ze[Zn]);++Zn);for(var Wn=(tr?ze[tr-1]:Le)=="L",Sr=(Zn<Ze?ze[Zn]:Le)=="L",Hi=Wn==Sr?Wn?"L":"R":Le,vi=tr;vi<Zn;++vi)ze[vi]=Hi;tr=Zn-1}for(var fr=[],ni,ar=0;ar<Ze;)if(X.test(ze[ar])){var Os=ar;for(++ar;ar<Ze&&X.test(ze[ar]);++ar);fr.push(new ee(0,Os,ar))}else{var oi=ar,wi=fr.length,Si=we=="rtl"?1:0;for(++ar;ar<Ze&&ze[ar]!="L";++ar);for(var vr=oi;vr<ar;)if(q.test(ze[vr])){oi<vr&&(fr.splice(wi,0,new ee(1,oi,vr)),wi+=Si);var Ki=vr;for(++vr;vr<ar&&q.test(ze[vr]);++vr);fr.splice(wi,0,new ee(2,Ki,vr)),wi+=Si,oi=vr}else++vr;oi<ar&&fr.splice(wi,0,new ee(1,oi,ar))}return we=="ltr"&&(fr[0].level==1&&(ni=re.match(/^\s+/))&&(fr[0].from=ni[0].length,fr.unshift(new ee(0,0,ni[0].length))),ne(fr).level==1&&(ni=re.match(/\s+$/))&&(ne(fr).to-=ni[0].length,fr.push(new ee(0,Ze-ni[0].length,Ze)))),we=="rtl"?fr.reverse():fr}}();function bt(e,t){var s=e.order;return s==null&&(s=e.order=xt(e.text,t)),s}var Ne=[],Oe=function(e,t,s){if(e.addEventListener)e.addEventListener(t,s,!1);else if(e.attachEvent)e.attachEvent("on"+t,s);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ne).concat(s)}};function nt(e,t){return e._handlers&&e._handlers[t]||Ne}function lt(e,t,s){if(e.removeEventListener)e.removeEventListener(t,s,!1);else if(e.detachEvent)e.detachEvent("on"+t,s);else{var r=e._handlers,g=r&&r[t];if(g){var F=oe(g,s);F>-1&&(r[t]=g.slice(0,F).concat(g.slice(F+1)))}}}function Ke(e,t){var s=nt(e,t);if(!s.length)return;for(var r=Array.prototype.slice.call(arguments,2),g=0;g<s.length;++g)s[g].apply(null,r)}function Xe(e,t,s){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ke(e,s||t.type,e,t),he(t)||t.codemirrorIgnore}function Se(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var s=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(s,t[r])==-1&&s.push(t[r])}function ge(e,t){return nt(e,t).length>0}function Ee(e){e.prototype.on=function(t,s){Oe(this,t,s)},e.prototype.off=function(t,s){lt(this,t,s)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ve(e){ie(e),ae(e)}function Te(e){return e.target||e.srcElement}function Ge(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var ot=function(){if(K&&H<9)return!1;var e=h("div");return"draggable"in e||"dragDrop"in e}(),Tt;function Ot(e){if(Tt==null){var t=h("span","\u200B");p(e,h("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Tt=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&H<8))}var s=Tt?h("span","\u200B"):h("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return s.setAttribute("cm-text",""),s}var wt;function vt(e){if(wt!=null)return wt;var t=p(e,document.createTextNode("A\u062EA")),s=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return b(e),!s||s.left==s.right?!1:wt=r.right-s.right<3}var qe=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,s=[],r=e.length;t<=r;){var g=e.indexOf(`
|
|
`,t);g==-1&&(g=e.length);var F=e.slice(t,e.charAt(g-1)=="\r"?g-1:g),X=F.indexOf("\r");X!=-1?(s.push(F.slice(0,X)),t+=X+1):(s.push(F),t=g+1)}return s}:function(e){return e.split(/\r\n?|\n/)},Qe=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(s){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ue=function(){var e=h("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ue=null;function me(e){if(ue!=null)return ue;var t=p(e,h("span","x")),s=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return ue=Math.abs(s.left-r.left)>1}var $e={},je={};function Je(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$e[e]=t}function mt(e,t){je[e]=t}function We(e){if(typeof e=="string"&&je.hasOwnProperty(e))e=je[e];else if(e&&typeof e.name=="string"&&je.hasOwnProperty(e.name)){var t=je[e.name];typeof t=="string"&&(t={name:t}),e=He(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function it(e,t){t=We(t);var s=$e[t.name];if(!s)return it(e,"text/plain");var r=s(e,t);if(st.hasOwnProperty(t.name)){var g=st[t.name];for(var F in g){if(!g.hasOwnProperty(F))continue;r.hasOwnProperty(F)&&(r["_"+F]=r[F]),r[F]=g[F]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var X in t.modeProps)r[X]=t.modeProps[X];return r}var st={};function dt(e,t){var s=st.hasOwnProperty(e)?st[e]:st[e]={};w(t,s)}function Et(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var s={};for(var r in t){var g=t[r];g instanceof Array&&(g=g.concat([])),s[r]=g}return s}function jt(e,t){for(var s;e.innerMode&&!(s=e.innerMode(t),!s||s.mode==e);)t=s.state,e=s.mode;return s||{mode:e,state:t}}function en(e,t,s){return e.startState?e.startState(t,s):!0}var Yt=function(e,t,s){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=s};Yt.prototype.eol=function(){return this.pos>=this.string.length},Yt.prototype.sol=function(){return this.pos==this.lineStart},Yt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Yt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Yt.prototype.eat=function(e){var t=this.string.charAt(this.pos),s;if(typeof e=="string"?s=t==e:s=t&&(e.test?e.test(t):e(t)),s)return++this.pos,t},Yt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Yt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Yt.prototype.skipToEnd=function(){this.pos=this.string.length},Yt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Yt.prototype.backUp=function(e){this.pos-=e},Yt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Yt.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Yt.prototype.match=function(e,t,s){if(typeof e=="string"){var r=function(X){return s?X.toLowerCase():X},g=this.string.substr(this.pos,e.length);if(r(g)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var F=this.string.slice(this.pos).match(e);return F&&F.index>0?null:(F&&t!==!1&&(this.pos+=F[0].length),F)}},Yt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Yt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Yt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Yt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ct(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 s=e;!s.lines;)for(var r=0;;++r){var g=s.children[r],F=g.chunkSize();if(t<F){s=g;break}t-=F}return s.lines[t]}function pn(e,t,s){var r=[],g=t.line;return e.iter(t.line,s.line+1,function(F){var X=F.text;g==s.line&&(X=X.slice(0,s.ch)),g==t.line&&(X=X.slice(t.ch)),r.push(X),++g}),r}function Rt(e,t,s){var r=[];return e.iter(t,s,function(g){r.push(g.text)}),r}function zt(e,t){var s=t-e.height;if(s)for(var r=e;r;r=r.parent)r.height+=s}function Pt(e){if(e.parent==null)return null;for(var t=e.parent,s=oe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var g=0;!(r.children[g]==t);++g)s+=r.children[g].chunkSize();return s+t.first}function qt(e,t){var s=e.first;e:do{for(var r=0;r<e.children.length;++r){var g=e.children[r],F=g.height;if(t<F){e=g;continue e}t-=F,s+=g.chunkSize()}return s}while(!e.lines);for(var X=0;X<e.lines.length;++X){var q=e.lines[X],ee=q.height;if(t<ee)break;t-=ee}return s+X}function yn(e,t){return t>=e.first&&t<e.first+e.size}function wn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function yt(e,t,s){if(s===void 0&&(s=null),!(this instanceof yt))return new yt(e,t,s);this.line=e,this.ch=t,this.sticky=s}function Vt(e,t){return e.line-t.line||e.ch-t.ch}function Mn(e,t){return e.sticky==t.sticky&&Vt(e,t)==0}function Un(e){return yt(e.line,e.ch)}function Pn(e,t){return Vt(e,t)<0?t:e}function Vn(e,t){return Vt(e,t)<0?e:t}function Q(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function L(e,t){if(t.line<e.first)return yt(e.first,0);var s=e.first+e.size-1;return t.line>s?yt(s,Ct(e,s).text.length):k(t,Ct(e,t.line).text.length)}function k(e,t){var s=e.ch;return s==null||s>t?yt(e.line,t):s<0?yt(e.line,0):e}function G(e,t){for(var s=[],r=0;r<t.length;r++)s[r]=L(e,t[r]);return s}var te=function(e,t){this.state=e,this.lookAhead=t},J=function(e,t,s,r){this.state=t,this.doc=e,this.line=s,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};J.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},J.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},J.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},J.fromSaved=function(e,t,s){return t instanceof te?new J(e,Et(e.mode,t.state),s,t.lookAhead):new J(e,Et(e.mode,t),s)},J.prototype.save=function(e){var t=e!==!1?Et(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new te(t,this.maxLookAhead):t};function Ie(e,t,s,r){var g=[e.state.modeGen],F={};Kn(e,t.text,e.doc.mode,s,function(re,we){return g.push(re,we)},F,r);for(var X=s.state,q=function(re){s.baseTokens=g;var we=e.state.overlays[re],Le=1,Ze=0;s.state=!0,Kn(e,t.text,we.mode,s,function(ze,ht){for(var _t=Le;Ze<ze;){var At=g[Le];At>ze&&g.splice(Le,1,ze,g[Le+1],At),Le+=2,Ze=Math.min(ze,At)}if(!ht)return;if(we.opaque)g.splice(_t,Le-_t,ze,"overlay "+ht),Le=_t+2;else for(;_t<Le;_t+=2){var Dt=g[_t+1];g[_t+1]=(Dt?Dt+" ":"")+"overlay "+ht}},F),s.state=X,s.baseTokens=null,s.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)q(ee);return{styles:g,classes:F.bgClass||F.textClass?F:null}}function at(e,t,s){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=St(e,Pt(t)),g=t.text.length>e.options.maxHighlightLength&&Et(e.doc.mode,r.state),F=Ie(e,t,r);g&&(r.state=g),t.stateAfter=r.save(!g),t.styles=F.styles,F.classes?t.styleClasses=F.classes:t.styleClasses&&(t.styleClasses=null),s===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,s){var r=e.doc,g=e.display;if(!r.mode.startState)return new J(r,!0,t);var F=In(e,t,s),X=F>r.first&&Ct(r,F-1).stateAfter,q=X?J.fromSaved(r,X,F):new J(r,en(r.mode),F);return r.iter(F,t,function(ee){Ft(e,ee.text,q);var re=q.line;ee.stateAfter=re==t-1||re%5==0||re>=g.viewFrom&&re<g.viewTo?q.save():null,q.nextLine()}),s&&(r.modeFrontier=q.line),q}function Ft(e,t,s,r){var g=e.doc.mode,F=new Yt(t,e.options.tabSize,s);for(F.start=F.pos=r||0,t==""&&ye(g,s.state);!F.eol();)Ut(g,F,s.state),F.start=F.pos}function ye(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var s=jt(e,t);if(s.mode.blankLine)return s.mode.blankLine(s.state)}function Ut(e,t,s,r){for(var g=0;g<10;g++){r&&(r[0]=jt(e,s).mode);var F=e.token(t,s);if(t.pos>t.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var $t=function(e,t,s){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=s};function Sn(e,t,s,r){var g=e.doc,F=g.mode,X;t=L(g,t);var q=Ct(g,t.line),ee=St(e,t.line,s),re=new Yt(q.text,e.options.tabSize,ee),we;for(r&&(we=[]);(r||re.pos<t.ch)&&!re.eol();)re.start=re.pos,X=Ut(F,re,ee.state),r&&we.push(new $t(re,X,Et(g.mode,ee.state)));return r?we:new $t(re,X,ee.state)}function Hn(e,t){if(e)for(;;){var s=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!s)break;e=e.slice(0,s.index)+e.slice(s.index+s[0].length);var r=s[1]?"bgClass":"textClass";t[r]==null?t[r]=s[2]:new RegExp("(?:^|\\s)"+s[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+s[2])}return e}function Kn(e,t,s,r,g,F,X){var q=s.flattenSpans;q==null&&(q=e.options.flattenSpans);var ee=0,re=null,we=new Yt(t,e.options.tabSize,r),Le,Ze=e.options.addModeClass&&[null];for(t==""&&Hn(ye(s,r.state),F);!we.eol();){if(we.pos>e.options.maxHighlightLength?(q=!1,X&&Ft(e,t,r,we.pos),we.pos=t.length,Le=null):Le=Hn(Ut(s,we,r.state,Ze),F),Ze){var ze=Ze[0].name;ze&&(Le="m-"+(Le?ze+" "+Le:ze))}if(!q||re!=Le){for(;ee<we.start;)ee=Math.min(we.start,ee+5e3),g(ee,re);re=Le}we.start=we.pos}for(;ee<we.pos;){var ht=Math.min(we.pos,ee+5e3);g(ht,re),ee=ht}}function In(e,t,s){for(var r,g,F=e.doc,X=s?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>X;--q){if(q<=F.first)return F.first;var ee=Ct(F,q-1),re=ee.stateAfter;if(re&&(!s||q+(re instanceof te?re.lookAhead:0)<=F.modeFrontier))return q;var we=Y(ee.text,null,e.options.tabSize);(g==null||r>we)&&(g=q-1,r=we)}return g}function pr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var s=e.first,r=t-1;r>s;r--){var g=Ct(e,r).stateAfter;if(g&&(!(g instanceof te)||r+g.lookAhead<t)){s=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,s)}var ur=!1,Bn=!1;function cr(){ur=!0}function Ar(){Bn=!0}function Cr(e,t,s){this.marker=e,this.from=t,this.to=s}function Yn(e,t){if(e)for(var s=0;s<e.length;++s){var r=e[s];if(r.marker==t)return r}}function Wr(e,t){for(var s,r=0;r<e.length;++r)e[r]!=t&&(s||(s=[])).push(e[r]);return s}function Pr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function yr(e,t,s){var r;if(e)for(var g=0;g<e.length;++g){var F=e[g],X=F.marker,q=F.from==null||(X.inclusiveLeft?F.from<=t:F.from<t);if(q||F.from==t&&X.type=="bookmark"&&(!s||!F.marker.insertLeft)){var ee=F.to==null||(X.inclusiveRight?F.to>=t:F.to>t);(r||(r=[])).push(new Cr(X,F.from,ee?null:F.to))}}return r}function Qr(e,t,s){var r;if(e)for(var g=0;g<e.length;++g){var F=e[g],X=F.marker,q=F.to==null||(X.inclusiveRight?F.to>=t:F.to>t);if(q||F.from==t&&X.type=="bookmark"&&(!s||F.marker.insertLeft)){var ee=F.from==null||(X.inclusiveLeft?F.from<=t:F.from<t);(r||(r=[])).push(new Cr(X,ee?null:F.from-t,F.to==null?null:F.to-t))}}return r}function br(e,t){if(t.full)return null;var s=yn(e,t.from.line)&&Ct(e,t.from.line).markedSpans,r=yn(e,t.to.line)&&Ct(e,t.to.line).markedSpans;if(!s&&!r)return null;var g=t.from.ch,F=t.to.ch,X=Vt(t.from,t.to)==0,q=yr(s,g,X),ee=Qr(r,F,X),re=t.text.length==1,we=ne(t.text).length+(re?g:0);if(q)for(var Le=0;Le<q.length;++Le){var Ze=q[Le];if(Ze.to==null){var ze=Yn(ee,Ze.marker);ze?re&&(Ze.to=ze.to==null?null:ze.to+we):Ze.to=g}}if(ee)for(var ht=0;ht<ee.length;++ht){var _t=ee[ht];if(_t.to!=null&&(_t.to+=we),_t.from==null){var At=Yn(q,_t.marker);At||(_t.from=we,re&&(q||(q=[])).push(_t))}else _t.from+=we,re&&(q||(q=[])).push(_t)}q&&(q=dr(q)),ee&&ee!=q&&(ee=dr(ee));var Dt=[q];if(!re){var Bt=t.text.length-2,Lt;if(Bt>0&&q)for(var Ht=0;Ht<q.length;++Ht)q[Ht].to==null&&(Lt||(Lt=[])).push(new Cr(q[Ht].marker,null,null));for(var nn=0;nn<Bt;++nn)Dt.push(Lt);Dt.push(ee)}return Dt}function dr(e){for(var t=0;t<e.length;++t){var s=e[t];s.from!=null&&s.from==s.to&&s.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Nr(e,t,s){var r=null;if(e.iter(t.line,s.line+1,function(ze){if(ze.markedSpans)for(var ht=0;ht<ze.markedSpans.length;++ht){var _t=ze.markedSpans[ht].marker;_t.readOnly&&(!r||oe(r,_t)==-1)&&(r||(r=[])).push(_t)}}),!r)return null;for(var g=[{from:t,to:s}],F=0;F<r.length;++F)for(var X=r[F],q=X.find(0),ee=0;ee<g.length;++ee){var re=g[ee];if(Vt(re.to,q.from)<0||Vt(re.from,q.to)>0)continue;var we=[ee,1],Le=Vt(re.from,q.from),Ze=Vt(re.to,q.to);(Le<0||!X.inclusiveLeft&&!Le)&&we.push({from:re.from,to:q.from}),(Ze>0||!X.inclusiveRight&&!Ze)&&we.push({from:q.to,to:re.to}),g.splice.apply(g,we),ee+=we.length-3}return g}function Hr(e){var t=e.markedSpans;if(!t)return;for(var s=0;s<t.length;++s)t[s].marker.detachLine(e);e.markedSpans=null}function Er(e,t){if(!t)return;for(var s=0;s<t.length;++s)t[s].marker.attachLine(e);e.markedSpans=t}function _n(e){return e.inclusiveLeft?-1:0}function sn(e){return e.inclusiveRight?1:0}function Ln(e,t){var s=e.lines.length-t.lines.length;if(s!=0)return s;var r=e.find(),g=t.find(),F=Vt(r.from,g.from)||_n(e)-_n(t);if(F)return-F;var X=Vt(r.to,g.to)||sn(e)-sn(t);return X||t.id-e.id}function un(e,t){var s=Bn&&e.markedSpans,r;if(s)for(var g=void 0,F=0;F<s.length;++F)g=s[F],g.marker.collapsed&&(t?g.from:g.to)==null&&(!r||Ln(r,g.marker)<0)&&(r=g.marker);return r}function Rn(e){return un(e,!0)}function bn(e){return un(e,!1)}function Or(e,t){var s=Bn&&e.markedSpans,r;if(s)for(var g=0;g<s.length;++g){var F=s[g];F.marker.collapsed&&(F.from==null||F.from<t)&&(F.to==null||F.to>t)&&(!r||Ln(r,F.marker)<0)&&(r=F.marker)}return r}function jn(e,t,s,r,g){var F=Ct(e,t),X=Bn&&F.markedSpans;if(X)for(var q=0;q<X.length;++q){var ee=X[q];if(!ee.marker.collapsed)continue;var re=ee.marker.find(0),we=Vt(re.from,s)||_n(ee.marker)-_n(g),Le=Vt(re.to,r)||sn(ee.marker)-sn(g);if(we>=0&&Le<=0||we<=0&&Le>=0)continue;if(we<=0&&(ee.marker.inclusiveRight&&g.inclusiveLeft?Vt(re.to,s)>=0:Vt(re.to,s)>0)||we>=0&&(ee.marker.inclusiveRight&&g.inclusiveLeft?Vt(re.from,r)<=0:Vt(re.from,r)<0))return!0}}function Xn(e){for(var t;t=Rn(e);)e=t.find(-1,!0).line;return e}function Kr(e){for(var t;t=bn(e);)e=t.find(1,!0).line;return e}function Rr(e){for(var t,s;t=bn(e);)e=t.find(1,!0).line,(s||(s=[])).push(e);return s}function Gr(e,t){var s=Ct(e,t),r=Xn(s);return s==r?t:Pt(r)}function Ir(e,t){if(t>e.lastLine())return t;var s=Ct(e,t),r;if(!Dr(e,s))return t;for(;r=bn(s);)s=r.find(1,!0).line;return Pt(s)+1}function Dr(e,t){var s=Bn&&t.markedSpans;if(s)for(var r=void 0,g=0;g<s.length;++g){if(r=s[g],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&jr(e,t,r))return!0}}function jr(e,t,s){if(s.to==null){var r=s.marker.find(1,!0);return jr(e,r.line,Yn(r.line.markedSpans,s.marker))}if(s.marker.inclusiveRight&&s.to==t.text.length)return!0;for(var g=void 0,F=0;F<t.markedSpans.length;++F)if(g=t.markedSpans[F],g.marker.collapsed&&!g.marker.widgetNode&&g.from==s.to&&(g.to==null||g.to!=s.from)&&(g.marker.inclusiveLeft||s.marker.inclusiveRight)&&jr(e,t,g))return!0}function _r(e){e=Xn(e);for(var t=0,s=e.parent,r=0;r<s.lines.length;++r){var g=s.lines[r];if(g==e)break;t+=g.height}for(var F=s.parent;F;s=F,F=s.parent)for(var X=0;X<F.children.length;++X){var q=F.children[X];if(q==s)break;t+=q.height}return t}function zr(e){if(e.height==0)return 0;for(var t=e.text.length,s,r=e;s=Rn(r);){var g=s.find(0,!0);r=g.from.line,t+=g.from.ch-g.to.ch}for(r=e;s=bn(r);){var F=s.find(0,!0);t-=r.text.length-F.from.ch,r=F.to.line,t+=r.text.length-F.to.ch}return t}function Jr(e){var t=e.display,s=e.doc;t.maxLine=Ct(s,s.first),t.maxLineLength=zr(t.maxLine),t.maxLineChanged=!0,s.iter(function(r){var g=zr(r);g>t.maxLineLength&&(t.maxLineLength=g,t.maxLine=r)})}var sr=function(e,t,s){this.text=e,Er(this,t),this.height=s?s(this):1};sr.prototype.lineNo=function(){return Pt(this)},Ee(sr);function ri(e,t,s,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Hr(e),Er(e,s);var g=r?r(e):1;g!=e.height&&zt(e,g)}function Gt(e){e.parent=null,Hr(e)}var tn={},Xt={};function on(e,t){if(!e||/^\s*$/.test(e))return null;var s=t.addModeClass?Xt:tn;return s[e]||(s[e]=e.replace(/\S+/g,"cm-$&"))}function dn(e,t){var s=A("span",null,null,n?"padding-right: .1px":null),r={pre:A("pre",[s],"CodeMirror-line"),content:s,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var g=0;g<=(t.rest?t.rest.length:0);g++){var F=g?t.rest[g-1]:t.line,X=void 0;r.pos=0,r.addToken=hn,vt(e.display.measure)&&(X=bt(F,e.doc.direction))&&(r.addToken=qn(r.addToken,X)),r.map=[];var q=t!=e.display.externalMeasured&&Pt(F);rn(F,r,at(e,F,q)),F.styleClasses&&(F.styleClasses.bgClass&&(r.bgClass=C(F.styleClasses.bgClass,r.bgClass||"")),F.styleClasses.textClass&&(r.textClass=C(F.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Ot(e.display.measure))),g==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var ee=r.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ke(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=C(r.pre.className,r.textClass||"")),r}function An(e){var t=h("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function hn(e,t,s,r,g,F,X){if(!t)return;var q=e.splitSpaces?kn(t,e.trailingSpace):t,ee=e.cm.state.specialChars,re=!1,we;if(!ee.test(t))e.col+=t.length,we=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,we),K&&H<9&&(re=!0),e.pos+=t.length;else{we=document.createDocumentFragment();for(var Le=0;;){ee.lastIndex=Le;var Ze=ee.exec(t),ze=Ze?Ze.index-Le:t.length-Le;if(ze){var ht=document.createTextNode(q.slice(Le,Le+ze));K&&H<9?we.appendChild(h("span",[ht])):we.appendChild(ht),e.map.push(e.pos,e.pos+ze,ht),e.col+=ze,e.pos+=ze}if(!Ze)break;Le+=ze+1;var _t=void 0;if(Ze[0]==" "){var At=e.cm.options.tabSize,Dt=At-e.col%At;_t=we.appendChild(h("span",fe(Dt),"cm-tab")),_t.setAttribute("role","presentation"),_t.setAttribute("cm-text"," "),e.col+=Dt}else Ze[0]=="\r"||Ze[0]==`
|
|
`?(_t=we.appendChild(h("span",Ze[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_t.setAttribute("cm-text",Ze[0]),e.col+=1):(_t=e.cm.options.specialCharPlaceholder(Ze[0]),_t.setAttribute("cm-text",Ze[0]),K&&H<9?we.appendChild(h("span",[_t])):we.appendChild(_t),e.col+=1);e.map.push(e.pos,e.pos+1,_t),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,s||r||g||re||F||X){var Bt=s||"";r&&(Bt+=r),g&&(Bt+=g);var Lt=h("span",[we],Bt,F);if(X)for(var Ht in X)X.hasOwnProperty(Ht)&&Ht!="style"&&Ht!="class"&&Lt.setAttribute(Ht,X[Ht]);return e.content.appendChild(Lt)}e.content.appendChild(we)}function kn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var s=t,r="",g=0;g<e.length;g++){var F=e.charAt(g);F==" "&&s&&(g==e.length-1||e.charCodeAt(g+1)==32)&&(F="\xA0"),r+=F,s=F==" "}return r}function qn(e,t){return function(s,r,g,F,X,q,ee){g=g?g+" cm-force-border":"cm-force-border";for(var re=s.pos,we=re+r.length;;){for(var Le=void 0,Ze=0;Ze<t.length&&!(Le=t[Ze],Le.to>re&&Le.from<=re);Ze++);if(Le.to>=we)return e(s,r,g,F,X,q,ee);e(s,r.slice(0,Le.to-re),g,F,null,q,ee),F=null,r=r.slice(Le.to-re),re=Le.to}}}function ln(e,t,s,r){var g=!r&&s.widgetNode;g&&e.map.push(e.pos,e.pos+t,g),!r&&e.cm.display.input.needsContentAttribute&&(g||(g=e.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",s.id)),g&&(e.cm.display.input.setUneditable(g),e.content.appendChild(g)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,s){var r=e.markedSpans,g=e.text,F=0;if(!r){for(var X=1;X<s.length;X+=2)t.addToken(t,g.slice(F,F=s[X]),on(s[X+1],t.cm.options));return}for(var q=g.length,ee=0,re=1,we="",Le,Ze,ze=0,ht,_t,At,Dt,Bt;;){if(ze==ee){ht=_t=At=Ze="",Bt=null,Dt=null,ze=Infinity;for(var Lt=[],Ht=void 0,nn=0;nn<r.length;++nn){var Zt=r[nn],fn=Zt.marker;if(fn.type=="bookmark"&&Zt.from==ee&&fn.widgetNode)Lt.push(fn);else if(Zt.from<=ee&&(Zt.to==null||Zt.to>ee||fn.collapsed&&Zt.to==ee&&Zt.from==ee)){if(Zt.to!=null&&Zt.to!=ee&&ze>Zt.to&&(ze=Zt.to,_t=""),fn.className&&(ht+=" "+fn.className),fn.css&&(Ze=(Ze?Ze+";":"")+fn.css),fn.startStyle&&Zt.from==ee&&(At+=" "+fn.startStyle),fn.endStyle&&Zt.to==ze&&(Ht||(Ht=[])).push(fn.endStyle,Zt.to),fn.title&&((Bt||(Bt={})).title=fn.title),fn.attributes)for(var Dn in fn.attributes)(Bt||(Bt={}))[Dn]=fn.attributes[Dn];fn.collapsed&&(!Dt||Ln(Dt.marker,fn)<0)&&(Dt=Zt)}else Zt.from>ee&&ze>Zt.from&&(ze=Zt.from)}if(Ht)for(var ir=0;ir<Ht.length;ir+=2)Ht[ir+1]==ze&&(_t+=" "+Ht[ir]);if(!Dt||Dt.from==ee)for(var Fn=0;Fn<Lt.length;++Fn)ln(t,0,Lt[Fn]);if(Dt&&(Dt.from||0)==ee){if(ln(t,(Dt.to==null?q+1:Dt.to)-ee,Dt.marker,Dt.from==null),Dt.to==null)return;Dt.to==ee&&(Dt=!1)}}if(ee>=q)break;for(var kr=Math.min(q,ze);;){if(we){var Tr=ee+we.length;if(!Dt){var Jn=Tr>kr?we.slice(0,kr-ee):we;t.addToken(t,Jn,Le?Le+ht:ht,At,ee+Jn.length==ze?_t:"",Ze,Bt)}if(Tr>=kr){we=we.slice(kr-ee),ee=kr;break}ee=Tr,At=""}we=g.slice(F,F=s[re++]),Le=on(s[re++],t.cm.options)}}}function mn(e,t,s){this.line=t,this.rest=Rr(t),this.size=this.rest?Pt(ne(this.rest))-s+1:1,this.node=this.text=null,this.hidden=Dr(e,t)}function Qn(e,t,s){for(var r=[],g,F=t;F<s;F=g){var X=new mn(e.doc,Ct(e.doc,F),F);g=F+X.size,r.push(X)}return r}var Gn=null;function an(e){Gn?Gn.ops.push(e):e.ownsGroup=Gn={ops:[e],delayedCallbacks:[]}}function Zr(e){var t=e.delayedCallbacks,s=0;do{for(;s<t.length;s++)t[s].call(null);for(var r=0;r<e.ops.length;r++){var g=e.ops[r];if(g.cursorActivityHandlers)for(;g.cursorActivityCalled<g.cursorActivityHandlers.length;)g.cursorActivityHandlers[g.cursorActivityCalled++].call(null,g.cm)}}while(s<t.length)}function xn(e,t){var s=e.ownsGroup;if(!s)return;try{Zr(s)}finally{Gn=null,t(s)}}var gn=null;function En(e,t){var s=nt(e,t);if(!s.length)return;var r=Array.prototype.slice.call(arguments,2),g;Gn?g=Gn.delayedCallbacks:gn?g=gn:(g=gn=[],setTimeout($n,0));for(var F=function(q){g.push(function(){return s[q].apply(null,r)})},X=0;X<s.length;++X)F(X)}function $n(){var e=gn;gn=null;for(var t=0;t<e.length;++t)e[t]()}function qr(e,t,s,r){for(var g=0;g<t.changes.length;g++){var F=t.changes[g];F=="text"?Gi(e,t):F=="gutter"?zi(e,t,s,r):F=="class"?Ci(e,t):F=="widget"&&Vi(e,t,r)}t.changes=null}function Vr(e){return e.node==e.text&&(e.node=h("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&H<8&&(e.node.style.zIndex=2)),e.node}function $r(e,t){var s=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(s&&(s+=" CodeMirror-linebackground"),t.background)s?t.background.className=s:(t.background.parentNode.removeChild(t.background),t.background=null);else if(s){var r=Vr(t);t.background=r.insertBefore(h("div",null,s),r.firstChild),e.display.input.setUneditable(t.background)}}function Ai(e,t){var s=e.display.externalMeasured;return s&&s.line==t.line?(e.display.externalMeasured=null,t.measure=s.measure,s.built):dn(e,t)}function Gi(e,t){var s=t.text.className,r=Ai(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Ci(e,t)):s&&(t.text.className=s)}function Ci(e,t){$r(e,t),t.line.wrapClass?Vr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var s=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=s||""}function zi(e,t,s,r){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 g=Vr(t);t.gutterBackground=h("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),g.insertBefore(t.gutterBackground,t.text)}var F=t.line.gutterMarkers;if(e.options.lineNumbers||F){var X=Vr(t),q=t.gutter=h("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),X.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!F||!F["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(h("div",wn(e.options,s),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),F)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var re=e.display.gutterSpecs[ee].className,we=F.hasOwnProperty(re)&&F[re];we&&q.appendChild(h("div",[we],"CodeMirror-gutter-elt","left: "+r.gutterLeft[re]+"px; width: "+r.gutterWidth[re]+"px"))}}}function Vi(e,t,s){t.alignable&&(t.alignable=null);for(var r=O("CodeMirror-linewidget"),g=t.node.firstChild,F=void 0;g;g=F)F=g.nextSibling,r.test(g.className)&&t.node.removeChild(g);Yi(e,t,s)}function Ja(e,t,s,r){var g=Ai(e,t);return t.text=t.node=g.pre,g.bgClass&&(t.bgClass=g.bgClass),g.textClass&&(t.textClass=g.textClass),Ci(e,t),zi(e,t,s,r),Yi(e,t,r),t.node}function Yi(e,t,s){if(Xi(e,t.line,t,s,!0),t.rest)for(var r=0;r<t.rest.length;r++)Xi(e,t.rest[r],t,s,!1)}function Xi(e,t,s,r,g){if(!t.widgets)return;for(var F=Vr(s),X=0,q=t.widgets;X<q.length;++X){var ee=q[X],re=h("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||re.setAttribute("cm-ignore-events","true"),Za(ee,re,s,r),e.display.input.setUneditable(re),g&&ee.above?F.insertBefore(re,s.gutter||s.text):F.appendChild(re),En(ee,"redraw")}}function Za(e,t,s,r){if(e.noHScroll){(s.alignable||(s.alignable=[])).push(t);var g=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(g-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=g+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function li(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!v(document.body,e.node)){var s="position: relative;";e.coverGutter&&(s+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(s+="width: "+t.display.wrapper.clientWidth+"px;"),p(t.display.measure,h("div",[e.node],null,s))}return e.height=e.node.parentNode.offsetHeight}function ei(e,t){for(var s=Te(t);s!=e.wrapper;s=s.parentNode)if(!s||s.nodeType==1&&s.getAttribute("cm-ignore-events")=="true"||s.parentNode==e.sizer&&s!=e.mover)return!0}function Oi(e){return e.lineSpace.offsetTop}function ti(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=p(e.measure,h("pre","x","CodeMirror-line-like")),s=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(s.paddingLeft),right:parseInt(s.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function mr(e){return de-e.display.nativeBarWidth}function ii(e){return e.display.scroller.clientWidth-mr(e)-e.display.barWidth}function yi(e){return e.display.scroller.clientHeight-mr(e)-e.display.barHeight}function $a(e,t,s){var r=e.options.lineWrapping,g=r&&ii(e);if(!t.measure.heights||r&&t.measure.width!=g){var F=t.measure.heights=[];if(r){t.measure.width=g;for(var X=t.text.firstChild.getClientRects(),q=0;q<X.length-1;q++){var ee=X[q],re=X[q+1];Math.abs(ee.bottom-re.bottom)>2&&F.push((ee.bottom+re.top)/2-s.top)}}F.push(s.bottom-s.top)}}function Qi(e,t,s){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var g=0;g<e.rest.length;g++)if(Pt(e.rest[g])>s)return{map:e.measure.maps[g],cache:e.measure.caches[g],before:!0}}function es(e,t){t=Xn(t);var s=Pt(t),r=e.display.externalMeasured=new mn(e.doc,t,s);r.lineN=s;var g=r.built=dn(e,r);return r.text=g.pre,p(e.display.lineMeasure,g.pre),r}function _a(e,t,s,r){return Ur(e,ui(e,t),s,r)}function ai(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Tn(e,t)];var s=e.display.externalMeasured;if(s&&t>=s.lineN&&t<s.lineN+s.size)return s}function ui(e,t){var s=Pt(t),r=ai(e,s);r&&!r.text?r=null:r&&r.changes&&(qr(e,r,s,kt(e)),e.curOp.forceUpdate=!0),r||(r=es(e,t));var g=Qi(r,t,s);return{line:t,view:r,rect:null,map:g.map,cache:g.cache,before:g.before,hasHeights:!1}}function Ur(e,t,s,r,g){t.before&&(s=-1);var F=s+(r||""),X;return t.cache.hasOwnProperty(F)?X=t.cache[F]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($a(e,t.view,t.rect),t.hasHeights=!0),X=ns(e,t,s,r),X.bogus||(t.cache[F]=X)),{left:X.left,right:X.right,top:g?X.rtop:X.top,bottom:g?X.rbottom:X.bottom}}var xa={left:0,right:0,top:0,bottom:0};function bi(e,t,s){for(var r,g,F,X,q,ee,re=0;re<e.length;re+=3)if(q=e[re],ee=e[re+1],t<q?(g=0,F=1,X="left"):t<ee?(g=t-q,F=g+1):(re==e.length-3||t==ee&&e[re+3]>t)&&(F=ee-q,g=F-1,t>=ee&&(X="right")),g!=null){if(r=e[re+2],q==ee&&s==(r.insertLeft?"left":"right")&&(X=s),s=="left"&&g==0)for(;re&&e[re-2]==e[re-3]&&e[re-1].insertLeft;)r=e[(re-=3)+2],X="left";if(s=="right"&&g==ee-q)for(;re<e.length-3&&e[re+3]==e[re+4]&&!e[re+5].insertLeft;)r=e[(re+=3)+2],X="right";break}return{node:r,start:g,end:F,collapse:X,coverStart:q,coverEnd:ee}}function ts(e,t){var s=xa;if(t=="left")for(var r=0;r<e.length&&!((s=e[r]).left!=s.right);r++);else for(var g=e.length-1;g>=0&&!((s=e[g]).left!=s.right);g--);return s}function ns(e,t,s,r){var g=bi(t.map,s,r),F=g.node,X=g.start,q=g.end,ee=g.collapse,re;if(F.nodeType==3){for(var we=0;we<4;we++){for(;X&&Ce(t.line.text.charAt(g.coverStart+X));)--X;for(;g.coverStart+q<g.coverEnd&&Ce(t.line.text.charAt(g.coverStart+q));)++q;if(K&&H<9&&X==0&&q==g.coverEnd-g.coverStart?re=F.parentNode.getBoundingClientRect():re=ts(E(F,X,q).getClientRects(),r),re.left||re.right||X==0)break;q=X,X=X-1,ee="right"}K&&H<11&&(re=rs(e.display.measure,re))}else{X>0&&(ee=r="right");var Le;e.options.lineWrapping&&(Le=F.getClientRects()).length>1?re=Le[r=="right"?Le.length-1:0]:re=F.getBoundingClientRect()}if(K&&H<9&&!X&&(!re||!re.left&&!re.right)){var Ze=F.parentNode.getClientRects()[0];Ze?re={left:Ze.left,right:Ze.left+Nt(e.display),top:Ze.top,bottom:Ze.bottom}:re=xa}for(var ze=re.top-t.rect.top,ht=re.bottom-t.rect.top,_t=(ze+ht)/2,At=t.view.measure.heights,Dt=0;Dt<At.length-1&&!(_t<At[Dt]);Dt++);var Bt=Dt?At[Dt-1]:0,Lt=At[Dt],Ht={left:(ee=="right"?re.right:re.left)-t.rect.left,right:(ee=="left"?re.left:re.right)-t.rect.left,top:Bt,bottom:Lt};return!re.left&&!re.right&&(Ht.bogus=!0),e.options.singleCursorHeightPerLine||(Ht.rtop=ze,Ht.rbottom=ht),Ht}function rs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!me(e))return t;var s=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*s,right:t.right*s,top:t.top*r,bottom:t.bottom*r}}function Ta(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 wa(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ta(e.display.view[t])}function ci(e){wa(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Sa(){return y&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Aa(){return y&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ji(e){var t=0;if(e.widgets)for(var s=0;s<e.widgets.length;++s)e.widgets[s].above&&(t+=li(e.widgets[s]));return t}function Ri(e,t,s,r,g){if(!g){var F=Ji(t);s.top+=F,s.bottom+=F}if(r=="line")return s;r||(r="local");var X=_r(t);if(r=="local"?X+=Oi(e.display):X-=e.display.viewOffset,r=="page"||r=="window"){var q=e.display.lineSpace.getBoundingClientRect();X+=q.top+(r=="window"?0:Aa());var ee=q.left+(r=="window"?0:Sa());s.left+=ee,s.right+=ee}return s.top+=X,s.bottom+=X,s}function Ca(e,t,s){if(s=="div")return t;var r=t.left,g=t.top;if(s=="page")r-=Sa(),g-=Aa();else if(s=="local"||!s){var F=e.display.sizer.getBoundingClientRect();r+=F.left,g+=F.top}var X=e.display.lineSpace.getBoundingClientRect();return{left:r-X.left,top:g-X.top}}function Zi(e,t,s,r,g){return r||(r=Ct(e.doc,t.line)),Ri(e,r,_a(e,r,t.ch,g),s)}function er(e,t,s,r,g,F){r=r||Ct(e.doc,t.line),g||(g=ui(e,r));function X(ht,_t){var At=Ur(e,g,ht,_t?"right":"left",F);return _t?At.left=At.right:At.right=At.left,Ri(e,r,At,s)}var q=bt(r,e.doc.direction),ee=t.ch,re=t.sticky;if(ee>=r.text.length?(ee=r.text.length,re="before"):ee<=0&&(ee=0,re="after"),!q)return X(re=="before"?ee-1:ee,re=="before");function we(ht,_t,At){var Dt=q[_t],Bt=Dt.level==1;return X(At?ht-1:ht,Bt!=At)}var Le=ut(q,ee,re),Ze=ft,ze=we(ee,Le,re=="before");return Ze!=null&&(ze.other=we(ee,Ze,re!="before")),ze}function Oa(e,t){var s=0;t=L(e.doc,t),e.options.lineWrapping||(s=Nt(e.display)*t.ch);var r=Ct(e.doc,t.line),g=_r(r)+Oi(e.display);return{left:s,right:s,top:g,bottom:g+r.height}}function qi(e,t,s,r,g){var F=yt(e,t,s);return F.xRel=g,r&&(F.outside=r),F}function $i(e,t,s){var r=e.doc;if(s+=e.display.viewOffset,s<0)return qi(r.first,0,null,-1,-1);var g=qt(r,s),F=r.first+r.size-1;if(g>F)return qi(r.first+r.size-1,Ct(r,F).text.length,null,1,1);t<0&&(t=0);for(var X=Ct(r,g);;){var q=pt(e,X,g,t,s),ee=Or(X,q.ch+(q.xRel>0||q.outside>0?1:0));if(!ee)return q;var re=ee.find(1);if(re.line==g)return re;X=Ct(r,g=re.line)}}function Ra(e,t,s,r){r-=Ji(t);var g=t.text.length,F=tt(function(X){return Ur(e,s,X-1).bottom<=r},g,0);return g=tt(function(X){return Ur(e,s,X).top>r},F,g),{begin:F,end:g}}function Wt(e,t,s,r){s||(s=ui(e,t));var g=Ri(e,t,Ur(e,s,r),"line").top;return Ra(e,t,s,g)}function be(e,t,s,r){return e.bottom<=s?!1:e.top>s?!0:(r?e.left:e.right)>t}function pt(e,t,s,r,g){g-=_r(t);var F=ui(e,t),X=Ji(t),q=0,ee=t.text.length,re=!0,we=bt(t,e.doc.direction);if(we){var Le=(e.options.lineWrapping?Mt:rt)(e,t,s,F,we,r,g);re=Le.level!=1,q=re?Le.from:Le.to-1,ee=re?Le.to:Le.from-1}var Ze=null,ze=null,ht=tt(function(nn){var Zt=Ur(e,F,nn);return Zt.top+=X,Zt.bottom+=X,be(Zt,r,g,!1)?(Zt.top<=g&&Zt.left<=r&&(Ze=nn,ze=Zt),!0):!1},q,ee),_t,At,Dt=!1;if(ze){var Bt=r-ze.left<ze.right-r,Lt=Bt==re;ht=Ze+(Lt?0:1),At=Lt?"after":"before",_t=Bt?ze.left:ze.right}else{!re&&(ht==ee||ht==q)&&ht++,At=ht==0?"after":ht==t.text.length?"before":Ur(e,F,ht-(re?1:0)).bottom+X<=g==re?"after":"before";var Ht=er(e,yt(s,ht,At),"line",t,F);_t=Ht.left,Dt=g<Ht.top?-1:g>=Ht.bottom?1:0}return ht=De(t.text,ht,1),qi(s,ht,At,Dt,r-_t)}function rt(e,t,s,r,g,F,X){var q=tt(function(Le){var Ze=g[Le],ze=Ze.level!=1;return be(er(e,yt(s,ze?Ze.to:Ze.from,ze?"before":"after"),"line",t,r),F,X,!0)},0,g.length-1),ee=g[q];if(q>0){var re=ee.level!=1,we=er(e,yt(s,re?ee.from:ee.to,re?"after":"before"),"line",t,r);be(we,F,X,!0)&&we.top>X&&(ee=g[q-1])}return ee}function Mt(e,t,s,r,g,F,X){var q=Ra(e,t,r,X),ee=q.begin,re=q.end;/\s/.test(t.text.charAt(re-1))&&re--;for(var we=null,Le=null,Ze=0;Ze<g.length;Ze++){var ze=g[Ze];if(ze.from>=re||ze.to<=ee)continue;var ht=ze.level!=1,_t=Ur(e,r,ht?Math.min(re,ze.to)-1:Math.max(ee,ze.from)).right,At=_t<F?F-_t+1e9:_t-F;(!we||Le>At)&&(we=ze,Le=At)}return we||(we=g[g.length-1]),we.from<ee&&(we={from:ee,to:we.to,level:we.level}),we.to>re&&(we={from:we.from,to:re,level:we.level}),we}var gt;function It(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(gt==null){gt=h("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)gt.appendChild(document.createTextNode("x")),gt.appendChild(h("br"));gt.appendChild(document.createTextNode("x"))}p(e.measure,gt);var s=gt.offsetHeight/50;return s>3&&(e.cachedTextHeight=s),b(e.measure),s||1}function Nt(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=h("span","xxxxxxxxxx"),s=h("pre",[t],"CodeMirror-line-like");p(e.measure,s);var r=t.getBoundingClientRect(),g=(r.right-r.left)/10;return g>2&&(e.cachedCharWidth=g),g||10}function kt(e){for(var t=e.display,s={},r={},g=t.gutters.clientLeft,F=t.gutters.firstChild,X=0;F;F=F.nextSibling,++X){var q=e.display.gutterSpecs[X].className;s[q]=F.offsetLeft+F.clientLeft+g,r[q]=F.clientWidth}return{fixedPos:Qt(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:s,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Qt(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Kt(e){var t=It(e.display),s=e.options.lineWrapping,r=s&&Math.max(5,e.display.scroller.clientWidth/Nt(e.display)-3);return function(g){if(Dr(e.doc,g))return 0;var F=0;if(g.widgets)for(var X=0;X<g.widgets.length;X++)g.widgets[X].height&&(F+=g.widgets[X].height);return s?F+(Math.ceil(g.text.length/r)||1)*t:F+t}}function Jt(e){var t=e.doc,s=Kt(e);t.iter(function(r){var g=s(r);g!=r.height&&zt(r,g)})}function vn(e,t,s,r){var g=e.display;if(!s&&Te(t).getAttribute("cm-not-content")=="true")return null;var F,X,q=g.lineSpace.getBoundingClientRect();try{F=t.clientX-q.left,X=t.clientY-q.top}catch(Le){return null}var ee=$i(e,F,X),re;if(r&&ee.xRel>0&&(re=Ct(e.doc,ee.line).text).length==ee.ch){var we=Y(re,re.length,e.options.tabSize)-re.length;ee=yt(ee.line,Math.max(0,Math.round((F-qa(e.display).left)/Nt(e.display))-we))}return ee}function Tn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var s=e.display.view,r=0;r<s.length;r++)if(t-=s[r].size,t<0)return r}function cn(e,t,s,r){t==null&&(t=e.doc.first),s==null&&(s=e.doc.first+e.doc.size),r||(r=0);var g=e.display;if(r&&s<g.viewTo&&(g.updateLineNumbers==null||g.updateLineNumbers>t)&&(g.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=g.viewTo)Bn&&Gr(e.doc,t)<g.viewTo&&Lr(e);else if(s<=g.viewFrom)Bn&&Ir(e.doc,s+r)>g.viewFrom?Lr(e):(g.viewFrom+=r,g.viewTo+=r);else if(t<=g.viewFrom&&s>=g.viewTo)Lr(e);else if(t<=g.viewFrom){var F=di(e,s,s+r,1);F?(g.view=g.view.slice(F.index),g.viewFrom=F.lineN,g.viewTo+=r):Lr(e)}else if(s>=g.viewTo){var X=di(e,t,t,-1);X?(g.view=g.view.slice(0,X.index),g.viewTo=X.lineN):Lr(e)}else{var q=di(e,t,t,-1),ee=di(e,s,s+r,1);q&&ee?(g.view=g.view.slice(0,q.index).concat(Qn(e,q.lineN,ee.lineN)).concat(g.view.slice(ee.index)),g.viewTo+=r):Lr(e)}var re=g.externalMeasured;re&&(s<re.lineN?re.lineN+=r:t<re.lineN+re.size&&(g.externalMeasured=null))}function or(e,t,s){e.curOp.viewChanged=!0;var r=e.display,g=e.display.externalMeasured;if(g&&t>=g.lineN&&t<g.lineN+g.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var F=r.view[Tn(e,t)];if(F.node==null)return;var X=F.changes||(F.changes=[]);oe(X,s)==-1&&X.push(s)}function Lr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function di(e,t,s,r){var g=Tn(e,t),F,X=e.display.view;if(!Bn||s==e.doc.first+e.doc.size)return{index:g,lineN:s};for(var q=e.display.viewFrom,ee=0;ee<g;ee++)q+=X[ee].size;if(q!=t){if(r>0){if(g==X.length-1)return null;F=q+X[g].size-t,g++}else F=q-t;t+=F,s+=F}for(;Gr(e.doc,s)!=s;){if(g==(r<0?0:X.length-1))return null;s+=r*X[g-(r<0?1:0)].size,g+=r}return{index:g,lineN:s}}function Ia(e,t,s){var r=e.display,g=r.view;g.length==0||t>=r.viewTo||s<=r.viewFrom?(r.view=Qn(e,t,s),r.viewFrom=t):(r.viewFrom>t?r.view=Qn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Tn(e,t))),r.viewFrom=t,r.viewTo<s?r.view=r.view.concat(Qn(e,r.viewTo,s)):r.viewTo>s&&(r.view=r.view.slice(0,Tn(e,s)))),r.viewTo=s}function Is(e){for(var t=e.display.view,s=0,r=0;r<t.length;r++){var g=t[r];!g.hidden&&(!g.node||g.changes)&&++s}return s}function ea(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ds(e,t){t===void 0&&(t=!0);for(var s=e.doc,r={},g=r.cursors=document.createDocumentFragment(),F=r.selection=document.createDocumentFragment(),X=0;X<s.sel.ranges.length;X++){if(!t&&X==s.sel.primIndex)continue;var q=s.sel.ranges[X];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var ee=q.empty();(ee||e.options.showCursorWhenSelecting)&&Ls(e,q.head,g),ee||Yo(e,q,F)}return r}function Ls(e,t,s){var r=er(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),g=s.appendChild(h("div","\xA0","CodeMirror-cursor"));if(g.style.left=r.left+"px",g.style.top=r.top+"px",g.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var F=s.appendChild(h("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));F.style.display="",F.style.left=r.other.left+"px",F.style.top=r.other.top+"px",F.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Da(e,t){return e.top-t.top||e.left-t.left}function Yo(e,t,s){var r=e.display,g=e.doc,F=document.createDocumentFragment(),X=qa(e.display),q=X.left,ee=Math.max(r.sizerWidth,ii(e)-r.sizer.offsetLeft)-X.right,re=g.direction=="ltr";function we(Lt,Ht,nn,Zt){Ht<0&&(Ht=0),Ht=Math.round(Ht),Zt=Math.round(Zt),F.appendChild(h("div",null,"CodeMirror-selected","position: absolute; left: "+Lt+`px;
|
|
top: `+Ht+"px; width: "+(nn==null?ee-Lt:nn)+`px;
|
|
height: `+(Zt-Ht)+"px"))}function Le(Lt,Ht,nn){var Zt=Ct(g,Lt),fn=Zt.text.length,Dn,ir;function Fn(Jn,wr){return Zi(e,yt(Lt,Jn),"div",Zt,wr)}function kr(Jn,wr,lr){var tr=Wt(e,Zt,null,Jn),Zn=wr=="ltr"==(lr=="after")?"left":"right",Wn=lr=="after"?tr.begin:tr.end-(/\s/.test(Zt.text.charAt(tr.end-1))?2:1);return Fn(Wn,Zn)[Zn]}var Tr=bt(Zt,g.direction);return ct(Tr,Ht||0,nn==null?fn:nn,function(Jn,wr,lr,tr){var Zn=lr=="ltr",Wn=Fn(Jn,Zn?"left":"right"),Sr=Fn(wr-1,Zn?"right":"left"),Hi=Ht==null&&Jn==0,vi=nn==null&&wr==fn,fr=tr==0,ni=!Tr||tr==Tr.length-1;if(Sr.top-Wn.top<=3){var ar=(re?Hi:vi)&&fr,Os=(re?vi:Hi)&&ni,oi=ar?q:(Zn?Wn:Sr).left,wi=Os?ee:(Zn?Sr:Wn).right;we(oi,Wn.top,wi-oi,Wn.bottom)}else{var Si,vr,Ki,Rs;Zn?(Si=re&&Hi&&fr?q:Wn.left,vr=re?ee:kr(Jn,lr,"before"),Ki=re?q:kr(wr,lr,"after"),Rs=re&&vi&&ni?ee:Sr.right):(Si=re?kr(Jn,lr,"before"):q,vr=!re&&Hi&&fr?ee:Wn.right,Ki=!re&&vi&&ni?q:Sr.left,Rs=re?kr(wr,lr,"after"):ee),we(Si,Wn.top,vr-Si,Wn.bottom),Wn.bottom<Sr.top&&we(q,Wn.bottom,null,Sr.top),we(Ki,Sr.top,Rs-Ki,Sr.bottom)}(!Dn||Da(Wn,Dn)<0)&&(Dn=Wn),Da(Sr,Dn)<0&&(Dn=Sr),(!ir||Da(Wn,ir)<0)&&(ir=Wn),Da(Sr,ir)<0&&(ir=Sr)}),{start:Dn,end:ir}}var Ze=t.from(),ze=t.to();if(Ze.line==ze.line)Le(Ze.line,Ze.ch,ze.ch);else{var ht=Ct(g,Ze.line),_t=Ct(g,ze.line),At=Xn(ht)==Xn(_t),Dt=Le(Ze.line,Ze.ch,At?ht.text.length+1:null).end,Bt=Le(ze.line,At?0:null,ze.ch).start;At&&(Dt.top<Bt.top-2?(we(Dt.right,Dt.top,null,Dt.bottom),we(q,Bt.top,Bt.left,Bt.bottom)):we(Dt.right,Dt.top,Bt.left-Dt.right,Dt.bottom)),Dt.bottom<Bt.top&&we(q,Dt.bottom,null,Bt.top)}s.appendChild(F)}function is(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var s=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ii(e),t.cursorDiv.style.visibility=(s=!s)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ms(e){e.state.focused||(e.display.input.focus(),as(e))}function ks(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ii(e))},100)}function as(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ke(e,"focus",e,t),e.state.focused=!0,x(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()),is(e)}function Ii(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ke(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 La(e){for(var t=e.display,s=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var g=t.view[r],F=e.options.lineWrapping,X=void 0,q=0;if(g.hidden)continue;if(K&&H<8){var ee=g.node.offsetTop+g.node.offsetHeight;X=ee-s,s=ee}else{var re=g.node.getBoundingClientRect();X=re.bottom-re.top,!F&&g.text.firstChild&&(q=g.text.firstChild.getBoundingClientRect().right-re.left-1)}var we=g.line.height-X;if((we>.005||we<-.005)&&(zt(g.line,X),Ps(g.line),g.rest))for(var Le=0;Le<g.rest.length;Le++)Ps(g.rest[Le]);if(q>e.display.sizerWidth){var Ze=Math.ceil(q/Nt(e.display));Ze>e.display.maxLineLength&&(e.display.maxLineLength=Ze,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}function Ps(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var s=e.widgets[t],r=s.node.parentNode;r&&(s.height=r.offsetHeight)}}function Ma(e,t,s){var r=s&&s.top!=null?Math.max(0,s.top):e.scroller.scrollTop;r=Math.floor(r-Oi(e));var g=s&&s.bottom!=null?s.bottom:r+e.wrapper.clientHeight,F=qt(t,r),X=qt(t,g);if(s&&s.ensure){var q=s.ensure.from.line,ee=s.ensure.to.line;q<F?(F=q,X=qt(t,_r(Ct(t,q))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=X&&(F=qt(t,_r(Ct(t,ee))-e.wrapper.clientHeight),X=ee)}return{from:F,to:Math.max(X,F+1)}}function Xo(e,t){if(Xe(e,"scrollCursorIntoView"))return;var s=e.display,r=s.sizer.getBoundingClientRect(),g=null;if(t.top+r.top<0?g=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),g!=null&&!l){var F=h("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-s.viewOffset-Oi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+mr(e)+s.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(g),e.display.lineSpace.removeChild(F)}}function Qo(e,t,s,r){r==null&&(r=0);var g;!e.options.lineWrapping&&t==s&&(t=t.ch?yt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,s=t.sticky=="before"?yt(t.line,t.ch+1,"before"):t);for(var F=0;F<5;F++){var X=!1,q=er(e,t),ee=!s||s==t?q:er(e,s);g={left:Math.min(q.left,ee.left),top:Math.min(q.top,ee.top)-r,right:Math.max(q.left,ee.left),bottom:Math.max(q.bottom,ee.bottom)+r};var re=ss(e,g),we=e.doc.scrollTop,Le=e.doc.scrollLeft;if(re.scrollTop!=null&&(na(e,re.scrollTop),Math.abs(e.doc.scrollTop-we)>1&&(X=!0)),re.scrollLeft!=null&&(Ei(e,re.scrollLeft),Math.abs(e.doc.scrollLeft-Le)>1&&(X=!0)),!X)break}return g}function Jo(e,t){var s=ss(e,t);s.scrollTop!=null&&na(e,s.scrollTop),s.scrollLeft!=null&&Ei(e,s.scrollLeft)}function ss(e,t){var s=e.display,r=It(e.display);t.top<0&&(t.top=0);var g=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:s.scroller.scrollTop,F=yi(e),X={};t.bottom-t.top>F&&(t.bottom=t.top+F);var q=e.doc.height+ti(s),ee=t.top<r,re=t.bottom>q-r;if(t.top<g)X.scrollTop=ee?0:t.top;else if(t.bottom>g+F){var we=Math.min(t.top,(re?q:t.bottom)-F);we!=g&&(X.scrollTop=we)}var Le=e.options.fixedGutter?0:s.gutters.offsetWidth,Ze=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:s.scroller.scrollLeft-Le,ze=ii(e)-s.gutters.offsetWidth,ht=t.right-t.left>ze;return ht&&(t.right=t.left+ze),t.left<10?X.scrollLeft=0:t.left<Ze?X.scrollLeft=Math.max(0,t.left+Le-(ht?0:10)):t.right>ze+Ze-3&&(X.scrollLeft=t.right+(ht?0:10)-ze),X}function os(e,t){if(t==null)return;ka(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Di(e){ka(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ta(e,t,s){(t!=null||s!=null)&&ka(e),t!=null&&(e.curOp.scrollLeft=t),s!=null&&(e.curOp.scrollTop=s)}function Zo(e,t){ka(e),e.curOp.scrollToPos=t}function ka(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var s=Oa(e,t.from),r=Oa(e,t.to);Ns(e,s,r,t.margin)}}function Ns(e,t,s,r){var g=ss(e,{left:Math.min(t.left,s.left),top:Math.min(t.top,s.top)-r,right:Math.max(t.right,s.right),bottom:Math.max(t.bottom,s.bottom)+r});ta(e,g.scrollLeft,g.scrollTop)}function na(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||us(e,{top:t}),Us(e,t,!0),N&&us(e),aa(e,100)}function Us(e,t,s){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!s)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ei(e,t,s,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(s?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Hs(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ra(e){var t=e.display,s=t.gutters.offsetWidth,r=Math.round(e.doc.height+ti(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?s:0,docHeight:r,scrollHeight:r+mr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:s}}var _i=function(e,t,s){this.cm=s;var r=this.vert=h("div",[h("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=h("div",[h("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=g.tabIndex=-1,e(r),e(g),Oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Oe(g,"scroll",function(){g.clientWidth&&t(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};_i.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,s=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(s){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var g=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+g)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=s?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var F=e.viewWidth-e.barLeft-(s?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+F)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:s?r:0,bottom:t?r:0}},_i.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},_i.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},_i.prototype.zeroWidthHack=function(){var e=a&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},_i.prototype.enableZeroWidthBar=function(e,t,s){e.style.pointerEvents="auto";function r(){var g=e.getBoundingClientRect(),F=s=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);F!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},_i.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ia=function(){};ia.prototype.update=function(){return{bottom:0,right:0}},ia.prototype.setScrollLeft=function(){},ia.prototype.setScrollTop=function(){},ia.prototype.clear=function(){};function Li(e,t){t||(t=ra(e));var s=e.display.barWidth,r=e.display.barHeight;Bs(e,t);for(var g=0;g<4&&s!=e.display.barWidth||r!=e.display.barHeight;g++)s!=e.display.barWidth&&e.options.lineWrapping&&La(e),Bs(e,ra(e)),s=e.display.barWidth,r=e.display.barHeight}function Bs(e,t){var s=e.display,r=s.scrollbars.update(t);s.sizer.style.paddingRight=(s.barWidth=r.right)+"px",s.sizer.style.paddingBottom=(s.barHeight=r.bottom)+"px",s.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(s.scrollbarFiller.style.display="block",s.scrollbarFiller.style.height=r.bottom+"px",s.scrollbarFiller.style.width=r.right+"px"):s.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(s.gutterFiller.style.display="block",s.gutterFiller.style.height=r.bottom+"px",s.gutterFiller.style.width=t.gutterWidth+"px"):s.gutterFiller.style.display=""}var Fs={native:_i,null:ia};function js(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Fs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,s){s=="horizontal"?Ei(e,t):na(e,t)},e),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)}var qo=0;function xi(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:++qo},an(e.curOp)}function Ti(e){var t=e.curOp;t&&xn(t,function(s){for(var r=0;r<s.ops.length;r++)s.ops[r].cm.curOp=null;$o(s)})}function $o(e){for(var t=e.ops,s=0;s<t.length;s++)el(t[s]);for(var r=0;r<t.length;r++)tl(t[r]);for(var g=0;g<t.length;g++)nl(t[g]);for(var F=0;F<t.length;F++)rl(t[F]);for(var X=0;X<t.length;X++)il(t[X])}function el(e){var t=e.cm,s=t.display;sl(t),e.updateMaxLine&&Jr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<s.viewFrom||e.scrollToPos.to.line>=s.viewTo)||s.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Pa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ls(e.cm,e.update)}function nl(e){var t=e.cm,s=t.display;e.updatedDisplay&&La(t),e.barMeasure=ra(t),s.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_a(t,s.maxLine,s.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(s.scroller.clientWidth,s.sizer.offsetLeft+e.adjustWidthTo+mr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,s.sizer.offsetLeft+e.adjustWidthTo-ii(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=s.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&&Ei(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var s=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,s),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Li(t,e.barMeasure),e.updatedDisplay&&ds(t,e.barMeasure),e.selectionChanged&&is(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),s&&Ms(e.cm)}function il(e){var t=e.cm,s=t.display,r=t.doc;if(e.updatedDisplay&&Ws(t,e.update),s.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(s.wheelStartX=s.wheelStartY=null),e.scrollTop!=null&&Us(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ei(t,e.scrollLeft,!0,!0),e.scrollToPos){var g=Qo(t,L(r,e.scrollToPos.from),L(r,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,g)}var F=e.maybeHiddenMarkers,X=e.maybeUnhiddenMarkers;if(F)for(var q=0;q<F.length;++q)F[q].lines.length||Ke(F[q],"hide");if(X)for(var ee=0;ee<X.length;++ee)X[ee].lines.length&&Ke(X[ee],"unhide");s.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Mr(e,t){if(e.curOp)return t();xi(e);try{return t()}finally{Ti(e)}}function nr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);xi(e);try{return t.apply(e,arguments)}finally{Ti(e)}}}function gr(e){return function(){if(this.curOp)return e.apply(this,arguments);xi(this);try{return e.apply(this,arguments)}finally{Ti(this)}}}function rr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);xi(t);try{return e.apply(this,arguments)}finally{Ti(t)}}}function aa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var s=+new Date+e.options.workTime,r=St(e,t.highlightFrontier),g=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(F){if(r.line>=e.display.viewFrom){var X=F.styles,q=F.text.length>e.options.maxHighlightLength?Et(t.mode,r.state):null,ee=Ie(e,F,r,!0);q&&(r.state=q),F.styles=ee.styles;var re=F.styleClasses,we=ee.classes;we?F.styleClasses=we:re&&(F.styleClasses=null);for(var Le=!X||X.length!=F.styles.length||re!=we&&(!re||!we||re.bgClass!=we.bgClass||re.textClass!=we.textClass),Ze=0;!Le&&Ze<X.length;++Ze)Le=X[Ze]!=F.styles[Ze];Le&&g.push(r.line),F.stateAfter=r.save(),r.nextLine()}else F.text.length<=e.options.maxHighlightLength&&Ft(e,F.text,r),F.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>s)return aa(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),g.length&&Mr(e,function(){for(var F=0;F<g.length;F++)or(e,g[F],"text")})}var Pa=function(e,t,s){var r=e.display;this.viewport=t,this.visible=Ma(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ii(e),this.force=s,this.dims=kt(e),this.events=[]};Pa.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},Pa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ke.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=mr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=mr(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=P();if(!t||!v(e.display.lineDiv,t))return null;var s={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&v(e.display.lineDiv,r.anchorNode)&&(s.anchorNode=r.anchorNode,s.anchorOffset=r.anchorOffset,s.focusNode=r.focusNode,s.focusOffset=r.focusOffset)}return s}function ll(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&v(document.body,e.anchorNode)&&v(document.body,e.focusNode)){var t=window.getSelection(),s=document.createRange();s.setEnd(e.anchorNode,e.anchorOffset),s.collapse(!1),t.removeAllRanges(),t.addRange(s),t.extend(e.focusNode,e.focusOffset)}}function ls(e,t){var s=e.display,r=e.doc;if(t.editorIsHidden)return Lr(e),!1;if(!t.force&&t.visible.from>=s.viewFrom&&t.visible.to<=s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>=s.viewTo)&&s.renderedView==s.view&&Is(e)==0)return!1;Ks(e)&&(Lr(e),t.dims=kt(e));var g=r.first+r.size,F=Math.max(t.visible.from-e.options.viewportMargin,r.first),X=Math.min(g,t.visible.to+e.options.viewportMargin);s.viewFrom<F&&F-s.viewFrom<20&&(F=Math.max(r.first,s.viewFrom)),s.viewTo>X&&s.viewTo-X<20&&(X=Math.min(g,s.viewTo)),Bn&&(F=Gr(e.doc,F),X=Ir(e.doc,X));var q=F!=s.viewFrom||X!=s.viewTo||s.lastWrapHeight!=t.wrapperHeight||s.lastWrapWidth!=t.wrapperWidth;Ia(e,F,X),s.viewOffset=_r(Ct(e.doc,s.viewFrom)),e.display.mover.style.top=s.viewOffset+"px";var ee=Is(e);if(!q&&ee==0&&!t.force&&s.renderedView==s.view&&(s.updateLineNumbers==null||s.updateLineNumbers>=s.viewTo))return!1;var re=ol(e);return ee>4&&(s.lineDiv.style.display="none"),ul(e,s.updateLineNumbers,t.dims),ee>4&&(s.lineDiv.style.display=""),s.renderedView=s.view,ll(re),b(s.cursorDiv),b(s.selectionDiv),s.gutters.style.height=s.sizer.style.minHeight=0,q&&(s.lastWrapHeight=t.wrapperHeight,s.lastWrapWidth=t.wrapperWidth,aa(e,400)),s.updateLineNumbers=null,!0}function Ws(e,t){for(var s=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ii(e)){if(s&&s.top!=null&&(s={top:Math.min(e.doc.height+ti(e.display)-yi(e),s.top)}),t.visible=Ma(e.display,e.doc,s),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ma(e.display,e.doc,s));if(!ls(e,t))break;La(e);var g=ra(e);ea(e),Li(e,g),ds(e,g),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function us(e,t){var s=new Pa(e,t);if(ls(e,s)){La(e),Ws(e,s);var r=ra(e);ea(e),Li(e,r),ds(e,r),s.finish()}}function ul(e,t,s){var r=e.display,g=e.options.lineNumbers,F=r.lineDiv,X=F.firstChild;function q(ht){var _t=ht.nextSibling;return n&&a&&e.display.currentWheelTarget==ht?ht.style.display="none":ht.parentNode.removeChild(ht),_t}for(var ee=r.view,re=r.viewFrom,we=0;we<ee.length;we++){var Le=ee[we];if(!Le.hidden)if(!Le.node||Le.node.parentNode!=F){var Ze=Ja(e,Le,re,s);F.insertBefore(Ze,X)}else{for(;X!=Le.node;)X=q(X);var ze=g&&t!=null&&t<=re&&Le.lineNumber;Le.changes&&(oe(Le.changes,"gutter")>-1&&(ze=!1),qr(e,Le,re,s)),ze&&(b(Le.lineNumber),Le.lineNumber.appendChild(document.createTextNode(wn(e.options,re)))),X=Le.node.nextSibling}re+=Le.size}for(;X;)X=q(X)}function cs(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ds(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+mr(e)+"px"}function Hs(e){var t=e.display,s=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Qt(t)-t.scroller.scrollLeft+e.doc.scrollLeft,g=t.gutters.offsetWidth,F=r+"px",X=0;X<s.length;X++)if(!s[X].hidden){e.options.fixedGutter&&(s[X].gutter&&(s[X].gutter.style.left=F),s[X].gutterBackground&&(s[X].gutterBackground.style.left=F));var q=s[X].alignable;if(q)for(var ee=0;ee<q.length;ee++)q[ee].style.left=F}e.options.fixedGutter&&(t.gutters.style.left=r+g+"px")}function Ks(e){if(!e.options.lineNumbers)return!1;var t=e.doc,s=wn(e.options,t.first+t.size-1),r=e.display;if(s.length!=r.lineNumChars){var g=r.measure.appendChild(h("div",[h("div",s)],"CodeMirror-linenumber CodeMirror-gutter-elt")),F=g.firstChild.offsetWidth,X=g.offsetWidth-F;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(F,r.lineGutter.offsetWidth-X)+1,r.lineNumWidth=r.lineNumInnerWidth+X,r.lineNumChars=r.lineNumInnerWidth?s.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",cs(e.display),!0}return!1}function hs(e,t){for(var s=[],r=!1,g=0;g<e.length;g++){var F=e[g],X=null;if(typeof F!="string"&&(X=F.style,F=F.className),F=="CodeMirror-linenumbers")if(t)r=!0;else continue;s.push({className:F,style:X})}return t&&!r&&s.push({className:"CodeMirror-linenumbers",style:null}),s}function Gs(e){var t=e.gutters,s=e.gutterSpecs;b(t),e.lineGutter=null;for(var r=0;r<s.length;++r){var g=s[r],F=g.className,X=g.style,q=t.appendChild(h("div",null,"CodeMirror-gutter "+F));X&&(q.style.cssText=X),F=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=s.length?"":"none",cs(e)}function sa(e){Gs(e.display),cn(e),Hs(e)}function cl(e,t,s,r){var g=this;this.input=s,g.scrollbarFiller=h("div",null,"CodeMirror-scrollbar-filler"),g.scrollbarFiller.setAttribute("cm-not-content","true"),g.gutterFiller=h("div",null,"CodeMirror-gutter-filler"),g.gutterFiller.setAttribute("cm-not-content","true"),g.lineDiv=A("div",null,"CodeMirror-code"),g.selectionDiv=h("div",null,null,"position: relative; z-index: 1"),g.cursorDiv=h("div",null,"CodeMirror-cursors"),g.measure=h("div",null,"CodeMirror-measure"),g.lineMeasure=h("div",null,"CodeMirror-measure"),g.lineSpace=A("div",[g.measure,g.lineMeasure,g.selectionDiv,g.cursorDiv,g.lineDiv],null,"position: relative; outline: none");var F=A("div",[g.lineSpace],"CodeMirror-lines");g.mover=h("div",[F],null,"position: relative"),g.sizer=h("div",[g.mover],"CodeMirror-sizer"),g.sizerWidth=null,g.heightForcer=h("div",null,null,"position: absolute; height: "+de+"px; width: 1px;"),g.gutters=h("div",null,"CodeMirror-gutters"),g.lineGutter=null,g.scroller=h("div",[g.sizer,g.heightForcer,g.gutters],"CodeMirror-scroll"),g.scroller.setAttribute("tabIndex","-1"),g.wrapper=h("div",[g.scrollbarFiller,g.gutterFiller,g.scroller],"CodeMirror"),K&&H<8&&(g.gutters.style.zIndex=-1,g.scroller.style.paddingRight=0),!n&&!(N&&u)&&(g.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(g.wrapper):e(g.wrapper)),g.viewFrom=g.viewTo=t.first,g.reportedViewFrom=g.reportedViewTo=t.first,g.view=[],g.renderedView=null,g.externalMeasured=null,g.viewOffset=0,g.lastWrapHeight=g.lastWrapWidth=0,g.updateLineNumbers=null,g.nativeBarWidth=g.barHeight=g.barWidth=0,g.scrollbarsClipped=!1,g.lineNumWidth=g.lineNumInnerWidth=g.lineNumChars=null,g.alignWidgets=!1,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=null,g.maxLine=null,g.maxLineLength=0,g.maxLineChanged=!1,g.wheelDX=g.wheelDY=g.wheelStartX=g.wheelStartY=null,g.shift=!1,g.selForContextMenu=null,g.activeTouch=null,g.gutterSpecs=hs(r.gutters,r.lineNumbers),Gs(g),s.init(g)}var Na=0,Br=null;K?Br=-.53:N?Br=15:y?Br=-.7:f&&(Br=-1/3);function zs(e){var t=e.wheelDeltaX,s=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),s==null&&e.detail&&e.axis==e.VERTICAL_AXIS?s=e.detail:s==null&&(s=e.wheelDelta),{x:t,y:s}}function dl(e){var t=zs(e);return t.x*=Br,t.y*=Br,t}function Vs(e,t){var s=zs(t),r=s.x,g=s.y,F=e.display,X=F.scroller,q=X.scrollWidth>X.clientWidth,ee=X.scrollHeight>X.clientHeight;if(!(r&&q||g&&ee))return;if(g&&a&&n){e:for(var re=t.target,we=F.view;re!=X;re=re.parentNode)for(var Le=0;Le<we.length;Le++)if(we[Le].node==re){e.display.currentWheelTarget=re;break e}}if(r&&!N&&!m&&Br!=null){g&&ee&&na(e,Math.max(0,X.scrollTop+g*Br)),Ei(e,Math.max(0,X.scrollLeft+r*Br)),(!g||g&&ee)&&ie(t),F.wheelStartX=null;return}if(g&&Br!=null){var Ze=g*Br,ze=e.doc.scrollTop,ht=ze+F.wrapper.clientHeight;Ze<0?ze=Math.max(0,ze+Ze-50):ht=Math.min(e.doc.height,ht+Ze+50),us(e,{top:ze,bottom:ht})}Na<20&&(F.wheelStartX==null?(F.wheelStartX=X.scrollLeft,F.wheelStartY=X.scrollTop,F.wheelDX=r,F.wheelDY=g,setTimeout(function(){if(F.wheelStartX==null)return;var _t=X.scrollLeft-F.wheelStartX,At=X.scrollTop-F.wheelStartY,Dt=At&&F.wheelDY&&At/F.wheelDY||_t&&F.wheelDX&&_t/F.wheelDX;if(F.wheelStartX=F.wheelStartY=null,!Dt)return;Br=(Br*Na+Dt)/(Na+1),++Na},200)):(F.wheelDX+=r,F.wheelDY+=g))}var Fr=function(e,t){this.ranges=e,this.primIndex=t};Fr.prototype.primary=function(){return this.ranges[this.primIndex]},Fr.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 s=this.ranges[t],r=e.ranges[t];if(!Mn(s.anchor,r.anchor)||!Mn(s.head,r.head))return!1}return!0},Fr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Cn(Un(this.ranges[t].anchor),Un(this.ranges[t].head));return new Fr(e,this.primIndex)},Fr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Fr.prototype.contains=function(e,t){t||(t=e);for(var s=0;s<this.ranges.length;s++){var r=this.ranges[s];if(Vt(t,r.from())>=0&&Vt(e,r.to())<=0)return s}return-1};var Cn=function(e,t){this.anchor=e,this.head=t};Cn.prototype.from=function(){return Vn(this.anchor,this.head)},Cn.prototype.to=function(){return Pn(this.anchor,this.head)},Cn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yr(e,t,s){var r=e&&e.options.selectionsMayTouch,g=t[s];t.sort(function(Ze,ze){return Vt(Ze.from(),ze.from())}),s=oe(t,g);for(var F=1;F<t.length;F++){var X=t[F],q=t[F-1],ee=Vt(q.to(),X.from());if(r&&!X.empty()?ee>0:ee>=0){var re=Vn(q.from(),X.from()),we=Pn(q.to(),X.to()),Le=q.empty()?X.from()==X.head:q.from()==q.head;F<=s&&--s,t.splice(--F,2,new Cn(Le?we:re,Le?re:we))}}return new Fr(t,s)}function hi(e,t){return new Fr([new Cn(e,t||e)],0)}function fi(e){return e.text?yt(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ys(e,t){if(Vt(e,t.from)<0)return e;if(Vt(e,t.to)<=0)return fi(t);var s=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=fi(t).ch-t.to.ch),yt(s,r)}function fs(e,t){for(var s=[],r=0;r<e.sel.ranges.length;r++){var g=e.sel.ranges[r];s.push(new Cn(Ys(g.anchor,t),Ys(g.head,t)))}return Yr(e.cm,s,e.sel.primIndex)}function Xs(e,t,s){return e.line==t.line?yt(s.line,e.ch-t.ch+s.ch):yt(s.line+(e.line-t.line),e.ch)}function hl(e,t,s){for(var r=[],g=yt(e.first,0),F=g,X=0;X<t.length;X++){var q=t[X],ee=Xs(q.from,g,F),re=Xs(fi(q),g,F);if(g=q.to,F=re,s=="around"){var we=e.sel.ranges[X],Le=Vt(we.head,we.anchor)<0;r[X]=new Cn(Le?re:ee,Le?ee:re)}else r[X]=new Cn(ee,ee)}return new Fr(r,e.sel.primIndex)}function ps(e){e.doc.mode=it(e.options,e.doc.modeOption),oa(e)}function oa(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,aa(e,100),e.state.modeGen++,e.curOp&&cn(e)}function Qs(e,t){return t.from.ch==0&&t.to.ch==0&&ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ms(e,t,s,r){function g(Bt){return s?s[Bt]:null}function F(Bt,Lt,Ht){ri(Bt,Lt,Ht,r),En(Bt,"change",Bt,t)}function X(Bt,Lt){for(var Ht=[],nn=Bt;nn<Lt;++nn)Ht.push(new sr(re[nn],g(nn),r));return Ht}var q=t.from,ee=t.to,re=t.text,we=Ct(e,q.line),Le=Ct(e,ee.line),Ze=ne(re),ze=g(re.length-1),ht=ee.line-q.line;if(t.full)e.insert(0,X(0,re.length)),e.remove(re.length,e.size-re.length);else if(Qs(e,t)){var _t=X(0,re.length-1);F(Le,Le.text,ze),ht&&e.remove(q.line,ht),_t.length&&e.insert(q.line,_t)}else if(we==Le)if(re.length==1)F(we,we.text.slice(0,q.ch)+Ze+we.text.slice(ee.ch),ze);else{var At=X(1,re.length-1);At.push(new sr(Ze+we.text.slice(ee.ch),ze,r)),F(we,we.text.slice(0,q.ch)+re[0],g(0)),e.insert(q.line+1,At)}else if(re.length==1)F(we,we.text.slice(0,q.ch)+re[0]+Le.text.slice(ee.ch),g(0)),e.remove(q.line+1,ht);else{F(we,we.text.slice(0,q.ch)+re[0],g(0)),F(Le,Ze+Le.text.slice(ee.ch),ze);var Dt=X(1,re.length-1);ht>1&&e.remove(q.line+1,ht-1),e.insert(q.line+1,Dt)}En(e,"change",e,t)}function pi(e,t,s){function r(g,F,X){if(g.linked)for(var q=0;q<g.linked.length;++q){var ee=g.linked[q];if(ee.doc==F)continue;var re=X&&ee.sharedHist;if(s&&!re)continue;t(ee.doc,re),r(ee.doc,g,re)}}r(e,null,!0)}function Js(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Jt(e),ps(e),Zs(e),e.options.lineWrapping||Jr(e),e.options.mode=t.modeOption,cn(e)}function Zs(e){(e.doc.direction=="rtl"?x:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Mr(e,function(){Zs(e),cn(e)})}function Ua(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 gs(e,t){var s={from:Un(t.from),to:fi(t),text:pn(e,t.from,t.to)};return eo(e,s,t.from.line,t.to.line+1),pi(e,function(r){return eo(r,s,t.from.line,t.to.line+1)},!0),s}function qs(e){for(;e.length;){var t=ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return qs(e.done),ne(e.done);if(e.done.length&&!ne(e.done).ranges)return ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ne(e.done)}function $s(e,t,s,r){var g=e.history;g.undone.length=0;var F=+new Date,X,q;if((g.lastOp==r||g.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&g.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(X=pl(g,g.lastOp==r)))q=ne(X.changes),Vt(t.from,t.to)==0&&Vt(t.from,q.to)==0?q.to=fi(t):X.changes.push(gs(e,t));else{var ee=ne(g.done);for((!ee||!ee.ranges)&&Ba(e.sel,g.done),X={changes:[gs(e,t)],generation:g.generation},g.done.push(X);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(s),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=F,g.lastOp=g.lastSelOp=r,g.lastOrigin=g.lastSelOrigin=t.origin,q||Ke(e,"historyAdded")}function ml(e,t,s,r){var g=t.charAt(0);return g=="*"||g=="+"&&s.ranges.length==r.ranges.length&&s.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,s,r){var g=e.history,F=r&&r.origin;s==g.lastSelOp||F&&g.lastSelOrigin==F&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==F||ml(e,F,ne(g.done),t))?g.done[g.done.length-1]=t:Ba(t,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=F,g.lastSelOp=s,r&&r.clearRedo!==!1&&qs(g.undone)}function Ba(e,t){var s=ne(t);s&&s.ranges&&s.equals(e)||t.push(e)}function eo(e,t,s,r){var g=t["spans_"+e.id],F=0;e.iter(Math.max(e.first,s),Math.min(e.first+e.size,r),function(X){X.markedSpans&&((g||(g=t["spans_"+e.id]={}))[F]=X.markedSpans),++F})}function vl(e){if(!e)return null;for(var t,s=0;s<e.length;++s)e[s].marker.explicitlyCleared?t||(t=e.slice(0,s)):t&&t.push(e[s]);return t?t.length?t:null:e}function yl(e,t){var s=t["spans_"+e.id];if(!s)return null;for(var r=[],g=0;g<t.text.length;++g)r.push(vl(s[g]));return r}function to(e,t){var s=yl(e,t),r=br(e,t);if(!s)return r;if(!r)return s;for(var g=0;g<s.length;++g){var F=s[g],X=r[g];if(F&&X){e:for(var q=0;q<X.length;++q){for(var ee=X[q],re=0;re<F.length;++re)if(F[re].marker==ee.marker)continue e;F.push(ee)}}else X&&(s[g]=X)}return s}function Mi(e,t,s){for(var r=[],g=0;g<e.length;++g){var F=e[g];if(F.ranges){r.push(s?Fr.prototype.deepCopy.call(F):F);continue}var X=F.changes,q=[];r.push({changes:q});for(var ee=0;ee<X.length;++ee){var re=X[ee],we=void 0;if(q.push({from:re.from,to:re.to,text:re.text}),t)for(var Le in re)(we=Le.match(/^spans_(\d+)$/))&&(oe(t,Number(we[1]))>-1&&(ne(q)[Le]=re[Le],delete re[Le]))}}return r}function vs(e,t,s,r){if(r){var g=e.anchor;if(s){var F=Vt(t,g)<0;F!=Vt(s,g)<0?(g=t,t=s):F!=Vt(t,s)<0&&(t=s)}return new Cn(g,t)}else return new Cn(s||t,t)}function Fa(e,t,s,r,g){g==null&&(g=e.cm&&(e.cm.display.shift||e.extend)),hr(e,new Fr([vs(e.sel.primary(),t,s,g)],0),r)}function no(e,t,s){for(var r=[],g=e.cm&&(e.cm.display.shift||e.extend),F=0;F<e.sel.ranges.length;F++)r[F]=vs(e.sel.ranges[F],t[F],null,g);var X=Yr(e.cm,r,e.sel.primIndex);hr(e,X,s)}function ys(e,t,s,r){var g=e.sel.ranges.slice(0);g[t]=s,hr(e,Yr(e.cm,g,e.sel.primIndex),r)}function ro(e,t,s,r){hr(e,hi(t,s),r)}function bl(e,t,s){var r={ranges:t.ranges,update:function(g){this.ranges=[];for(var F=0;F<g.length;F++)this.ranges[F]=new Cn(L(e,g[F].anchor),L(e,g[F].head))},origin:s&&s.origin};return Ke(e,"beforeSelectionChange",e,r),e.cm&&Ke(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Yr(e.cm,r.ranges,r.ranges.length-1):t}function io(e,t,s){var r=e.history.done,g=ne(r);g&&g.ranges?(r[r.length-1]=t,ja(e,t,s)):hr(e,t,s)}function hr(e,t,s){ja(e,t,s),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,s)}function ja(e,t,s){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,s));var r=s&&s.bias||(Vt(t.primary().head,e.sel.primary().head)<0?-1:1);ao(e,oo(e,t,r,!0)),!(s&&s.scroll===!1)&&e.cm&&Di(e.cm)}function ao(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Se(e.cm)),En(e,"cursorActivity",e)}function so(e){ao(e,oo(e,e.sel,null,!1))}function oo(e,t,s,r){for(var g,F=0;F<t.ranges.length;F++){var X=t.ranges[F],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[F],ee=Wa(e,X.anchor,q&&q.anchor,s,r),re=Wa(e,X.head,q&&q.head,s,r);(g||ee!=X.anchor||re!=X.head)&&(g||(g=t.ranges.slice(0,F)),g[F]=new Cn(ee,re))}return g?Yr(e.cm,g,t.primIndex):t}function ki(e,t,s,r,g){var F=Ct(e,t.line);if(F.markedSpans)for(var X=0;X<F.markedSpans.length;++X){var q=F.markedSpans[X],ee=q.marker,re="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,we="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((q.from==null||(re?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(we?q.to>=t.ch:q.to>t.ch))){if(g&&(Ke(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(F.markedSpans){--X;continue}else break;if(!ee.atomic)continue;if(s){var Le=ee.find(r<0?1:-1),Ze=void 0;if((r<0?we:re)&&(Le=lo(e,Le,-r,Le&&Le.line==t.line?F:null)),Le&&Le.line==t.line&&(Ze=Vt(Le,s))&&(r<0?Ze<0:Ze>0))return ki(e,Le,t,r,g)}var ze=ee.find(r<0?-1:1);return(r<0?re:we)&&(ze=lo(e,ze,r,ze.line==t.line?F:null)),ze?ki(e,ze,t,r,g):null}}return t}function Wa(e,t,s,r,g){var F=r||1,X=ki(e,t,s,F,g)||!g&&ki(e,t,s,F,!0)||ki(e,t,s,-F,g)||!g&&ki(e,t,s,-F,!0);return X||(e.cantEdit=!0,yt(e.first,0))}function lo(e,t,s,r){return s<0&&t.ch==0?t.line>e.first?L(e,yt(t.line-1)):null:s>0&&t.ch==(r||Ct(e,t.line)).text.length?t.line<e.first+e.size-1?yt(t.line+1,0):null:new yt(t.line,t.ch+s)}function uo(e){e.setSelection(yt(e.firstLine(),0),yt(e.lastLine()),Ae)}function co(e,t,s){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return s&&(r.update=function(g,F,X,q){g&&(r.from=L(e,g)),F&&(r.to=L(e,F)),X&&(r.text=X),q!==void 0&&(r.origin=q)}),Ke(e,"beforeChange",e,r),e.cm&&Ke(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Pi(e,t,s){if(e.cm){if(!e.cm.curOp)return nr(e.cm,Pi)(e,t,s);if(e.cm.state.suppressEdits)return}if((ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))&&(t=co(e,t,!0),!t))return;var r=ur&&!s&&Nr(e,t.from,t.to);if(r)for(var g=r.length-1;g>=0;--g)ho(e,{from:r[g].from,to:r[g].to,text:g?[""]:t.text,origin:t.origin});else ho(e,t)}function ho(e,t){if(t.text.length==1&&t.text[0]==""&&Vt(t.from,t.to)==0)return;var s=fs(e,t);$s(e,t,s,e.cm?e.cm.curOp.id:NaN),la(e,t,s,br(e,t));var r=[];pi(e,function(g,F){!F&&oe(r,g.history)==-1&&(go(g.history,t),r.push(g.history)),la(g,t,null,br(g,t))})}function Ha(e,t,s){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!s)return;for(var g=e.history,F,X=e.sel,q=t=="undo"?g.done:g.undone,ee=t=="undo"?g.undone:g.done,re=0;re<q.length&&!(F=q[re],s?F.ranges&&!F.equals(e.sel):!F.ranges);re++);if(re==q.length)return;for(g.lastOrigin=g.lastSelOrigin=null;;)if(F=q.pop(),F.ranges){if(Ba(F,ee),s&&!F.equals(e.sel)){hr(e,F,{clearRedo:!1});return}X=F}else if(r){q.push(F);return}else break;var we=[];Ba(X,ee),ee.push({changes:we,generation:g.generation}),g.generation=F.generation||++g.maxGeneration;for(var Le=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),Ze=function(_t){var At=F.changes[_t];if(At.origin=t,Le&&!co(e,At,!1))return q.length=0,{};we.push(gs(e,At));var Dt=_t?fs(e,At):ne(q);la(e,At,Dt,to(e,At)),!_t&&e.cm&&e.cm.scrollIntoView({from:At.from,to:fi(At)});var Bt=[];pi(e,function(Lt,Ht){!Ht&&oe(Bt,Lt.history)==-1&&(go(Lt.history,At),Bt.push(Lt.history)),la(Lt,At,null,to(Lt,At))})},ze=F.changes.length-1;ze>=0;--ze){var ht=Ze(ze);if(ht)return ht.v}}function fo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Fr(xe(e.sel.ranges,function(g){return new Cn(yt(g.anchor.line+t,g.anchor.ch),yt(g.head.line+t,g.head.ch))}),e.sel.primIndex),e.cm){cn(e.cm,e.first,e.first-t,t);for(var s=e.cm.display,r=s.viewFrom;r<s.viewTo;r++)or(e.cm,r,"gutter")}}function la(e,t,s,r){if(e.cm&&!e.cm.curOp)return nr(e.cm,la)(e,t,s,r);if(t.to.line<e.first){fo(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 g=t.text.length-1-(e.first-t.from.line);fo(e,g),t={from:yt(e.first,0),to:yt(t.to.line+g,t.to.ch),text:[ne(t.text)],origin:t.origin}}var F=e.lastLine();t.to.line>F&&(t={from:t.from,to:yt(F,Ct(e,F).text.length),text:[t.text[0]],origin:t.origin}),t.removed=pn(e,t.from,t.to),s||(s=fs(e,t)),e.cm?El(e.cm,t,r):ms(e,t,r),ja(e,s,Ae),e.cantEdit&&Wa(e,yt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,s){var r=e.doc,g=e.display,F=t.from,X=t.to,q=!1,ee=F.line;e.options.lineWrapping||(ee=Pt(Xn(Ct(r,F.line))),r.iter(ee,X.line+1,function(ze){if(ze==g.maxLine)return q=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Se(e),ms(r,t,s,Kt(e)),e.options.lineWrapping||(r.iter(ee,F.line+t.text.length,function(ze){var ht=zr(ze);ht>g.maxLineLength&&(g.maxLine=ze,g.maxLineLength=ht,g.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),pr(r,F.line),aa(e,400);var re=t.text.length-(X.line-F.line)-1;t.full?cn(e):F.line==X.line&&t.text.length==1&&!Qs(e.doc,t)?or(e,F.line,"text"):cn(e,F.line,X.line+1,re);var we=ge(e,"changes"),Le=ge(e,"change");if(Le||we){var Ze={from:F,to:X,text:t.text,removed:t.removed,origin:t.origin};Le&&En(e,"change",e,Ze),we&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ze)}e.display.selForContextMenu=null}function Ni(e,t,s,r,g){var F;r||(r=s),Vt(r,s)<0&&(F=[r,s],s=F[0],r=F[1]),typeof t=="string"&&(t=e.splitLines(t)),Pi(e,{from:s,to:r,text:t,origin:g})}function po(e,t,s,r){s<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function mo(e,t,s,r){for(var g=0;g<e.length;++g){var F=e[g],X=!0;if(F.ranges){F.copied||(F=e[g]=F.deepCopy(),F.copied=!0);for(var q=0;q<F.ranges.length;q++)po(F.ranges[q].anchor,t,s,r),po(F.ranges[q].head,t,s,r);continue}for(var ee=0;ee<F.changes.length;++ee){var re=F.changes[ee];if(s<re.from.line)re.from=yt(re.from.line+r,re.from.ch),re.to=yt(re.to.line+r,re.to.ch);else if(t<=re.to.line){X=!1;break}}X||(e.splice(0,g+1),g=0)}}function go(e,t){var s=t.from.line,r=t.to.line,g=t.text.length-(r-s)-1;mo(e.done,s,r,g),mo(e.undone,s,r,g)}function ua(e,t,s,r){var g=t,F=t;return typeof t=="number"?F=Ct(e,Q(e,t)):g=Pt(t),g==null?null:(r(F,g)&&e.cm&&or(e.cm,g,s),F)}function ca(e){this.lines=e,this.parent=null;for(var t=0,s=0;s<e.length;++s)e[s].parent=this,t+=e[s].height;this.height=t}ca.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var s=e,r=e+t;s<r;++s){var g=this.lines[s];this.height-=g.height,Gt(g),En(g,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,s){this.height+=s,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,s){for(var r=e+t;e<r;++e)if(s(this.lines[e]))return!0}};function da(e){this.children=e;for(var t=0,s=0,r=0;r<e.length;++r){var g=e[r];t+=g.chunkSize(),s+=g.height,g.parent=this}this.size=t,this.height=s,this.parent=null}da.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var s=0;s<this.children.length;++s){var r=this.children[s],g=r.chunkSize();if(e<g){var F=Math.min(t,g-e),X=r.height;if(r.removeInner(e,F),this.height-=X-r.height,g==F&&(this.children.splice(s--,1),r.parent=null),(t-=F)==0)break;e=0}else e-=g}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ca))){var q=[];this.collapse(q),this.children=[new ca(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,s){this.size+=t.length,this.height+=s;for(var r=0;r<this.children.length;++r){var g=this.children[r],F=g.chunkSize();if(e<=F){if(g.insertInner(e,t,s),g.lines&&g.lines.length>50){for(var X=g.lines.length%25+25,q=X;q<g.lines.length;){var ee=new ca(g.lines.slice(q,q+=25));g.height-=ee.height,this.children.splice(++r,0,ee),ee.parent=this}g.lines=g.lines.slice(0,X),this.maybeSpill()}break}e-=F}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),s=new da(t);if(e.parent){e.size-=s.size,e.height-=s.height;var g=oe(e.parent.children,e);e.parent.children.splice(g+1,0,s)}else{var r=new da(e.children);r.parent=e,e.children=[r,s],e=r}s.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,s){for(var r=0;r<this.children.length;++r){var g=this.children[r],F=g.chunkSize();if(e<F){var X=Math.min(t,F-e);if(g.iterN(e,X,s))return!0;if((t-=X)==0)break;e=0}else e-=F}}};var ha=function(e,t,s){if(s)for(var r in s)s.hasOwnProperty(r)&&(this[r]=s[r]);this.doc=e,this.node=t};ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,s=this.line,r=Pt(s);if(r==null||!t)return;for(var g=0;g<t.length;++g)t[g]==this&&t.splice(g--,1);t.length||(s.widgets=null);var F=li(this);zt(s,Math.max(0,s.height-F)),e&&(Mr(e,function(){vo(e,s,-F),or(e,r,"widget")}),En(e,"lineWidgetCleared",e,this,r))},ha.prototype.changed=function(){var e=this,t=this.height,s=this.doc.cm,r=this.line;this.height=null;var g=li(this)-t;if(!g)return;Dr(this.doc,r)||zt(r,r.height+g),s&&Mr(s,function(){s.curOp.forceUpdate=!0,vo(s,r,g),En(s,"lineWidgetChanged",s,e,Pt(r))})},Ee(ha);function vo(e,t,s){_r(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&os(e,s)}function _l(e,t,s,r){var g=new ha(e,s,r),F=e.cm;return F&&g.noHScroll&&(F.display.alignWidgets=!0),ua(e,t,"widget",function(X){var q=X.widgets||(X.widgets=[]);if(g.insertAt==null?q.push(g):q.splice(Math.min(q.length-1,Math.max(0,g.insertAt)),0,g),g.line=X,F&&!Dr(e,X)){var ee=_r(X)<e.scrollTop;zt(X,X.height+li(g)),ee&&os(F,g.height),F.curOp.forceUpdate=!0}return!0}),F&&En(F,"lineWidgetAdded",F,g,typeof t=="number"?t:Pt(t)),g}var yo=0,mi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yo};mi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&xi(e),ge(this,"clear")){var s=this.find();s&&En(this,"clear",s.from,s.to)}for(var r=null,g=null,F=0;F<this.lines.length;++F){var X=this.lines[F],q=Yn(X.markedSpans,this);e&&!this.collapsed?or(e,Pt(X),"text"):e&&(q.to!=null&&(g=Pt(X)),q.from!=null&&(r=Pt(X))),X.markedSpans=Wr(X.markedSpans,q),q.from==null&&this.collapsed&&!Dr(this.doc,X)&&e&&zt(X,It(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var re=Xn(this.lines[ee]),we=zr(re);we>e.display.maxLineLength&&(e.display.maxLine=re,e.display.maxLineLength=we,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&cn(e,r,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&so(e.doc)),e&&En(e,"markerCleared",e,this,r,g),t&&Ti(e),this.parent&&this.parent.clear()},mi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var s,r,g=0;g<this.lines.length;++g){var F=this.lines[g],X=Yn(F.markedSpans,this);if(X.from!=null&&(s=yt(t?F:Pt(F),X.from),e==-1))return s;if(X.to!=null&&(r=yt(t?F:Pt(F),X.to),e==1))return r}return s&&{from:s,to:r}},mi.prototype.changed=function(){var e=this,t=this.find(-1,!0),s=this,r=this.doc.cm;if(!t||!r)return;Mr(r,function(){var g=t.line,F=Pt(t.line),X=ai(r,F);if(X&&(Ta(X),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Dr(s.doc,g)&&s.height!=null){var q=s.height;s.height=null;var ee=li(s)-q;ee&&zt(g,g.height+ee)}En(r,"markerChanged",r,e)})},mi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},mi.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ee(mi);function Ui(e,t,s,r,g){if(r&&r.shared)return xl(e,t,s,r,g);if(e.cm&&!e.cm.curOp)return nr(e.cm,Ui)(e,t,s,r,g);var F=new mi(e,g),X=Vt(t,s);if(r&&w(r,F,!1),X>0||X==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=A("span",[F.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(jn(e,t.line,t,s,F)||t.line!=s.line&&jn(e,s.line,t,s,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ar()}F.addToHistory&&$s(e,{from:t,to:s,origin:"markText"},e.sel,NaN);var q=t.line,ee=e.cm,re;if(e.iter(q,s.line+1,function(Le){ee&&F.collapsed&&!ee.options.lineWrapping&&Xn(Le)==ee.display.maxLine&&(re=!0),F.collapsed&&q!=t.line&&zt(Le,0),Pr(Le,new Cr(F,q==t.line?t.ch:null,q==s.line?s.ch:null)),++q}),F.collapsed&&e.iter(t.line,s.line+1,function(Le){Dr(e,Le)&&zt(Le,0)}),F.clearOnEnter&&Oe(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(cr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++yo,F.atomic=!0),ee){if(re&&(ee.curOp.updateMaxLine=!0),F.collapsed)cn(ee,t.line,s.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var we=t.line;we<=s.line;we++)or(ee,we,"text");F.atomic&&so(ee.doc),En(ee,"markerAdded",ee,F)}return F}var fa=function(e,t){this.markers=e,this.primary=t;for(var s=0;s<e.length;++s)e[s].parent=this};fa.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();En(this,"clear")},fa.prototype.find=function(e,t){return this.primary.find(e,t)},Ee(fa);function xl(e,t,s,r,g){r=w(r),r.shared=!1;var F=[Ui(e,t,s,r,g)],X=F[0],q=r.widgetNode;return pi(e,function(ee){q&&(r.widgetNode=q.cloneNode(!0)),F.push(Ui(ee,L(ee,t),L(ee,s),r,g));for(var re=0;re<ee.linked.length;++re)if(ee.linked[re].isParent)return;X=ne(F)}),new fa(F,X)}function bo(e){return e.findMarks(yt(e.first,0),e.clipPos(yt(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var s=0;s<t.length;s++){var r=t[s],g=r.find(),F=e.clipPos(g.from),X=e.clipPos(g.to);if(Vt(F,X)){var q=Ui(e,F,X,r.primary,r.primary.type);r.markers.push(q),q.parent=r}}}function wl(e){for(var t=function(r){var g=e[r],F=[g.primary.doc];pi(g.primary.doc,function(ee){return F.push(ee)});for(var X=0;X<g.markers.length;X++){var q=g.markers[X];oe(F,q.doc)==-1&&(q.parent=null,g.markers.splice(X--,1))}},s=0;s<e.length;s++)t(s)}var Sl=0,xr=function(e,t,s,r,g){if(!(this instanceof xr))return new xr(e,t,s,r,g);s==null&&(s=0),da.call(this,[new ca([new sr("",null)])]),this.first=s,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=s;var F=yt(s,0);this.sel=hi(F),this.history=new Ua(null),this.id=++Sl,this.modeOption=t,this.lineSep=r,this.direction=g=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ms(this,{from:F,to:F,text:e}),hr(this,hi(F),Ae)};xr.prototype=He(da.prototype,{constructor:xr,iter:function(e,t,s){s?this.iterN(e-this.first,t-e,s):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var s=0,r=0;r<t.length;++r)s+=t[r].height;this.insertInner(e-this.first,t,s)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Rt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:rr(function(e){var t=yt(this.first,0),s=this.first+this.size-1;Pi(this,{from:t,to:yt(s,Ct(this,s).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ta(this.cm,0,0),hr(this,hi(t),Ae)}),replaceRange:function(e,t,s,r){t=L(this,t),s=s?L(this,s):t,Ni(this,e,t,s,r)},getRange:function(e,t,s){var r=pn(this,L(this,e),L(this,t));return s===!1?r:r.join(s||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(yn(this,e))return Ct(this,e)},getLineNumber:function(e){return Pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ct(this,e)),Xn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return L(this,e)},getCursor:function(e){var t=this.sel.primary(),s;return e==null||e=="head"?s=t.head:e=="anchor"?s=t.anchor:e=="end"||e=="to"||e===!1?s=t.to():s=t.from(),s},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:rr(function(e,t,s){ro(this,L(this,typeof e=="number"?yt(e,t||0):e),null,s)}),setSelection:rr(function(e,t,s){ro(this,L(this,e),L(this,t||e),s)}),extendSelection:rr(function(e,t,s){Fa(this,L(this,e),t&&L(this,t),s)}),extendSelections:rr(function(e,t){no(this,G(this,e),t)}),extendSelectionsBy:rr(function(e,t){var s=xe(this.sel.ranges,e);no(this,G(this,s),t)}),setSelections:rr(function(e,t,s){if(!e.length)return;for(var r=[],g=0;g<e.length;g++)r[g]=new Cn(L(this,e[g].anchor),L(this,e[g].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),hr(this,Yr(this.cm,r,t),s)}),addSelection:rr(function(e,t,s){var r=this.sel.ranges.slice(0);r.push(new Cn(L(this,e),L(this,t||e))),hr(this,Yr(this.cm,r,r.length-1),s)}),getSelection:function(e){for(var t=this.sel.ranges,s,r=0;r<t.length;r++){var g=pn(this,t[r].from(),t[r].to());s=s?s.concat(g):g}return e===!1?s:s.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],s=this.sel.ranges,r=0;r<s.length;r++){var g=pn(this,s[r].from(),s[r].to());e!==!1&&(g=g.join(e||this.lineSeparator())),t[r]=g}return t},replaceSelection:function(e,t,s){for(var r=[],g=0;g<this.sel.ranges.length;g++)r[g]=e;this.replaceSelections(r,t,s||"+input")},replaceSelections:rr(function(e,t,s){for(var r=[],g=this.sel,F=0;F<g.ranges.length;F++){var X=g.ranges[F];r[F]={from:X.from(),to:X.to(),text:this.splitLines(e[F]),origin:s}}for(var q=t&&t!="end"&&hl(this,r,t),ee=r.length-1;ee>=0;ee--)Pi(this,r[ee]);q?io(this,q):this.cm&&Di(this.cm)}),undo:rr(function(){Ha(this,"undo")}),redo:rr(function(){Ha(this,"redo")}),undoSelection:rr(function(){Ha(this,"undo",!0)}),redoSelection:rr(function(){Ha(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,s=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var g=0;g<e.undone.length;g++)e.undone[g].ranges||++s;return{undo:t,redo:s}},clearHistory:function(){var e=this;this.history=new Ua(this.history.maxGeneration),pi(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:Mi(this.history.done),undone:Mi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ua(this.history.maxGeneration);t.done=Mi(e.done.slice(0),null,!0),t.undone=Mi(e.undone.slice(0),null,!0)},setGutterMarker:rr(function(e,t,s){return ua(this,e,"gutter",function(r){var g=r.gutterMarkers||(r.gutterMarkers={});return g[t]=s,!s&&le(g)&&(r.gutterMarkers=null),!0})}),clearGutter:rr(function(e){var t=this;this.iter(function(s){s.gutterMarkers&&s.gutterMarkers[e]&&ua(t,s,"gutter",function(){return s.gutterMarkers[e]=null,le(s.gutterMarkers)&&(s.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!yn(this,e))return null;if(t=e,e=Ct(this,e),!e)return null}else if(t=Pt(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:rr(function(e,t,s){return ua(this,e,t=="gutter"?"gutter":"class",function(r){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[g])r[g]=s;else{if(O(s).test(r[g]))return!1;r[g]+=" "+s}return!0})}),removeLineClass:rr(function(e,t,s){return ua(this,e,t=="gutter"?"gutter":"class",function(r){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",F=r[g];if(F)if(s==null)r[g]=null;else{var X=F.match(O(s));if(!X)return!1;var q=X.index+X[0].length;r[g]=F.slice(0,X.index)+(!X.index||q==F.length?"":" ")+F.slice(q)||null}else return!1;return!0})}),addLineWidget:rr(function(e,t,s){return _l(this,e,t,s)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,s){return Ui(this,L(this,e),L(this,t),s,s&&s.type||"range")},setBookmark:function(e,t){var s={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=L(this,e),Ui(this,e,e,s,"bookmark")},findMarksAt:function(e){e=L(this,e);var t=[],s=Ct(this,e.line).markedSpans;if(s)for(var r=0;r<s.length;++r){var g=s[r];(g.from==null||g.from<=e.ch)&&(g.to==null||g.to>=e.ch)&&t.push(g.marker.parent||g.marker)}return t},findMarks:function(e,t,s){e=L(this,e),t=L(this,t);var r=[],g=e.line;return this.iter(e.line,t.line+1,function(F){var X=F.markedSpans;if(X)for(var q=0;q<X.length;q++){var ee=X[q];!(ee.to!=null&&g==e.line&&e.ch>=ee.to||ee.from==null&&g!=e.line||ee.from!=null&&g==t.line&&ee.from>=t.ch)&&(!s||s(ee.marker))&&r.push(ee.marker.parent||ee.marker)}++g}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var s=t.markedSpans;if(s)for(var r=0;r<s.length;++r)s[r].from!=null&&e.push(s[r].marker)}),e},posFromIndex:function(e){var t,s=this.first,r=this.lineSeparator().length;return this.iter(function(g){var F=g.text.length+r;if(F>e)return t=e,!0;e-=F,++s}),L(this,yt(s,t))},indexFromPos:function(e){e=L(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var s=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+s}),t},copy:function(e){var t=new xr(Rt(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,s=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<s&&(s=e.to);var r=new xr(Rt(this,t,s),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,bo(this)),r},unlinkDoc:function(e){if(e instanceof Nn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var s=this.linked[t];if(s.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(bo(this));break}if(e.history==this.history){var r=[e.id];pi(e,function(g){return r.push(g.id)},!0),e.history=new Ua(null),e.history.done=Mi(this.history.done,r),e.history.undone=Mi(this.history.undone,r)}},iterLinkedDocs:function(e){pi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):qe(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:rr(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)})}),xr.prototype.eachLine=xr.prototype.iter;var Eo=0;function Al(e){var t=this;if(_o(t),Xe(t,e)||ei(t.display,e))return;ie(e),K&&(Eo=+new Date);var s=vn(t,e,!0),r=e.dataTransfer.files;if(!s||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var g=r.length,F=Array(g),X=0,q=function(){++X==g&&nr(t,function(){s=L(t.doc,s);var ze={from:s,to:s,text:t.doc.splitLines(F.filter(function(ht){return ht!=null}).join(t.doc.lineSeparator())),origin:"paste"};Pi(t.doc,ze),io(t.doc,hi(L(t.doc,s),L(t.doc,fi(ze))))})()},ee=function(ze,ht){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,ze.type)==-1){q();return}var _t=new FileReader;_t.onerror=function(){return q()},_t.onload=function(){var At=_t.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(At)){q();return}F[ht]=At,q()},_t.readAsText(ze)},re=0;re<r.length;re++)ee(r[re],re);else{if(t.state.draggingText&&t.doc.sel.contains(s)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var we=e.dataTransfer.getData("Text");if(we){var Le;if(t.state.draggingText&&!t.state.draggingText.copy&&(Le=t.listSelections()),ja(t.doc,hi(s,s)),Le)for(var Ze=0;Ze<Le.length;++Ze)Ni(t.doc,"",Le[Ze].anchor,Le[Ze].head,"drag");t.replaceSelection(we,"around","paste"),t.display.input.focus()}}catch(ze){}}}function Cl(e,t){if(K&&(!e.state.draggingText||+new Date-Eo<100)){ve(t);return}if(Xe(e,t)||ei(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f){var s=h("img",null,null,"position: fixed; left: 0; top: 0;");s.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(s.width=s.height=1,e.display.wrapper.appendChild(s),s._top=s.offsetTop),t.dataTransfer.setDragImage(s,0,0),m&&s.parentNode.removeChild(s)}}function Ol(e,t){var s=vn(e,t);if(!s)return;var r=document.createDocumentFragment();Ls(e,s,r),e.display.dragCursor||(e.display.dragCursor=h("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),p(e.display.dragCursor,r)}function _o(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function xo(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),s=[],r=0;r<t.length;r++){var g=t[r].CodeMirror;g&&s.push(g)}s.length&&s[0].operation(function(){for(var F=0;F<s.length;F++)e(s[F])})}var To=!1;function Rl(){if(To)return;Il(),To=!0}function Il(){var e;Oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,xo(Dl)},100))}),Oe(window,"blur",function(){return xo(Ii)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var gi={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"},pa=0;pa<10;pa++)gi[pa+48]=gi[pa+96]=String(pa);for(var Ka=65;Ka<=90;Ka++)gi[Ka]=String.fromCharCode(Ka);for(var ma=1;ma<=12;ma++)gi[ma+111]=gi[ma+63235]="F"+ma;var si={};si.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"},si.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"},si.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"},si.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"]},si.default=a?si.macDefault:si.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var s,r,g,F,X=0;X<t.length-1;X++){var q=t[X];if(/^(cmd|meta|m)$/i.test(q))F=!0;else if(/^a(lt)?$/i.test(q))s=!0;else if(/^(c|ctrl|control)$/i.test(q))r=!0;else if(/^s(hift)?$/i.test(q))g=!0;else throw new Error("Unrecognized modifier name: "+q)}return s&&(e="Alt-"+e),r&&(e="Ctrl-"+e),F&&(e="Cmd-"+e),g&&(e="Shift-"+e),e}function Ml(e){var t={};for(var s in e)if(e.hasOwnProperty(s)){var r=e[s];if(/^(name|fallthrough|(de|at)tach)$/.test(s))continue;if(r=="..."){delete e[s];continue}for(var g=xe(s.split(" "),Ll),F=0;F<g.length;F++){var X=void 0,q=void 0;F==g.length-1?(q=g.join(" "),X=r):(q=g.slice(0,F+1).join(" "),X="...");var ee=t[q];if(!ee)t[q]=X;else if(ee!=X)throw new Error("Inconsistent bindings for "+q)}delete e[s]}for(var re in t)e[re]=t[re];return e}function Bi(e,t,s,r){t=Ga(t);var g=t.call?t.call(e,r):t[e];if(g===!1)return"nothing";if(g==="...")return"multi";if(g!=null&&s(g))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Bi(e,t.fallthrough,s,r);for(var F=0;F<t.fallthrough.length;F++){var X=Bi(e,t.fallthrough[F],s,r);if(X)return X}}}function wo(e){var t=typeof e=="string"?e:gi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function So(e,t,s){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!s&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Ao(e,t){if(m&&e.keyCode==34&&e.char)return!1;var s=gi[e.keyCode];return s==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(s=e.code),So(s,e,t))}function Ga(e){return typeof e=="string"?si[e]:e}function Fi(e,t){for(var s=e.doc.sel.ranges,r=[],g=0;g<s.length;g++){for(var F=t(s[g]);r.length&&Vt(F.from,ne(r).to)<=0;){var X=r.pop();if(Vt(X.from,F.from)<0){F.from=X.from;break}}r.push(F)}Mr(e,function(){for(var q=r.length-1;q>=0;q--)Ni(e.doc,"",r[q].from,r[q].to,"+delete");Di(e)})}function bs(e,t,s){var r=De(e.text,t+s,s);return r<0||r>e.text.length?null:r}function Es(e,t,s){var r=bs(e,t.ch,s);return r==null?null:new yt(t.line,r,s<0?"after":"before")}function _s(e,t,s,r,g){if(e){t.doc.direction=="rtl"&&(g=-g);var F=bt(s,t.doc.direction);if(F){var X=g<0?ne(F):F[0],q=g<0==(X.level==1),ee=q?"after":"before",re;if(X.level>0||t.doc.direction=="rtl"){var we=ui(t,s);re=g<0?s.text.length-1:0;var Le=Ur(t,we,re).top;re=tt(function(Ze){return Ur(t,we,Ze).top==Le},g<0==(X.level==1)?X.from:X.to-1,re),ee=="before"&&(re=bs(s,re,1))}else re=g<0?X.to:X.from;return new yt(r,re,ee)}}return new yt(r,g<0?s.text.length:0,g<0?"before":"after")}function kl(e,t,s,r){var g=bt(t,e.doc.direction);if(!g)return Es(t,s,r);s.ch>=t.text.length?(s.ch=t.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var F=ut(g,s.ch,s.sticky),X=g[F];if(e.doc.direction=="ltr"&&X.level%2==0&&(r>0?X.to>s.ch:X.from<s.ch))return Es(t,s,r);var q=function(Dt,Bt){return bs(t,Dt instanceof yt?Dt.ch:Dt,Bt)},ee,re=function(Dt){return e.options.lineWrapping?(ee=ee||ui(e,t),Wt(e,t,ee,Dt)):{begin:0,end:t.text.length}},we=re(s.sticky=="before"?q(s,-1):s.ch);if(e.doc.direction=="rtl"||X.level==1){var Le=X.level==1==r<0,Ze=q(s,Le?1:-1);if(Ze!=null&&(Le?Ze<=X.to&&Ze<=we.end:Ze>=X.from&&Ze>=we.begin)){var ze=Le?"before":"after";return new yt(s.line,Ze,ze)}}var ht=function(Dt,Bt,Lt){for(var Ht=function(Dn,ir){return ir?new yt(s.line,q(Dn,1),"before"):new yt(s.line,Dn,"after")};Dt>=0&&Dt<g.length;Dt+=Bt){var nn=g[Dt],Zt=Bt>0==(nn.level!=1),fn=Zt?Lt.begin:q(Lt.end,-1);if(nn.from<=fn&&fn<nn.to)return Ht(fn,Zt);if(fn=Zt?nn.from:q(nn.to,-1),Lt.begin<=fn&&fn<Lt.end)return Ht(fn,Zt)}},_t=ht(F+r,r,we);if(_t)return _t;var At=r>0?we.end:q(we.begin,-1);return At!=null&&!(r>0&&At==t.text.length)&&(_t=ht(r>0?0:g.length-1,r,re(At)),_t)?_t:null}var ga={selectAll:uo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ae)},killLine:function(e){return Fi(e,function(t){if(t.empty()){var s=Ct(e.doc,t.head.line).text.length;return t.head.ch==s&&t.head.line<e.lastLine()?{from:t.head,to:yt(t.head.line+1,0)}:{from:t.head,to:yt(t.head.line,s)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Fi(e,function(t){return{from:yt(t.from().line,0),to:L(e.doc,yt(t.to().line+1,0))}})},delLineLeft:function(e){return Fi(e,function(t){return{from:yt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Fi(e,function(t){var s=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:s},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Fi(e,function(t){var s=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:s},"div");return{from:t.from(),to:r}})},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(yt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(yt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Co(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Oo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var s=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:s},"div")},Me)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var s=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:s},"div")},Me)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var s=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:s},"div");return r.ch<e.getLine(r.line).search(/\S/)?Oo(e,t.head):r},Me)},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=[],s=e.listSelections(),r=e.options.tabSize,g=0;g<s.length;g++){var F=s[g].from(),X=Y(e.getLine(F.line),F.ch,r);t.push(fe(r-X%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Mr(e,function(){for(var t=e.listSelections(),s=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var g=t[r].head,F=Ct(e.doc,g.line).text;if(F){if(g.ch==F.length&&(g=new yt(g.line,g.ch-1)),g.ch>0)g=new yt(g.line,g.ch+1),e.replaceRange(F.charAt(g.ch-1)+F.charAt(g.ch-2),yt(g.line,g.ch-2),g,"+transpose");else if(g.line>e.doc.first){var X=Ct(e.doc,g.line-1).text;X&&(g=new yt(g.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),yt(g.line-1,X.length-1),g,"+transpose"))}}s.push(new Cn(g,g))}e.setSelections(s)})},newlineAndIndent:function(e){return Mr(e,function(){for(var t=e.listSelections(),s=t.length-1;s>=0;s--)e.replaceRange(e.doc.lineSeparator(),t[s].anchor,t[s].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Di(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Co(e,t){var s=Ct(e.doc,t),r=Xn(s);return r!=s&&(t=Pt(r)),_s(!0,e,r,t,1)}function Pl(e,t){var s=Ct(e.doc,t),r=Kr(s);return r!=s&&(t=Pt(r)),_s(!0,e,s,t,-1)}function Oo(e,t){var s=Co(e,t.line),r=Ct(e.doc,s.line),g=bt(r,e.doc.direction);if(!g||g[0].level==0){var F=Math.max(s.ch,r.text.search(/\S/)),X=t.line==s.line&&t.ch<=F&&t.ch;return yt(s.line,X?0:F,s.sticky)}return s}function za(e,t,s){if(typeof t=="string"&&(t=ga[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s&&(e.display.shift=!1),g=t(e)!=Fe}finally{e.display.shift=r,e.state.suppressEdits=!1}return g}function Nl(e,t,s){for(var r=0;r<e.state.keyMaps.length;r++){var g=Bi(t,e.state.keyMaps[r],s,e);if(g)return g}return e.options.extraKeys&&Bi(t,e.options.extraKeys,s,e)||Bi(t,e.options.keyMap,s,e)}var Ul=new $;function va(e,t,s,r){var g=e.state.keySeq;if(g){if(wo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==g&&(e.state.keySeq=null,e.display.input.reset())}),Ro(e,g+" "+t,s,r))return!0}return Ro(e,t,s,r)}function Ro(e,t,s,r){var g=Nl(e,t,r);return g=="multi"&&(e.state.keySeq=t),g=="handled"&&En(e,"keyHandled",e,t,s),(g=="handled"||g=="multi")&&(ie(s),is(e)),!!g}function Io(e,t){var s=Ao(t,!0);return s?t.shiftKey&&!e.state.keySeq?va(e,"Shift-"+s,t,function(r){return za(e,r,!0)})||va(e,s,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return za(e,r)}):va(e,s,t,function(r){return za(e,r)}):!1}function Bl(e,t,s){return va(e,"'"+s+"'",t,function(r){return za(e,r,!0)})}var xs=null;function Do(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),Xe(t,e))return;K&&H<11&&e.keyCode==27&&(e.returnValue=!1);var s=e.keyCode;t.display.shift=s==16||e.shiftKey;var r=Io(t,e);m&&(xs=r?s:null,!r&&s==88&&!Ue&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!a&&!r&&s==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),s==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;x(t,"CodeMirror-crosshair");function s(r){(r.keyCode==18||!r.altKey)&&(_(t,"CodeMirror-crosshair"),lt(document,"keyup",s),lt(document,"mouseover",s))}Oe(document,"keyup",s),Oe(document,"mouseover",s)}function Lo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Xe(this,e)}function Mo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ei(t.display,e)||Xe(t,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var s=e.keyCode,r=e.charCode;if(m&&s==xs){xs=null,ie(e);return}if(m&&(!e.which||e.which<10)&&Io(t,e))return;var g=String.fromCharCode(r==null?s:r);if(g=="\b")return;if(Bl(t,e,g))return;t.display.input.onKeyPress(e)}var jl=400,Ts=function(e,t,s){this.time=e,this.pos=t,this.button=s};Ts.prototype.compare=function(e,t,s){return this.time+jl>e&&Vt(t,this.pos)==0&&s==this.button};var ya,ba;function Wl(e,t){var s=+new Date;return ba&&ba.compare(s,e,t)?(ya=ba=null,"triple"):ya&&ya.compare(s,e,t)?(ba=new Ts(s,e,t),ya=null,"double"):(ya=new Ts(s,e,t),ba=null,"single")}function ko(e){var t=this,s=t.display;if(Xe(t,e)||s.activeTouch&&s.input.supportsTouch())return;if(s.input.ensurePolled(),s.shift=e.shiftKey,ei(s,e)){n||(s.scroller.draggable=!1,setTimeout(function(){return s.scroller.draggable=!0},100));return}if(ws(t,e))return;var r=vn(t,e),g=Ge(e),F=r?Wl(r,g):"single";if(window.focus(),g==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,g,r,F,e))return;g==1?r?Gl(t,r,F,e):Te(e)==s.scroller&&ie(e):g==2?(r&&Fa(t.doc,r),setTimeout(function(){return s.input.focus()},20)):g==3&&(I?t.display.input.onContextMenu(e):ks(t))}function Hl(e,t,s,r,g){var F="Click";return r=="double"?F="Double"+F:r=="triple"&&(F="Triple"+F),F=(t==1?"Left":t==2?"Middle":"Right")+F,va(e,So(F,g),g,function(X){if(typeof X=="string"&&(X=ga[X]),!X)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=X(e,s)!=Fe}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,s){var r=e.getOption("configureMouse"),g=r?r(e,t,s):{};if(g.unit==null){var F=i?s.shiftKey&&s.metaKey:s.altKey;g.unit=F?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(g.extend==null||e.doc.extend)&&(g.extend=e.doc.extend||s.shiftKey),g.addNew==null&&(g.addNew=a?s.metaKey:s.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(a?s.altKey:s.ctrlKey)),g}function Gl(e,t,s,r){K?setTimeout(B(Ms,e),0):e.curOp.focus=P();var g=Kl(e,s,r),F=e.doc.sel,X;e.options.dragDrop&&ot&&!e.isReadOnly()&&s=="single"&&(X=F.contains(t))>-1&&(Vt((X=F.ranges[X]).from(),t)<0||t.xRel>0)&&(Vt(X.to(),t)>0||t.xRel<0)?zl(e,r,t,g):Vl(e,r,t,g)}function zl(e,t,s,r){var g=e.display,F=!1,X=nr(e,function(re){n&&(g.scroller.draggable=!1),e.state.draggingText=!1,lt(g.wrapper.ownerDocument,"mouseup",X),lt(g.wrapper.ownerDocument,"mousemove",q),lt(g.scroller,"dragstart",ee),lt(g.scroller,"drop",X),F||(ie(re),r.addNew||Fa(e.doc,s,null,null,r.extend),n&&!f||K&&H==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),q=function(re){F=F||Math.abs(t.clientX-re.clientX)+Math.abs(t.clientY-re.clientY)>=10},ee=function(){return F=!0};n&&(g.scroller.draggable=!0),e.state.draggingText=X,X.copy=!r.moveOnDrag,g.scroller.dragDrop&&g.scroller.dragDrop(),Oe(g.wrapper.ownerDocument,"mouseup",X),Oe(g.wrapper.ownerDocument,"mousemove",q),Oe(g.scroller,"dragstart",ee),Oe(g.scroller,"drop",X),ks(e),setTimeout(function(){return g.input.focus()},20)}function Po(e,t,s){if(s=="char")return new Cn(t,t);if(s=="word")return e.findWordAt(t);if(s=="line")return new Cn(yt(t.line,0),L(e.doc,yt(t.line+1,0)));var r=s(e,t);return new Cn(r.from,r.to)}function Vl(e,t,s,r){var g=e.display,F=e.doc;ie(t);var X,q,ee=F.sel,re=ee.ranges;if(r.addNew&&!r.extend?(q=F.sel.contains(s),q>-1?X=re[q]:X=new Cn(s,s)):(X=F.sel.primary(),q=F.sel.primIndex),r.unit=="rectangle")r.addNew||(X=new Cn(s,s)),s=vn(e,t,!0,!0),q=-1;else{var we=Po(e,s,r.unit);r.extend?X=vs(X,we.anchor,we.head,r.extend):X=we}r.addNew?q==-1?(q=re.length,hr(F,Yr(e,re.concat([X]),q),{scroll:!1,origin:"*mouse"})):re.length>1&&re[q].empty()&&r.unit=="char"&&!r.extend?(hr(F,Yr(e,re.slice(0,q).concat(re.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),ee=F.sel):ys(F,q,X,Re):(q=0,hr(F,new Fr([X],0),Re),ee=F.sel);var Le=s;function Ze(Lt){if(Vt(Le,Lt)==0)return;if(Le=Lt,r.unit=="rectangle"){for(var Ht=[],nn=e.options.tabSize,Zt=Y(Ct(F,s.line).text,s.ch,nn),fn=Y(Ct(F,Lt.line).text,Lt.ch,nn),Dn=Math.min(Zt,fn),ir=Math.max(Zt,fn),Fn=Math.min(s.line,Lt.line),kr=Math.min(e.lastLine(),Math.max(s.line,Lt.line));Fn<=kr;Fn++){var Tr=Ct(F,Fn).text,Jn=Be(Tr,Dn,nn);Dn==ir?Ht.push(new Cn(yt(Fn,Jn),yt(Fn,Jn))):Tr.length>Jn&&Ht.push(new Cn(yt(Fn,Jn),yt(Fn,Be(Tr,ir,nn))))}Ht.length||Ht.push(new Cn(s,s)),hr(F,Yr(e,ee.ranges.slice(0,q).concat(Ht),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Lt)}else{var wr=X,lr=Po(e,Lt,r.unit),tr=wr.anchor,Zn;Vt(lr.anchor,tr)>0?(Zn=lr.head,tr=Vn(wr.from(),lr.anchor)):(Zn=lr.anchor,tr=Pn(wr.to(),lr.head));var Wn=ee.ranges.slice(0);Wn[q]=Yl(e,new Cn(L(F,tr),Zn)),hr(F,Yr(e,Wn,q),Re)}}var ze=g.wrapper.getBoundingClientRect(),ht=0;function _t(Lt){var Ht=++ht,nn=vn(e,Lt,!0,r.unit=="rectangle");if(!nn)return;if(Vt(nn,Le)!=0){e.curOp.focus=P(),Ze(nn);var Zt=Ma(g,F);(nn.line>=Zt.to||nn.line<Zt.from)&&setTimeout(nr(e,function(){ht==Ht&&_t(Lt)}),150)}else{var fn=Lt.clientY<ze.top?-20:Lt.clientY>ze.bottom?20:0;fn&&setTimeout(nr(e,function(){if(ht!=Ht)return;g.scroller.scrollTop+=fn,_t(Lt)}),50)}}function At(Lt){e.state.selectingText=!1,ht=Infinity,Lt&&(ie(Lt),g.input.focus()),lt(g.wrapper.ownerDocument,"mousemove",Dt),lt(g.wrapper.ownerDocument,"mouseup",Bt),F.history.lastSelOrigin=null}var Dt=nr(e,function(Lt){Lt.buttons===0||!Ge(Lt)?At(Lt):_t(Lt)}),Bt=nr(e,At);e.state.selectingText=Bt,Oe(g.wrapper.ownerDocument,"mousemove",Dt),Oe(g.wrapper.ownerDocument,"mouseup",Bt)}function Yl(e,t){var s=t.anchor,r=t.head,g=Ct(e.doc,s.line);if(Vt(s,r)==0&&s.sticky==r.sticky)return t;var F=bt(g);if(!F)return t;var X=ut(F,s.ch,s.sticky),q=F[X];if(q.from!=s.ch&&q.to!=s.ch)return t;var ee=X+(q.from==s.ch==(q.level!=1)?0:1);if(ee==0||ee==F.length)return t;var re;if(r.line!=s.line)re=(r.line-s.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var we=ut(F,r.ch,r.sticky),Le=we-X||(r.ch-s.ch)*(q.level==1?-1:1);we==ee-1||we==ee?re=Le<0:re=Le>0}var Ze=F[ee+(re?-1:0)],ze=re==(Ze.level==1),ht=ze?Ze.from:Ze.to,_t=ze?"after":"before";return s.ch==ht&&s.sticky==_t?t:new Cn(new yt(s.line,ht,_t),r)}function No(e,t,s,r){var g,F;if(t.touches)g=t.touches[0].clientX,F=t.touches[0].clientY;else try{g=t.clientX,F=t.clientY}catch(Ze){return!1}if(g>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ie(t);var X=e.display,q=X.lineDiv.getBoundingClientRect();if(F>q.bottom||!ge(e,s))return he(t);F-=q.top-X.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var re=X.gutters.childNodes[ee];if(re&&re.getBoundingClientRect().right>=g){var we=qt(e.doc,F),Le=e.display.gutterSpecs[ee];return Ke(e,s,e,we,Le.className,t),he(t)}}}function ws(e,t){return No(e,t,"gutterClick",!0)}function Uo(e,t){if(ei(e.display,t)||Xl(e,t))return;if(Xe(e,t,"contextmenu"))return;I||e.display.input.onContextMenu(t)}function Xl(e,t){return ge(e,"gutterContextMenu")?No(e,t,"gutterContextMenu",!1):!1}function Bo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ci(e)}var ji={toString:function(){return"CodeMirror.Init"}},Fo={},Va={};function Ql(e){var t=e.optionHandlers;function s(r,g,F,X){e.defaults[r]=g,F&&(t[r]=X?function(q,ee,re){re!=ji&&F(q,ee,re)}:F)}e.defineOption=s,e.Init=ji,s("value","",function(r,g){return r.setValue(g)},!0),s("mode",null,function(r,g){r.doc.modeOption=g,ps(r)},!0),s("indentUnit",2,ps,!0),s("indentWithTabs",!1),s("smartIndent",!0),s("tabSize",4,function(r){oa(r),ci(r),cn(r)},!0),s("lineSeparator",null,function(r,g){if(r.doc.lineSep=g,!g)return;var F=[],X=r.doc.first;r.doc.iter(function(ee){for(var re=0;;){var we=ee.text.indexOf(g,re);if(we==-1)break;re=we+g.length,F.push(yt(X,we))}X++});for(var q=F.length-1;q>=0;q--)Ni(r.doc,g,F[q],yt(F[q].line,F[q].ch+g.length))}),s("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,g,F){r.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),F!=ji&&r.refresh()}),s("specialCharPlaceholder",An,function(r){return r.refresh()},!0),s("electricChars",!0),s("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),s("spellcheck",!1,function(r,g){return r.getInputField().spellcheck=g},!0),s("autocorrect",!1,function(r,g){return r.getInputField().autocorrect=g},!0),s("autocapitalize",!1,function(r,g){return r.getInputField().autocapitalize=g},!0),s("rtlMoveVisually",!R),s("wholeLineUpdateBefore",!0),s("theme","default",function(r){Bo(r),sa(r)},!0),s("keyMap","default",function(r,g,F){var X=Ga(g),q=F!=ji&&Ga(F);q&&q.detach&&q.detach(r,X),X.attach&&X.attach(r,q||null)}),s("extraKeys",null),s("configureMouse",null),s("lineWrapping",!1,Zl,!0),s("gutters",[],function(r,g){r.display.gutterSpecs=hs(g,r.options.lineNumbers),sa(r)},!0),s("fixedGutter",!0,function(r,g){r.display.gutters.style.left=g?Qt(r.display)+"px":"0",r.refresh()},!0),s("coverGutterNextToScrollbar",!1,function(r){return Li(r)},!0),s("scrollbarStyle","native",function(r){js(r),Li(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),s("lineNumbers",!1,function(r,g){r.display.gutterSpecs=hs(r.options.gutters,g),sa(r)},!0),s("firstLineNumber",1,sa,!0),s("lineNumberFormatter",function(r){return r},sa,!0),s("showCursorWhenSelecting",!1,ea,!0),s("resetSelectionOnContextMenu",!0),s("lineWiseCopyCut",!0),s("pasteLinesPerSelection",!0),s("selectionsMayTouch",!1),s("readOnly",!1,function(r,g){g=="nocursor"&&(Ii(r),r.display.input.blur()),r.display.input.readOnlyChanged(g)}),s("screenReaderLabel",null,function(r,g){g=g===""?null:g,r.display.input.screenReaderLabelChanged(g)}),s("disableInput",!1,function(r,g){g||r.display.input.reset()},!0),s("dragDrop",!0,Jl),s("allowDropFileTypes",null),s("cursorBlinkRate",530),s("cursorScrollMargin",0),s("cursorHeight",1,ea,!0),s("singleCursorHeightPerLine",!0,ea,!0),s("workTime",100),s("workDelay",100),s("flattenSpans",!0,oa,!0),s("addModeClass",!1,oa,!0),s("pollInterval",100),s("undoDepth",200,function(r,g){return r.doc.history.undoDepth=g}),s("historyEventDelay",1250),s("viewportMargin",10,function(r){return r.refresh()},!0),s("maxHighlightLength",1e4,oa,!0),s("moveInputWithCursor",!0,function(r,g){g||r.display.input.resetPosition()}),s("tabindex",null,function(r,g){return r.display.input.getField().tabIndex=g||""}),s("autofocus",null),s("direction","ltr",function(r,g){return r.doc.setDirection(g)},!0),s("phrases",null)}function Jl(e,t,s){var r=s&&s!=ji;if(!t!=!r){var g=e.display.dragFunctions,F=t?Oe:lt;F(e.display.scroller,"dragstart",g.start),F(e.display.scroller,"dragenter",g.enter),F(e.display.scroller,"dragover",g.over),F(e.display.scroller,"dragleave",g.leave),F(e.display.scroller,"drop",g.drop)}}function Zl(e){e.options.lineWrapping?(x(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Jr(e)),Jt(e),cn(e),ci(e),setTimeout(function(){return Li(e)},100)}function Nn(e,t){var s=this;if(!(this instanceof Nn))return new Nn(e,t);this.options=t=t?w(t):{},w(Fo,t,!1);var r=t.value;typeof r=="string"?r=new xr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var g=new Nn.inputStyles[t.inputStyle](this),F=this.display=new cl(e,r,g,t);F.wrapper.CodeMirror=this,Bo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),js(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 $,keySeq:null,specialChars:null},t.autofocus&&!u&&F.input.focus(),K&&H<11&&setTimeout(function(){return s.display.input.reset(!0)},20),ql(this),Rl(),xi(this),this.curOp.forceUpdate=!0,Js(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){s.hasFocus()&&!s.state.focused&&as(s)},20):Ii(this);for(var X in Va)Va.hasOwnProperty(X)&&Va[X](this,t[X],ji);Ks(this),t.finishInit&&t.finishInit(this);for(var q=0;q<Ss.length;++q)Ss[q](this);Ti(this),n&&t.lineWrapping&&getComputedStyle(F.lineDiv).textRendering=="optimizelegibility"&&(F.lineDiv.style.textRendering="auto")}Nn.defaults=Fo,Nn.optionHandlers=Va;function ql(e){var t=e.display;Oe(t.scroller,"mousedown",nr(e,ko)),K&&H<11?Oe(t.scroller,"dblclick",nr(e,function(ee){if(Xe(e,ee))return;var re=vn(e,ee);if(!re||ws(e,ee)||ei(e.display,ee))return;ie(ee);var we=e.findWordAt(re);Fa(e.doc,we.anchor,we.head)})):Oe(t.scroller,"dblclick",function(ee){return Xe(e,ee)||ie(ee)}),Oe(t.scroller,"contextmenu",function(ee){return Uo(e,ee)}),Oe(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||Uo(e,ee)});var s,r={end:0};function g(){t.activeTouch&&(s=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function F(ee){if(ee.touches.length!=1)return!1;var re=ee.touches[0];return re.radiusX<=1&&re.radiusY<=1}function X(ee,re){if(re.left==null)return!0;var we=re.left-ee.left,Le=re.top-ee.top;return we*we+Le*Le>20*20}Oe(t.scroller,"touchstart",function(ee){if(!Xe(e,ee)&&!F(ee)&&!ws(e,ee)){t.input.ensurePolled(),clearTimeout(s);var re=+new Date;t.activeTouch={start:re,moved:!1,prev:re-r.end<=300?r:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Oe(t.scroller,"touchend",function(ee){var re=t.activeTouch;if(re&&!ei(t,ee)&&re.left!=null&&!re.moved&&new Date-re.start<300){var we=e.coordsChar(t.activeTouch,"page"),Le;!re.prev||X(re,re.prev)?Le=new Cn(we,we):!re.prev.prev||X(re,re.prev.prev)?Le=e.findWordAt(we):Le=new Cn(yt(we.line,0),L(e.doc,yt(we.line+1,0))),e.setSelection(Le.anchor,Le.head),e.focus(),ie(ee)}g()}),Oe(t.scroller,"touchcancel",g),Oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(na(e,t.scroller.scrollTop),Ei(e,t.scroller.scrollLeft,!0),Ke(e,"scroll",e))}),Oe(t.scroller,"mousewheel",function(ee){return Vs(e,ee)}),Oe(t.scroller,"DOMMouseScroll",function(ee){return Vs(e,ee)}),Oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){Xe(e,ee)||ve(ee)},over:function(ee){Xe(e,ee)||(Ol(e,ee),ve(ee))},start:function(ee){return Cl(e,ee)},drop:nr(e,Al),leave:function(ee){Xe(e,ee)||_o(e)}};var q=t.input.getField();Oe(q,"keyup",function(ee){return Lo.call(e,ee)}),Oe(q,"keydown",nr(e,Do)),Oe(q,"keypress",nr(e,Mo)),Oe(q,"focus",function(ee){return as(e,ee)}),Oe(q,"blur",function(ee){return Ii(e,ee)})}var Ss=[];Nn.defineInitHook=function(e){return Ss.push(e)};function Ea(e,t,s,r){var g=e.doc,F;s==null&&(s="add"),s=="smart"&&(g.mode.indent?F=St(e,t).state:s="prev");var X=e.options.tabSize,q=Ct(g,t),ee=Y(q.text,null,X);q.stateAfter&&(q.stateAfter=null);var re=q.text.match(/^\s*/)[0],we;if(!r&&!/\S/.test(q.text))we=0,s="not";else if(s=="smart"&&(we=g.mode.indent(F,q.text.slice(re.length),q.text),we==Fe||we>150)){if(!r)return;s="prev"}s=="prev"?t>g.first?we=Y(Ct(g,t-1).text,null,X):we=0:s=="add"?we=ee+e.options.indentUnit:s=="subtract"?we=ee-e.options.indentUnit:typeof s=="number"&&(we=ee+s),we=Math.max(0,we);var Le="",Ze=0;if(e.options.indentWithTabs)for(var ze=Math.floor(we/X);ze;--ze)Ze+=X,Le+=" ";if(Ze<we&&(Le+=fe(we-Ze)),Le!=re)return Ni(g,Le,yt(t,0),yt(t,re.length),"+input"),q.stateAfter=null,!0;for(var ht=0;ht<g.sel.ranges.length;ht++){var _t=g.sel.ranges[ht];if(_t.head.line==t&&_t.head.ch<re.length){var At=yt(t,re.length);ys(g,ht,new Cn(At,At));break}}}var Xr=null;function Ya(e){Xr=e}function As(e,t,s,r,g){var F=e.doc;e.display.shift=!1,r||(r=F.sel);var X=+new Date-200,q=g=="paste"||e.state.pasteIncoming>X,ee=qe(t),re=null;if(q&&r.ranges.length>1)if(Xr&&Xr.text.join(`
|
|
`)==t){if(r.ranges.length%Xr.text.length==0){re=[];for(var we=0;we<Xr.text.length;we++)re.push(F.splitLines(Xr.text[we]))}}else ee.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(re=xe(ee,function(Dt){return[Dt]}));for(var Le=e.curOp.updateInput,Ze=r.ranges.length-1;Ze>=0;Ze--){var ze=r.ranges[Ze],ht=ze.from(),_t=ze.to();ze.empty()&&(s&&s>0?ht=yt(ht.line,ht.ch-s):e.state.overwrite&&!q?_t=yt(_t.line,Math.min(Ct(F,_t.line).text.length,_t.ch+ne(ee).length)):q&&Xr&&Xr.lineWise&&Xr.text.join(`
|
|
`)==ee.join(`
|
|
`)&&(ht=_t=yt(ht.line,0)));var At={from:ht,to:_t,text:re?re[Ze%re.length]:ee,origin:g||(q?"paste":e.state.cutIncoming>X?"cut":"+input")};Pi(e.doc,At),En(e,"inputRead",e,At)}t&&!q&&Wo(e,t),Di(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Le),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function jo(e,t){var s=e.clipboardData&&e.clipboardData.getData("Text");if(s)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Mr(t,function(){return As(t,s,0,null,"paste")}),!0}function Wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var s=e.doc.sel,r=s.ranges.length-1;r>=0;r--){var g=s.ranges[r];if(g.head.ch>100||r&&s.ranges[r-1].head.line==g.head.line)continue;var F=e.getModeAt(g.head),X=!1;if(F.electricChars){for(var q=0;q<F.electricChars.length;q++)if(t.indexOf(F.electricChars.charAt(q))>-1){X=Ea(e,g.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(Ct(e.doc,g.head.line).text.slice(0,g.head.ch))&&(X=Ea(e,g.head.line,"smart")));X&&En(e,"electricInput",e,g.head.line)}}function Ho(e){for(var t=[],s=[],r=0;r<e.doc.sel.ranges.length;r++){var g=e.doc.sel.ranges[r].head.line,F={anchor:yt(g,0),head:yt(g+1,0)};s.push(F),t.push(e.getRange(F.anchor,F.head))}return{text:t,ranges:s}}function Ko(e,t,s,r){e.setAttribute("autocorrect",s?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Go(){var e=h("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=h("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"),Ko(e),t}function $l(e){var t=e.optionHandlers,s=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,g){var F=this.options,X=F[r];if(F[r]==g&&r!="mode")return;F[r]=g,t.hasOwnProperty(r)&&nr(this,t[r])(this,g,X),Ke(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,g){this.state.keyMaps[g?"push":"unshift"](Ga(r))},removeKeyMap:function(r){for(var g=this.state.keyMaps,F=0;F<g.length;++F)if(g[F]==r||g[F].name==r)return g.splice(F,1),!0},addOverlay:gr(function(r,g){var F=r.token?r:e.getMode(this.options,r);if(F.startState)throw new Error("Overlays may not be stateful.");ce(this.state.overlays,{mode:F,modeSpec:r,opaque:g&&g.opaque,priority:g&&g.priority||0},function(X){return X.priority}),this.state.modeGen++,cn(this)}),removeOverlay:gr(function(r){for(var g=this.state.overlays,F=0;F<g.length;++F){var X=g[F].modeSpec;if(X==r||typeof r=="string"&&X.name==r){g.splice(F,1),this.state.modeGen++,cn(this);return}}}),indentLine:gr(function(r,g,F){typeof g!="string"&&typeof g!="number"&&(g==null?g=this.options.smartIndent?"smart":"prev":g=g?"add":"subtract"),yn(this.doc,r)&&Ea(this,r,g,F)}),indentSelection:gr(function(r){for(var g=this.doc.sel.ranges,F=-1,X=0;X<g.length;X++){var q=g[X];if(q.empty())q.head.line>F&&(Ea(this,q.head.line,r,!0),F=q.head.line,X==this.doc.sel.primIndex&&Di(this));else{var ee=q.from(),re=q.to(),we=Math.max(F,ee.line);F=Math.min(this.lastLine(),re.line-(re.ch?0:1))+1;for(var Le=we;Le<F;++Le)Ea(this,Le,r);var Ze=this.doc.sel.ranges;ee.ch==0&&g.length==Ze.length&&Ze[X].from().ch>0&&ys(this.doc,X,new Cn(ee,Ze[X].to()),Ae)}}}),getTokenAt:function(r,g){return Sn(this,r,g)},getLineTokens:function(r,g){return Sn(this,yt(r),g,!0)},getTokenTypeAt:function(r){r=L(this.doc,r);var g=at(this,Ct(this.doc,r.line)),F=0,X=(g.length-1)/2,q=r.ch,ee;if(q==0)ee=g[2];else for(;;){var re=F+X>>1;if((re?g[re*2-1]:0)>=q)X=re;else if(g[re*2+1]<q)F=re+1;else{ee=g[re*2+2];break}}var we=ee?ee.indexOf("overlay "):-1;return we<0?ee:we==0?null:ee.slice(0,we-1)},getModeAt:function(r){var g=this.doc.mode;return g.innerMode?e.innerMode(g,this.getTokenAt(r).state).mode:g},getHelper:function(r,g){return this.getHelpers(r,g)[0]},getHelpers:function(r,g){var F=[];if(!s.hasOwnProperty(g))return F;var X=s[g],q=this.getModeAt(r);if(typeof q[g]=="string")X[q[g]]&&F.push(X[q[g]]);else if(q[g])for(var ee=0;ee<q[g].length;ee++){var re=X[q[g][ee]];re&&F.push(re)}else q.helperType&&X[q.helperType]?F.push(X[q.helperType]):X[q.name]&&F.push(X[q.name]);for(var we=0;we<X._global.length;we++){var Le=X._global[we];Le.pred(q,this)&&oe(F,Le.val)==-1&&F.push(Le.val)}return F},getStateAfter:function(r,g){var F=this.doc;return r=Q(F,r==null?F.first+F.size-1:r),St(this,r+1,g).state},cursorCoords:function(r,g){var F,X=this.doc.sel.primary();return r==null?F=X.head:typeof r=="object"?F=L(this.doc,r):F=r?X.from():X.to(),er(this,F,g||"page")},charCoords:function(r,g){return Zi(this,L(this.doc,r),g||"page")},coordsChar:function(r,g){return r=Ca(this,r,g||"page"),$i(this,r.left,r.top)},lineAtHeight:function(r,g){return r=Ca(this,{top:r,left:0},g||"page").top,qt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,g,F){var X=!1,q;if(typeof r=="number"){var ee=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>ee&&(r=ee,X=!0),q=Ct(this.doc,r)}else q=r;return Ri(this,q,{top:0,left:0},g||"page",F||X).top+(X?this.doc.height-_r(q):0)},defaultTextHeight:function(){return It(this.display)},defaultCharWidth:function(){return Nt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,g,F,X,q){var ee=this.display;r=er(this,L(this.doc,r));var re=r.bottom,we=r.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),ee.sizer.appendChild(g),X=="over")re=r.top;else if(X=="above"||X=="near"){var Le=Math.max(ee.wrapper.clientHeight,this.doc.height),Ze=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(X=="above"||r.bottom+g.offsetHeight>Le)&&r.top>g.offsetHeight?re=r.top-g.offsetHeight:r.bottom+g.offsetHeight<=Le&&(re=r.bottom),we+g.offsetWidth>Ze&&(we=Ze-g.offsetWidth)}g.style.top=re+"px",g.style.left=g.style.right="",q=="right"?(we=ee.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(q=="left"?we=0:q=="middle"&&(we=(ee.sizer.clientWidth-g.offsetWidth)/2),g.style.left=we+"px"),F&&Jo(this,{left:we,top:re,right:we+g.offsetWidth,bottom:re+g.offsetHeight})},triggerOnKeyDown:gr(Do),triggerOnKeyPress:gr(Mo),triggerOnKeyUp:Lo,triggerOnMouseDown:gr(ko),execCommand:function(r){if(ga.hasOwnProperty(r))return ga[r].call(null,this)},triggerElectric:gr(function(r){Wo(this,r)}),findPosH:function(r,g,F,X){var q=1;g<0&&(q=-1,g=-g);for(var ee=L(this.doc,r),re=0;re<g&&!(ee=Cs(this.doc,ee,q,F,X),ee.hitSide);++re);return ee},moveH:gr(function(r,g){var F=this;this.extendSelectionsBy(function(X){return F.display.shift||F.doc.extend||X.empty()?Cs(F.doc,X.head,r,g,F.options.rtlMoveVisually):r<0?X.from():X.to()},Me)}),deleteH:gr(function(r,g){var F=this.doc.sel,X=this.doc;F.somethingSelected()?X.replaceSelection("",null,"+delete"):Fi(this,function(q){var ee=Cs(X,q.head,r,g,!1);return r<0?{from:ee,to:q.head}:{from:q.head,to:ee}})}),findPosV:function(r,g,F,X){var q=1,ee=X;g<0&&(q=-1,g=-g);for(var re=L(this.doc,r),we=0;we<g;++we){var Le=er(this,re,"div");if(ee==null?ee=Le.left:Le.left=ee,re=zo(this,Le,q,F),re.hitSide)break}return re},moveV:gr(function(r,g){var F=this,X=this.doc,q=[],ee=!this.display.shift&&!X.extend&&X.sel.somethingSelected();if(X.extendSelectionsBy(function(we){if(ee)return r<0?we.from():we.to();var Le=er(F,we.head,"div");we.goalColumn!=null&&(Le.left=we.goalColumn),q.push(Le.left);var Ze=zo(F,Le,r,g);return g=="page"&&we==X.sel.primary()&&os(F,Zi(F,Ze,"div").top-Le.top),Ze},Me),q.length)for(var re=0;re<X.sel.ranges.length;re++)X.sel.ranges[re].goalColumn=q[re]}),findWordAt:function(r){var g=this.doc,F=Ct(g,r.line).text,X=r.ch,q=r.ch;if(F){var ee=this.getHelper(r,"wordChars");(r.sticky=="before"||q==F.length)&&X?--X:++q;for(var re=F.charAt(X),we=et(re,ee)?function(Le){return et(Le,ee)}:/\s/.test(re)?function(Le){return/\s/.test(Le)}:function(Le){return!/\s/.test(Le)&&!et(Le)};X>0&&we(F.charAt(X-1));)--X;for(;q<F.length&&we(F.charAt(q));)++q}return new Cn(yt(r.line,X),yt(r.line,q))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?x(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),Ke(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gr(function(r,g){ta(this,r,g)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-mr(this)-this.display.barHeight,width:r.scrollWidth-mr(this)-this.display.barWidth,clientHeight:yi(this),clientWidth:ii(this)}},scrollIntoView:gr(function(r,g){r==null?(r={from:this.doc.sel.primary().head,to:null},g==null&&(g=this.options.cursorScrollMargin)):typeof r=="number"?r={from:yt(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=g||0,r.from.line!=null?Zo(this,r):Ns(this,r.from,r.to,r.margin)}),setSize:gr(function(r,g){var F=this,X=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};r!=null&&(this.display.wrapper.style.width=X(r)),g!=null&&(this.display.wrapper.style.height=X(g)),this.options.lineWrapping&&wa(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(ee){if(ee.widgets){for(var re=0;re<ee.widgets.length;re++)if(ee.widgets[re].noHScroll){or(F,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,Ke(this,"refresh",this)}),operation:function(r){return Mr(this,r)},startOperation:function(){return xi(this)},endOperation:function(){return Ti(this)},refresh:gr(function(){var r=this.display.cachedTextHeight;cn(this),this.curOp.forceUpdate=!0,ci(this),ta(this,this.doc.scrollLeft,this.doc.scrollTop),cs(this.display),(r==null||Math.abs(r-It(this.display))>.5||this.options.lineWrapping)&&Jt(this),Ke(this,"refresh",this)}),swapDoc:gr(function(r){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),Js(this,r),ci(this),this.display.input.reset(),ta(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,En(this,"swapDoc",this,g),g}),phrase:function(r){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,r)?g[r]:r},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}},Ee(e),e.registerHelper=function(r,g,F){s.hasOwnProperty(r)||(s[r]=e[r]={_global:[]}),s[r][g]=F},e.registerGlobalHelper=function(r,g,F,X){e.registerHelper(r,g,X),s[r]._global.push({pred:F,val:X})}}function Cs(e,t,s,r,g){var F=t,X=s,q=Ct(e,t.line),ee=g&&e.direction=="rtl"?-s:s;function re(){var Bt=t.line+ee;return Bt<e.first||Bt>=e.first+e.size?!1:(t=new yt(Bt,t.ch,t.sticky),q=Ct(e,Bt))}function we(Bt){var Lt;if(r=="codepoint"){var Ht=q.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Ht)?Lt=null:Lt=new yt(t.line,Math.max(0,Math.min(q.text.length,t.ch+s*(Ht>=55296&&Ht<56320?2:1))),-s)}else g?Lt=kl(e.cm,q,t,s):Lt=Es(q,t,s);if(Lt==null)if(!Bt&&re())t=_s(g,e.cm,q,t.line,ee);else return!1;else t=Lt;return!0}if(r=="char"||r=="codepoint")we();else if(r=="column")we(!0);else if(r=="word"||r=="group")for(var Le=null,Ze=r=="group",ze=e.cm&&e.cm.getHelper(t,"wordChars"),ht=!0;!(s<0&&!we(!ht));ht=!1){var _t=q.text.charAt(t.ch)||`
|
|
`,At=et(_t,ze)?"w":Ze&&_t==`
|
|
`?"n":!Ze||/\s/.test(_t)?null:"p";if(Ze&&!ht&&!At&&(At="s"),Le&&Le!=At){s<0&&(s=1,we(),t.sticky="after");break}if(At&&(Le=At),s>0&&!we(!ht))break}var Dt=Wa(e,t,F,X,!0);return Mn(F,Dt)&&(Dt.hitSide=!0),Dt}function zo(e,t,s,r){var g=e.doc,F=t.left,X;if(r=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(q-.5*It(e.display),3);X=(s>0?t.bottom:t.top)+s*ee}else r=="line"&&(X=s>0?t.bottom+3:t.top-3);for(var re;!(re=$i(e,F,X),!re.outside);){if(s<0?X<=0:X>=g.height){re.hitSide=!0;break}X+=s*5}return re}var On=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};On.prototype.init=function(e){var t=this,s=this,r=s.cm,g=s.div=e.lineDiv;Ko(g,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function F(q){for(var ee=q.target;ee;ee=ee.parentNode){if(ee==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Oe(g,"paste",function(q){if(!F(q)||Xe(r,q)||jo(q,r))return;H<=11&&setTimeout(nr(r,function(){return t.updateFromDOM()}),20)}),Oe(g,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Oe(g,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Oe(g,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Oe(g,"touchstart",function(){return s.forceCompositionEnd()}),Oe(g,"input",function(){t.composing||t.readFromDOMSoon()});function X(q){if(!F(q)||Xe(r,q))return;if(r.somethingSelected())Ya({lineWise:!1,text:r.getSelections()}),q.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var ee=Ho(r);Ya({lineWise:!0,text:ee.text}),q.type=="cut"&&r.operation(function(){r.setSelections(ee.ranges,0,Ae),r.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var re=Xr.text.join(`
|
|
`);if(q.clipboardData.setData("Text",re),q.clipboardData.getData("Text")==re){q.preventDefault();return}}var we=Go(),Le=we.firstChild;r.display.lineSpace.insertBefore(we,r.display.lineSpace.firstChild),Le.value=Xr.text.join(`
|
|
`);var Ze=document.activeElement;j(Le),setTimeout(function(){r.display.lineSpace.removeChild(we),Ze.focus(),Ze==g&&s.showPrimarySelection()},50)}Oe(g,"copy",X),Oe(g,"cut",X)},On.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},On.prototype.prepareSelection=function(){var e=Ds(this.cm,!1);return e.focus=document.activeElement==this.div,e},On.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},On.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},On.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,s=t.doc.sel.primary(),r=s.from(),g=s.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||g.line<t.display.viewFrom){e.removeAllRanges();return}var F=Xa(t,e.anchorNode,e.anchorOffset),X=Xa(t,e.focusNode,e.focusOffset);if(F&&!F.bad&&X&&!X.bad&&Vt(Vn(F,X),r)==0&&Vt(Pn(F,X),g)==0)return;var q=t.display.view,ee=r.line>=t.display.viewFrom&&Vo(t,r)||{node:q[0].measure.map[2],offset:0},re=g.line<t.display.viewTo&&Vo(t,g);if(!re){var we=q[q.length-1].measure,Le=we.maps?we.maps[we.maps.length-1]:we.map;re={node:Le[Le.length-1],offset:Le[Le.length-2]-Le[Le.length-3]}}if(!ee||!re){e.removeAllRanges();return}var Ze=e.rangeCount&&e.getRangeAt(0),ze;try{ze=E(ee.node,ee.offset,re.offset,re.node)}catch(ht){}ze&&(!N&&t.state.focused?(e.collapse(ee.node,ee.offset),ze.collapsed||(e.removeAllRanges(),e.addRange(ze))):(e.removeAllRanges(),e.addRange(ze)),Ze&&e.anchorNode==null?e.addRange(Ze):N&&this.startGracePeriod()),this.rememberSelection()},On.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)},On.prototype.showMultipleSelections=function(e){p(this.cm.display.cursorDiv,e.cursors),p(this.cm.display.selectionDiv,e.selection)},On.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},On.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return v(this.div,t)},On.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},On.prototype.blur=function(){this.div.blur()},On.prototype.getField=function(){return this.div},On.prototype.supportsTouch=function(){return!0},On.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Mr(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)},On.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},On.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&y&&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 s=Xa(t,e.anchorNode,e.anchorOffset),r=Xa(t,e.focusNode,e.focusOffset);s&&r&&Mr(t,function(){hr(t.doc,hi(s,r),Ae),(s.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},On.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,s=e.doc.sel.primary(),r=s.from(),g=s.to();if(r.ch==0&&r.line>e.firstLine()&&(r=yt(r.line-1,Ct(e.doc,r.line-1).length)),g.ch==Ct(e.doc,g.line).text.length&&g.line<e.lastLine()&&(g=yt(g.line+1,0)),r.line<t.viewFrom||g.line>t.viewTo-1)return!1;var F,X,q;r.line==t.viewFrom||(F=Tn(e,r.line))==0?(X=Pt(t.view[0].line),q=t.view[0].node):(X=Pt(t.view[F].line),q=t.view[F-1].node.nextSibling);var ee=Tn(e,g.line),re,we;if(ee==t.view.length-1?(re=t.viewTo-1,we=t.lineDiv.lastChild):(re=Pt(t.view[ee+1].line)-1,we=t.view[ee+1].node.previousSibling),!q)return!1;for(var Le=e.doc.splitLines(tu(e,q,we,X,re)),Ze=pn(e.doc,yt(X,0),yt(re,Ct(e.doc,re).text.length));Le.length>1&&Ze.length>1;)if(ne(Le)==ne(Ze))Le.pop(),Ze.pop(),re--;else if(Le[0]==Ze[0])Le.shift(),Ze.shift(),X++;else break;for(var ze=0,ht=0,_t=Le[0],At=Ze[0],Dt=Math.min(_t.length,At.length);ze<Dt&&_t.charCodeAt(ze)==At.charCodeAt(ze);)++ze;for(var Bt=ne(Le),Lt=ne(Ze),Ht=Math.min(Bt.length-(Le.length==1?ze:0),Lt.length-(Ze.length==1?ze:0));ht<Ht&&Bt.charCodeAt(Bt.length-ht-1)==Lt.charCodeAt(Lt.length-ht-1);)++ht;if(Le.length==1&&Ze.length==1&&X==r.line)for(;ze&&ze>r.ch&&Bt.charCodeAt(Bt.length-ht-1)==Lt.charCodeAt(Lt.length-ht-1);)ze--,ht++;Le[Le.length-1]=Bt.slice(0,Bt.length-ht).replace(/^\u200b+/,""),Le[0]=Le[0].slice(ze).replace(/\u200b+$/,"");var nn=yt(X,ze),Zt=yt(re,Ze.length?ne(Ze).length-ht:0);if(Le.length>1||Le[0]||Vt(nn,Zt))return Ni(e.doc,Le,nn,Zt,"+input"),!0},On.prototype.ensurePolled=function(){this.forceCompositionEnd()},On.prototype.reset=function(){this.forceCompositionEnd()},On.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},On.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)},On.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Mr(this.cm,function(){return cn(e.cm)})},On.prototype.setUneditable=function(e){e.contentEditable="false"},On.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||nr(this.cm,As)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},On.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},On.prototype.onContextMenu=function(){},On.prototype.resetPosition=function(){},On.prototype.needsContentAttribute=!0;function Vo(e,t){var s=ai(e,t.line);if(!s||s.hidden)return null;var r=Ct(e.doc,t.line),g=Qi(s,r,t.line),F=bt(r,e.doc.direction),X="left";if(F){var q=ut(F,t.ch);X=q%2?"right":"left"}var ee=bi(g.map,t.ch,X);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Wi(e,t){return t&&(e.bad=!0),e}function tu(e,t,s,r,g){var F="",X=!1,q=e.doc.lineSeparator(),ee=!1;function re(ze){return function(ht){return ht.id==ze}}function we(){X&&(F+=q,ee&&(F+=q),X=ee=!1)}function Le(ze){ze&&(we(),F+=ze)}function Ze(ze){if(ze.nodeType==1){var ht=ze.getAttribute("cm-text");if(ht){Le(ht);return}var _t=ze.getAttribute("cm-marker"),At;if(_t){var Dt=e.findMarks(yt(r,0),yt(g+1,0),re(+_t));Dt.length&&(At=Dt[0].find(0))&&Le(pn(e.doc,At.from,At.to).join(q));return}if(ze.getAttribute("contenteditable")=="false")return;var Bt=/^(pre|div|p|li|table|br)$/i.test(ze.nodeName);if(!/^br$/i.test(ze.nodeName)&&ze.textContent.length==0)return;Bt&&we();for(var Lt=0;Lt<ze.childNodes.length;Lt++)Ze(ze.childNodes[Lt]);/^(pre|p)$/i.test(ze.nodeName)&&(ee=!0),Bt&&(X=!0)}else ze.nodeType==3&&Le(ze.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ze(t),t==s);)t=t.nextSibling,ee=!1;return F}function Xa(e,t,s){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[s],!r)return Wi(e.clipPos(yt(e.display.viewTo-1)),!0);t=null,s=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var g=0;g<e.display.view.length;g++){var F=e.display.view[g];if(F.node==r)return nu(F,t,s)}}function nu(e,t,s){var r=e.text.firstChild,g=!1;if(!t||!v(r,t))return Wi(yt(Pt(e.line),0),!0);if(t==r&&(g=!0,t=r.childNodes[s],s=0,!t)){var F=e.rest?ne(e.rest):e.line;return Wi(yt(Pt(F),F.text.length),g)}var X=t.nodeType==3?t:null,q=t;for(!X&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(X=t.firstChild,s&&(s=X.nodeValue.length));q.parentNode!=r;)q=q.parentNode;var ee=e.measure,re=ee.maps;function we(At,Dt,Bt){for(var Lt=-1;Lt<(re?re.length:0);Lt++)for(var Ht=Lt<0?ee.map:re[Lt],nn=0;nn<Ht.length;nn+=3){var Zt=Ht[nn+2];if(Zt==At||Zt==Dt){var fn=Pt(Lt<0?e.line:e.rest[Lt]),Dn=Ht[nn]+Bt;return(Bt<0||Zt!=At)&&(Dn=Ht[nn+(Bt?1:0)]),yt(fn,Dn)}}}var Le=we(X,q,s);if(Le)return Wi(Le,g);for(var Ze=q.nextSibling,ze=X?X.nodeValue.length-s:0;Ze;Ze=Ze.nextSibling){if(Le=we(Ze,Ze.firstChild,0),Le)return Wi(yt(Le.line,Le.ch-ze),g);ze+=Ze.textContent.length}for(var ht=q.previousSibling,_t=s;ht;ht=ht.previousSibling){if(Le=we(ht,ht.firstChild,-1),Le)return Wi(yt(Le.line,Le.ch+_t),g);_t+=ht.textContent.length}}var zn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};zn.prototype.init=function(e){var t=this,s=this,r=this.cm;this.createField(e);var g=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(g.style.width="0px"),Oe(g,"input",function(){K&&H>=9&&t.hasSelection&&(t.hasSelection=null),s.poll()}),Oe(g,"paste",function(X){if(Xe(r,X)||jo(X,r))return;r.state.pasteIncoming=+new Date,s.fastPoll()});function F(X){if(Xe(r,X))return;if(r.somethingSelected())Ya({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var q=Ho(r);Ya({lineWise:!0,text:q.text}),X.type=="cut"?r.setSelections(q.ranges,null,Ae):(s.prevInput="",g.value=q.text.join(`
|
|
`),j(g))}else return;X.type=="cut"&&(r.state.cutIncoming=+new Date)}Oe(g,"cut",F),Oe(g,"copy",F),Oe(e.scroller,"paste",function(X){if(ei(e,X)||Xe(r,X))return;if(!g.dispatchEvent){r.state.pasteIncoming=+new Date,s.focus();return}var q=new Event("paste");q.clipboardData=X.clipboardData,g.dispatchEvent(q)}),Oe(e.lineSpace,"selectstart",function(X){ei(e,X)||ie(X)}),Oe(g,"compositionstart",function(){var X=r.getCursor("from");s.composing&&s.composing.range.clear(),s.composing={start:X,range:r.markText(X,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Oe(g,"compositionend",function(){s.composing&&(s.poll(),s.composing.range.clear(),s.composing=null)})},zn.prototype.createField=function(e){this.wrapper=Go(),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,s=e.doc,r=Ds(e);if(e.options.moveInputWithCursor){var g=er(e,s.sel.primary().head,"div"),F=t.wrapper.getBoundingClientRect(),X=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,g.top+X.top-F.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,g.left+X.left-F.left))}return r},zn.prototype.showSelection=function(e){var t=this.cm,s=t.display;p(s.cursorDiv,e.cursors),p(s.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 s=t.getSelection();this.textarea.value=s,t.state.focused&&j(this.textarea),K&&H>=9&&(this.hasSelection=s)}else e||(this.prevInput=this.textarea.value="",K&&H>=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"&&(!u||P()!=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 s(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,s)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,s)},zn.prototype.poll=function(){var e=this,t=this.cm,s=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Qe(s)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var g=s.value;if(g==r&&!t.somethingSelected())return!1;if(K&&H>=9&&this.hasSelection===g||a&&/[\uf700-\uf7ff]/.test(g))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var F=g.charCodeAt(0);if(F==8203&&!r&&(r="\u200B"),F==8666)return this.reset(),this.cm.execCommand("undo")}for(var X=0,q=Math.min(r.length,g.length);X<q&&r.charCodeAt(X)==g.charCodeAt(X);)++X;return Mr(t,function(){As(t,g.slice(X),r.length-X,null,e.composing?"*compose":null),g.length>1e3||g.indexOf(`
|
|
`)>-1?s.value=e.prevInput="":e.prevInput=g,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},zn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zn.prototype.onKeyPress=function(){K&&H>=9&&(this.hasSelection=null),this.fastPoll()},zn.prototype.onContextMenu=function(e){var t=this,s=t.cm,r=s.display,g=t.textarea;t.contextMenuPending&&t.contextMenuPending();var F=vn(s,e),X=r.scroller.scrollTop;if(!F||m)return;var q=s.options.resetSelectionOnContextMenu;q&&s.doc.sel.contains(F)==-1&&nr(s,hr)(s.doc,hi(F),Ae);var ee=g.style.cssText,re=t.wrapper.style.cssText,we=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-we.top-5)+"px; left: "+(e.clientX-we.left-5)+`px;
|
|
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Le;n&&(Le=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Le),r.input.reset(),s.somethingSelected()||(g.value=t.prevInput=" "),t.contextMenuPending=ze,r.selForContextMenu=s.doc.sel,clearTimeout(r.detectingSelectAll);function Ze(){if(g.selectionStart!=null){var _t=s.somethingSelected(),At="\u200B"+(_t?g.value:"");g.value="\u21DA",g.value=At,t.prevInput=_t?"":"\u200B",g.selectionStart=1,g.selectionEnd=At.length,r.selForContextMenu=s.doc.sel}}function ze(){if(t.contextMenuPending!=ze)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=re,g.style.cssText=ee,K&&H<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=X),g.selectionStart!=null){(!K||K&&H<9)&&Ze();var _t=0,At=function(){r.selForContextMenu==s.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&t.prevInput=="\u200B"?nr(s,uo)(s):_t++<10?r.detectingSelectAll=setTimeout(At,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(At,200)}}if(K&&H>=9&&Ze(),I){ve(e);var ht=function(){lt(window,"mouseup",ht),setTimeout(ze,20)};Oe(window,"mouseup",ht)}else setTimeout(ze,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?w(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 s=P();t.autofocus=s==e||e.getAttribute("autofocus")!=null&&s==document.body}function r(){e.value=q.getValue()}var g;if(e.form&&(Oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var F=e.form;g=F.submit;try{var X=F.submit=function(){r(),F.submit=g,F.submit(),F.submit=X}}catch(ee){}}t.finishInit=function(ee){ee.save=r,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,r(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=g))}},e.style.display="none";var q=Nn(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return q}function iu(e){e.off=lt,e.on=Oe,e.wheelEventPixels=dl,e.Doc=xr,e.splitLines=qe,e.countColumn=Y,e.findColumn=Be,e.isWordChar=Ve,e.Pass=Fe,e.signal=Ke,e.Line=sr,e.changeEnd=fi,e.scrollbarModel=Fs,e.Pos=yt,e.cmpPos=Vt,e.modes=$e,e.mimeModes=je,e.resolveMode=We,e.getMode=it,e.modeExtensions=st,e.extendMode=dt,e.copyState=Et,e.startState=en,e.innerMode=jt,e.commands=ga,e.keyMap=si,e.keyName=Ao,e.isModifierKey=wo,e.lookupKey=Bi,e.normalizeKeyMap=Ml,e.StringStream=Yt,e.SharedTextMarker=fa,e.TextMarker=mi,e.LineWidget=ha,e.e_preventDefault=ie,e.e_stopPropagation=ae,e.e_stop=ve,e.addClass=x,e.contains=v,e.rmClass=_,e.keyNames=gi}Ql(Nn),$l(Nn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Qa in xr.prototype)xr.prototype.hasOwnProperty(Qa)&&oe(au,Qa)<0&&(Nn.prototype[Qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(xr.prototype[Qa]));return Ee(xr),Nn.inputStyles={textarea:zn,contenteditable:On},Nn.defineMode=function(e){!Nn.defaults.mode&&e!="null"&&(Nn.defaults.mode=e),Je.apply(this,arguments)},Nn.defineMIME=mt,Nn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nn.defineMIME("text/plain","null"),Nn.defineExtension=function(e,t){Nn.prototype[e]=t},Nn.defineDocExtension=function(e,t){xr.prototype[e]=t},Nn.fromTextArea=ru,iu(Nn),Nn.version="5.58.2",Nn})},W6BS:function(Ye,se){Ye.exports="data:image/png;base64,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"},WaYH:function(Ye,se,U){"use strict";var Z=U("rePB"),z=U("Ff2n"),N=U("VTBJ"),V=U("1OyB"),W=U("vuIU"),M=U("JX7q"),K=U("Ji7U"),H=U("LK+K"),n=U("q1tI"),D=U("TSYQ"),y=U.n(D),m=U("sboe"),f=U("OZM5"),c=function(I){var O=I.prefixCls,_=I.level,b=I.isStart,p=I.isEnd;if(!_)return null;for(var h="".concat(O,"-indent-unit"),A=[],E=0;E<_;E+=1){var v;A.push(n.createElement("span",{key:E,className:y()(h,(v={},Object(Z.a)(v,"".concat(h,"-start"),b[E+1]),Object(Z.a)(v,"".concat(h,"-end"),p[E+1]),Object(Z.a)(v,"".concat(h,"-end-first-level"),!E&&p[0]),v))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},A)},l=c,d=U("815F"),o="open",u="close",a="---",i=function(T){Object(K.a)(O,T);var I=Object(H.a)(O);function O(){var _;return Object(V.a)(this,O),_=I.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(b){var p=_.props.context.onNodeClick;p(b,Object(d.b)(_.props)),_.isSelectable()?_.onSelect(b):_.onCheck(b)},_.onSelectorDoubleClick=function(b){var p=_.props.context.onNodeDoubleClick;p(b,Object(d.b)(_.props))},_.onSelect=function(b){if(_.isDisabled())return;var p=_.props.context.onNodeSelect;b.preventDefault(),p(b,Object(d.b)(_.props))},_.onCheck=function(b){if(_.isDisabled())return;var p=_.props,h=p.disableCheckbox,A=p.checked,E=_.props.context.onNodeCheck;if(!_.isCheckable()||h)return;b.preventDefault();var v=!A;E(b,Object(d.b)(_.props),v)},_.onMouseEnter=function(b){var p=_.props.context.onNodeMouseEnter;p(b,Object(d.b)(_.props))},_.onMouseLeave=function(b){var p=_.props.context.onNodeMouseLeave;p(b,Object(d.b)(_.props))},_.onContextMenu=function(b){var p=_.props.context.onNodeContextMenu;p(b,Object(d.b)(_.props))},_.onDragStart=function(b){var p=_.props.context.onNodeDragStart;b.stopPropagation(),_.setState({dragNodeHighlight:!0}),p(b,Object(M.a)(_));try{b.dataTransfer.setData("text/plain","")}catch(h){}},_.onDragEnter=function(b){var p=_.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),p(b,Object(M.a)(_))},_.onDragOver=function(b){var p=_.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),p(b,Object(M.a)(_))},_.onDragLeave=function(b){var p=_.props.context.onNodeDragLeave;b.stopPropagation(),p(b,Object(M.a)(_))},_.onDragEnd=function(b){var p=_.props.context.onNodeDragEnd;b.stopPropagation(),_.setState({dragNodeHighlight:!1}),p(b,Object(M.a)(_))},_.onDrop=function(b){var p=_.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),_.setState({dragNodeHighlight:!1}),p(b,Object(M.a)(_))},_.onExpand=function(b){var p=_.props.context.onNodeExpand;p(b,Object(d.b)(_.props))},_.setSelectHandle=function(b){_.selectHandle=b},_.getNodeState=function(){var b=_.props.expanded;return _.isLeaf()?null:b?o:u},_.hasChildren=function(){var b=_.props.eventKey,p=_.props.context.keyEntities,h=p[b]||{},A=h.children;return!!(A||[]).length},_.isLeaf=function(){var b=_.props,p=b.isLeaf,h=b.loaded,A=_.props.context.loadData,E=_.hasChildren();return p===!1?!1:p||!A&&!E||A&&h&&!E},_.isDisabled=function(){var b=_.props.disabled,p=_.props.context.disabled;return!!(p||b)},_.isCheckable=function(){var b=_.props.checkable,p=_.props.context.checkable;return!p||b===!1?!1:p},_.syncLoadData=function(b){var p=b.expanded,h=b.loading,A=b.loaded,E=_.props.context,v=E.loadData,P=E.onNodeLoad;if(h)return;v&&p&&!_.isLeaf()&&(!_.hasChildren()&&!A&&P(Object(d.b)(_.props)))},_.renderSwitcher=function(){var b=_.props,p=b.expanded,h=b.switcherIcon,A=_.props.context,E=A.prefixCls,v=A.switcherIcon,P=h||v;if(_.isLeaf())return n.createElement("span",{className:y()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof P=="function"?P(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!0})):P);var x=y()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(p?o:u));return n.createElement("span",{onClick:_.onExpand,className:x},typeof P=="function"?P(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!1})):P)},_.renderCheckbox=function(){var b=_.props,p=b.checked,h=b.halfChecked,A=b.disableCheckbox,E=_.props.context.prefixCls,v=_.isDisabled(),P=_.isCheckable();if(!P)return null;var x=typeof P!="boolean"?P:null;return n.createElement("span",{className:y()("".concat(E,"-checkbox"),p&&"".concat(E,"-checkbox-checked"),!p&&h&&"".concat(E,"-checkbox-indeterminate"),(v||A)&&"".concat(E,"-checkbox-disabled")),onClick:_.onCheck},x)},_.renderIcon=function(){var b=_.props.loading,p=_.props.context.prefixCls;return n.createElement("span",{className:y()("".concat(p,"-iconEle"),"".concat(p,"-icon__").concat(_.getNodeState()||"docu"),b&&"".concat(p,"-icon_loading"))})},_.renderSelector=function(){var b=_.state.dragNodeHighlight,p=_.props,h=p.title,A=p.selected,E=p.icon,v=p.loading,P=p.data,x=_.props.context,C=x.prefixCls,j=x.showIcon,B=x.icon,w=x.draggable,Y=x.loadData,$=x.titleRender,oe=_.isDisabled(),de="".concat(C,"-node-content-wrapper"),Fe;if(j){var Ae=E||B;Fe=Ae?n.createElement("span",{className:y()("".concat(C,"-iconEle"),"".concat(C,"-icon__customize"))},typeof Ae=="function"?Ae(_.props):Ae):_.renderIcon()}else Y&&v&&(Fe=_.renderIcon());var Re;typeof h=="function"?Re=h(P):$?Re=$(P):Re=h;var Me=n.createElement("span",{className:"".concat(C,"-title")},Re);return n.createElement("span",{ref:_.setSelectHandle,title:typeof h=="string"?h:"",className:y()("".concat(de),"".concat(de,"-").concat(_.getNodeState()||"normal"),!oe&&(A||b)&&"".concat(C,"-node-selected"),!oe&&w&&"draggable"),draggable:!oe&&w||void 0,"aria-grabbed":!oe&&w||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:w?_.onDragStart:void 0},Fe,Me)},_}return Object(W.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,p=this.props.context.selectable;return typeof b=="boolean"?b:p}},{key:"render",value:function(){var b,p=this.props,h=p.eventKey,A=p.className,E=p.style,v=p.dragOver,P=p.dragOverGapTop,x=p.dragOverGapBottom,C=p.isLeaf,j=p.isStart,B=p.isEnd,w=p.expanded,Y=p.selected,$=p.checked,oe=p.halfChecked,de=p.loading,Fe=p.domRef,Ae=p.active,Re=p.onMouseMove,Me=Object(z.a)(p,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Be=this.props.context,pe=Be.prefixCls,fe=Be.filterTreeNode,ne=Be.draggable,xe=Be.keyEntities,ce=this.isDisabled(),Pe=Object(f.f)(Me),He=xe[h]||{},ke=He.level,Ve=B[B.length-1];return n.createElement("div",Object.assign({ref:Fe,className:y()(A,"".concat(pe,"-treenode"),(b={},Object(Z.a)(b,"".concat(pe,"-treenode-disabled"),ce),Object(Z.a)(b,"".concat(pe,"-treenode-switcher-").concat(w?"open":"close"),!C),Object(Z.a)(b,"".concat(pe,"-treenode-checkbox-checked"),$),Object(Z.a)(b,"".concat(pe,"-treenode-checkbox-indeterminate"),oe),Object(Z.a)(b,"".concat(pe,"-treenode-selected"),Y),Object(Z.a)(b,"".concat(pe,"-treenode-loading"),de),Object(Z.a)(b,"".concat(pe,"-treenode-active"),Ae),Object(Z.a)(b,"".concat(pe,"-treenode-leaf-last"),Ve),Object(Z.a)(b,"drag-over",!ce&&v),Object(Z.a)(b,"drag-over-gap-top",!ce&&P),Object(Z.a)(b,"drag-over-gap-bottom",!ce&&x),Object(Z.a)(b,"filter-node",fe&&fe(Object(d.b)(this.props))),b)),style:E,onDragEnter:ne?this.onDragEnter:void 0,onDragOver:ne?this.onDragOver:void 0,onDragLeave:ne?this.onDragLeave:void 0,onDrop:ne?this.onDrop:void 0,onDragEnd:ne?this.onDragEnd:void 0,onMouseMove:Re},Pe),n.createElement(l,{prefixCls:pe,level:ke,isStart:j,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(n.Component),R=function(I){return n.createElement(m.a.Consumer,null,function(O){return n.createElement(i,Object.assign({},I,{context:O}))})};R.displayName="TreeNode",R.defaultProps={title:a},R.isTreeNode=1;var S=se.a=R},Xsq0:function(Ye,se,U){Ye.exports=U.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Ye,se,U){"use strict";U.r(se),U.d(se,"ResizableTextArea",function(){return oe});var Z=U("wx14"),z=U("1OyB"),N=U("vuIU"),V=U("Ji7U"),W=U("LK+K"),M=U("q1tI"),K=U("VTBJ"),H=U("rePB"),n=U("Zm9Q"),D=U("Kwbf"),y=U("c+Xe"),m=U("m+aA"),f=U("bdgK"),c=new Map;function l(Ae){Ae.forEach(function(Re){var Me,Be=Re.target;(Me=c.get(Be))===null||Me===void 0||Me.forEach(function(pe){return pe(Be)})})}var d=new f.default(l),o=null,u=null;function a(Ae,Re){c.has(Ae)||(c.set(Ae,new Set),d.observe(Ae)),c.get(Ae).add(Re)}function i(Ae,Re){c.has(Ae)&&(c.get(Ae).delete(Re),c.get(Ae).size||(d.unobserve(Ae),c.delete(Ae)))}var R=function(Ae){Object(V.a)(Me,Ae);var Re=Object(W.a)(Me);function Me(){return Object(z.a)(this,Me),Re.apply(this,arguments)}return Object(N.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(M.Component),S=M.createContext(null);function T(Ae){var Re=Ae.children,Me=Ae.onBatchResize,Be=M.useRef(0),pe=M.useRef([]),fe=M.useContext(S),ne=M.useCallback(function(xe,ce,Pe){Be.current+=1;var He=Be.current;pe.current.push({size:xe,element:ce,data:Pe}),Promise.resolve().then(function(){He===Be.current&&(Me==null||Me(pe.current),pe.current=[])}),fe==null||fe(xe,ce,Pe)},[Me,fe]);return M.createElement(S.Provider,{value:ne},Re)}function I(Ae){var Re=Ae.children,Me=Ae.disabled,Be=M.useRef(null),pe=M.useRef(null),fe=M.useContext(S),ne=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),xe=M.isValidElement(Re)&&Object(y.c)(Re),ce=xe?Re.ref:null,Pe=M.useMemo(function(){return Object(y.a)(ce,Be)},[ce,Be]),He=M.useRef(Ae);He.current=Ae;var ke=M.useCallback(function(Ve){var et=He.current,le=et.onResize,_e=et.data,Ce=Ve.getBoundingClientRect(),De=Ce.width,tt=Ce.height,ct=Ve.offsetWidth,ft=Ve.offsetHeight,ut=Math.floor(De),xt=Math.floor(tt);if(ne.current.width!==ut||ne.current.height!==xt||ne.current.offsetWidth!==ct||ne.current.offsetHeight!==ft){var bt={width:ut,height:xt,offsetWidth:ct,offsetHeight:ft};ne.current=bt;var Ne=ct===Math.round(De)?De:ct,Oe=ft===Math.round(tt)?tt:ft,nt=Object(K.a)(Object(K.a)({},bt),{},{offsetWidth:Ne,offsetHeight:Oe});fe==null||fe(nt,Ve,_e),le&&Promise.resolve().then(function(){le(nt,Ve)})}},[]);return M.useEffect(function(){var Ve=Object(m.a)(Be.current)||Object(m.a)(pe.current);return Ve&&!Me&&a(Ve,ke),function(){return i(Ve,ke)}},[Be.current,Me]),M.createElement(R,{ref:pe},xe?M.cloneElement(Re,{ref:Pe}):Re)}var O="rc-observer-key";function _(Ae){var Re=Ae.children,Me=Object(n.a)(Re);return Me.map(function(Be,pe){var fe=(Be==null?void 0:Be.key)||"".concat(O,"-").concat(pe);return M.createElement(I,Object(Z.a)({},Ae,{key:fe}),Be)})}_.Collection=T;var b=_,p=U("bT9E"),h=U("TSYQ"),A=U.n(h),E=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,v=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},x;function C(Ae){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=Ae.getAttribute("id")||Ae.getAttribute("data-reactid")||Ae.getAttribute("name");if(Re&&P[Me])return P[Me];var Be=window.getComputedStyle(Ae),pe=Be.getPropertyValue("box-sizing")||Be.getPropertyValue("-moz-box-sizing")||Be.getPropertyValue("-webkit-box-sizing"),fe=parseFloat(Be.getPropertyValue("padding-bottom"))+parseFloat(Be.getPropertyValue("padding-top")),ne=parseFloat(Be.getPropertyValue("border-bottom-width"))+parseFloat(Be.getPropertyValue("border-top-width")),xe=v.map(function(Pe){return"".concat(Pe,":").concat(Be.getPropertyValue(Pe))}).join(";"),ce={sizingStyle:xe,paddingSize:fe,borderSize:ne,boxSizing:pe};return Re&&Me&&(P[Me]=ce),ce}function j(Ae){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;x||(x=document.createElement("textarea"),x.setAttribute("tab-index","-1"),x.setAttribute("aria-hidden","true"),document.body.appendChild(x)),Ae.getAttribute("wrap")?x.setAttribute("wrap",Ae.getAttribute("wrap")):x.removeAttribute("wrap");var pe=C(Ae,Re),fe=pe.paddingSize,ne=pe.borderSize,xe=pe.boxSizing,ce=pe.sizingStyle;x.setAttribute("style","".concat(ce,";").concat(E)),x.value=Ae.value||Ae.placeholder||"";var Pe=Number.MIN_SAFE_INTEGER,He=Number.MAX_SAFE_INTEGER,ke=x.scrollHeight,Ve;if(xe==="border-box"?ke+=ne:xe==="content-box"&&(ke-=fe),Me!==null||Be!==null){x.value=" ";var et=x.scrollHeight-fe;Me!==null&&(Pe=et*Me,xe==="border-box"&&(Pe=Pe+fe+ne),ke=Math.max(Pe,ke)),Be!==null&&(He=et*Be,xe==="border-box"&&(He=He+fe+ne),Ve=ke>He?"":"hidden",ke=Math.min(He,ke))}return{height:ke,minHeight:Pe,maxHeight:He,overflowY:Ve,resize:"none"}}var B=U("Gytx"),w=U.n(B),Y;(function(Ae){Ae[Ae.NONE=0]="NONE",Ae[Ae.RESIZING=1]="RESIZING",Ae[Ae.RESIZED=2]="RESIZED"})(Y||(Y={}));var $=function(Ae){Object(V.a)(Me,Ae);var Re=Object(W.a)(Me);function Me(Be){var pe;return Object(z.a)(this,Me),pe=Re.call(this,Be),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(fe){pe.textArea=fe},pe.handleResize=function(fe){var ne=pe.state.resizeStatus,xe=pe.props,ce=xe.autoSize,Pe=xe.onResize;if(ne!==Y.NONE)return;typeof Pe=="function"&&Pe(fe),ce&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var fe=pe.props.autoSize;if(!fe||!pe.textArea)return;var ne=fe.minRows,xe=fe.maxRows,ce=j(pe.textArea,!1,ne,xe);pe.setState({textareaStyles:ce,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var fe=pe.props,ne=fe.prefixCls,xe=ne===void 0?"rc-textarea":ne,ce=fe.autoSize,Pe=fe.onResize,He=fe.className,ke=fe.disabled,Ve=pe.state,et=Ve.textareaStyles,le=Ve.resizeStatus,_e=Object(p.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ce=A()(xe,He,Object(H.a)({},"".concat(xe,"-disabled"),ke));"value"in _e&&(_e.value=_e.value||"");var De=Object(K.a)(Object(K.a)(Object(K.a)({},pe.props.style),et),le===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(b,{onResize:pe.handleResize,disabled:!(ce||Pe)},M.createElement("textarea",Object(Z.a)({},_e,{className:Ce,style:De,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:Y.NONE},pe}return Object(N.a)(Me,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!w()(pe.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 pe=this.textArea.selectionStart,fe=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,fe)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Me}(M.Component),oe=$,de=function(Ae){Object(V.a)(Me,Ae);var Re=Object(W.a)(Me);function Me(Be){var pe;Object(z.a)(this,Me),pe=Re.call(this,Be),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(ne){pe.resizableTextArea=ne},pe.handleChange=function(ne){var xe=pe.props.onChange;pe.setValue(ne.target.value,function(){pe.resizableTextArea.resizeTextarea()}),xe&&xe(ne)},pe.handleKeyDown=function(ne){var xe=pe.props,ce=xe.onPressEnter,Pe=xe.onKeyDown;ne.keyCode===13&&ce&&ce(ne),Pe&&Pe(ne)};var fe=typeof Be.value=="undefined"||Be.value===null?Be.defaultValue:Be.value;return pe.state={value:fe},pe}return Object(N.a)(Me,[{key:"setValue",value:function(pe,fe){"value"in this.props||this.setState({value:pe},fe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(oe,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),Me}(M.Component),Fe=se.default=de},ZW9T:function(Ye,se,U){"use strict";U.d(se,"a",function(){return B});var Z=U("k1fw"),z=U("oBTY"),N=U("miYZ"),V=U("tsqr"),W=U("rAM+"),M=U("tJVT"),K=U("PpiC"),H=U("q1tI"),n=U.n(H),D=U("bdgK"),y=U("9og8"),m=U("WmNS"),f=U.n(m),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"]},l={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(`
|
|
`)}]},o={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(`
|
|
`)}]},u=U("5VLF"),a=U.n(u),i={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"]}},R=function(Y,$){return $.map(function(oe){return{label:oe,kind:Y.languages.CompletionItemKind.Keyword,insertText:oe}})},S=function(Y){return Object.keys(i.tables).map(function($){return{label:$,kind:Y.languages.CompletionItemKind.Variable,insertText:$}})},T=function(Y,$){var oe=i.tables[Y];return oe?oe.map(function(de){return{label:de,kind:$.languages.CompletionItemKind.Field,insertText:de}}):[]};function I(w,Y,$,oe,de){var Fe=Y.getWordUntilPosition($),Ae={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:Fe.startColumn,endColumn:Fe.endColumn},Re=oe.map(function(Me){return{label:Me,kind:w.languages.CompletionItemKind.Keyword,insertText:Me,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}});return de.map(function(Me){Re.push(Object(Z.a)(Object(Z.a)({},Me),{},{range:Ae}))}),Re}var O=function(w){i.languages.map(function(de){return w.languages.registerDocumentFormattingEditProvider(de,{provideDocumentFormattingEdits:function(Ae,Re,Me){return Object(y.a)(f.a.mark(function Be(){var pe;return f.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return pe=a()(Ae.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}),ne.abrupt("return",[{range:Ae.getFullModelRange(),text:pe}]);case 2:case"end":return ne.stop()}},Be)}))()}}),de});var Y=d.quickKey.map(function(de){return{label:de.label,kind:w.languages.CompletionItemKind.Method,insertText:de.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=o.quickKey.map(function(de){return{label:de.label,kind:w.languages.CompletionItemKind.Method,insertText:de.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),oe=l.quickKey.map(function(de){return{label:de.label,kind:w.languages.CompletionItemKind.Method,insertText:de.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}});w.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Fe,Ae){var Re=Fe.getWordUntilPosition(Ae),Me={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Be=Fe.getLineContent(Ae.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(z.a)(d.keywords.map(function(pe){return{label:pe,kind:w.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}})),Object(z.a)(d.quickKey.map(function(pe){return{label:pe.label,kind:w.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Be.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}})))}}}),w.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Fe,Ae){var Re=Fe.getWordUntilPosition(Ae),Me={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn};return{suggestions:Object(z.a)(c.keywords.map(function(Be){return{label:Be,kind:w.languages.CompletionItemKind.Function,documentation:Be,insertText:Be,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}}))}}}),w.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Fe,Ae){var Re=Fe.getWordUntilPosition(Ae),Me={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Be=Fe.getLineContent(Ae.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(z.a)(l.keywords.map(function(pe){return{label:pe,kind:w.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}})),Object(z.a)(l.quickKey.map(function(pe){return{label:pe.label,kind:w.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Be.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}})))}}}),w.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Fe,Ae){var Re=Fe.getWordUntilPosition(Ae),Me={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Be=Fe.getLineContent(Ae.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(z.a)(o.keywords.map(function(pe){return{label:pe,kind:w.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}})),Object(z.a)(o.quickKey.map(function(pe){return{label:pe.label,kind:w.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Be.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}})))}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=U("fjLI"),p=U("LvDl"),h=U("+ua5");function A(w){return/^\d+$/.test(w)?"".concat(w,"px"):w}function E(){}var v=!1,P={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function x(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=w;if(Array.isArray(w)){for(var $=0;$<w.length;$++){var oe=P[w[$]];if(oe)return oe}return Y[0]}return P[Y]||Y}var C=null,j=se.b=function(w){var Y=w.width,$=Y===void 0?"100%":Y,oe=w.height,de=oe===void 0?"100%":oe,Fe=w.value,Ae=w.language,Re=Ae===void 0?"javascript":Ae,Me=w.style,Be=Me===void 0?{}:Me,pe=w.options,fe=pe===void 0?{}:pe,ne=w.overrideServices,xe=ne===void 0?{}:ne,ce=w.theme,Pe=ce===void 0?"vs-dark":ce,He=w.onEditBlur,ke=w.onSave,Ve=w.autoHeight,et=Ve===void 0?!1:Ve,le=w.forbidCopy,_e=le===void 0?!1:le,Ce=w.onChange,De=Ce===void 0?E:Ce,tt=w.editorDidMount,ct=tt===void 0?E:tt,ft=w.onFocus,ut=ft===void 0?E:ft,xt=w.filename,bt=xt===void 0?"educoder.txt":xt,Ne=w.errorLine,Oe=w.errorContent,nt=Oe===void 0?"":Oe,lt=Object(K.a)(w,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ke=Object(H.useRef)(),Xe=Object(H.useRef)({}),Se=Object(H.useRef)(),ge=Object(H.useRef)(),Ee=Object(H.useRef)(!1),ie=Object(H.useRef)(),ae=Object(H.useState)(!1),he=Object(M.a)(ae,2),ve=he[0],Te=he[1];function Ge(){var st;return Ke.current&&(st=new D.default(function(dt){var Et=Object(W.a)(dt),jt;try{for(Et.s();!(jt=Et.n()).done;){var en=jt.value;(en.target.offsetHeight>0||en.target.offsetWidth>0)&&Xe.current.instance.layout()}}catch(Yt){Et.e(Yt)}finally{Et.f()}}),st.observe(Ke.current)),st}function ot(){V.b.warn(decodeURIComponent(_))}var Tt=function(){var dt=Xe.current.instance;if(Fe!=null&&dt&&ve){var Et=dt.getModel();Et&&Fe!==Et.getValue()&&(v=!0,Et.setValue(Fe),dt.layout(),v=!1)}};Object(H.useEffect)(function(){ge.current&&clearTimeout(ge.current),ge.current=setTimeout(function(){Tt()},500)},[Fe,ve,Xe.current]),Object(H.useEffect)(function(){if(Ne&&Xe.current&&Xe.current.instance){var st=Xe.current.instance;st.changeViewZones(function(Et){var jt=document.createElement("div");jt.style.padding="10px 20px",jt.style.width="calc(100% - 20px)",jt.className="my-error-line-wrp",jt.innerHTML=nt,Et.addZone({afterLineNumber:Ne||11,heightInLines:3,domNode:jt})});var dt={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}};st.addOverlayWidget(dt),st.revealPositionInCenter({lineNumber:20,column:1})}},[Ne,Xe.current,ve]);function Ot(){var st=Xe.current.instance;if(st){var dt=st.getSelection(),Et=Xe.current.pastePos||{},jt=new C.Range(Et.startLineNumber||dt.endLineNumber,Et.startColumn||dt.endColumn,Et.endLineNumber||dt.endLineNumber,Et.endColumn||dt.endColumn);setTimeout(function(){st.executeEdits("",[{range:jt,text:""}])},300)}}function wt(st){(window.navigator.platform.match("Mac")?st.metaKey:st.ctrlKey)&&st.keyCode==83&&(st.preventDefault(),ke())}var vt=function(){if(et&&Xe.current.instance){var dt=Xe.current.instance.getContentHeight();We(dt<de?de:dt)}else We(de)};function qe(st){var dt=document.createEvent("MouseEvents");dt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),st.dispatchEvent(dt)}function Qe(st,dt){var Et=window.URL||window.webkitURL||window,jt=new Blob([dt]),en=document.createElementNS("http://www.w3.org/1999/xhtml","a");en.href=Et.createObjectURL(jt),en.download=st,qe(en)}Object(H.useEffect)(function(){vt()},[vt]),Object(H.useEffect)(function(){Ke.current&&!ve&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(st){try{C=st,Xe.current.instance=C.editor.create(Ke.current,{value:Fe,language:x(Re),theme:Pe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},xe);var dt=Xe.current.instance,Et=b.d._menuItems,jt=Object(z.a)(Et).find(function(Rt){return Rt[0]._debugName=="EditorContext"}),en=jt[1],Yt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ct=function(zt,Pt){var qt=zt._first;do{var yn,wn,yt=Pt.includes((yn=qt.element)===null||yn===void 0||((wn=yn.command)===null||wn===void 0)?void 0:wn.id);yt&&zt._remove(qt)}while(qt=qt.next)};if(ct(dt,C),setTimeout(function(){vt(),Xe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Qe(bt||"educoder.txt",dt.getValue())}}),dt.getDomNode().addEventListener("input",function(){Se.current.autoFormat&&dt.getAction("editor.action.formatDocument").run()})},500),Xe.current.subscription=dt.onDidChangeModelContent(function(Rt){Ee.current?clearTimeout(ie.current):(vt(),De(dt.getValue(),Rt)),ie.current=setTimeout(function(){Ee.current=!1},500)}),window.Monaco||O(C,x(Re)),_e&&(Ct(en,Yt),Ke.current.classList.add("noCopyPaste"),dt.onKeyDown(function(Rt){var zt=Rt.keyCode,Pt=Rt.ctrlKey,qt=Rt.metaKey;(zt===33||zt===52)&&(qt||Pt)&&(ot(),Rt.preventDefault())})),window.Monaco=C,He&&dt.onDidBlurEditorWidget(function(){He(dt.getValue())}),ut&&dt.onDidFocusEditorText(function(){ut(dt.getValue())}),_e){dt.addCommand(C.KeyMod.CtrlCmd|C.KeyCode.KEY_V,function(){return ot(),null}),dt.onDidPaste(function(Rt){Xe.current.pastePos=Rt});try{window.addEventListener("paste",Ot)}catch(Rt){}}var pn=Ge();return Te(!0),function(){var Rt=Xe.current.instance;Rt.dispose();var zt=Rt.getModel();zt&&zt.dispose(),Xe.current.subscription&&Xe.current.subscription.dispose(),_e&&window.removeEventListener("paste",Ot),pn.unobserve(Ke.current)}}catch(Rt){}})},[]),Object(H.useEffect)(function(){var st=Xe.current.instance;if(st&&ve)return document.addEventListener("keydown",wt,!1),function(){document.removeEventListener("keydown",wt)}},[ke,ve]),Object(H.useEffect)(function(){var st=Xe.current.instance;if(st&&ve){var dt=x(Re);C.editor.setModelLanguage(st.getModel(),dt),console.log("language:",Re,st.getModel(),dt)}},[Re,ve]),Object(H.useEffect)(function(){var st=Xe.current.instance;st&&ve&&C.editor.setTheme(Pe)},[Pe,ve]),Object(H.useEffect)(function(){var st=Xe.current.instance;Se.current=fe,st&&ve&&(st.updateOptions(Object(Z.a)({},fe)),setTimeout(function(){st.getModel().updateOptions(Object(Z.a)({},fe))},200))},[JSON.stringify(fe),ve]),Object(H.useEffect)(function(){var st=Xe.current.instance;st&&ve&&st.layout()},[$,de,ve]);var Ue=Object(H.useState)(A($)),ue=Object(M.a)(Ue,2),me=ue[0],$e=ue[1],je=Object(H.useState)(A(de)),Je=Object(M.a)(je,2),mt=Je[0],We=Je[1],it=Object(Z.a)(Object(Z.a)({},Be),{},{width:me,height:mt});return n.a.createElement("div",{className:"my-monaco-editor",ref:Ke,style:it})};function B(w){var Y=w.width,$=Y===void 0?"100%":Y,oe=w.height,de=oe===void 0?"100%":oe,Fe=w.original,Ae=w.modified,Re=w.language,Me=w.options,Be=Me===void 0?{}:Me,pe=Object(H.useRef)(),fe=Object(H.useState)(null),ne=Object(M.a)(fe,2),xe=ne[0],ce=ne[1];function Pe(et){var le;return pe.current&&(le=new D.default(function(_e){var Ce=Object(W.a)(_e),De;try{for(Ce.s();!(De=Ce.n()).done;){var tt=De.value;(tt.target.offsetHeight>0||tt.target.offsetWidth>0)&&et.layout()}}catch(ct){Ce.e(ct)}finally{Ce.f()}}),le.observe(pe.current)),le}Object(H.useEffect)(function(){pe.current&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(et){C=et;var le=C.editor.createDiffEditor(pe.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},Be),{},{wordWrap:!0}));ce(le);var _e=Pe(le);return function(){le.dispose();var Ce=le.getModel();Ce&&Ce.dispose(),_e.unobserve(pe.current)}})},[]),Object(H.useEffect)(function(){xe&&xe.setModel({original:C.editor.createModel(Fe,Re),modified:C.editor.createModel(Ae,Re)})},[Fe,Ae,Re,xe]);var He=A($),ke=A(de),Ve={width:He,height:ke};return n.a.createElement("div",{className:"my-diff-editor",ref:pe,style:Ve})}},ZpRC:function(Ye,se,U){"use strict";function Z(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function z(y,m){return(!m||y!=="hidden")&&y!=="visible"&&y!=="clip"}function N(y,m){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var f=getComputedStyle(y,null);return z(f.overflowY,m)||z(f.overflowX,m)||function(c){var l=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(o){return null}}(c);return!!l&&(l.clientHeight<c.scrollHeight||l.clientWidth<c.scrollWidth)}(y)}return!1}function V(y,m,f,c,l,d,o,u){return d<y&&o>m||d>y&&o<m?0:d<=y&&u<=f||o>=m&&u>=f?d-y-c:o>m&&u<f||d<y&&u>f?o-m+l:0}var W=function(y,m){var f=window,c=m.scrollMode,l=m.block,d=m.inline,o=m.boundary,u=m.skipOverflowHiddenElements,a=typeof o=="function"?o:function(et){return et!==o};if(!Z(y))throw new TypeError("Invalid target");for(var i=document.scrollingElement||document.documentElement,R=[],S=y;Z(S)&&a(S);){if((S=S.parentElement)===i){R.push(S);break}S!=null&&S===document.body&&N(S)&&!N(document.documentElement)||S!=null&&N(S,u)&&R.push(S)}for(var T=f.visualViewport?f.visualViewport.width:innerWidth,I=f.visualViewport?f.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,b=y.getBoundingClientRect(),p=b.height,h=b.width,A=b.top,E=b.right,v=b.bottom,P=b.left,x=l==="start"||l==="nearest"?A:l==="end"?v:A+p/2,C=d==="center"?P+h/2:d==="end"?E:P,j=[],B=0;B<R.length;B++){var w=R[B],Y=w.getBoundingClientRect(),$=Y.height,oe=Y.width,de=Y.top,Fe=Y.right,Ae=Y.bottom,Re=Y.left;if(c==="if-needed"&&A>=0&&P>=0&&v<=I&&E<=T&&A>=de&&v<=Ae&&P>=Re&&E<=Fe)return j;var Me=getComputedStyle(w),Be=parseInt(Me.borderLeftWidth,10),pe=parseInt(Me.borderTopWidth,10),fe=parseInt(Me.borderRightWidth,10),ne=parseInt(Me.borderBottomWidth,10),xe=0,ce=0,Pe="offsetWidth"in w?w.offsetWidth-w.clientWidth-Be-fe:0,He="offsetHeight"in w?w.offsetHeight-w.clientHeight-pe-ne:0;if(i===w)xe=l==="start"?x:l==="end"?x-I:l==="nearest"?V(_,_+I,I,pe,ne,_+x,_+x+p,p):x-I/2,ce=d==="start"?C:d==="center"?C-T/2:d==="end"?C-T:V(O,O+T,T,Be,fe,O+C,O+C+h,h),xe=Math.max(0,xe+_),ce=Math.max(0,ce+O);else{xe=l==="start"?x-de-pe:l==="end"?x-Ae+ne+He:l==="nearest"?V(de,Ae,$,pe,ne+He,x,x+p,p):x-(de+$/2)+He/2,ce=d==="start"?C-Re-Be:d==="center"?C-(Re+oe/2)+Pe/2:d==="end"?C-Fe+fe+Pe:V(Re,Fe,oe,Be,fe+Pe,C,C+h,h);var ke=w.scrollLeft,Ve=w.scrollTop;x+=Ve-(xe=Math.max(0,Math.min(Ve+xe,w.scrollHeight-$+He))),C+=ke-(ce=Math.max(0,Math.min(ke+ce,w.scrollWidth-oe+Pe)))}j.push({el:w,top:xe,left:ce})}return j};function M(y){return y===Object(y)&&Object.keys(y).length!==0}function K(y,m){m===void 0&&(m="auto");var f="scrollBehavior"in document.body.style;y.forEach(function(c){var l=c.el,d=c.top,o=c.left;l.scroll&&f?l.scroll({top:d,left:o,behavior:m}):(l.scrollTop=d,l.scrollLeft=o)})}function H(y){return y===!1?{block:"end",inline:"nearest"}:M(y)?y:{block:"start",inline:"nearest"}}function n(y,m){var f=!y.ownerDocument.documentElement.contains(y);if(M(m)&&typeof m.behavior=="function")return m.behavior(f?[]:W(y,m));if(f)return;var c=H(m);return K(W(y,c),c.behavior)}var D=se.a=n},Zss7:function(Ye,se,U){var Z;(function(z){var N=/^\s+/,V=/\s+$/,W=0,M=z.round,K=z.min,H=z.max,n=z.random;function D(ne,xe){if(ne=ne||"",xe=xe||{},ne instanceof D)return ne;if(!(this instanceof D))return new D(ne,xe);var ce=y(ne);this._originalInput=ne,this._r=ce.r,this._g=ce.g,this._b=ce.b,this._a=ce.a,this._roundA=M(100*this._a)/100,this._format=xe.format||ce.format,this._gradientType=xe.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=ce.ok,this._tc_id=W++}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ne=this.toRgb();return(ne.r*299+ne.g*587+ne.b*114)/1e3},getLuminance:function(){var ne=this.toRgb(),xe,ce,Pe,He,ke,Ve;return xe=ne.r/255,ce=ne.g/255,Pe=ne.b/255,xe<=.03928?He=xe/12.92:He=z.pow((xe+.055)/1.055,2.4),ce<=.03928?ke=ce/12.92:ke=z.pow((ce+.055)/1.055,2.4),Pe<=.03928?Ve=Pe/12.92:Ve=z.pow((Pe+.055)/1.055,2.4),.2126*He+.7152*ke+.0722*Ve},setAlpha:function(ne){return this._a=j(ne),this._roundA=M(100*this._a)/100,this},toHsv:function(){var ne=l(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=l(this._r,this._g,this._b),xe=M(ne.h*360),ce=M(ne.s*100),Pe=M(ne.v*100);return this._a==1?"hsv("+xe+", "+ce+"%, "+Pe+"%)":"hsva("+xe+", "+ce+"%, "+Pe+"%, "+this._roundA+")"},toHsl:function(){var ne=f(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=f(this._r,this._g,this._b),xe=M(ne.h*360),ce=M(ne.s*100),Pe=M(ne.l*100);return this._a==1?"hsl("+xe+", "+ce+"%, "+Pe+"%)":"hsla("+xe+", "+ce+"%, "+Pe+"%, "+this._roundA+")"},toHex:function(ne){return o(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return u(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(B(this._r,255)*100)+"%",g:M(B(this._g,255)*100)+"%",b:M(B(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(B(this._r,255)*100)+"%, "+M(B(this._g,255)*100)+"%, "+M(B(this._b,255)*100)+"%)":"rgba("+M(B(this._r,255)*100)+"%, "+M(B(this._g,255)*100)+"%, "+M(B(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:x[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(ne){var xe="#"+a(this._r,this._g,this._b,this._a),ce=xe,Pe=this._gradientType?"GradientType = 1, ":"";if(ne){var He=D(ne);ce="#"+a(He._r,He._g,He._b,He._a)}return"progid:DXImageTransform.Microsoft.gradient("+Pe+"startColorstr="+xe+",endColorstr="+ce+")"},toString:function(ne){var xe=!!ne;ne=ne||this._format;var ce=!1,Pe=this._a<1&&this._a>=0,He=!xe&&Pe&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return He?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(ce=this.toRgbString()),ne==="prgb"&&(ce=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(ce=this.toHexString()),ne==="hex3"&&(ce=this.toHexString(!0)),ne==="hex4"&&(ce=this.toHex8String(!0)),ne==="hex8"&&(ce=this.toHex8String()),ne==="name"&&(ce=this.toName()),ne==="hsl"&&(ce=this.toHslString()),ne==="hsv"&&(ce=this.toHsvString()),ce||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(ne,xe){var ce=ne.apply(null,[this].concat([].slice.call(xe)));return this._r=ce._r,this._g=ce._g,this._b=ce._b,this.setAlpha(ce._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(I,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(i,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(ne,xe){return ne.apply(null,[this].concat([].slice.call(xe)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(v,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(p,arguments)},tetrad:function(){return this._applyCombination(h,arguments)}},D.fromRatio=function(ne,xe){if(typeof ne=="object"){var ce={};for(var Pe in ne)ne.hasOwnProperty(Pe)&&(Pe==="a"?ce[Pe]=ne[Pe]:ce[Pe]=Fe(ne[Pe]));ne=ce}return D(ne,xe)};function y(ne){var xe={r:0,g:0,b:0},ce=1,Pe=null,He=null,ke=null,Ve=!1,et=!1;return typeof ne=="string"&&(ne=pe(ne)),typeof ne=="object"&&(Be(ne.r)&&Be(ne.g)&&Be(ne.b)?(xe=m(ne.r,ne.g,ne.b),Ve=!0,et=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):Be(ne.h)&&Be(ne.s)&&Be(ne.v)?(Pe=Fe(ne.s),He=Fe(ne.v),xe=d(ne.h,Pe,He),Ve=!0,et="hsv"):Be(ne.h)&&Be(ne.s)&&Be(ne.l)&&(Pe=Fe(ne.s),ke=Fe(ne.l),xe=c(ne.h,Pe,ke),Ve=!0,et="hsl"),ne.hasOwnProperty("a")&&(ce=ne.a)),ce=j(ce),{ok:Ve,format:ne.format||et,r:K(255,H(xe.r,0)),g:K(255,H(xe.g,0)),b:K(255,H(xe.b,0)),a:ce}}function m(ne,xe,ce){return{r:B(ne,255)*255,g:B(xe,255)*255,b:B(ce,255)*255}}function f(ne,xe,ce){ne=B(ne,255),xe=B(xe,255),ce=B(ce,255);var Pe=H(ne,xe,ce),He=K(ne,xe,ce),ke,Ve,et=(Pe+He)/2;if(Pe==He)ke=Ve=0;else{var le=Pe-He;Ve=et>.5?le/(2-Pe-He):le/(Pe+He);switch(Pe){case ne:ke=(xe-ce)/le+(xe<ce?6:0);break;case xe:ke=(ce-ne)/le+2;break;case ce:ke=(ne-xe)/le+4;break}ke/=6}return{h:ke,s:Ve,l:et}}function c(ne,xe,ce){var Pe,He,ke;ne=B(ne,360),xe=B(xe,100),ce=B(ce,100);function Ve(_e,Ce,De){return De<0&&(De+=1),De>1&&(De-=1),De<1/6?_e+(Ce-_e)*6*De:De<1/2?Ce:De<2/3?_e+(Ce-_e)*(2/3-De)*6:_e}if(xe===0)Pe=He=ke=ce;else{var et=ce<.5?ce*(1+xe):ce+xe-ce*xe,le=2*ce-et;Pe=Ve(le,et,ne+1/3),He=Ve(le,et,ne),ke=Ve(le,et,ne-1/3)}return{r:Pe*255,g:He*255,b:ke*255}}function l(ne,xe,ce){ne=B(ne,255),xe=B(xe,255),ce=B(ce,255);var Pe=H(ne,xe,ce),He=K(ne,xe,ce),ke,Ve,et=Pe,le=Pe-He;if(Ve=Pe===0?0:le/Pe,Pe==He)ke=0;else{switch(Pe){case ne:ke=(xe-ce)/le+(xe<ce?6:0);break;case xe:ke=(ce-ne)/le+2;break;case ce:ke=(ne-xe)/le+4;break}ke/=6}return{h:ke,s:Ve,v:et}}function d(ne,xe,ce){ne=B(ne,360)*6,xe=B(xe,100),ce=B(ce,100);var Pe=z.floor(ne),He=ne-Pe,ke=ce*(1-xe),Ve=ce*(1-He*xe),et=ce*(1-(1-He)*xe),le=Pe%6,_e=[ce,Ve,ke,ke,et,ce][le],Ce=[et,ce,ce,Ve,ke,ke][le],De=[ke,ke,et,ce,ce,Ve][le];return{r:_e*255,g:Ce*255,b:De*255}}function o(ne,xe,ce,Pe){var He=[de(M(ne).toString(16)),de(M(xe).toString(16)),de(M(ce).toString(16))];return Pe&&He[0].charAt(0)==He[0].charAt(1)&&He[1].charAt(0)==He[1].charAt(1)&&He[2].charAt(0)==He[2].charAt(1)?He[0].charAt(0)+He[1].charAt(0)+He[2].charAt(0):He.join("")}function u(ne,xe,ce,Pe,He){var ke=[de(M(ne).toString(16)),de(M(xe).toString(16)),de(M(ce).toString(16)),de(Ae(Pe))];return He&&ke[0].charAt(0)==ke[0].charAt(1)&&ke[1].charAt(0)==ke[1].charAt(1)&&ke[2].charAt(0)==ke[2].charAt(1)&&ke[3].charAt(0)==ke[3].charAt(1)?ke[0].charAt(0)+ke[1].charAt(0)+ke[2].charAt(0)+ke[3].charAt(0):ke.join("")}function a(ne,xe,ce,Pe){var He=[de(Ae(Pe)),de(M(ne).toString(16)),de(M(xe).toString(16)),de(M(ce).toString(16))];return He.join("")}D.equals=function(ne,xe){return!ne||!xe?!1:D(ne).toRgbString()==D(xe).toRgbString()},D.random=function(){return D.fromRatio({r:n(),g:n(),b:n()})};function i(ne,xe){xe=xe===0?0:xe||10;var ce=D(ne).toHsl();return ce.s-=xe/100,ce.s=w(ce.s),D(ce)}function R(ne,xe){xe=xe===0?0:xe||10;var ce=D(ne).toHsl();return ce.s+=xe/100,ce.s=w(ce.s),D(ce)}function S(ne){return D(ne).desaturate(100)}function T(ne,xe){xe=xe===0?0:xe||10;var ce=D(ne).toHsl();return ce.l+=xe/100,ce.l=w(ce.l),D(ce)}function I(ne,xe){xe=xe===0?0:xe||10;var ce=D(ne).toRgb();return ce.r=H(0,K(255,ce.r-M(255*-(xe/100)))),ce.g=H(0,K(255,ce.g-M(255*-(xe/100)))),ce.b=H(0,K(255,ce.b-M(255*-(xe/100)))),D(ce)}function O(ne,xe){xe=xe===0?0:xe||10;var ce=D(ne).toHsl();return ce.l-=xe/100,ce.l=w(ce.l),D(ce)}function _(ne,xe){var ce=D(ne).toHsl(),Pe=(ce.h+xe)%360;return ce.h=Pe<0?360+Pe:Pe,D(ce)}function b(ne){var xe=D(ne).toHsl();return xe.h=(xe.h+180)%360,D(xe)}function p(ne){var xe=D(ne).toHsl(),ce=xe.h;return[D(ne),D({h:(ce+120)%360,s:xe.s,l:xe.l}),D({h:(ce+240)%360,s:xe.s,l:xe.l})]}function h(ne){var xe=D(ne).toHsl(),ce=xe.h;return[D(ne),D({h:(ce+90)%360,s:xe.s,l:xe.l}),D({h:(ce+180)%360,s:xe.s,l:xe.l}),D({h:(ce+270)%360,s:xe.s,l:xe.l})]}function A(ne){var xe=D(ne).toHsl(),ce=xe.h;return[D(ne),D({h:(ce+72)%360,s:xe.s,l:xe.l}),D({h:(ce+216)%360,s:xe.s,l:xe.l})]}function E(ne,xe,ce){xe=xe||6,ce=ce||30;var Pe=D(ne).toHsl(),He=360/ce,ke=[D(ne)];for(Pe.h=(Pe.h-(He*xe>>1)+720)%360;--xe;)Pe.h=(Pe.h+He)%360,ke.push(D(Pe));return ke}function v(ne,xe){xe=xe||6;for(var ce=D(ne).toHsv(),Pe=ce.h,He=ce.s,ke=ce.v,Ve=[],et=1/xe;xe--;)Ve.push(D({h:Pe,s:He,v:ke})),ke=(ke+et)%1;return Ve}D.mix=function(ne,xe,ce){ce=ce===0?0:ce||50;var Pe=D(ne).toRgb(),He=D(xe).toRgb(),ke=ce/100,Ve={r:(He.r-Pe.r)*ke+Pe.r,g:(He.g-Pe.g)*ke+Pe.g,b:(He.b-Pe.b)*ke+Pe.b,a:(He.a-Pe.a)*ke+Pe.a};return D(Ve)},D.readability=function(ne,xe){var ce=D(ne),Pe=D(xe);return(z.max(ce.getLuminance(),Pe.getLuminance())+.05)/(z.min(ce.getLuminance(),Pe.getLuminance())+.05)},D.isReadable=function(ne,xe,ce){var Pe=D.readability(ne,xe),He,ke;ke=!1,He=fe(ce);switch(He.level+He.size){case"AAsmall":case"AAAlarge":ke=Pe>=4.5;break;case"AAlarge":ke=Pe>=3;break;case"AAAsmall":ke=Pe>=7;break}return ke},D.mostReadable=function(ne,xe,ce){var Pe=null,He=0,ke,Ve,et,le;ce=ce||{},Ve=ce.includeFallbackColors,et=ce.level,le=ce.size;for(var _e=0;_e<xe.length;_e++)ke=D.readability(ne,xe[_e]),ke>He&&(He=ke,Pe=D(xe[_e]));return D.isReadable(ne,Pe,{level:et,size:le})||!Ve?Pe:(ce.includeFallbackColors=!1,D.mostReadable(ne,["#fff","#000"],ce))};var P=D.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},x=D.hexNames=C(P);function C(ne){var xe={};for(var ce in ne)ne.hasOwnProperty(ce)&&(xe[ne[ce]]=ce);return xe}function j(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function B(ne,xe){$(ne)&&(ne="100%");var ce=oe(ne);return ne=K(xe,H(0,parseFloat(ne))),ce&&(ne=parseInt(ne*xe,10)/100),z.abs(ne-xe)<1e-6?1:ne%xe/parseFloat(xe)}function w(ne){return K(1,H(0,ne))}function Y(ne){return parseInt(ne,16)}function $(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function oe(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function de(ne){return ne.length==1?"0"+ne:""+ne}function Fe(ne){return ne<=1&&(ne=ne*100+"%"),ne}function Ae(ne){return z.round(parseFloat(ne)*255).toString(16)}function Re(ne){return Y(ne)/255}var Me=function(){var ne="[-\\+]?\\d+%?",xe="[-\\+]?\\d*\\.\\d+%?",ce="(?:"+xe+")|(?:"+ne+")",Pe="[\\s|\\(]+("+ce+")[,|\\s]+("+ce+")[,|\\s]+("+ce+")\\s*\\)?",He="[\\s|\\(]+("+ce+")[,|\\s]+("+ce+")[,|\\s]+("+ce+")[,|\\s]+("+ce+")\\s*\\)?";return{CSS_UNIT:new RegExp(ce),rgb:new RegExp("rgb"+Pe),rgba:new RegExp("rgba"+He),hsl:new RegExp("hsl"+Pe),hsla:new RegExp("hsla"+He),hsv:new RegExp("hsv"+Pe),hsva:new RegExp("hsva"+He),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Be(ne){return!!Me.CSS_UNIT.exec(ne)}function pe(ne){ne=ne.replace(N,"").replace(V,"").toLowerCase();var xe=!1;if(P[ne])ne=P[ne],xe=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ce;return(ce=Me.rgb.exec(ne))?{r:ce[1],g:ce[2],b:ce[3]}:(ce=Me.rgba.exec(ne))?{r:ce[1],g:ce[2],b:ce[3],a:ce[4]}:(ce=Me.hsl.exec(ne))?{h:ce[1],s:ce[2],l:ce[3]}:(ce=Me.hsla.exec(ne))?{h:ce[1],s:ce[2],l:ce[3],a:ce[4]}:(ce=Me.hsv.exec(ne))?{h:ce[1],s:ce[2],v:ce[3]}:(ce=Me.hsva.exec(ne))?{h:ce[1],s:ce[2],v:ce[3],a:ce[4]}:(ce=Me.hex8.exec(ne))?{r:Y(ce[1]),g:Y(ce[2]),b:Y(ce[3]),a:Re(ce[4]),format:xe?"name":"hex8"}:(ce=Me.hex6.exec(ne))?{r:Y(ce[1]),g:Y(ce[2]),b:Y(ce[3]),format:xe?"name":"hex"}:(ce=Me.hex4.exec(ne))?{r:Y(ce[1]+""+ce[1]),g:Y(ce[2]+""+ce[2]),b:Y(ce[3]+""+ce[3]),a:Re(ce[4]+""+ce[4]),format:xe?"name":"hex8"}:(ce=Me.hex3.exec(ne))?{r:Y(ce[1]+""+ce[1]),g:Y(ce[2]+""+ce[2]),b:Y(ce[3]+""+ce[3]),format:xe?"name":"hex"}:!1}function fe(ne){var xe,ce;return ne=ne||{level:"AA",size:"small"},xe=(ne.level||"AA").toUpperCase(),ce=(ne.size||"small").toLowerCase(),xe!=="AA"&&xe!=="AAA"&&(xe="AA"),ce!=="small"&&ce!=="large"&&(ce="small"),{level:xe,size:ce}}Ye.exports?Ye.exports=D:!(Z=function(){return D}.call(se,U,se,Ye),Z!==void 0&&(Ye.exports=Z))})(Math)},bPs0:function(Ye,se,U){"use strict";U.d(se,"b",function(){return i});var Z=U("k1fw"),z=U("9og8"),N=U("2qtc"),V=U("kLXV"),W=U("tJVT"),M=U("PpiC"),K=U("aHsQ"),H=U("sGsY"),n=U("WmNS"),D=U.n(n),y=U("q1tI"),m=U.n(y),f=U("bntm"),c=U("V0Rq"),l=U("wd/R"),d=U.n(l),o=U("Ty5D"),u=U("9kvl"),a=H.a.Countdown,i=["fullscreenchange","msfullscreenchange","webkitfullscreenchange","mozfullscreenchange"],R=function(T){var I=T.globalSetting,O=T.loading,_=T.user,b=T.exercise,p=T.socket,h=T.dispatch,A=Object(M.a)(T,["globalSetting","loading","user","exercise","socket","dispatch"]),E=Object(y.useState)({}),v=Object(W.a)(E,2),P=v[0],x=v[1],C=V.a.useModal(),j=Object(W.a)(C,2),B=j[0],w=j[1],Y=Object(y.useRef)(),$=Object(y.useRef)(null),oe=Object(y.useRef)(null),de=Object(y.useState)(!0),Fe=Object(W.a)(de,2),Ae=Fe[0],Re=Fe[1],Me=Object(o.h)().query,Be=Object(o.i)();Object(y.useEffect)(function(){var le,_e,Ce,De,tt;if(clearTimeout($.current),document.addEventListener(Object(f.c)(),et,!1),window.addEventListener("blur",ke,!1),(le=b.exerciseUserInfo)!==null&&le!==void 0&&le.screen_open&&Object(f.a)()&&(h({type:"globalSetting/headerFooterToggle",payload:!1}),Re(!1)),(_e=b.exerciseUserInfo)!==null&&_e!==void 0&&_e.screen_at&&d()().diff(d()((Ce=b.exerciseUserInfo)===null||Ce===void 0?void 0:Ce.screen_at),"seconds")>0)pe();else if((De=b.exerciseUserInfo)!==null&&De!==void 0&&De.screen_open&&!Object(f.a)()){var ct=document.domain==="kepukehuan.educoder.net"?30:b.exerciseUserInfo.screen_sec+10+1;Y.current=V.a.info({icon:null,content:m.a.createElement("div",{className:"tc font16"},"\u672C\u573A\u8003\u8BD5\u5DF2\u5F00\u542F\u9632\u5207\u5C4F\u9650\u5236\uFF0C",m.a.createElement("br",null),"\u5207\u6362\u9875\u9762"," ",b.exerciseUserInfo.screen_num-b.exerciseUserInfo.used_screen_num," ","\u6B21\u540E\u5C06\u8FDB\u884C\u5F3A\u5236\u4EA4\u5377\uFF0C",m.a.createElement("br",null),"\u8BF7\u52FF\u5207\u5C4F\u53CA\u5237\u65B0\u9875\u9762"),okText:m.a.createElement("span",null,"\u5F00\u59CB\u8003\u8BD5\uFF08",m.a.createElement("span",{style:{display:"inline-block"}},m.a.createElement(a,{onFinish:function(){var ut;pe(),(ut=Y.current)===null||ut===void 0||ut.destroy()},valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+ct*1e3})),"S\uFF09"),onOk:function(){var ut;(ut=Y.current)===null||ut===void 0||ut.destroy(),Re(!1),Object(f.d)(document.body),document.getElementById("root").addEventListener("click",fe,!1)}})}return(tt=b.exerciseUserInfo)!==null&&tt!==void 0&&tt.screen_open&&!Object(f.a)()||document.getElementById("root").addEventListener("click",fe,!1),function(){document.getElementById("root").removeEventListener("click",fe,!1),document.removeEventListener(Object(f.c)(),et,!1),window.removeEventListener("blur",ke,!1),clearTimeout($.current)}},[]),Object(y.useEffect)(function(){setTimeout(function(){b.actionTabs.removeEventListenerExitScreen&&(clearTimeout($.current),document.getElementById("root").removeEventListener("click",fe,!1),document.removeEventListener(Object(f.c)(),et,!1))},500),ne()},[b.actionTabs]),Object(y.useEffect)(function(){setTimeout(function(){b.exerciseUserInfo.used_screen_num>b.exerciseUserInfo.screen_num?Pe():!Ae},500)},[b.exerciseUserInfo]);var pe=function(){var le=Object(z.a)(D.a.mark(function _e(){var Ce;return D.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.next=2,Ve();case 2:Ce=tt.sent,setTimeout(function(){var ct,ft;(ct=Y.current)===null||ct===void 0||ct.destroy(),Y.current=V.a.info({okText:m.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:m.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",m.a.createElement("span",{className:"c-red"},Ce.used_screen_num),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",m.a.createElement("span",{className:"c-red"},(ft=b.exerciseUserInfo)===null||ft===void 0?void 0:ft.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377"),onOk:function(){var ut=Object(z.a)(D.a.mark(function bt(){return D.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:Object(f.d)(document.body);case 1:case"end":return Oe.stop()}},bt)}));function xt(){return ut.apply(this,arguments)}return xt}()})},1e3);case 4:case"end":return tt.stop()}},_e)}));return function(){return le.apply(this,arguments)}}(),fe=function(_e){!Object(f.a)()&&_e.target.nodeName!=="A"&&_e.target.nodeName!=="BUTTON"&&_e.target.innerHTML!=="\u786E \u5B9A"&&(Object(f.d)(document.body),console.log("documentClick.full"))},ne=function(){var le=Object(z.a)(D.a.mark(function _e(){return D.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.abrupt("return",new Promise(function(){var tt=Object(z.a)(D.a.mark(function ct(ft){var ut;return D.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,h({type:"exercise/getExerciseUserInfo",payload:Object(Z.a)({},Be)});case 2:return ut=bt.sent,ft(ut==null?void 0:ut.data),bt.abrupt("return",ut==null?void 0:ut.data);case 5:case"end":return bt.stop()}},ct)}));return function(ct){return tt.apply(this,arguments)}}()));case 1:case"end":return De.stop()}},_e)}));return function(){return le.apply(this,arguments)}}(),xe=function(){var le=Object(z.a)(D.a.mark(function _e(Ce){var De,tt,ct;return D.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:(De=Y.current)===null||De===void 0||((tt=De.destroyAll)===null||tt===void 0)||tt.call(De),Y.current=V.a.info({maskClosable:!1,keyboard:!1,okText:m.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5\uFF08",m.a.createElement("span",{style:{display:"inline-block"}},m.a.createElement(a,{onFinish:Ve,valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+(b.exerciseUserInfo.screen_sec+1)*1e3})),"S\uFF09"),content:m.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",m.a.createElement("span",{className:"c-red"},Ce),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",m.a.createElement("span",{className:"c-red"},(ct=b.exerciseUserInfo)===null||ct===void 0?void 0:ct.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377,",m.a.createElement("span",{className:"c-red"},b.exerciseUserInfo.screen_sec),"\u79D2\u5185\u56DE\u5230",m.a.createElement("br",null),m.a.createElement("span",{style:{marginLeft:38}},"\u8003\u8BD5\u4E0D\u8BA1\u5207\u5C4F\u6B21\u6570\u3002")),onOk:function(){var xt=Object(z.a)(D.a.mark(function Ne(){return D.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:clearTimeout(oe.current),Object(f.d)(document.body),Y.current.destroy();case 3:case"end":return nt.stop()}},Ne)}));function bt(){return xt.apply(this,arguments)}return bt}()}),oe.current=setTimeout(function(){var xt;Y.current.update({okText:m.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:m.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",m.a.createElement("span",{className:"c-red"},Ce+1),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",m.a.createElement("span",{className:"c-red"},(xt=b.exerciseUserInfo)===null||xt===void 0?void 0:xt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377")})},(b.exerciseUserInfo.screen_sec+1)*1e3);case 3:case"end":return ut.stop()}},_e)}));return function(Ce){return le.apply(this,arguments)}}(),ce=function(){location.href="/classrooms/".concat(Be.coursesId,"/exercise/").concat(Be.categoryId,"/detail")},Pe=function(){var le=Object(z.a)(D.a.mark(function _e(){var Ce,De,tt;return D.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return(Ce=Y.current)===null||Ce===void 0||((De=Ce.destroyAll)===null||De===void 0)||De.call(Ce),ft.next=3,Object(c.bb)({categoryId:Be.categoryId,commit_method:1});case 3:if(tt=ft.sent,tt){try{p.send(JSON.stringify({type:"toggleLockExit",data:!1})),p.send(JSON.stringify({type:"network-open",data:""}))}catch(ut){}He()}case 5:case"end":return ft.stop()}},_e)}));return function(){return le.apply(this,arguments)}}(),He=function(){var _e,Ce;document.removeEventListener(Object(f.c)(),et,!1),Object(f.b)(),(_e=Y.current)===null||_e===void 0||((Ce=_e.destroyAll)===null||Ce===void 0)||Ce.call(_e);try{p.send(JSON.stringify({type:"toggleLockExit",data:!1})),p.send(JSON.stringify({type:"network-open",data:""}))}catch(De){}B.info({content:m.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",m.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){ce()}})},ke=function(_e){Object(f.a)()&&document.getElementById("iframeShixuns").style.display=="none"&&Object(f.b)()},Ve=function(){var le=Object(z.a)(D.a.mark(function _e(){return D.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.abrupt("return",new Promise(function(){var tt=Object(z.a)(D.a.mark(function ct(ft){var ut,xt,bt;return D.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(!((ut=b.exerciseUserInfo)!==null&&ut!==void 0&&ut.screen_at)){Oe.next=3;break}return Oe.next=3,Object(c.h)(Object(Z.a)(Object(Z.a)({},Be),{},{reset:!0}));case 3:return Oe.next=5,Object(c.S)({id:Be.categoryId});case 5:if(xt=Oe.sent,!(xt!=null&&xt.is_commit)){Oe.next=9;break}return He(),Oe.abrupt("return");case 9:return Oe.next=11,ne();case 11:bt=Oe.sent,ft(bt);case 13:case"end":return Oe.stop()}},ct)}));return function(ct){return tt.apply(this,arguments)}}()));case 1:case"end":return De.stop()}},_e)}));return function(){return le.apply(this,arguments)}}(),et=function(){var le=Object(z.a)(D.a.mark(function _e(){var Ce,De,tt,ct;return D.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(Ce=!1,console.log("fullscreen change"),!Object(f.a)()){ut.next=7;break}(De=b.exerciseUserInfo)!==null&&De!==void 0&&De.screen_at&&Object(c.h)(Object(Z.a)(Object(Z.a)({},Be),{},{reset:!0})),clearTimeout($.current),ut.next=17;break;case 7:return Ce=!0,ut.next=10,Object(c.h)(Object(Z.a)({},Be));case 10:return ut.next=12,ne();case 12:tt=ut.sent,xe(tt.used_screen_num),ct=setTimeout(Object(z.a)(D.a.mark(function xt(){return D.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:case"end":return Ne.stop()}},xt)})),b.exerciseUserInfo.screen_sec*1e3),window.frames.length!=parent.frames.length&&window.parent.postMessage("backExercise","*"),$.current=ct;case 17:h({type:"globalSetting/headerFooterToggle",payload:Ce});case 18:case"end":return ut.stop()}},_e)}));return function(){return le.apply(this,arguments)}}();return m.a.createElement("div",null,w)};se.a=Object(u.a)(function(S){var T=S.loading,I=S.user,O=S.exercise,_=S.globalSetting;return{globalSetting:_,user:I,exercise:O,loading:T.effects}})(R)},bT9E:function(Ye,se,U){"use strict";U.d(se,"a",function(){return z});var Z=U("VTBJ");function z(N,V){var W=Object(Z.a)({},N);return Array.isArray(V)&&V.forEach(function(M){delete W[M]}),W}},biw7:function(Ye,se,U){"use strict";var Z=U("q1tI"),z=U.n(Z),N=Z.createContext(null);se.a=N},c5Ni:function(Ye,se,U){},cQPA:function(Ye,se,U){"use strict";U.r(se);var Z=U("T2oS"),z=U("W9HT"),N=U("sPJy"),V=U("bE4q"),W=U("+L6B"),M=U("2/Rp"),K=U("14J3"),H=U("BMrR"),n=U("jCWc"),D=U("kPKH"),y=U("5Dmo"),m=U("3S7+"),f=U("sRBo"),c=U("kaz8"),l=U("7Kak"),d=U("9yH6"),o=U("MXD1"),u=U("CFYs"),a=U("miYZ"),i=U("tsqr"),R=U("2qtc"),S=U("kLXV"),T=U("k1fw"),I=U("9og8"),O=U("tJVT"),_=U("PpiC"),b=U("5NDa"),p=U("5rEg"),h=U("aHsQ"),A=U("sGsY"),E=U("WmNS"),v=U.n(E),P=U("q1tI"),x=U.n(P),C=U("Ty5D"),j=U("55Ip"),B=U("9kvl"),w=U("gUdW"),Y=U("xGfz"),$=U("jhfD"),oe=U("BlwA"),de=U("bPs0"),Fe=U("wd/R"),Ae=U.n(Fe),Re=U("9GDu"),Me=U.n(Re),Be=U("1vsH"),pe=U("s8TD"),fe=U("xKgJ"),ne=U("bntm"),xe=U("V0Rq"),ce=U("HBuW"),Pe=U("9Bee"),He=U("Ot1p"),ke=function(Qe){var Ue,ue,me,$e,je,Je=Qe.item,mt=Qe.answerData,We=Qe.onBlur,it=We===void 0?function(){}:We,st=Object(P.useState)(),dt=Object(O.a)(st,2),Et=dt[0],jt=dt[1],en=Object(P.useState)(),Yt=Object(O.a)(en,2),Ct=Yt[0],pn=Yt[1],Rt=Object(P.useState)(),zt=Object(O.a)(Rt,2),Pt=zt[0],qt=zt[1];return Object(P.useEffect)(function(){pn(Je==null?void 0:Je.a_flag)},[Je==null?void 0:Je.a_flag]),x.a.createElement("div",null,(mt==null||((Ue=mt.exercise)===null||Ue===void 0)?void 0:Ue.commit_status)===1?x.a.createElement("div",null,x.a.createElement("p",{className:"mt10 mb0"},"\u6211\u7684\u7B54\u6848\uFF1A"),x.a.createElement("div",{className:Me.a.simpleText},x.a.createElement(Pe.a,{value:Je==null||((ue=Je.user_answer)===null||ue===void 0)?void 0:ue[0]}))):x.a.createElement("div",{className:Je.user_score&&(Je.user_score===Je.question_score?"c-green":"c-red")},Pt?x.a.createElement(He.a,{height:150,isFocus:!0,defaultValue:Je==null||((me=Je.user_answer)===null||me===void 0)?void 0:me[0],id:Je==null?void 0:Je.question_id,onChange:function(wn){return jt(wn)},onBlur:function(){return it(Et)}}):x.a.createElement("div",{onClick:function(){var wn;if(!Je.repeat_answer&&(Je==null||((wn=Je.user_answer)===null||wn===void 0)?void 0:wn.length)>0)return;qt(!0)}},x.a.createElement(p.a,{disabled:!Je.repeat_answer&&(Je==null||(($e=Je.user_answer)===null||$e===void 0)?void 0:$e.length)>0&&!Je.israp,size:"large",className:"current",placeholder:"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54",readOnly:!0}))),(Je==null?void 0:Je.standard_answer)&&x.a.createElement("div",null,x.a.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),x.a.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},x.a.createElement(Pe.a,{value:Je==null||((je=Je.standard_answer)===null||je===void 0)?void 0:je[0]}))))},Ve=ke,et=U("g9YV"),le=U("wCAj"),_e=U("5GOC"),Ce=U("JsLm"),De=U("ZW9T"),tt=U("o/qq"),ct=U.n(tt),ft=function(Qe){var Ue,ue,me,$e,je=Qe.item,Je=Qe.answerData,mt=Object(P.useState)([]),We=Object(O.a)(mt,2),it=We[0],st=We[1],dt=Object(P.useState)([]),Et=Object(O.a)(dt,2),jt=Et[0],en=Et[1];Object(P.useEffect)(function(){var Rt;if(!(je!=null&&(Rt=je.shixun_details)!==null&&Rt!==void 0&&Rt.length))return;for(var zt=[],Pt=[],qt=0;qt<(je==null||((yn=je.shixun_details)===null||yn===void 0)?void 0:yn.length);qt++){for(var yn,wn,yt,Vt=0;Vt<(je==null?void 0:je.shixun_details[qt].stage_list.length);Vt++){var Mn,Un,Pn,Vn,Q=je==null?void 0:je.shixun_details[qt].stage_list[Vt];zt.push(Object(T.a)(Object(T.a)({},Q),{operation:je==null||((Mn=je.shixun_details)===null||Mn===void 0||((Un=Mn[qt])===null||Un===void 0||((Pn=Un.shixun_detail)===null||Pn===void 0||((Vn=Pn[0])===null||Vn===void 0))))?void 0:Vn.game_identifier}))}if(je!=null&&(wn=je.shixun_details)!==null&&wn!==void 0&&(yt=wn[qt])!==null&&yt!==void 0&&yt.shixun_detail){var L,k,G;Pt.push(je==null||((L=je.shixun_details)===null||L===void 0||((k=L[qt])===null||k===void 0||((G=k.shixun_detail)===null||G===void 0)))?void 0:G[0])}}en(Pt),st(zt)},[je==null?void 0:je.shixun_details]);var Yt=[{title:"\u5173\u5361",dataIndex:"position",key:"position",align:"center"},{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"name",key:"name",align:"center",render:function(zt){return x.a.createElement("span",{className:"overflowHidden1",style:{maxWidth:"400px"},title:zt&&zt.length>25?zt:""},zt)}},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"evaluate_count",key:"evaluate_count",align:"center",render:function(zt,Pt){return x.a.createElement("span",null,Pt.evaluate_count?Pt.evaluate_count:x.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u5B8C\u6210\u65F6\u95F4",key:"endTime",dataIndex:"endTime",align:"center",render:function(zt,Pt){var qt=!1;return Pt.finished_time&&Je!==null&&Je!==void 0&&Je.exercise&&Je!==null&&Je!==void 0&&Je.exercise_answer_user&&((Je==null?void 0:Je.exercise.time)===-1?qt=Ae()(Je==null?void 0:Je.exercise.end_time).isBefore(Pt.finished_time):qt=Ae()(Je==null?void 0:Je.exercise_answer_user.start_at).add(Je==null?void 0:Je.exercise.time,"m").isBefore(Pt.finished_time)),x.a.createElement("span",null,Pt.finished_time||x.a.createElement("span",{className:"c-grey-999"},"--"),x.a.createElement("span",{className:"c-orange-ff9 "},qt?"\uFF08\u5DF2\u8D85\u65F6\uFF09":""))}},{title:"\u8017\u65F6",dataIndex:"time_consuming",key:"time_consuming",align:"center",render:function(zt,Pt){return x.a.createElement("span",null,Pt.time_consuming||x.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u67E5\u770B\u7B54\u6848",dataIndex:"view_answer",key:"view_answer",align:"center",render:function(zt,Pt){return x.a.createElement("span",null,Pt.view_answer?"\u5DF2\u67E5\u770B":"\u672A\u67E5\u770B")}},{title:"\u64CD\u4F5C",dataIndex:"operation",key:"operation",align:"center",render:function(zt,Pt,qt){return zt?x.a.createElement(Ce.a,{affix:!1,className:"mt10"},x.a.createElement(Ce.a.Link,{href:"#challenge_".concat(je==null?void 0:je.question_id).concat(qt),title:x.a.createElement("span",{style:{color:"#0152d9"}},"\u67E5\u770B")})):x.a.createElement("span",{className:"c-grey-999"},"--")}}],Ct=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(zt,Pt){return x.a.createElement("span",null,Pt.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(zt,Pt){return x.a.createElement("span",null,Pt.error_msg?Pt.error_msg:"--")}}],pn={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return x.a.createElement("div",{className:"mt15 mb15"},(Je==null||((Ue=Je.exercise)===null||Ue===void 0)?void 0:Ue.commit_status)===0&&x.a.createElement("div",null,je.shixun.map(function(Rt,zt){return x.a.createElement(H.a,{className:"font16",gutter:[0,20]},x.a.createElement(D.a,{flex:"1"},Rt.challenge_name," (",Rt.challenge_score,"\u5206)"),x.a.createElement(D.a,{flex:"100px",className:"tr"},Rt.answer_status===0&&x.a.createElement("span",{className:"font12 tag-style-border border-orange c-orange "},"\u672A\u5B8C\u6210"),Rt.answer_status===1&&x.a.createElement("span",{className:"font12 tag-style-border border-green c-green "},"\u5DF2\u5B8C\u6210")))})),(Je==null||((ue=Je.exercise)===null||ue===void 0)?void 0:ue.commit_status)!==0||(Je==null||((me=Je.exercise)===null||me===void 0)?void 0:me.user_exercise_status)!==0?x.a.createElement(x.a.Fragment,null,!!(it!=null&&it.length)&&x.a.createElement("div",null,x.a.createElement("p",{className:"font16 c-grey-666"},"\u9636\u6BB5\u6210\u7EE9"),x.a.createElement(le.a,{columns:Yt,dataSource:it,pagination:!1})),!!(jt!=null&&jt.length)&&x.a.createElement("div",null,x.a.createElement("p",{className:"font16 c-grey-666 mt10"},"\u5B9E\u8BAD\u8BE6\u60C5"),jt==null?void 0:jt.map(function(Rt,zt){return x.a.createElement("div",{id:"challenge_".concat(je==null?void 0:je.question_id).concat(zt),className:"mt5"},x.a.createElement("div",null,x.a.createElement("span",{className:"font16 mr15"}," ","\u7B2C",Rt.position,"\u5173"),x.a.createElement(j.a,{className:"current c-black font16",to:"/tasks/".concat(Rt.game_identifier)},Rt.name)),(Rt==null?void 0:Rt.st)===0&&Rt.passed_code&&x.a.createElement("aside",{className:ct.a.shixunWrp},x.a.createElement("h2",null,"\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09",x.a.createElement("span",{className:"c-light-black"},Rt.path)),x.a.createElement(De.b,{height:300,language:"python",theme:"default",value:Rt.passed_code,options:pn})))}))):x.a.createElement(x.a.Fragment,null,x.a.createElement(Pe.a,{className:"c-grey-999 mt20 mb20",value:je==null?void 0:je.question_title}),je==null||(($e=je.shixun)===null||$e===void 0)?void 0:$e.map(function(Rt,zt){return x.a.createElement("p",{className:"font16 c-grey-666 mb5",key:zt},x.a.createElement("span",{className:"mr20"},"\u7B2C",Rt==null?void 0:Rt.challenge_position,"\u5173 ",Rt==null?void 0:Rt.challenge_name),x.a.createElement("span",null,Rt==null?void 0:Rt.challenge_score,"\u5206"))})))},ut=ft,xt=U("J66h"),bt=function(Qe){var Ue=Qe.item,ue=Qe.answerData,me=Object(P.useState)([]),$e=Object(O.a)(me,2),je=$e[0],Je=$e[1];Object(P.useEffect)(function(){var it;if((Ue==null||((it=Ue.evaluate_codes)===null||it===void 0)?void 0:it.length)>0){var st;Je(Ue==null||((st=Ue.evaluate_codes)===null||st===void 0)?void 0:st.map(function(dt,Et){return{key:Et+1,error_msg:dt!=null&&dt.error_msg?xt.Base64.decode(dt==null?void 0:dt.error_msg):""}}))}else Je([{key:"--",error_msg:"--"}])},[Ue==null?void 0:Ue.evaluate_codes]);var mt=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(st,dt){return x.a.createElement("span",null,dt.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(st,dt){return x.a.createElement("span",null,dt.error_msg?dt.error_msg:"--")}}],We={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return x.a.createElement(x.a.Fragment,null,x.a.createElement("div",{className:"mt15 mb15"},x.a.createElement(Pe.a,{value:Ue==null?void 0:Ue.description})),!!(Ue!=null&&Ue.user_answer.length)&&(Ue==null?void 0:Ue.passed_code)&&x.a.createElement("aside",{className:ct.a.shixunWrp},x.a.createElement("h3",null,"\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"),x.a.createElement(De.b,{style:{border:"1px solid #ccc"},height:300,language:"python",theme:"vs-light",value:Ue!=null&&Ue.passed_code?xt.Base64.decode(Ue==null?void 0:Ue.passed_code):"",options:We})))},Ne=bt,Oe=U("oBTY"),nt=p.a.TextArea,lt=function(Qe){var Ue,ue,me=Qe.item,$e=Qe.answerData,je=Qe.onBlur,Je=je===void 0?function(){}:je,mt=Object(P.useState)([]),We=Object(O.a)(mt,2),it=We[0],st=We[1];return Object(P.useEffect)(function(){for(var dt=[],Et=function(Yt){var Ct,pn=(me==null||((Ct=me.user_answer)===null||Ct===void 0)?void 0:Ct.find(function(Rt){return Rt.choice_id===Yt+1}))||{choice_id:Yt+1,answer_text:""};dt.push(Object(T.a)({},pn))},jt=0;jt<(me==null?void 0:me.multi_count);jt++)Et(jt);st(dt)},[me==null?void 0:me.user_answer]),x.a.createElement("div",null,it==null?void 0:it.map(function(dt,Et){var jt;return x.a.createElement("div",{className:"mt10"},x.a.createElement("span",null,"\u6211\u7684\u7B54\u6848\uFF08\u586B\u7A7A",Et+1,"\uFF09:"),x.a.createElement("div",null,x.a.createElement(nt,{autoSize:!0,rows:4,disabled:!me.repeat_answer&&(me==null||((jt=me.user_answer)===null||jt===void 0)?void 0:jt.length)>0&&!me.israp||!!($e!=null&&$e.exercise.commit_status),value:dt==null?void 0:dt.answer_text,onChange:function(Yt){it[Et].answer_text=Yt.target.value,st(Object(Oe.a)(it))},onBlur:function(Yt){return Je(dt==null?void 0:dt.answer_text,Et+1,it)},className:"overflow_hidden ".concat(me.user_score&&(me.user_score===me.question_score?"c-green":"c-red"))})))}),!!(me!=null&&(Ue=me.standard_answer)!==null&&Ue!==void 0&&Ue.length)&&x.a.createElement("div",null,me==null||((ue=me.standard_answer)===null||ue===void 0)?void 0:ue.map(function(dt,Et){return x.a.createElement("div",null,x.a.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A",Et+1,"\uFF09:"),x.a.createElement("div",null,x.a.createElement(nt,{autoSize:!0,disabled:!0,value:dt==null?void 0:dt.answer_text[0]})))})))},Ke=lt,Xe=U("lzim"),Se=p.a.TextArea,ge=function(Qe){var Ue=Qe.data;return x.a.createElement("div",{className:"tc mt80"},x.a.createElement("img",{width:"486",src:Xe.l})," ",x.a.createElement("br",null),Ue.status===-1&&x.a.createElement("div",{className:"c-grey-999 mt60"},"\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"),Ue.status===-2&&x.a.createElement("div",{className:" c-grey-999 mt60"},"\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A",x.a.createElement("span",{className:"c-red"},Ue.ip),"\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"),x.a.createElement(M.a,{className:"mt40 pl20 pr20",type:"primary"},x.a.createElement("a",{href:"/"},"\u56DE\u5230\u9996\u9875")))},Ee=ge,ie=U("m3rI"),ae=U("LvDl"),he=A.a.Countdown,ve=p.a.TextArea,Te=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ge={1:"\u672A\u53D1\u5E03",2:"\u5DF2\u53D1\u5E03",3:"\u5DF2\u622A\u6B62"},ot={1:Me.a.flagActive,2:Me.a.flagHalf},Tt={0:"c-red-ee4",1:"c-green"},Ot=["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u5B9E\u8BAD\u9898","\u7F16\u7A0B\u9898"],wt=function(Qe){var Ue,ue,me,$e,je,Je,mt,We,it,st,dt,Et,jt,en,Yt,Ct,pn,Rt,zt,Pt,qt,yn,wn,yt,Vt,Mn,Un,Pn,Vn,Q,L,k=Qe.globalSetting,G=Qe.loading,te=Qe.user,J=Qe.dispatch,Ie=Object(_.a)(Qe,["globalSetting","loading","user","dispatch"]),at=Object(C.i)(),St=Object(P.useState)({}),Ft=Object(O.a)(St,2),ye=Ft[0],Ut=Ft[1],$t=Object(P.useState)({}),Sn=Object(O.a)($t,2),Hn=Sn[0],Kn=Sn[1],In=Object(P.useState)({}),pr=Object(O.a)(In,2),ur=pr[0],Bn=pr[1],cr=Object(P.useState)(!1),Ar=Object(O.a)(cr,2),Cr=Ar[0],Yn=Ar[1],Wr=Object(P.useState)(!0),Pr=Object(O.a)(Wr,2),yr=Pr[0],Qr=Pr[1],br=Object(P.useState)(!1),dr=Object(O.a)(br,2),Nr=dr[0],Hr=dr[1],Er=Object(P.useState)(!1),_n=Object(O.a)(Er,2),sn=_n[0],Ln=_n[1],un=Object(P.useState)(),Rn=Object(O.a)(un,2),bn=Rn[0],Or=Rn[1],jn=Object(P.useState)(0),Xn=Object(O.a)(jn,2),Kr=Xn[0],Rr=Xn[1],Gr=Object(P.useState)(""),Ir=Object(O.a)(Gr,2),Dr=Ir[0],jr=Ir[1],_r=Object(P.useState)("none"),zr=Object(O.a)(_r,2),Jr=zr[0],sr=zr[1],ri=Object(P.useState)(""),Gt=Object(O.a)(ri,2),tn=Gt[0],Xt=Gt[1],on=Object(P.useState)({status:0}),dn=Object(O.a)(on,2),An=dn[0],hn=dn[1],kn=Object(P.useRef)(),qn=Object(P.useState)(0),ln=Object(O.a)(qn,2),rn=ln[0],mn=ln[1],Qn=Object(P.useState)(0),Gn=Object(O.a)(Qn,2),an=Gn[0],Zr=Gn[1],xn=Object(P.useState)(!1),gn=Object(O.a)(xn,2),En=gn[0],$n=gn[1],qr=Object(P.useState)(!1),Vr=Object(O.a)(qr,2),$r=Vr[0],Ai=Vr[1],Gi=Object(P.useState)(),Ci=Object(O.a)(Gi,2),zi=Ci[0],Vi=Ci[1],Ja=Object(P.useState)(),Yi=Object(O.a)(Ja,2),Xi=Yi[0],Za=Yi[1];Object(P.useEffect)(function(){return(Object(fe.c)()||Object(fe.l)()||te.userInfo.enable_simulate)&&ti(),window.addEventListener("message",li),function(){window.removeEventListener("message",li),window.removeEventListener("beforeunload",Oi),location.pathname.indexOf("/detail")>-1&&Object(ne.b)()}},[at.categoryId,te.userInfo.login]);var li=function(be){be.data==="backExercise"&&(sr("none"),jr(""),ti())},ei=function(){var Wt=Object(I.a)(v.a.mark(function be(){var pt,rt,Mt,gt,It,Nt,kt,Qt,Kt,Jt,vn;return v.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,J({type:"exercise/getExerciseUserInfo",payload:Object(T.a)({},at)});case 2:if(rt=cn.sent,Kn(Object(T.a)({},rt.data)),!((rt==null||((pt=rt.data)===null||pt===void 0)?void 0:pt.ip_limit)!=="no")){cn.next=11;break}if(!((rt==null||((Mt=rt.data)===null||Mt===void 0)?void 0:Mt.ip_limit)==="inner")){cn.next=9;break}return cn.next=8,Object(pe.a)({ip_limit:rt==null||((gt=rt.data)===null||gt===void 0)?void 0:gt.ip_limit});case 8:Nt=cn.sent;case 9:return cn.next=11,Object(Be.s)({exerciseId:at.categoryId,ip:Nt,errmsgHide:!0,ip_limit:rt==null||((It=rt.data)===null||It===void 0)?void 0:It.ip_limit}).catch(function(or){hn(or)});case 11:if(!((rt==null?void 0:rt.status)==0)){cn.next=18;break}if(!((rt==null||((kt=rt.data)===null||kt===void 0)?void 0:kt.used_screen_num)>(rt==null||((Qt=rt.data)===null||Qt===void 0)?void 0:Qt.screen_num)&&rt!==null&&rt!==void 0&&(Kt=rt.data)!==null&&Kt!==void 0&&Kt.screen_open)){cn.next=15;break}return bi(),cn.abrupt("return",!1);case 15:Hr(rt==null?void 0:rt.data.check_camera),Ln(rt==null||((Jt=rt.data)===null||Jt===void 0)?void 0:Jt.screen_open),rt!=null&&(vn=rt.data)!==null&&vn!==void 0&&vn.check_camera||ti();case 18:case"end":return cn.stop()}},be)}));return function(){return Wt.apply(this,arguments)}}(),Oi=function(be){var pt="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(be||window.event).returnValue=pt,pt},ti=function(){var Wt=Object(I.a)(v.a.mark(function be(){var pt,rt,Mt,gt,It;return v.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return Yn(!0),kt.next=3,Object(xe.ab)(Object(T.a)({},at)).catch(function(){return Yn(!1)});case 3:rt=kt.sent,((pt=rt)===null||pt===void 0?void 0:pt.exercise)&&(rt.exercise.user_exercise_status=1),Yn(!1),rt&&(rt.exercise_types=((Mt=rt)===null||Mt===void 0?void 0:Mt.exercise_types)||((gt=rt)===null||gt===void 0||((It=gt.exercise_scores)===null||It===void 0)?void 0:It.exercise_types),Ut(rt));case 7:case"end":return kt.stop()}},be)}));return function(){return Wt.apply(this,arguments)}}();Object(P.useEffect)(function(){var Wt,be,pt;((Wt=ye.exercise)===null||Wt===void 0?void 0:Wt.time)===0&&bi(),((be=ye.exercise)===null||be===void 0?void 0:be.time)&&Or(Date.now()+(ye==null||((pt=ye.exercise)===null||pt===void 0)?void 0:pt.time)*1e3*60)},[(Ue=ye.exercise)===null||Ue===void 0?void 0:Ue.time]);var qa=function(){var be;(ye==null||((be=ye.exercise)===null||be===void 0)?void 0:be.exercise_status)===3?S.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:x.a.createElement("div",{className:"tc font16"},"\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377",x.a.createElement("br",null),"\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C")}):S.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:x.a.createElement("div",{className:"tc font16"},"\u5B66\u751F\u5C06\u5F97\u5230\u4E00\u6B21\u91CD\u65B0\u7B54\u9898\u7684\u673A\u4F1A\uFF0C\u73B0\u6709\u7684\u7B54\u9898\u60C5\u51B5\u5C06\u88AB\u6E05\u7A7A",x.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"),onOk:function(){var pt=Object(I.a)(v.a.mark(function Mt(){var gt,It;return v.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(xe.T)({categoryId:at.categoryId,user_ids:[ye==null||((gt=ye.exercise_answer_user)===null||gt===void 0)?void 0:gt.user_id]});case 2:It=kt.sent,It&&(i.b.info(It==null?void 0:It.message),mr());case 4:case"end":return kt.stop()}},Mt)}));function rt(){return pt.apply(this,arguments)}return rt}()})},mr=function(){ti()},ii=function(){var Wt=Object(I.a)(v.a.mark(function be(){var pt,rt;return v.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(xe.cb)({categoryId:at.categoryId,commit_method:2});case 2:pt=gt.sent,(pt==null?void 0:pt.status)===0&&(S.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:x.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",x.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var It=Object(I.a)(v.a.mark(function kt(){return v.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:mr();case 1:case"end":return Kt.stop()}},kt)}));function Nt(){return It.apply(this,arguments)}return Nt}()}),i.b.info(pt==null?void 0:pt.message)),(pt==null?void 0:pt.status)===-3&&(rt=parseInt(pt==null?void 0:pt.message),ye.exercise.time=rt,Ut(Object(T.a)({},ye)));case 5:case"end":return gt.stop()}},be)}));return function(){return Wt.apply(this,arguments)}}(),yi=function(){var Wt=Object(I.a)(v.a.mark(function be(pt){var rt;return v.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(ce.E)({id:pt.shixun_identifier});case 2:rt=gt.sent,rt!=null&&rt.game_identifier&&(jr("/tasks/".concat(rt.game_identifier,"?type=exercises&exercisesId=").concat(at.categoryId,"&coursesId=").concat(at.coursesId,"&login=").concat(at.login,"&questionId=").concat(pt.question_id)),sr("block")),(rt==null?void 0:rt.status)===-3?Object(Be.q)():(rt==null?void 0:rt.status)===2?$a(rt==null?void 0:rt.message,pt.question_id):(rt==null?void 0:rt.status)===3&&Qi(rt==null?void 0:rt.message);case 5:case"end":return gt.stop()}},be)}));return function(pt){return Wt.apply(this,arguments)}}(),$a=function Wt(be,pt){var rt;be=(rt=be)!==null&&rt!==void 0&&rt.includes(".json")?be:"".concat(be,".json"),S.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:x.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var Mt=Object(I.a)(v.a.mark(function It(){var Nt,kt;return v.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(xe.U)({url:be});case 2:if(Nt=Kt.sent,Nt){Kt.next=5;break}return Kt.abrupt("return");case 5:return i.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),Kt.next=8,Object(ce.E)({id:Nt.shixun_identifier});case 8:if(kt=Kt.sent,!(kt!=null&&kt.game_identifier)){Kt.next=12;break}return yi({shixun_identifier:kt==null?void 0:kt.game_identifier,question_id:pt}),Kt.abrupt("return");case 12:(kt==null?void 0:kt.status)===2?Wt(kt==null?void 0:kt.message,pt):(kt==null?void 0:kt.status)===3&&Qi(kt==null?void 0:kt.message);case 13:case"end":return Kt.stop()}},It)}));function gt(){return Mt.apply(this,arguments)}return gt}()})},Qi=function(be){S.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:x.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",be,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},es=function(be){be.redo?S.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:x.a.createElement("div",{className:"tc font16"},"\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"),onOk:function(){var pt=Object(I.a)(v.a.mark(function Mt(){var gt,It,Nt,kt;return v.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(xe.U)({id:be.myshixun_identifier,url:be.url});case 2:gt=Kt.sent,gt&&(It=Object(ae.cloneDeep)(ye==null?void 0:ye.exercise_question_types),Nt=It==null?void 0:It.findIndex(function(Jt){return Jt.question_type===5}),It[Nt].items.find(function(Jt){return Jt.question_id===be.question_id}).redo=!1,It[Nt].items.find(function(Jt){return Jt.question_id===be.question_id}).shixun_identifier=gt.shixun_identifier,ye.exercise_question_types=It,Ut(ye),kt=Object(T.a)(Object(T.a)({},be),{},{shixun_identifier:gt.shixun_identifier}),yi(kt));case 4:case"end":return Kt.stop()}},Mt)}));function rt(){return pt.apply(this,arguments)}return rt}()}):yi(be)},_a=function(){var Wt=Object(I.a)(v.a.mark(function be(pt){var rt;return v.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(!pt.hack_identifier){gt.next=5;break}return gt.next=3,Object(xe.Z)({id:pt.hack_identifier});case 3:rt=gt.sent,(rt==null?void 0:rt.status)===0&&(jr("/myproblems/".concat(rt.identifier,"?type=exercises&exercisesId=").concat(at.categoryId,"&coursesId=").concat(at.coursesId,"&login=").concat(at.login,"&questionId=").concat(pt.question_id)),sr("block"));case 5:case"end":return gt.stop()}},be)}));return function(pt){return Wt.apply(this,arguments)}}(),ai=function(){var Wt=Object(I.a)(v.a.mark(function be(pt,rt,Mt,gt){var It,Nt;return v.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(pt){Qt.next=3;break}return console.error("handleSave no questionId params"),Qt.abrupt("return");case 3:return Qt.next=5,Object(xe.eb)({questionId:pt,exercise_choice_id:rt,answer_text:Mt});case 5:Nt=Qt.sent,(Nt==null?void 0:Nt.status)===0&&(gt&>());case 7:case"end":return Qt.stop()}},be)}));return function(pt,rt,Mt,gt){return Wt.apply(this,arguments)}}(),ui=function(){var Wt=Object(I.a)(v.a.mark(function be(pt){var rt,Mt;return v.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(xe.X)({id:at.categoryId});case 2:if(rt=It.sent,rt){It.next=5;break}return It.abrupt("return");case 5:rt.question_undo!==0||rt.oj_undo!==0?(Mt="",rt.question_undo!==0&&rt.oj_undo!==0?Mt="\u6709 ".concat(rt.question_undo," \u9898\u672A\u5B8C\u6210\uFF0C\u5305\u542B ").concat(rt.oj_undo," \u4E2A\u7F16\u7A0B\u9898"):rt.question_undo!==0&&rt.oj_undo===0?Mt="\u6709 ".concat(rt.question_undo," \u9898\u672A\u5B8C\u6210"):rt.question_undo===0&&rt.oj_undo!==0&&(Mt="\u6709 ".concat(rt.oj_undo," \u7F16\u7A0B\u9898\u672A\u5B8C\u6210")),S.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:x.a.createElement("div",{className:"tc font16"},Mt,x.a.createElement("br",null),pt?"\u5728".concat(Ae()(rt.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var Nt=Object(I.a)(v.a.mark(function Qt(){return v.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:pt?mr():bi();case 1:case"end":return Jt.stop()}},Qt)}));function kt(){return Nt.apply(this,arguments)}return kt}()})):S.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u77E5\u9053\u5566",content:x.a.createElement("div",{className:"tc font16"},pt?"\u5728".concat(Ae()(rt.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var Nt=Object(I.a)(v.a.mark(function Qt(){return v.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:pt?mr():bi();case 1:case"end":return Jt.stop()}},Qt)}));function kt(){return Nt.apply(this,arguments)}return kt}()});case 6:case"end":return It.stop()}},be)}));return function(pt){return Wt.apply(this,arguments)}}(),Ur=function(be){return x.a.createElement("div",null,x.a.createElement(u.a,{strokeColor:{from:"#108ee9",to:"#87d068"},status:"active",percent:be}),x.a.createElement("div",{className:"c-grey-c tc mt10 mb20"},"\u6B63\u5728\u5224\u5206\u4E2D\u2026"))},xa=function(){var be=0,pt=S.a.info({title:"\u4EA4\u5377\u4E2D",icon:null,className:"modal-footer-none",content:Ur(be)}),rt=setInterval(function(){be<=100?(be+=2,pt.update({content:Ur(be)})):(pt.destroy(),clearInterval(rt))},50)},bi=function(){var Wt=Object(I.a)(v.a.mark(function be(){var pt;return v.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return xa(),Mt.next=3,Object(xe.cb)({categoryId:at.categoryId,commit_method:1});case 3:pt=Mt.sent,Object(ne.b)(),J({type:"exercise/setActionTabs",payload:Object(T.a)({},{removeEventListenerExitScreen:!0})}),(pt==null?void 0:pt.status)===0&&(i.b.success(pt==null?void 0:pt.message),Hr(!1),setTimeout(function(){S.a.info({title:"\u4EA4\u5377\u6210\u529F\uFF01",okText:"\u786E\u5B9A",onOk:function(){mr()}})},3e3));case 7:case"end":return Mt.stop()}},be)}));return function(){return Wt.apply(this,arguments)}}(),ts=function(){var Wt=Object(I.a)(v.a.mark(function be(pt,rt,Mt,gt){return v.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:ai(rt,pt,null,function(){ye.question_status.find(function(kt){return kt.ques_id===rt}).ques_status=pt?1:0,gt.user_answer=[],gt.user_answer.push(pt),gt.repeat_answer||(gt.israp=!0),Ut(Object(T.a)({},ye))});case 1:case"end":return Nt.stop()}},be)}));return function(pt,rt,Mt,gt){return Wt.apply(this,arguments)}}(),ns=function(){var Wt=Object(I.a)(v.a.mark(function be(pt,rt,Mt,gt,It){return v.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:ai(gt.question_id,pt,null,function(){var Qt,Kt,Jt;gt.user_answer=[],gt.user_answer.push(pt);var vn=It==null||((Qt=It.sub_exercise_questions)===null||Qt===void 0)?void 0:Qt.filter(function(Tn){var cn;return((cn=Tn.user_answer)===null||cn===void 0?void 0:cn.length)===0});ye.question_status.find(function(Tn){return Tn.ques_id===rt}).ques_status=(vn==null?void 0:vn.length)===(It==null||((Kt=It.sub_exercise_questions)===null||Kt===void 0)?void 0:Kt.length)?0:(vn==null?void 0:vn.length)>0&&(vn==null?void 0:vn.length)<(It==null||((Jt=It.sub_exercise_questions)===null||Jt===void 0)?void 0:Jt.length)?2:1,Ut(Object(T.a)({},ye))});case 1:case"end":return kt.stop()}},be)}));return function(pt,rt,Mt,gt,It){return Wt.apply(this,arguments)}}(),rs=function(be,pt,rt){ai(pt,be,null,function(){rt.user_answer=be,rt.repeat_answer||(rt.israp=!0),ye.question_status.find(function(Mt){return Mt.ques_id===pt}).ques_status=be!=null&&be.length?1:0,Ut(Object(T.a)({},ye))})},Ta=function(be,pt,rt,Mt,gt){ai(rt,pt,be,function(){ye.question_status.find(function(Nt){return Nt.ques_id===rt}).ques_status=Mt.every(function(Nt){return!!Nt.answer_text})?1:ye.question_status.find(function(Nt){return Nt.ques_id===rt}).ques_status=Mt.some(function(Nt){return!!Nt.answer_text})?2:0;var It={choice_id:pt,answer_text:be};gt.user_answer.filter(function(Nt){return Nt.choice_id!=pt})?gt.user_answer.splice(pt-1,1,It):gt.user_answer.push(It),gt.repeat_answer||(gt.israp=!0),Ut(Object(T.a)({},ye))})},wa=function(be,pt,rt){ai(pt,null,be,function(){ye.question_status.find(function(Mt){return Mt.ques_id===pt}).ques_status=be?1:0,rt.user_answer=[],rt.user_answer.push(be),rt.repeat_answer||(rt.israp=!0),Ut(Object(T.a)({},ye))})},ci=function(be,pt){var rt,Mt,gt,It,Nt,kt;return x.a.createElement("div",null,x.a.createElement(d.a.Group,{disabled:!!(ye!=null&&ye.exercise.commit_status),defaultValue:be==null||((rt=be.user_answer)===null||rt===void 0)?void 0:rt[0],onChange:function(Kt){return ts(Kt.target.value,be==null?void 0:be.question_id,pt,be)},className:be.user_score&&"edu-radio-".concat(be.user_score===be.question_score?"green":"red")},be==null||((Mt=be.question_choices)===null||Mt===void 0)?void 0:Mt.map(function(Qt,Kt){var Jt,vn=be.question_type==2,Tn=vn?"":"".concat(Te[Kt],".");return x.a.createElement("div",{className:Me.a.answerWrap,key:Kt},x.a.createElement(d.a,{disabled:!be.repeat_answer&&(be==null||((Jt=be.user_answer)===null||Jt===void 0)?void 0:Jt.length)>0&&!be.israp,value:Qt==null?void 0:Qt.choice_id},x.a.createElement("span",{className:"mr3"},Tn),x.a.createElement(Pe.a,{style:{width:740},className:Me.a.renderHtml,value:Qt==null?void 0:Qt.choice_text})))})),Object(fe.s)()&&(ye==null||((gt=ye.exercise)===null||gt===void 0)?void 0:gt.answer_open)&&((ye==null||((It=ye.exercise)===null||It===void 0)?void 0:It.exercise_status)==3||(ye==null||((Nt=ye.exercise)===null||Nt===void 0)?void 0:Nt.user_exercise_status)==1)&&x.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",be==null||((kt=be.standard_answer)===null||kt===void 0)?void 0:kt.map(function(Qt,Kt){return x.a.createElement("span",null,Te[Number(Qt)-1])})))},Sa=function(be,pt,rt){var Mt;return x.a.createElement("div",null,be==null||((Mt=be.sub_exercise_questions)===null||Mt===void 0)?void 0:Mt.map(function(gt,It){var Nt,kt,Qt,Kt,Jt,vn;return x.a.createElement("div",null,x.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},x.a.createElement("span",{style:{flexShrink:0},className:"font18"},rt+1+"."+(It+1),"\uFF08\u5355\u9009\u9898\uFF09"),x.a.createElement(Pe.a,{value:gt==null?void 0:gt.question_title}),x.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",gt==null?void 0:gt.question_score,"\u5206\uFF09")),x.a.createElement(d.a.Group,{disabled:!!(ye!=null&&ye.exercise.commit_status),defaultValue:gt==null||((Nt=gt.user_answer)===null||Nt===void 0)?void 0:Nt[0],onChange:function(cn){return ns(cn.target.value,be==null?void 0:be.question_id,It,gt,be)},className:gt.user_score&&"edu-radio-".concat(gt.user_score===gt.question_score?"green":"red")},gt==null||((kt=gt.question_choices)===null||kt===void 0)?void 0:kt.map(function(Tn,cn){var or,Lr=gt.question_type==2,di=Lr?"":"".concat(Te[cn],".");return x.a.createElement("div",{className:Me.a.answerWrap,key:cn},x.a.createElement(d.a,{disabled:!gt.repeat_answer&&(gt==null||((or=gt.user_answer)===null||or===void 0)?void 0:or.length)>0,value:Tn==null?void 0:Tn.choice_id},x.a.createElement("span",{className:"mr3"},di),x.a.createElement(Pe.a,{style:{width:740},className:Me.a.renderHtml,value:Tn==null?void 0:Tn.choice_text})))})),Object(fe.s)()&&(ye==null||((Qt=ye.exercise)===null||Qt===void 0)?void 0:Qt.answer_open)&&((ye==null||((Kt=ye.exercise)===null||Kt===void 0)?void 0:Kt.exercise_status)==3||(ye==null||((Jt=ye.exercise)===null||Jt===void 0)?void 0:Jt.user_exercise_status)==1)&&x.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",gt==null||((vn=gt.standard_answer)===null||vn===void 0)?void 0:vn.map(function(Tn,cn){return x.a.createElement("span",null,Te[Number(Tn)-1])})))}))},Aa=function(be,pt){var rt,Mt,gt,It;return x.a.createElement("div",null,x.a.createElement(c.a.Group,{disabled:!!(ye!=null&&ye.exercise.commit_status),defaultValue:be==null?void 0:be.user_answer,onChange:function(kt){return rs(kt,be==null?void 0:be.question_id,be)},className:be.user_score&&"edu-checkbox-".concat(be.user_score===be.question_score?"green":"red")},be==null||((rt=be.question_choices)===null||rt===void 0)?void 0:rt.map(function(Nt,kt){var Qt,Kt="".concat(Te[kt],".");return x.a.createElement("div",{className:Me.a.answerWrap},x.a.createElement(c.a,{disabled:!be.repeat_answer&&(be==null||((Qt=be.user_answer)===null||Qt===void 0)?void 0:Qt.length)>0&&!be.israp,value:Nt==null?void 0:Nt.choice_id},x.a.createElement("span",{className:"mr3"},Kt),x.a.createElement(Pe.a,{className:Me.a.renderHtml,value:Nt==null?void 0:Nt.choice_text})))})),Object(fe.s)()&&(ye==null||((Mt=ye.exercise)===null||Mt===void 0)?void 0:Mt.answer_open)&&(ye==null||((gt=ye.exercise)===null||gt===void 0)?void 0:gt.exercise_status)==3&&x.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",be==null||((It=be.standard_answer)===null||It===void 0)?void 0:It.map(function(Nt,kt){return x.a.createElement("span",null,Te[Number(Nt)-1])})))},Ji=function(be,pt){return x.a.createElement(Ke,{item:be,answerData:ye,onBlur:function(Mt,gt,It){return Ta(Mt,gt,be==null?void 0:be.question_id,It,be)}})},Ri=function(be,pt){return x.a.createElement(Ve,{item:be,answerData:ye,onBlur:function(Mt){return wa(Mt,be==null?void 0:be.question_id,be)}})},Ca=function(be,pt){return x.a.createElement(ut,{item:be,answerData:ye})},Zi=function(be,pt){return x.a.createElement(Ne,{item:be,answerData:ye})},er=function(be,pt,rt){var Mt,gt,It=ye==null||((Mt=ye.exercise_question_types)===null||Mt===void 0)?void 0:Mt.find(function(Nt){return Nt.question_type===pt});return x.a.createElement(x.a.Fragment,null,x.a.createElement("h1",{className:"font14 current",onClick:function(){ur[pt]=!ur[pt],Bn(Object(T.a)({},ur))}},!ur[pt]&&x.a.createElement(w.a,null),ur[pt]&&x.a.createElement(Y.a,null),x.a.createElement("span",{className:"ml5 c-grey-666"},be)),x.a.createElement("ul",{className:Me.a.answerSheet,key:pt},!ur[pt]&&(It==null||((gt=It.items)===null||gt===void 0)?void 0:gt.map(function(Nt,kt){if(Nt.question_type===pt){var Qt,Kt;return x.a.createElement("li",{onClick:function(){var vn;if(ye.exercise_question_types[rn].items[an].israp=!1,Ut(Object(T.a)({},ye)),!$r&&(ye==null||((vn=ye.exercise)===null||vn===void 0)?void 0:vn.user_exercise_status)===0&&Object(fe.s)()){var Tn,cn,or,Lr;if(!((Tn=ye.exercise_question_types)!==null&&Tn!==void 0&&(cn=Tn[rn])!==null&&cn!==void 0&&(or=cn.items)!==null&&or!==void 0&&(Lr=or[an])!==null&&Lr!==void 0&&Lr.repeat_answer)){$n(!0),Vi(3),Za({oneindex:rt,twoindex:kt});return}}mn(rt),Zr(kt);var di="Anchor_".concat(pt,"_").concat(kt),Ia=document.getElementById(di);Ia&&setTimeout(function(){return Ia.scrollIntoView({block:"start",behavior:"smooth"})})},key:kt,className:(ye==null||((Qt=ye.question_status)===null||Qt===void 0)?void 0:Qt.some(function(Jt){return Jt.ques_id===Nt.question_id&&(Jt==null?void 0:Jt.ques_status)===1}))&&Me.a.active},kt+1,(ye==null||((Kt=ye.question_status)===null||Kt===void 0)?void 0:Kt.some(function(Jt){return Jt.ques_id===Nt.question_id&&(Jt==null?void 0:Jt.ques_status)===2}))&&x.a.createElement("div",{style:{height:3,background:"#0152d9",position:"absolute",width:26,bottom:0}}))}}))))},Oa=function(be,pt){var rt,Mt,gt,It,Nt,kt,Qt=(be==null?void 0:be.question_type)==5?be==null?void 0:be.shixun_name:be==null?void 0:be.question_title;return x.a.createElement("div",{className:Me.a.questionItem,id:"Anchor_".concat(be==null?void 0:be.question_type,"_").concat(pt)},x.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},x.a.createElement("span",{style:{flexShrink:0},className:"font18"},pt+1,"."),x.a.createElement(Pe.a,{value:be==null?void 0:be.question_title}),x.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",(be==null?void 0:be.question_type)===7?"\u5171".concat(be==null||((rt=be.sub_exercise_questions)===null||rt===void 0)?void 0:rt.length,"\u5C0F\u9898\uFF0C"):"",be==null?void 0:be.question_score,"\u5206\uFF09"),!(be!=null&&be.repeat_answer)&&x.a.createElement("span",{style:{color:"#FA6400 ",marginLeft:10,fontSize:16}},"\u6CE8\u610F\uFF1A\u8BE5\u9898\u4E0D\u5141\u8BB8\u91CD\u590D\u7B54\u9898"),!!(be!=null&&(Mt=be.schools)!==null&&Mt!==void 0&&Mt.length)&&x.a.createElement(m.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},x.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 line24 font18 c-orange"}))),(be==null?void 0:be.question_type)==0&&ci(be,be==null?void 0:be.question_type),(be==null?void 0:be.question_type)==2&&ci(be,be==null?void 0:be.question_type),(be==null?void 0:be.question_type)==1&&Aa(be,be==null?void 0:be.question_type),(be==null?void 0:be.question_type)==3&&Ji(be,be==null?void 0:be.question_type),(be==null?void 0:be.question_type)==4&&Ri(be,be==null?void 0:be.question_type),(be==null?void 0:be.question_type)==5&&Ca(be,be==null?void 0:be.question_type),(be==null?void 0:be.question_type)==6&&Zi(be,be==null?void 0:be.question_type),(be==null?void 0:be.question_type)==7&&Sa(be,be==null?void 0:be.question_type,pt),!!(be!=null&&(gt=be.answer_comments)!==null&>!==void 0&>.length)&&x.a.createElement("div",{className:"mt30"},be==null||((It=be.answer_comments)===null||It===void 0)?void 0:It.map(function(Kt,Jt){var vn,Tn;return x.a.createElement("div",null,x.a.createElement(H.a,{align:"middle",gutter:[0,10]},x.a.createElement(D.a,{flex:"50px"},x.a.createElement("img",{src:ie.a.API_SERVER+"/images/"+((vn=Kt.user)===null||vn===void 0?void 0:vn.image_url),width:"40",style:{borderRadius:40}})),x.a.createElement(D.a,{flex:"1"},Kt.updated_at,x.a.createElement("br",null),(Tn=Kt.user)===null||Tn===void 0?void 0:Tn.name),x.a.createElement(D.a,{className:"c-grey-c"},Kt.shixun_chanllge_position&&x.a.createElement("span",null,"\u7B2C",Kt.shixun_chanllge_position,"\u5173"),be.question_type!==4&&x.a.createElement("span",null,"\u539F\u59CB\u5F97\u5206",Kt.origin_score,"\u5206 \uFF0C")," ","\u4FEE\u6B63\u4E3A",Kt.score,"\u5206")),Kt.comment&&x.a.createElement(H.a,{align:"middle",gutter:[0,10]},x.a.createElement(D.a,{flex:"50px"}),x.a.createElement(D.a,{flex:"1"},x.a.createElement(ve,{autoSize:!0,value:Kt.comment,disabled:!0}))))})),x.a.createElement("div",{className:Me.a.itemType},x.a.createElement(H.a,null,x.a.createElement(D.a,{flex:"1"}),x.a.createElement(D.a,null,(be==null?void 0:be.question_type)<3&&(be==null?void 0:be.standard_answer_show)&&x.a.createElement("span",{className:"font16 ml20"},"\u6B63\u786E\u7B54\u6848\uFF1A",be==null?void 0:be.standard_answer_show),x.a.createElement("span",{className:"font16 ml20"},(be==null?void 0:be.user_score)!==null&&(be==null?void 0:be.user_score)>=0&&x.a.createElement("span",null,x.a.createElement("span",{className:Tt[Number(be==null?void 0:be.answer_status)]||"c-orange-ff9"},be==null?void 0:be.user_score)," ","\u5206")),(be==null?void 0:be.question_type)==5&&!((Nt=ye.exercise)!==null&&Nt!==void 0&&Nt.commit_status)&&x.a.createElement(M.a,{type:"primary",className:"font16 ml20",onClick:function(){return es(be)}},"\u8FDB\u5165\u7B54\u9898"),(be==null?void 0:be.question_type)==6&&!((kt=ye.exercise)!==null&&kt!==void 0&&kt.commit_status)&&x.a.createElement(M.a,{type:"primary",className:"font16 ml20",onClick:function(){return _a(be)}},"\u8FDB\u5165\u7B54\u9898")))))},qi=function(be,pt){return x.a.createElement(P.Fragment,null,be.question_type===0&&er("\u5355\u9009\u9898",0,pt),be.question_type===1&&er("\u591A\u9009\u9898",1,pt),be.question_type===2&&er("\u5224\u65AD\u9898",2,pt),be.question_type===3&&er("\u586B\u7A7A\u9898",3,pt),be.question_type===4&&er("\u7B80\u7B54\u9898",4,pt),be.question_type===5&&er("\u5B9E\u8BAD\u9898",5,pt),be.question_type===6&&er("\u7F16\u7A0B\u9898",6,pt),be.question_type===7&&er("\u7EC4\u5408\u9898",7,pt))},$i=function(be){var pt=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],rt=["","\u5341","\u767E","\u5343","\u4E07"];be=parseInt(be);var Mt=function(kt){for(var Qt=kt.toString().split("").reverse(),Kt="",Jt=0;Jt<Qt.length;Jt++)Kt=(Jt==0&&Qt[Jt]==0||Jt>0&&Qt[Jt]==0&&Qt[Jt-1]==0?"":pt[Qt[Jt]]+(Qt[Jt]==0?rt[0]:rt[Jt]))+Kt;return Kt},gt=Math.floor(be/1e4),It=be%1e4;return It.toString().length<4&&(It="0"+It),gt?Mt(gt)+"\u4E07"+Mt(It):Mt(be)},Ra=function(){var be,pt,rt,Mt,gt,It,Nt,kt,Qt,Kt,Jt,vn,Tn;return x.a.createElement(P.Fragment,{key:rn},x.a.createElement("div",{className:"pt20"},x.a.createElement("span",{className:"font16 c-light-primary"},$i(rn+1),"\u3001",ye==null||((be=ye.exercise_question_types)===null||be===void 0||((pt=be[rn])===null||pt===void 0))?void 0:pt.name),x.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",ye==null||((rt=ye.exercise_question_types)===null||rt===void 0||((Mt=rt[rn])===null||Mt===void 0))?void 0:Mt.count,"\u9898\uFF1B",(ye==null||((gt=ye.exercise_question_types)===null||gt===void 0||((It=gt[rn])===null||It===void 0))?void 0:It.question_type)===7?"\u5305\u542B".concat(ye==null||((Nt=ye.exercise_question_types)===null||Nt===void 0||((kt=Nt[rn])===null||kt===void 0))?void 0:kt.sub_questions_count,"\u5C0F\u9898"):""," ","\u5171",ye==null||((Qt=ye.exercise_question_types)===null||Qt===void 0||((Kt=Qt[rn])===null||Kt===void 0))?void 0:Kt.score,"\u5206\uFF09")),x.a.createElement(P.Fragment,{key:an},Oa(ye==null||((Jt=ye.exercise_question_types)===null||Jt===void 0||((vn=Jt[rn])===null||vn===void 0||((Tn=vn.items)===null||Tn===void 0)))?void 0:Tn[an],an)))};return x.a.createElement(z.a,{size:"large",spinning:Cr},sn&&x.a.createElement(de.a,{iframe:kn}),x.a.createElement("iframe",{style:{display:Jr},id:"iframeShixuns",className:Me.a.iframe,src:Dr,ref:kn,frameBorder:"0"}),x.a.createElement("section",{className:"edu-container"},x.a.createElement("section",{className:"animated fadeIn"},x.a.createElement("aside",{className:"mt10"},k.showHeaderFooter&&at.coursesId!=="coursesId"&&x.a.createElement(V.a,{separator:">"},x.a.createElement(V.a.Item,null,x.a.createElement(j.a,{to:"/classrooms/".concat(at.coursesId,"/exercise")},(ue=te.userInfo)===null||ue===void 0||((me=ue.course)===null||me===void 0)?void 0:me.course_name)),x.a.createElement(V.a.Item,null,x.a.createElement(j.a,{to:"/classrooms/".concat(at.coursesId,"/exercise")},"\u8BD5\u5377")),x.a.createElement(V.a.Item,null,x.a.createElement(j.a,{to:"/classrooms/".concat(at.coursesId,"/exercise/").concat(at.categoryId,"/detail")},"\u8BD5\u5377\u8BE6\u60C5")),x.a.createElement(V.a.Item,null,($e=te.userInfo)===null||$e===void 0?void 0:$e.real_name)),k.showHeaderFooter&&at.coursesId==="coursesId"&&x.a.createElement(V.a,{separator:">"},x.a.createElement(V.a.Item,null,x.a.createElement(j.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),x.a.createElement(V.a.Item,null,(je=te.userInfo)===null||je===void 0?void 0:je.real_name))),x.a.createElement("aside",{className:[Me.a.title,"mt10"].join(" ")},x.a.createElement(H.a,{style:{width:"100%"},align:"middle"},x.a.createElement(D.a,{flex:"1"},x.a.createElement("div",{className:Me.a.title},(k==null?void 0:k.showHeaderFooter)&&x.a.createElement(j.a,{to:at.coursesId==="coursesId"?"/paperlibrary":"/classrooms/".concat(at.coursesId,"/exercise/").concat(at.categoryId,"/detail")},x.a.createElement($.a,{className:"font16 c-black"})),x.a.createElement("strong",{className:"font24 ml5"},ye==null||((Je=ye.exercise)===null||Je===void 0)?void 0:Je.exercise_name),(ye==null||((mt=ye.exercise)===null||mt===void 0)?void 0:mt.is_random)&&x.a.createElement("span",{className:Me.a.randomFlag},"\u968F\u673A"),x.a.createElement(Be.m,{status:[Be.c[99]]}))),x.a.createElement(D.a,{style:{display:"flex"}},(ye==null||((We=ye.user_score)===null||We===void 0)?void 0:We.length)&&x.a.createElement("div",null,"\u6A21\u62DF\u8003\u8BD5\u603B\u5F97\u5206\uFF1A",x.a.createElement("span",{className:"c-red"},ye==null?void 0:ye.user_score)," \u5206"),!!(ye!=null&&(it=ye.exercise)!==null&&it!==void 0&&it.time)&&!(ye!=null&&(st=ye.exercise)!==null&&st!==void 0&&st.commit_status)&&x.a.createElement("aside",{className:"".concat(Me.a.countDown," ").concat(tn)},"\u5269\u4F59\u65F6\u95F4:",x.a.createElement(he,{value:bn,onFinish:ii})),!(ye!=null&&(dt=ye.exercise)!==null&&dt!==void 0&&dt.commit_status)&&x.a.createElement(M.a,{className:Me.a.submitButton,style:{marginLeft:20},type:"primary",onClick:function(){return ui(!1)}},"\u4EA4\u5377"))))),An.status===0&&x.a.createElement(H.a,{className:"mt10"},x.a.createElement(D.a,{flex:yr?"316px":"16px"},x.a.createElement("section",{style:{position:"sticky",top:0,zIndex:1}},Nr&&x.a.createElement(oe.a,{number:(ye==null||((Et=ye.exercise)===null||Et===void 0)?void 0:Et.photo_count)-(ye==null||((jt=ye.exercise)===null||jt===void 0)?void 0:jt.take_photo),time:(en=ye.exercise)===null||en===void 0?void 0:en.left_time,update:ti,supportCamera:function(be){be===2?(ti(),Ln(Hn==null?void 0:Hn.screen_open)):be===1&&setTimeout(function(){return Ie.history.push("/")},3e3)}}),x.a.createElement("div",{className:"relative",style:{minHeight:236}},yr&&x.a.createElement("aside",{className:"bg-white p16"},x.a.createElement(H.a,null,x.a.createElement(D.a,{span:8},x.a.createElement("span",{className:"font16 blod"},"\u7B54\u9898\u5361")),x.a.createElement(D.a,{span:16},x.a.createElement("div",{className:"tr",style:{display:"flex",alignItems:"center",justifyContent:"end"}},x.a.createElement("span",{className:Me.a.answerYes}),"\u5DF2\u7B54",x.a.createElement("span",{style:{width:13,height:13,display:"flex",flexDirection:"column-reverse"},className:"".concat(Me.a.answerNo," ml10")},x.a.createElement("div",{style:{height:"10%",background:"#0152d9"}})),"\u90E8\u5206\u7B54\u9898",x.a.createElement("span",{className:"".concat(Me.a.answerNo," ml10")}),"\u672A\u7B54"))),x.a.createElement("aside",{className:Me.a.answerInfo},x.a.createElement(H.a,null,x.a.createElement(x.a.Fragment,null,x.a.createElement(D.a,{span:12},"\u7B54\u9898\u8FDB\u5EA6"),x.a.createElement(D.a,{span:12,className:"tr c-blue"},ye==null||((Yt=ye.question_status)===null||Yt===void 0||((Ct=Yt.filter(function(Wt){return(Wt==null?void 0:Wt.ques_status)===1}))===null||Ct===void 0))?void 0:Ct.length," ","/ ",ye==null||((pn=ye.exercise_types)===null||pn===void 0)?void 0:pn.q_counts),x.a.createElement(D.a,{span:24},x.a.createElement(u.a,{trailColor:"#c3ced2",percent:(ye==null||((Rt=ye.question_status)===null||Rt===void 0||((zt=Rt.filter(function(Wt){return(Wt==null?void 0:Wt.ques_status)===1}))===null||zt===void 0))?void 0:zt.length)/(ye==null||((Pt=ye.exercise_types)===null||Pt===void 0)?void 0:Pt.q_counts)*100,showInfo:!1}))),x.a.createElement(D.a,null,x.a.createElement("span",{className:"c-grey-333"},"\u5171"," ",x.a.createElement("span",{className:"c-blue-4ca"},(ye==null||((qt=ye.exercise_types)===null||qt===void 0)?void 0:qt.q_counts)||(ye==null||((yn=ye.exercise_scores)===null||yn===void 0||((wn=yn.exercise_types)===null||wn===void 0))?void 0:wn.q_counts))," ","\u9898\uFF1A"),x.a.createElement("span",{className:"c-grey-333"},"\u6EE1\u5206"," ",x.a.createElement("span",{className:"c-blue-4ca"},(ye==null||((yt=ye.exercise_types)===null||yt===void 0)?void 0:yt.q_scores)||(ye==null||((Vt=ye.exercise_scores)===null||Vt===void 0||((Mn=Vt.exercise_types)===null||Mn===void 0))?void 0:Mn.q_scores))," ","\u5206")))),x.a.createElement(H.a,null,x.a.createElement(D.a,{flex:"1"},x.a.createElement("aside",{className:Me.a.cardList},ye==null||((Un=ye.exercise_question_types)===null||Un===void 0)?void 0:Un.map(function(Wt,be){return x.a.createElement(P.Fragment,{key:Wt.question_type},qi(Wt,be))}))))),x.a.createElement("div",{className:Me.a.fold,onClick:function(){return Qr(!yr)}},yr&&x.a.createElement("span",{className:"icon-zuojiantou iconfont c-grey-c"}),!yr&&x.a.createElement("span",{className:"icon-youjiantou iconfont c-grey-c"}))))),x.a.createElement(D.a,{flex:"1"},x.a.createElement("section",{className:[Me.a.bg,"pl30","pr30","pb30","mb50","ml20"].join(" ")},x.a.createElement("div",{style:{maxHeight:600,overflow:"hidden auto"}},Ra()),x.a.createElement("div",{style:{marginTop:60,textAlign:"center"}},(rn!=0||an!=0)&&x.a.createElement(M.a,{className:"".concat(Me.a.submitButton," mr10"),type:"default",onClick:function(){var be;if(ye.exercise_question_types[rn].items[an].israp=!1,Ut(Object(T.a)({},ye)),!$r&&(ye==null||((be=ye.exercise)===null||be===void 0)?void 0:be.user_exercise_status)===0&&Object(fe.s)()){var pt,rt,Mt,gt;if(!((pt=ye.exercise_question_types)!==null&&pt!==void 0&&(rt=pt[rn])!==null&&rt!==void 0&&(Mt=rt.items)!==null&&Mt!==void 0&&(gt=Mt[an])!==null&>!==void 0&>.repeat_answer)){$n(!0),Vi(1);return}}an===0?(rn-=1,an=ye.exercise_question_types[rn].items.length-1):an-=1,mn(rn),Zr(an)}},"\u4E0A\u4E00\u9898"),!(rn===(ye==null||((Pn=ye.exercise_question_types)===null||Pn===void 0)?void 0:Pn.length)-1&&an===(ye==null||((Vn=ye.exercise_question_types)===null||Vn===void 0||((Q=Vn[rn])===null||Q===void 0||((L=Q.items)===null||L===void 0)))?void 0:L.length)-1)&&x.a.createElement(M.a,{className:Me.a.submitButton,type:"primary",onClick:function(){var be;if(ye.exercise_question_types[rn].items[an].israp=!1,Ut(Object(T.a)({},ye)),!$r&&(ye==null||((be=ye.exercise)===null||be===void 0)?void 0:be.user_exercise_status)===0&&Object(fe.s)()){var pt,rt,Mt,gt;if(!((pt=ye.exercise_question_types)!==null&&pt!==void 0&&(rt=pt[rn])!==null&&rt!==void 0&&(Mt=rt.items)!==null&&Mt!==void 0&&(gt=Mt[an])!==null&>!==void 0&>.repeat_answer)){$n(!0),Vi(2);return}}ye.exercise_question_types[rn].items.length-1===an?(rn=rn+1,an=0):an=an+1,mn(rn),Zr(an)}},"\u4E0B\u4E00\u9898")))),x.a.createElement(S.a,{title:"\u6CE8\u610F",visible:En,onCancel:function(){return $n(!1)},footer:!1},x.a.createElement("div",null,x.a.createElement("p",{style:{marginBottom:0}},"\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"),x.a.createElement("div",{style:{marginTop:60,display:"flex",justifyContent:"space-between"}},x.a.createElement(c.a,{checked:$r,onChange:function(be){Ai(be.target.checked)}},"\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"),x.a.createElement("div",null,x.a.createElement(M.a,{onClick:function(){ye.exercise_question_types[rn].items[an].israp?(ye.exercise_question_types[rn].items[an].israp=!0,Ut(Object(T.a)({},ye))):ye.exercise_question_types[rn].items[an].israp===""&&(ye.exercise_question_types[rn].items[an].israp=!0,Ut(Object(T.a)({},ye)))}},"\u6211\u518D\u60F3\u60F3"),x.a.createElement(M.a,{onClick:function(){ye.exercise_question_types[rn].items[an].israp=!1,Ut(Object(T.a)({},ye)),zi===1?(an===0?(rn-=1,an=ye.exercise_question_types[rn].items.length-1):an-=1,console.log(ye.exercise_question_types[rn].items[an],"-----"),mn(rn),Zr(an)):zi===2?(ye.exercise_question_types[rn].items.length-1===an?(rn=rn+1,an=0):an=an+1,mn(rn),Zr(an)):(mn(Xi.oneindex),Zr(Xi.twoindex)),$n(!1)},type:"primary",style:{marginLeft:30}},"\u786E\u8BA4")))))),An.status!==0&&x.a.createElement(Ee,{data:An})))},vt=se.default=Object(B.a)(function(qe){var Qe=qe.loading,Ue=qe.user,ue=qe.globalSetting;return{globalSetting:ue,user:Ue,loading:Qe.effects}})(wt)},cRFk:function(Ye,se,U){Ye.exports=U.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Ye,se,U){Ye.exports=U.p+"static/choose.4ad1045f.svg"},dejd:function(Ye,se,U){},djh8:function(Ye,se,U){Ye.exports=U.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Ye,se,U){"use strict";var Z=U("Ff2n"),z=U("rePB"),N=U("1OyB"),V=U("vuIU"),W=U("Ji7U"),M=U("md7G"),K=U("foSv"),H=U("q1tI"),n=U.n(H),D=U("TSYQ"),y=U.n(D),m=U("4IlW");function f(p,h){var A=Object.keys(p);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(p);h&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(p,v).enumerable})),A.push.apply(A,E)}return A}function c(p){for(var h=1;h<arguments.length;h++){var A=arguments[h]!=null?arguments[h]:{};h%2?f(Object(A),!0).forEach(function(E){Object(z.a)(p,E,A[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(A)):f(Object(A)).forEach(function(E){Object.defineProperty(p,E,Object.getOwnPropertyDescriptor(A,E))})}return p}function l(p){var h=d();return function(){var E=Object(K.a)(p),v;if(h){var P=Object(K.a)(this).constructor;v=Reflect.construct(E,arguments,P)}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(p){return!1}}function o(){}function u(p){p.preventDefault()}var a=function(h){return h.replace(/[^\w.-]+/g,"")},i=200,R=600,S=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(h){return h!=null},I=function(h,A){return A===h||typeof A=="number"&&typeof h=="number"&&isNaN(A)&&isNaN(h)},O=function(p){Object(W.a)(A,p);var h=l(A);function A(E){var v;Object(N.a)(this,A),v=h.call(this,E),v.onKeyDown=function(C){var j=v.props,B=j.onKeyDown,w=j.onPressEnter;if(C.keyCode===m.a.UP){var Y=v.getRatio(C);v.up(C,Y,null),v.stop()}else if(C.keyCode===m.a.DOWN){var $=v.getRatio(C);v.down(C,$,null),v.stop()}else C.keyCode===m.a.ENTER&&w&&w(C);if(v.recordCursorPosition(),v.lastKeyCode=C.keyCode,B){for(var oe=arguments.length,de=new Array(oe>1?oe-1:0),Fe=1;Fe<oe;Fe++)de[Fe-1]=arguments[Fe];B.apply(void 0,[C].concat(de))}},v.onKeyUp=function(C){var j=v.props.onKeyUp;if(v.stop(),v.recordCursorPosition(),j){for(var B=arguments.length,w=new Array(B>1?B-1:0),Y=1;Y<B;Y++)w[Y-1]=arguments[Y];j.apply(void 0,[C].concat(w))}},v.onChange=function(C){var j=v.props.onChange;v.state.focused&&(v.inputting=!0),v.rawInput=v.props.parser(v.getValueFromEvent(C)),v.setState({inputValue:v.rawInput}),j(v.toNumber(v.rawInput))},v.onMouseUp=function(){var C=v.props.onMouseUp;v.recordCursorPosition(),C&&C.apply(void 0,arguments)},v.onFocus=function(){var C;v.setState({focused:!0}),(C=v.props).onFocus.apply(C,arguments)},v.onBlur=function(){var C=v.props.onBlur;v.inputting=!1,v.setState({focused:!1});var j=v.getCurrentValidValue(v.state.inputValue),B=v.setValue(j,o);if(C){var w=v.input.value,Y=v.getInputDisplayValue({focus:!1,value:B});v.input.value=Y&&Number(Y),C.apply(void 0,arguments),v.input.value=w}},v.getRatio=function(C){var j=1;return C.metaKey||C.ctrlKey?j=.1:C.shiftKey&&(j=10),j},v.getFullNum=function(C){return isNaN(C)?C:/e/i.test(String(C))?Number(C).toFixed(18).replace(/\.?0+$/,""):C},v.getPrecision=function(C){if(T(v.props.precision))return v.props.precision;var j=String(C);if(j.indexOf("e-")>=0)return parseInt(j.slice(j.indexOf("e-")+2),10);var B=0;return j.indexOf(".")>=0&&(B=j.length-j.indexOf(".")-1),B},v.getInputDisplayValue=function(C){var j=C||v.state,B=j.focused,w=j.inputValue,Y=j.value,$;B?$=w:$=v.toPrecisionAsStep(Y),$==null&&($="");var oe=v.formatWrapper($);return T(v.props.decimalSeparator)&&(oe=oe.toString().replace(".",v.props.decimalSeparator)),oe},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(C){}},v.restoreByAfter=function(C){if(C===void 0)return!1;var j=v.input.value,B=j.lastIndexOf(C);if(B===-1)return!1;var w=v.cursorBefore.length;return v.lastKeyCode===m.a.DELETE&&v.cursorBefore.charAt(w-1)===C[0]?(v.fixCaret(w,w),!0):B+C.length===j.length?(v.fixCaret(B,B),!0):!1},v.partRestoreByAfter=function(C){return C===void 0?!1:Array.prototype.some.call(C,function(j,B){var w=C.substring(B);return v.restoreByAfter(w)})},v.isNotCompleteNumber=function(C){return isNaN(C)||C===""||C===null||C&&C.toString().indexOf(".")===C.toString().length-1},v.stop=function(){v.autoStepTimer&&clearTimeout(v.autoStepTimer)},v.down=function(C,j,B){v.pressingUpOrDown=!0,v.step("down",C,j,B)},v.up=function(C,j,B){v.pressingUpOrDown=!0,v.step("up",C,j,B)},v.saveInput=function(C){v.input=C};var P=E.value;P===void 0&&(P=E.defaultValue),v.state={focused:E.autoFocus};var x=v.getValidValue(v.toNumber(P));return v.state=c(c({},v.state),{},{inputValue:v.toPrecisionAsStep(x),value:x}),v}return Object(V.a)(A,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(v){var P=this.props,x=P.value,C=P.onChange,j=P.max,B=P.min,w=this.state.focused;if(v){if(!I(v.value,x)||!I(v.max,j)||!I(v.min,B)){var Y=w?x:this.getValidValue(x),$;this.pressingUpOrDown?$=Y:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:$})}var oe="value"in this.props?x:this.state.value;"max"in this.props&&v.max!==j&&typeof oe=="number"&&oe>j&&C&&C(j),"min"in this.props&&v.min!==B&&typeof oe=="number"&&oe<B&&C&&C(B)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var de=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?de=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(de=this.cursorStart):de=this.input.value.length,this.fixCaret(de,de)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Fe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(v){var P=v;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(v){var P=v.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,C=parseFloat(v);return isNaN(C)?v:(C<P&&(C=P),C>x&&(C=x),C)}},{key:"setValue",value:function(v,P){var x=this.props.precision,C=this.isNotCompleteNumber(parseFloat(v))?null:parseFloat(v),j=this.state.value,B=j===void 0?null:j,w=this.state.inputValue,Y=w===void 0?null:w,$=typeof C=="number"?C.toFixed(x):"".concat(C),oe=C!==B||$!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},P)):this.setState({value:C,inputValue:this.toPrecisionAsStep(v)},P),oe&&this.props.onChange(C),C}},{key:"getMaxPrecision",value:function(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,x=this.props,C=x.precision,j=x.step;if(T(C))return C;var B=this.getPrecision(P),w=this.getPrecision(j),Y=this.getPrecision(v);return v?Math.max(Y,B+w):B+w}},{key:"getPrecisionFactor",value:function(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,x=this.getMaxPrecision(v,P);return Math.pow(10,x)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(v){return this.props.formatter?this.props.formatter(v):v}},{key:"toPrecisionAsStep",value:function(v){if(this.isNotCompleteNumber(v)||v==="")return v;var P=Math.abs(this.getMaxPrecision(v));return isNaN(P)?v.toString():Number(v).toFixed(P)}},{key:"toNumber",value:function(v){var P=this.props.precision,x=this.state.focused,C=v&&v.length>16&&x;return this.isNotCompleteNumber(v)||C?v:T(P)?Math.round(v*Math.pow(10,P))/Math.pow(10,P):Number(v)}},{key:"upStep",value:function(v,P){var x=this.props.step,C=this.getPrecisionFactor(v,P),j=Math.abs(this.getMaxPrecision(v,P)),B=((C*v+C*x*P)/C).toFixed(j);return this.toNumber(B)}},{key:"downStep",value:function(v,P){var x=this.props.step,C=this.getPrecisionFactor(v,P),j=Math.abs(this.getMaxPrecision(v,P)),B=((C*v-C*x*P)/C).toFixed(j);return this.toNumber(B)}},{key:"step",value:function(v,P){var x=this,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var B=this.props;if(B.disabled)return;var w=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(w))return;var Y=this["".concat(v,"Step")](w,C),$=Y>B.max||Y<B.min;if(Y>B.max?Y=B.max:Y<B.min&&(Y=B.min),this.setValue(Y,null),this.setState({focused:!0},function(){x.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){x[v](P,C,!0)},j?i:R)}},{key:"fixCaret",value:function(v,P){if(v===void 0||P===void 0||!this.input||!this.input.value)return;try{var x=this.input.selectionStart,C=this.input.selectionEnd;(v!==x||P!==C)&&this.input.setSelectionRange(v,P)}catch(j){}}},{key:"render",value:function(){var v,P=this.props,x=P.prefixCls,C=P.disabled,j=P.readOnly,B=P.useTouch,w=P.autoComplete,Y=P.upHandler,$=P.downHandler,oe=P.className,de=P.max,Fe=P.min,Ae=P.style,Re=P.title,Me=P.onMouseEnter,Be=P.onMouseLeave,pe=P.onMouseOver,fe=P.onMouseOut,ne=P.required,xe=P.onClick,ce=P.tabIndex,Pe=P.type,He=P.placeholder,ke=P.id,Ve=P.inputMode,et=P.pattern,le=P.step,_e=P.maxLength,Ce=P.autoFocus,De=P.name,tt=P.onPaste,ct=P.onInput,ft=Object(Z.a)(P,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ut=this.state,xt=ut.value,bt=ut.focused,Ne=y()(x,(v={},Object(z.a)(v,oe,!!oe),Object(z.a)(v,"".concat(x,"-disabled"),C),Object(z.a)(v,"".concat(x,"-focused"),bt),v)),Oe={};Object.keys(ft).forEach(function(ve){(ve.substr(0,5)==="data-"||ve.substr(0,5)==="aria-"||ve==="role")&&(Oe[ve]=ft[ve])});var nt=!j&&!C,lt=this.getInputDisplayValue(null),Ke=(xt||xt===0)&&(isNaN(xt)||Number(xt)>=de),Xe=(xt||xt===0)&&(isNaN(xt)||Number(xt)<=Fe),Se=Ke||C||j,ge=Xe||C||j,Ee=y()("".concat(x,"-handler"),"".concat(x,"-handler-up"),Object(z.a)({},"".concat(x,"-handler-up-disabled"),Se)),ie=y()("".concat(x,"-handler"),"".concat(x,"-handler-down"),Object(z.a)({},"".concat(x,"-handler-down-disabled"),ge)),ae=B?{onTouchStart:Se?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Se?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=B?{onTouchStart:ge?o:this.down,onTouchEnd:this.stop}:{onMouseDown:ge?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ne,style:Ae,title:Re,onMouseEnter:Me,onMouseLeave:Be,onMouseOver:pe,onMouseOut:fe,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(x,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":Se,className:Ee}),Y||n.a.createElement("span",{unselectable:"on",className:"".concat(x,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":ge,className:ie}),$||n.a.createElement("span",{unselectable:"on",className:"".concat(x,"-handler-down-inner"),onClick:u}))),n.a.createElement("div",{className:"".concat(x,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Fe,"aria-valuemax":de,"aria-valuenow":xt,required:ne,type:Pe,placeholder:He,onPaste:tt,onClick:xe,onMouseUp:this.onMouseUp,className:"".concat(x,"-input"),tabIndex:ce,autoComplete:w,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:nt?this.onKeyDown:o,onKeyUp:nt?this.onKeyUp:o,autoFocus:Ce,maxLength:_e,readOnly:j,disabled:C,max:de,min:Fe,step:le,name:De,title:Re,id:ke,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(lt),pattern:et,inputMode:Ve,onInput:ct},Oe))))}}]),A}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:a,required:!1,autoComplete:"off"};var _=O,b=se.a=_},fjLI:function(Ye,se,U){"use strict";U.d(se,"f",function(){return f}),U.d(se,"b",function(){return c}),U.d(se,"a",function(){return l}),U.d(se,"d",function(){return d}),U.d(se,"e",function(){return o}),U.d(se,"c",function(){return u});var Z=U("8HAY"),z=U("Vhoy"),N=U("MI8n"),V=U("JYp7"),W=U("pmY6"),M=U("24hK"),K=U("nnTU"),H=U("T8No"),n=U("Cg/j"),D=U("t9D7"),y=function(a,i,R,S){var T=arguments.length,I=T<3?i:S===null?S=Object.getOwnPropertyDescriptor(i,R):S,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(a,i,R,S);else for(var _=a.length-1;_>=0;_--)(O=a[_])&&(I=(T<3?O(I):T>3?O(i,R,I):O(i,R))||I);return T>3&&I&&Object.defineProperty(i,R,I),I},m=function(a,i){return function(R,S){i(R,S,a)}};function f(a){return a.command!==void 0}class c{constructor(a){this.id=c._idPool++,this._debugName=a}}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 l=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:a=>a===c.CommandPalette}}addCommand(a){return this.addCommands(V.a.single(a))}addCommands(a){for(const i of a)this._commands.set(i.id,i);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(W.i)(()=>{let i=!1;for(const R of a)i=this._commands.delete(R.id)||i;i&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(a){return this._commands.get(a)}getCommands(){const a=new Map;return this._commands.forEach((i,R)=>a.set(R,i)),a}appendMenuItem(a,i){return this.appendMenuItems(V.a.single({id:a,item:i}))}appendMenuItems(a){const i=new Set,R=new M.a;for(const{id:S,item:T}of a){let I=this._menuItems.get(S);I||(I=new M.a,this._menuItems.set(S,I)),R.push(I.push(T)),i.add(S)}return this._onDidChangeMenu.fire(i),Object(W.i)(()=>{if(R.size>0){for(let S of R)S();this._onDidChangeMenu.fire(i),R.clear()}})}getMenuItems(a){let i;return this._menuItems.has(a)?i=[...this._menuItems.get(a)]:i=[],a===c.CommandPalette&&this._appendImplicitItems(i),i}_appendImplicitItems(a){const i=new Set;for(const R of a)f(R)&&(i.add(R.command.id),R.alt&&i.add(R.alt.id));this._commands.forEach((R,S)=>{i.has(S)||a.push({command:R})})}};class o extends Z.e{constructor(a,i,R,S){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu");this.item=a,this._menuService=i,this._contextKeyService=R,this._options=S}get actions(){const a=[],i=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=i.getActions(this._options);i.dispose();for(const[,S]of R)S.length>0&&(a.push(...S),a.push(new Z.d));return a.length&&a.pop(),a}}let u=class a{constructor(i,R,S,T,I){var O,_;if(this._commandService=I,this.id=i.id,this.label=(S==null?void 0:S.renderShortTitle)&&i.shortTitle?typeof i.shortTitle=="string"?i.shortTitle:i.shortTitle.value:typeof i.title=="string"?i.title:i.title.value,this.tooltip=(_=typeof i.tooltip=="string"?i.tooltip:(O=i.tooltip)===null||O===void 0?void 0:O.value)!==null&&_!==void 0?_:"",this.enabled=!i.precondition||T.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const b=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=T.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=i,this.alt=R?new a(R,void 0,S,T,I):void 0,this._options=S,D.d.isThemeIcon(i.icon)&&(this.class=z.a.asClassName(i.icon))}dispose(){}run(...i){var R,S;let T=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(T=[...T,this._options.arg]),((S=this._options)===null||S===void 0?void 0:S.shouldForwardArgs)&&(T=[...T,...i]),this._commandService.executeCommand(this.id,...T)}};u=y([m(3,H.b),m(4,K.b)],u)},fyJ8:function(Ye,se,U){"use strict";var Z=U("rePB"),z=U("VTBJ"),N=U("Ff2n"),V=U("U8pU"),W=U("q1tI"),M=U.n(W),K=U("TSYQ"),H=U.n(K),n=U("c+Xe"),D=U("sR1s");function y(d){return d&&Object(V.a)(d)==="object"&&!Array.isArray(d)&&!W.isValidElement(d)}function m(d){return typeof d=="string"?!0:Object(n.c)(d)}function f(d,o){var u,a=d.prefixCls,i=d.className,R=d.record,S=d.index,T=d.dataIndex,I=d.render,O=d.children,_=d.component,b=_===void 0?"td":_,p=d.colSpan,h=d.rowSpan,A=d.fixLeft,E=d.fixRight,v=d.firstFixLeft,P=d.lastFixLeft,x=d.firstFixRight,C=d.lastFixRight,j=d.appendNode,B=d.additionalProps,w=B===void 0?{}:B,Y=d.ellipsis,$=d.align,oe=d.rowType,de=d.isSticky,Fe="".concat(a,"-cell"),Ae,Re;if(O)Re=O;else{var Me=Object(D.b)(R,T);if(Re=Me,I){var Be=I(Me,R,S);y(Be)?(Re=Be.children,Ae=Be.props):Re=Be}}Object(V.a)(Re)==="object"&&!Array.isArray(Re)&&!W.isValidElement(Re)&&(Re=null),Y&&(P||x)&&(Re=W.createElement("span",{className:"".concat(Fe,"-content")},Re));var pe=Ae||{},fe=pe.colSpan,ne=pe.rowSpan,xe=pe.style,ce=pe.className,Pe=Object(N.a)(pe,["colSpan","rowSpan","style","className"]),He=fe!==void 0?fe:p,ke=ne!==void 0?ne:h;if(He===0||ke===0)return null;var Ve={},et=typeof A=="number",le=typeof E=="number";et&&(Ve.position="sticky",Ve.left=A),le&&(Ve.position="sticky",Ve.right=E);var _e={};$&&(_e.textAlign=$);var Ce,De=Y===!0?{showTitle:!0}:Y;De&&(De.showTitle||oe==="header")&&(typeof Re=="string"||typeof Re=="number"?Ce=Re.toString():W.isValidElement(Re)&&typeof Re.props.children=="string"&&(Ce=Re.props.children));var tt=Object(z.a)(Object(z.a)(Object(z.a)({title:Ce},Pe),w),{},{colSpan:He&&He!==1?He:null,rowSpan:ke&&ke!==1?ke:null,className:H()(Fe,i,(u={},Object(Z.a)(u,"".concat(Fe,"-fix-left"),et),Object(Z.a)(u,"".concat(Fe,"-fix-left-first"),v),Object(Z.a)(u,"".concat(Fe,"-fix-left-last"),P),Object(Z.a)(u,"".concat(Fe,"-fix-right"),le),Object(Z.a)(u,"".concat(Fe,"-fix-right-first"),x),Object(Z.a)(u,"".concat(Fe,"-fix-right-last"),C),Object(Z.a)(u,"".concat(Fe,"-ellipsis"),Y),Object(Z.a)(u,"".concat(Fe,"-with-append"),j),Object(Z.a)(u,"".concat(Fe,"-fix-sticky"),(et||le)&&de),u),w.className,ce),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},w.style),_e),Ve),xe),ref:m(b)?o:null});return W.createElement(b,Object.assign({},tt),j,Re)}var c=W.forwardRef(f);c.displayName="Cell";var l=W.memo(c,function(d,o){return o.shouldCellUpdate?!o.shouldCellUpdate(o.record,d.record):!1});se.a=l},h78n:function(Ye,se,U){"use strict";U.d(se,"a",function(){return v});var Z=U("q1tI"),z=U.n(Z),N=U("TSYQ"),V=U.n(N),W={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(C){var j=C.map(function(){return Object(Z.useRef)()}),B=Object(Z.useRef)();return Object(Z.useEffect)(function(){var w=Date.now(),Y=!1;Object.keys(j).forEach(function($){var oe=j[$].current;if(!oe)return;Y=!0;var de=oe.style;de.transitionDuration=".3s, .3s, .3s, .06s",B.current&&w-B.current<100&&(de.transitionDuration="0s, 0s")}),Y&&(B.current=Date.now())}),[j]};function K(){return K=Object.assign||function(x){for(var C=1;C<arguments.length;C++){var j=arguments[C];for(var B in j)Object.prototype.hasOwnProperty.call(j,B)&&(x[B]=j[B])}return x},K.apply(this,arguments)}function H(x,C){return f(x)||m(x,C)||D(x,C)||n()}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(x,C){if(!x)return;if(typeof x=="string")return y(x,C);var j=Object.prototype.toString.call(x).slice(8,-1);if(j==="Object"&&x.constructor&&(j=x.constructor.name),j==="Map"||j==="Set")return Array.from(x);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return y(x,C)}function y(x,C){(C==null||C>x.length)&&(C=x.length);for(var j=0,B=new Array(C);j<C;j++)B[j]=x[j];return B}function m(x,C){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(x)))return;var j=[],B=!0,w=!1,Y=void 0;try{for(var $=x[Symbol.iterator](),oe;!(B=(oe=$.next()).done)&&!(j.push(oe.value),C&&j.length===C);B=!0);}catch(de){w=!0,Y=de}finally{try{!B&&$.return!=null&&$.return()}finally{if(w)throw Y}}return j}function f(x){if(Array.isArray(x))return x}function c(x,C){if(x==null)return{};var j=l(x,C),B,w;if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(x);for(w=0;w<Y.length;w++){if(B=Y[w],C.indexOf(B)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(x,B))continue;j[B]=x[B]}}return j}function l(x,C){if(x==null)return{};var j={},B=Object.keys(x),w,Y;for(Y=0;Y<B.length;Y++){if(w=B[Y],C.indexOf(w)>=0)continue;j[w]=x[w]}return j}var d=function(C){var j=C.className,B=C.percent,w=C.prefixCls,Y=C.strokeColor,$=C.strokeLinecap,oe=C.strokeWidth,de=C.style,Fe=C.trailColor,Ae=C.trailWidth,Re=C.transition,Me=c(C,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Me.gapPosition;var Be=Array.isArray(B)?B:[B],pe=Array.isArray(Y)?Y:[Y],fe=M(Be),ne=H(fe,1),xe=ne[0],ce=oe/2,Pe=100-oe/2,He="M ".concat($==="round"?ce:0,",").concat(ce,`
|
|
L `).concat($==="round"?Pe:100,",").concat(ce),ke="0 0 100 ".concat(oe),Ve=0;return z.a.createElement("svg",K({className:V()("".concat(w,"-line"),j),viewBox:ke,preserveAspectRatio:"none",style:de},Me),z.a.createElement("path",{className:"".concat(w,"-line-trail"),d:He,strokeLinecap:$,stroke:Fe,strokeWidth:Ae||oe,fillOpacity:"0"}),Be.map(function(et,le){var _e={strokeDasharray:"".concat(et,"px, 100px"),strokeDashoffset:"-".concat(Ve,"px"),transition:Re||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ce=pe[le]||pe[pe.length-1];return Ve+=et,z.a.createElement("path",{key:le,className:"".concat(w,"-line-path"),d:He,strokeLinecap:$,stroke:Ce,strokeWidth:oe,fillOpacity:"0",ref:xe[le],style:_e})}))};d.defaultProps=W;var o=d;function u(){return u=Object.assign||function(x){for(var C=1;C<arguments.length;C++){var j=arguments[C];for(var B in j)Object.prototype.hasOwnProperty.call(j,B)&&(x[B]=j[B])}return x},u.apply(this,arguments)}function a(x,C){return I(x)||T(x,C)||R(x,C)||i()}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(x,C){if(!x)return;if(typeof x=="string")return S(x,C);var j=Object.prototype.toString.call(x).slice(8,-1);if(j==="Object"&&x.constructor&&(j=x.constructor.name),j==="Map"||j==="Set")return Array.from(x);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return S(x,C)}function S(x,C){(C==null||C>x.length)&&(C=x.length);for(var j=0,B=new Array(C);j<C;j++)B[j]=x[j];return B}function T(x,C){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(x)))return;var j=[],B=!0,w=!1,Y=void 0;try{for(var $=x[Symbol.iterator](),oe;!(B=(oe=$.next()).done)&&!(j.push(oe.value),C&&j.length===C);B=!0);}catch(de){w=!0,Y=de}finally{try{!B&&$.return!=null&&$.return()}finally{if(w)throw Y}}return j}function I(x){if(Array.isArray(x))return x}function O(x,C){if(x==null)return{};var j=_(x,C),B,w;if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(x);for(w=0;w<Y.length;w++){if(B=Y[w],C.indexOf(B)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(x,B))continue;j[B]=x[B]}}return j}function _(x,C){if(x==null)return{};var j={},B=Object.keys(x),w,Y;for(Y=0;Y<B.length;Y++){if(w=B[Y],C.indexOf(w)>=0)continue;j[w]=x[w]}return j}var b=0;function p(x){return+x.replace("%","")}function h(x){return Array.isArray(x)?x:[x]}function A(x,C,j,B){var w=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,Y=arguments.length>5?arguments[5]:void 0,$=50-B/2,oe=0,de=-$,Fe=0,Ae=-2*$;switch(Y){case"left":oe=-$,de=0,Fe=2*$,Ae=0;break;case"right":oe=$,de=0,Fe=-2*$,Ae=0;break;case"bottom":de=$,Ae=2*$;break;default:}var Re="M 50,50 m ".concat(oe,",").concat(de,`
|
|
a `).concat($,",").concat($," 0 1 1 ").concat(Fe,",").concat(-Ae,`
|
|
a `).concat($,",").concat($," 0 1 1 ").concat(-Fe,",").concat(Ae),Me=Math.PI*2*$,Be={stroke:j,strokeDasharray:"".concat(C/100*(Me-w),"px ").concat(Me,"px"),strokeDashoffset:"-".concat(w/2+x/100*(Me-w),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Re,pathStyle:Be}}var E=function(C){var j=C.prefixCls,B=C.strokeWidth,w=C.trailWidth,Y=C.gapDegree,$=C.gapPosition,oe=C.trailColor,de=C.strokeLinecap,Fe=C.style,Ae=C.className,Re=C.strokeColor,Me=C.percent,Be=O(C,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),pe=Object(Z.useMemo)(function(){return b+=1,b},[]),fe=A(0,100,oe,B,Y,$),ne=fe.pathString,xe=fe.pathStyle,ce=h(Me),Pe=h(Re),He=Pe.find(function(_e){return Object.prototype.toString.call(_e)==="[object Object]"}),ke=M(ce),Ve=a(ke,1),et=Ve[0],le=function(){var Ce=0;return ce.map(function(De,tt){var ct=Pe[tt]||Pe[Pe.length-1],ft=Object.prototype.toString.call(ct)==="[object Object]"?"url(#".concat(j,"-gradient-").concat(pe,")"):"",ut=A(Ce,De,ct,B,Y,$);return Ce+=De,z.a.createElement("path",{key:tt,className:"".concat(j,"-circle-path"),d:ut.pathString,stroke:ft,strokeLinecap:de,strokeWidth:B,opacity:De===0?0:1,fillOpacity:"0",style:ut.pathStyle,ref:et[tt]})})};return z.a.createElement("svg",u({className:V()("".concat(j,"-circle"),Ae),viewBox:"0 0 100 100",style:Fe},Be),He&&z.a.createElement("defs",null,z.a.createElement("linearGradient",{id:"".concat(j,"-gradient-").concat(pe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(He).sort(function(_e,Ce){return p(_e)-p(Ce)}).map(function(_e,Ce){return z.a.createElement("stop",{key:Ce,offset:_e,stopColor:He[_e]})}))),z.a.createElement("path",{className:"".concat(j,"-circle-trail"),d:ne,stroke:oe,strokeLinecap:de,strokeWidth:w||B,fillOpacity:"0",style:xe}),le().reverse())};E.defaultProps=W;var v=E,P={Line:o,Circle:v}},hW8S:function(Ye,se,U){"use strict";U.d(se,"a",function(){return V}),U.d(se,"c",function(){return W}),U.d(se,"b",function(){return M});var Z=U("VTBJ"),z=U("Ff2n"),N=U("Kwbf"),V="RC_TABLE_INTERNAL_COL_DEFINE";function W(K){var H=K.expandable,n=Object(z.a)(K,["expandable"]);return"expandable"in K?Object(Z.a)(Object(Z.a)({},n),H):n}function M(K){return Object.keys(K).reduce(function(H,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(H[n]=K[n]),H},{})}},ic2d:function(Ye,se,U){"use strict";U.d(se,"a",function(){return V});var Z=U("FWmy"),z=U("746U");class N{constructor(){this.data=new Map}add(W,M){Z.a(z.l(W)),Z.a(z.k(M)),Z.a(!this.data.has(W),"There is already an extension with this id"),this.data.set(W,M)}as(W){return this.data.get(W)||null}}const V=new N},ji0R:function(Ye,se,U){Ye.exports=U.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Ye,se,U){Ye.exports=U.p+"static/question.cb52bef9.gif"},kPYp:function(Ye,se){Ye.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPfDncPmdihV6Y9nkA+Ot4nrIXaDSGElH6KfjdzpBSpVo8ttVU8Xitx/7hw/imWmYD4wXy6Iqjje9mOGYj/uX0bjYf/5nsaLcpY9fqDZ5hNTD8/wi+27bB+CzfOVcqSiq0BMPdRpiBUNANmHNvJUQo1ZFls0lTuXupnOw+0UVamMsCz+eHCuf3MWgUjZ3w76kUZQeW8j4iOnadXmCUNQI3xvsIbl7bX70MEdKpFLutcCA7iz/BxvfrfY2hNVXDb2v2s/TkU/Lf8SZXrtOcUxFfF8P1AiNVSYj0aihUGOoCu/vFFVpQlpmQX1iflQg3dMxxR1OaVHERfUIglXFKf6AIIbs97SnUq7I5VFZ+skiOt+NwSVIHpAu4wwgLBAZ04COkUGoytusEAhUGi9APyO+UTlWVfyPkrt0/kQ8y4FcI3NQF6zYnNAEn1VKtQuAJg1XiPRPOnnggFmwmicTIC/VqOa5wCiFHhCFGGGAtnkNUBGyaLVGKJXvvZXe8ZlpS/UP5DAh8cgPt8nTP8n+LZbS7vIHpdH2WzcBzUZp1njCTgB/HacYNQxS1sluFF4zwmgpHEpa09ckOleGkuUaEa70sRmrU4fgGG7L8VBOPnCiThgvXaU5ByE14rAGcwxA/vsxha3lJPF4ylv0mpCVKYBCGRRFXm5BvedlMcEEVgyY0hSHP+nn8XZiin1G6gu+At3watfC0l8MWIk5GBs+0UhxZbvSyuM545Gvn+ijYsIU9GvKkyeLVIOBUypIwKSbSyt94RUxHCeIgMNRFEauaDBt6fSrdkS+p0MnisUpgGtIlH7rc9nOU8pQyPmF4XGBY5v2G6RRvtp7irkFjeGf7bYTuyXfYVpUhi8gtLOCaoJA1KKPaL2aVHXjM+XievFm6Ti+JlE0GrupIDMqRps+4z6vh+f3DqHcF8MyZVSbdhl9lKCm8gBVBPn+pNq43qHBSlTujgNeDkJUo3+3Iw9BYF3F3i7K5eonUd9hLqhm2lz/IG8OaYADflgjPndMBGHkcqD3B4mMn+Gc2iaszbSOpZtDbFBdN4uFgINOJMAqOjGxLW77bJ/BHJDU7kcfXjOEeEa7s9NzdM65WeNK0sC5dQGjSrPDgB+1zVNiRqmbh7wO2dQWnm2tv0+C8Zq7rfxkbjOEC3AsQmtSyYnc9q8cW8kMDSYHB7saqHGs+xvLgQ36272VJ9Zajh92ukwtH8JCXxxWajvFSC1sjZYEPC0W4pT3RG3jj0xQ/qF8qe86ymVRTbLg2KOQxLBdkvkdWeLoR7qyaL6fOWqMqI+9jZvYAHsEyKP7eVtj//HPBn5bU7CP9uN4oi4GvSFdGcRhhgybYvHuunByzXqd4IZtEmNi2BzZSklrPQ/vKpK43gOJvEzWvZDZrvYCb1ZIDhBZeyE3xt01ZrDRwc5zqhCiyPNtaxZwD63tmRe37jbhZs/1i5iQKSGpIYeZs+7HcKYYZwPfb50bwSK2l/LNOtabzuUet0TGB4VdGmJD5f0qFiro6Ko7cL65OnDVcxjA+zwDFmY9H/TY62/OYuFbzQphthXIRzus8U4kLy10DhGfemi8u3zOuUv9K4Km4gLaF14kIbty7SF75XOAzE0rW6iwxPBxHOFiUt0Plx77HvSjXZiLntI0o/3iJrO+bXZWSCibh8QsjlMRnE06IZYWjiEgb+CLo6RQrm1t4oKbs3E4dnNSh/fLYkvCZHNtRmppDysOAh6oyOHQ/0+i1Ot6HZzyPS1TjunvcRFzVI/gZjn6rKPORzHNps+ro4A6F5aaef+1oXFSl9EFmqvIEkBunBstea5i9Z778T99AgnFr1dWTp0S4sO1u7ETj1LCItiLvEu1RQn6ya7H8Q5/tJnWEzecFz+PSDPtxKWIdMMJFvkNEDHq4iuU1dVSySWrPZXvkeh2SHfEi8EfGQBTRWFdLecLw0IEyaTnXmovX6ng1PC3CeNeuifCZCeP+5OxRXKEXGp95hrgouAjsGBZ+KxHLTCOvd+0YVUrXMUMVB0j70z4cRty0b7H8R19BKqnUGQY20kZnXU1511rm+R5LFa7J2KmOQpJ7lsijfbU7brVOwOcfRSiNIxaqjbBaLeNc5HeAf5DlNQ1fAPyQxoY6yv0vA/xxq3QEAcvFMCumR2eG476vRsKCPQvY0blNbp9y8Xr9YxvyhBFGZS4YRSFzCot4YvvtnVhAT4hN0mDsDSz1PRaoUuCYgcLWAO4IYbXAdzLNTGgtmz5exNxzneMs80n1i7P4TpDLOokY5KiWKlXAYhG+1iXyPw/8FTokO7tT5H8p4CfVlBbyFassFeE6IKvTJRqt5QVfWLVzoXzUE3bOcZpgjYGZmfTgmpBt0UkW71vJe70CNVO9QZbLBl7J3xufCY7tZJq29UPrufdIAYtNG1j9XEqzyq7mwyw+eIiXO2tJ5zrbebfoqKIxVPr5zNB03AOoVd6KWpkbJJwDubXPkf9lgz9powaNdUw1HveqMrUz8Erc6W0OI9bvW8T+Lhy9+003alDcyPd8pVKIu0uHU2O6medaPmP5oZ/KJ+d03DT1i6cy2eSzzE8wTV0P4agS7DeWH+1aJC+VPKhTRXlUNMOkhEhb2d58jLsPHuYNnusqmrXvM2i2DisazeKgkFsRCp1dFRpUWGYifolQDnzv/wV8p5XYfP5CPMpRLu0GzlGrrB9g+Gltbdwc9Dhyzke3HyEqzmKgn2CDSCxWuShzmk86XcvrErDR+vxGsqhNnESbwHiFDJYGvi4+3w8KmEK6Q/azqjzWYLjP8efipBb6eSwQj6XtnbVJQNTEzqiVjZ7PlpYWjuWCbR2ImFYKwkamGMstWf3jBivXVW91+lHIG4W5zKxpJbu9w+0r+CPW6NBcjxcVLo8Lbl/TjvCMmFjRPVNwix/Q0kDiAuc6xy6qoAqHULaKpVGlZ9WzLQtwysLbrR5vZaco1SDO0a6ixzbFgLUcUdhllE+d5OpSiIXhpq0IDnShHrMkSClsM5YluxbJh7HHVWXCaka2BpQb4Vsxo2pr192C084uzq5y2mk7GEaIk4SFi1xHlUmDroC/Z5V79iyUlztrOw58l45OVbMsFbLudEUPbGeFDsnJjsFvYzt9Bf9cbKe0Ui8DnlYY1z2sXcETzfSavdMKB0OI4/7C42EtD5tcLhef+w1c0U0DcpYcXXUauYOus8Mdns1W2eIpy3Y18FGXrjipZmzAMLIoM4ZZQqwmdh7Oaltv3E0id1lMlR1hRJnk8PK+H0mqu7DmHBDB4vw6HtneQ8N06YNalIp4HmF6X8EfV6ljRfk5EmNxJvIdn09ksdYIs7oV2d7h7uGrhUOEzP14ibzoNgXmC3wjQx3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Ye,se,U){},l2Kq:function(Ye,se,U){Ye.exports=U.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Ye,se,U){(function(Z){Z(U("VrN/"),U("1eCo"),U("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(z,N){var V=Z.getMode(z,"text/html"),W=V.name=="null";function M(B){if(Z.findModeByName){var w=Z.findModeByName(B);w&&(B=w.mime||w.mimes[0])}var Y=Z.getMode(z,B);return Y.name=="null"?null:Y}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var H in K)K.hasOwnProperty(H)&&N.tokenTypeOverrides[H]&&(K[H]=N.tokenTypeOverrides[H]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,m=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,u=" ";function a(B,w,Y){return w.f=w.inline=Y,Y(B,w)}function i(B,w,Y){return w.f=w.block=Y,Y(B,w)}function R(B){return!B||!/\S/.test(B.string)}function S(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==I){var w=W;if(!w){var Y=Z.innerMode(V,B.htmlState);w=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}w&&(B.f=p,B.block=T,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function T(B,w){var Y=B.column()===w.indentation,$=R(w.prevLine.stream),oe=w.indentedCode,de=w.prevLine.hr,Fe=w.list!==!1,Ae=(w.listStack[w.listStack.length-1]||0)+3;w.indentedCode=!1;var Re=w.indentation;if(w.indentationDiff===null&&(w.indentationDiff=w.indentation,Fe)){for(w.list=null;Re<w.listStack[w.listStack.length-1];)w.listStack.pop(),w.listStack.length?w.indentation=w.listStack[w.listStack.length-1]:w.list=!1;w.list!==!1&&(w.indentationDiff=Re-w.listStack[w.listStack.length-1])}var Me=!$&&!de&&!w.prevLine.header&&(!Fe||!oe)&&!w.prevLine.fencedCodeEnd,Be=(w.list===!1||de||$)&&w.indentation<=Ae&&B.match(n),pe=null;if(w.indentationDiff>=4&&(oe||w.prevLine.fencedCodeEnd||w.prevLine.header||$))return B.skipToEnd(),w.indentedCode=!0,K.code;if(B.eatSpace())return null;if(Y&&w.indentation<=Ae&&(pe=B.match(m))&&pe[1].length<=6)return w.quote=0,w.header=pe[1].length,w.thisLine.header=!0,N.highlightFormatting&&(w.formatting="header"),w.f=w.inline,_(w);if(w.indentation<=Ae&&B.eat(">"))return w.quote=Y?1:w.quote+1,N.highlightFormatting&&(w.formatting="quote"),B.eatSpace(),_(w);if(!Be&&!w.setext&&Y&&w.indentation<=Ae&&(pe=B.match(D))){var fe=pe[1]?"ol":"ul";return w.indentation=Re+B.current().length,w.list=!0,w.quote=0,w.listStack.push(w.indentation),w.em=!1,w.strong=!1,w.code=!1,w.strikethrough=!1,N.taskLists&&B.match(y,!1)&&(w.taskList=!0),w.f=w.inline,N.highlightFormatting&&(w.formatting=["list","list-"+fe]),_(w)}else{if(Y&&w.indentation<=Ae&&(pe=B.match(l,!0)))return w.quote=0,w.fencedEndRE=new RegExp(pe[1]+"+ *$"),w.localMode=N.fencedCodeBlockHighlighting&&M(pe[2]||N.fencedCodeBlockDefaultMode),w.localMode&&(w.localState=Z.startState(w.localMode)),w.f=w.block=O,N.highlightFormatting&&(w.formatting="code-block"),w.code=-1,_(w);if(w.setext||(!Me||!Fe)&&!w.quote&&w.list===!1&&!w.code&&!Be&&!d.test(B.string)&&(pe=B.lookAhead(1))&&(pe=pe.match(f)))return w.setext?(w.header=w.setext,w.setext=0,B.skipToEnd(),N.highlightFormatting&&(w.formatting="header")):(w.header=pe[0].charAt(0)=="="?1:2,w.setext=w.header),w.thisLine.header=!0,w.f=w.inline,_(w);if(Be)return B.skipToEnd(),w.hr=!0,w.thisLine.hr=!0,K.hr;if(B.peek()==="[")return a(B,w,P)}return a(B,w,w.inline)}function I(B,w){var Y=V.token(B,w.htmlState);if(!W){var $=Z.innerMode(V,w.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||w.md_inside&&B.current().indexOf(">")>-1)&&(w.f=p,w.block=T,w.htmlState=null)}return Y}function O(B,w){var Y=w.listStack[w.listStack.length-1]||0,$=w.indentation<Y,oe=Y+3;if(w.fencedEndRE&&w.indentation<=oe&&($||B.match(w.fencedEndRE))){N.highlightFormatting&&(w.formatting="code-block");var de;return $||(de=_(w)),w.localMode=w.localState=null,w.block=T,w.f=p,w.fencedEndRE=null,w.code=0,w.thisLine.fencedCodeEnd=!0,$?i(B,w,w.block):de}else return w.localMode?w.localMode.token(B,w.localState):(B.skipToEnd(),K.code)}function _(B){var w=[];if(B.formatting){w.push(K.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var Y=0;Y<B.formatting.length;Y++)w.push(K.formatting+"-"+B.formatting[Y]),B.formatting[Y]==="header"&&w.push(K.formatting+"-"+B.formatting[Y]+"-"+B.header),B.formatting[Y]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=B.quote?w.push(K.formatting+"-"+B.formatting[Y]+"-"+B.quote):w.push("error"))}if(B.taskOpen)return w.push("meta"),w.length?w.join(" "):null;if(B.taskClosed)return w.push("property"),w.length?w.join(" "):null;if(B.linkHref?w.push(K.linkHref,"url"):(B.strong&&w.push(K.strong),B.em&&w.push(K.em),B.strikethrough&&w.push(K.strikethrough),B.emoji&&w.push(K.emoji),B.linkText&&w.push(K.linkText),B.code&&w.push(K.code),B.image&&w.push(K.image),B.imageAltText&&w.push(K.imageAltText,"link"),B.imageMarker&&w.push(K.imageMarker)),B.header&&w.push(K.header,K.header+"-"+B.header),B.quote&&(w.push(K.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=B.quote?w.push(K.quote+"-"+B.quote):w.push(K.quote+"-"+N.maxBlockquoteDepth)),B.list!==!1){var $=(B.listStack.length-1)%3;$?$===1?w.push(K.list2):w.push(K.list3):w.push(K.list1)}return B.trailingSpaceNewLine?w.push("trailing-space-new-line"):B.trailingSpace&&w.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),w.length?w.join(" "):null}function b(B,w){return B.match(c,!0)?_(w):void 0}function p(B,w){var Y=w.text(B,w);if(typeof Y!="undefined")return Y;if(w.list)return w.list=null,_(w);if(w.taskList){var $=B.match(y,!0)[1]===" ";return $?w.taskOpen=!0:w.taskClosed=!0,N.highlightFormatting&&(w.formatting="task"),w.taskList=!1,_(w)}if(w.taskOpen=!1,w.taskClosed=!1,w.header&&B.match(/^#+$/,!0))return N.highlightFormatting&&(w.formatting="header"),_(w);var oe=B.next();if(w.linkTitle){w.linkTitle=!1;var de=oe;oe==="("&&(de=")"),de=(de+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Fe="^\\s*(?:[^"+de+"\\\\]+|\\\\\\\\|\\\\.)"+de;if(B.match(new RegExp(Fe),!0))return K.linkHref}if(oe==="`"){var Ae=w.formatting;N.highlightFormatting&&(w.formatting="code"),B.eatWhile("`");var Re=B.current().length;if(w.code==0&&(!w.quote||Re==1))return w.code=Re,_(w);if(Re==w.code){var Me=_(w);return w.code=0,Me}else return w.formatting=Ae,_(w)}else if(w.code)return _(w);if(oe==="\\"&&(B.next(),N.highlightFormatting)){var Be=_(w),pe=K.formatting+"-escape";return Be?Be+" "+pe:pe}if(oe==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return w.imageMarker=!0,w.image=!0,N.highlightFormatting&&(w.formatting="image"),_(w);if(oe==="["&&w.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return w.imageMarker=!1,w.imageAltText=!0,N.highlightFormatting&&(w.formatting="image"),_(w);if(oe==="]"&&w.imageAltText){N.highlightFormatting&&(w.formatting="image");var Be=_(w);return w.imageAltText=!1,w.image=!1,w.inline=w.f=A,Be}if(oe==="["&&!w.image)return w.linkText&&B.match(/^.*?\]/)||(w.linkText=!0,N.highlightFormatting&&(w.formatting="link")),_(w);if(oe==="]"&&w.linkText){N.highlightFormatting&&(w.formatting="link");var Be=_(w);return w.linkText=!1,w.inline=w.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?A:p,Be}if(oe==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,N.highlightFormatting&&(w.formatting="link");var Be=_(w);return Be?Be+=" ":Be="",Be+K.linkInline}if(oe==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,N.highlightFormatting&&(w.formatting="link");var Be=_(w);return Be?Be+=" ":Be="",Be+K.linkEmail}if(N.xml&&oe==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var fe=B.string.indexOf(">",B.pos);if(fe!=-1){var ne=B.string.substring(B.start,fe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(w.md_inside=!0)}return B.backUp(1),w.htmlState=Z.startState(V),i(B,w,I)}if(N.xml&&oe==="<"&&B.match(/^\/\w*?>/))return w.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var xe=1,ce=B.pos==1?" ":B.string.charAt(B.pos-2);xe<3&&B.eat(oe);)xe++;var Pe=B.peek()||" ",He=!/\s/.test(Pe)&&(!o.test(Pe)||/\s/.test(ce)||o.test(ce)),ke=!/\s/.test(ce)&&(!o.test(ce)||/\s/.test(Pe)||o.test(Pe)),Ve=null,et=null;if(xe%2&&(!w.em&&He&&(oe==="*"||!ke||o.test(ce))?Ve=!0:w.em==oe&&ke&&(oe==="*"||!He||o.test(Pe))&&(Ve=!1)),xe>1&&(!w.strong&&He&&(oe==="*"||!ke||o.test(ce))?et=!0:w.strong==oe&&ke&&(oe==="*"||!He||o.test(Pe))&&(et=!1)),et!=null||Ve!=null){N.highlightFormatting&&(w.formatting=Ve==null?"strong":et==null?"em":"strong em"),Ve===!0&&(w.em=oe),et===!0&&(w.strong=oe);var Me=_(w);return Ve===!1&&(w.em=!1),et===!1&&(w.strong=!1),Me}}else if(oe===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return _(w);B.backUp(1)}if(N.strikethrough){if(oe==="~"&&B.eatWhile(oe)){if(w.strikethrough){N.highlightFormatting&&(w.formatting="strikethrough");var Me=_(w);return w.strikethrough=!1,Me}else if(B.match(/^[^\s]/,!1))return w.strikethrough=!0,N.highlightFormatting&&(w.formatting="strikethrough"),_(w)}else if(oe===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return _(w);B.backUp(2)}}if(N.emoji&&oe===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){w.emoji=!0,N.highlightFormatting&&(w.formatting="emoji");var le=_(w);return w.emoji=!1,le}return oe===" "&&(B.match(/^ +$/,!1)?w.trailingSpace++:w.trailingSpace&&(w.trailingSpaceNewLine=!0)),_(w)}function h(B,w){var Y=B.next();if(Y===">"){w.f=w.inline=p,N.highlightFormatting&&(w.formatting="link");var $=_(w);return $?$+=" ":$="",$+K.linkInline}return B.match(/^[^>]+/,!0),K.linkInline}function A(B,w){if(B.eatSpace())return null;var Y=B.next();return Y==="("||Y==="["?(w.f=w.inline=v(Y==="("?")":"]"),N.highlightFormatting&&(w.formatting="link-string"),w.linkHref=!0,_(w)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function v(B){return function(w,Y){var $=w.next();if($===B){Y.f=Y.inline=p,N.highlightFormatting&&(Y.formatting="link-string");var oe=_(Y);return Y.linkHref=!1,oe}return w.match(E[B]),Y.linkHref=!0,_(Y)}}function P(B,w){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(w.f=x,B.next(),N.highlightFormatting&&(w.formatting="link"),w.linkText=!0,_(w)):a(B,w,p)}function x(B,w){if(B.match(/^\]:/,!0)){w.f=w.inline=C,N.highlightFormatting&&(w.formatting="link");var Y=_(w);return w.linkText=!1,Y}return B.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function C(B,w){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?w.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),w.f=w.inline=p,K.linkHref+" url")}var j={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:p,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&Z.copyState(V,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?Z.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,w){if(w.formatting=!1,B!=w.thisLine.stream){if(w.header=0,w.hr=!1,B.match(/^\s*$/,!0))return S(w),null;if(w.prevLine=w.thisLine,w.thisLine={stream:B},w.taskList=!1,w.trailingSpace=0,w.trailingSpaceNewLine=!1,!w.localState&&(w.f=w.block,w.f!=I)){var Y=B.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(w.indentation=Y,w.indentationDiff=null,Y>0)return null}}return w.f(B,w)},innerMode:function(B){return B.block==I?{state:B.htmlState,mode:V}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:j}},indent:function(B,w,Y){return B.block==I&&V.indent?V.indent(B.htmlState,w,Y):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,w,Y):Z.Pass},blankLine:S,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},lzim:function(Ye,se,U){"use strict";var Z=U("E7E6"),z=U.n(Z);U.d(se,"w",function(){return z.a});var N=U("/GNS"),V=U.n(N);U.d(se,"v",function(){return V.a});var W=U("FOrL"),M=U.n(W);U.d(se,"q",function(){return M.a});var K=U("HpTS"),H=U.n(K);U.d(se,"x",function(){return H.a});var n=U("tWlo"),D=U.n(n);U.d(se,"a",function(){return D.a});var y=U("7ZXX"),m=U.n(y);U.d(se,"l",function(){return m.a});var f=U("GABl"),c=U.n(f);U.d(se,"e",function(){return c.a});var l=U("onxn"),d=U.n(l);U.d(se,"n",function(){return d.a});var o=U("nKGa"),u=U.n(o);U.d(se,"m",function(){return u.a});var a=U("4qgm"),i=U.n(a);U.d(se,"y",function(){return i.a});var R=U("JeFH"),S=U.n(R);U.d(se,"b",function(){return S.a});var T=U("ji0R"),I=U.n(T);U.d(se,"i",function(){return I.a});var O=U("W6BS"),_=U.n(O);U.d(se,"z",function(){return _.a});var b=U("kPYp"),p=U.n(b);U.d(se,"A",function(){return p.a});var h=U("nukY"),A=U.n(h),E=U("4u4S"),v=U.n(E),P=U("yslc"),x=U.n(P),C=U("l2Kq"),j=U.n(C),B=U("RMFE"),w=U.n(B);U.d(se,"o",function(){return w.a});var Y=U("TGq3"),$=U.n(Y),oe=U("SMhR"),de=U.n(oe),Fe=U("8/bI"),Ae=U.n(Fe);U.d(se,"j",function(){return Ae.a});var Re=U("JWDV"),Me=U.n(Re),Be=U("Xsq0"),pe=U.n(Be);U.d(se,"p",function(){return pe.a});var fe=U("Ohmc"),ne=U.n(fe);U.d(se,"c",function(){return ne.a});var xe=U("csWT"),ce=U.n(xe);U.d(se,"d",function(){return ce.a});var Pe=U("7v3h"),He=U.n(Pe);U.d(se,"k",function(){return He.a});var ke=U("cRFk"),Ve=U.n(ke);U.d(se,"u",function(){return Ve.a});var et=U("kPWJ"),le=U.n(et);U.d(se,"t",function(){return le.a});var _e=U("qgvg"),Ce=U.n(_e);U.d(se,"r",function(){return Ce.a});var De=U("FPkq"),tt=U.n(De);U.d(se,"s",function(){return tt.a});var ct=U("A/g1"),ft=U.n(ct);U.d(se,"f",function(){return ft.a});var ut=U("Nmxd"),xt=U.n(ut);U.d(se,"g",function(){return xt.a});var bt=U("5D2P"),Ne=U.n(bt);U.d(se,"h",function(){return Ne.a});var Oe=U("djh8"),nt=U.n(Oe),lt=U("Jq4h"),Ke=U.n(lt)},n6Qo:function(Ye,se,U){"use strict";U.d(se,"a",function(){return H});var Z=U("q1tI"),z=U("biw7"),N=U("fyJ8");function V(n){var D=n.className,y=n.index,m=n.children,f=n.colSpan,c=n.rowSpan,l=Z.useContext(z.a),d=l.prefixCls,o=l.fixedInfoList,u=o[y];return Z.createElement(N.a,Object.assign({className:D,index:y,component:"td",prefixCls:d,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:f,rowSpan:c}}}},u))}function W(n){return Z.createElement("tr",Object.assign({},n))}function M(n){var D=n.children,y=Z.useContext(z.a),m=y.prefixCls;return Z.createElement("tfoot",{className:"".concat(m,"-summary")},D)}var K=se.b=M,H={Cell:V,Row:W}},nEHx:function(Ye,se,U){"use strict";U.d(se,"a",function(){return Z});var Z;(function(z){z.DARK="dark",z.LIGHT="light",z.HIGH_CONTRAST="hc"})(Z||(Z={}))},nKGa:function(Ye,se,U){Ye.exports=U.p+"static/export_exercise-template.f7655c19.png"},nnTU:function(Ye,se,U){"use strict";U.d(se,"b",function(){return K}),U.d(se,"a",function(){return H});var Z=U("MI8n"),z=U("JYp7"),N=U("pmY6"),V=U("24hK"),W=U("746U"),M=U("Cg/j");const K=Object(M.c)("commandService"),H=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 l=[];for(let o of n.description.args)l.push(o.constraint);const d=n.handler;n.handler=function(o,...u){return Object(W.o)(u,l),d(o,...u)}}const{id:y}=n;let m=this._commands.get(y);m||(m=new V.a,this._commands.set(y,m));let f=m.unshift(n),c=Object(N.i)(()=>{f();const l=this._commands.get(y);(l==null?void 0:l.isEmpty())&&this._commands.delete(y)});return this._onDidRegisterCommand.fire(y),c}registerCommandAlias(n,D){return H.registerCommand(n,(y,...m)=>y.get(K).executeCommand(D,...m))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:z.a.first(D)}getCommands(){const n=new Map;for(const D of this._commands.keys()){const y=this.getCommand(D);y&&n.set(D,y)}return n}};H.registerCommand("noop",()=>{})},nukY:function(Ye,se){Ye.exports="data:image/png;base64,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"},"o/qq":function(Ye,se,U){Ye.exports={flex_box_center:"flex_box_center___1LYHS",flex_space_between:"flex_space_between___EmHgD",flex_box_vertical_center:"flex_box_vertical_center___8y-JO",flex_box_center_end:"flex_box_center_end___2Ow7E",flex_box_column:"flex_box_column___2_dIp",shixunWrp:"shixunWrp___2zw8A"}},onxn:function(Ye,se){Ye.exports="data:image/png;base64,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"},osHv:function(Ye,se,U){(function(Z){Z(U("VrN/"))})(function(Z){"use strict";var z=Z.Pos;function N(o,u){return o.line-u.line||o.ch-u.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",W=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+V+"]["+W+"]*)","g");function K(o,u,a,i){this.line=u,this.ch=a,this.cm=o,this.text=o.getLine(u),this.min=i?Math.max(i.from,o.firstLine()):o.firstLine(),this.max=i?Math.min(i.to-1,o.lastLine()):o.lastLine()}function H(o,u){var a=o.cm.getTokenTypeAt(z(o.line,u));return a&&/\btag\b/.test(a)}function n(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function D(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function y(o){for(;;){var u=o.text.indexOf(">",o.ch);if(u==-1){if(n(o))continue;return}if(!H(o,u+1)){o.ch=u+1;continue}var a=o.text.lastIndexOf("/",u),i=a>-1&&!/\S/.test(o.text.slice(a+1,u));return o.ch=u+1,i?"selfClose":"regular"}}function m(o){for(;;){var u=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(u==-1){if(D(o))continue;return}if(!H(o,u+1)){o.ch=u;continue}M.lastIndex=u,o.ch=u;var a=M.exec(o.text);if(a&&a.index==u)return a}}function f(o){for(;;){M.lastIndex=o.ch;var u=M.exec(o.text);if(!u){if(n(o))continue;return}if(!H(o,u.index+1)){o.ch=u.index+1;continue}return o.ch=u.index+u[0].length,u}}function c(o){for(;;){var u=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(u==-1){if(D(o))continue;return}if(!H(o,u+1)){o.ch=u;continue}var a=o.text.lastIndexOf("/",u),i=a>-1&&!/\S/.test(o.text.slice(a+1,u));return o.ch=u+1,i?"selfClose":"regular"}}function l(o,u){for(var a=[];;){var i=f(o),R,S=o.line,T=o.ch-(i?i[0].length:0);if(!i||!(R=y(o)))return;if(R=="selfClose")continue;if(i[1]){for(var I=a.length-1;I>=0;--I)if(a[I]==i[2]){a.length=I;break}if(I<0&&(!u||u==i[2]))return{tag:i[2],from:z(S,T),to:z(o.line,o.ch)}}else a.push(i[2])}}function d(o,u){for(var a=[];;){var i=c(o);if(!i)return;if(i=="selfClose"){m(o);continue}var R=o.line,S=o.ch,T=m(o);if(!T)return;if(T[1])a.push(T[2]);else{for(var I=a.length-1;I>=0;--I)if(a[I]==T[2]){a.length=I;break}if(I<0&&(!u||u==T[2]))return{tag:T[2],from:z(o.line,o.ch),to:z(R,S)}}}}Z.registerHelper("fold","xml",function(o,u){for(var a=new K(o,u.line,0);;){var i=f(a);if(!i||a.line!=u.line)return;var R=y(a);if(!R)return;if(!i[1]&&R!="selfClose"){var S=z(a.line,a.ch),T=l(a,i[2]);return T&&N(T.from,S)>0?{from:S,to:T.from}:null}}}),Z.findMatchingTag=function(o,u,a){var i=new K(o,u.line,u.ch,a);if(i.text.indexOf(">")==-1&&i.text.indexOf("<")==-1)return;var R=y(i),S=R&&z(i.line,i.ch),T=R&&m(i);if(!R||!T||N(i,u)>0)return;var I={from:z(i.line,i.ch),to:S,tag:T[2]};return R=="selfClose"?{open:I,close:null,at:"open"}:T[1]?{open:d(i,T[2]),close:I,at:"close"}:(i=new K(o,S.line,S.ch,a),{open:I,close:l(i,T[2]),at:"open"})},Z.findEnclosingTag=function(o,u,a,i){for(var R=new K(o,u.line,u.ch,a);;){var S=d(R,i);if(!S)break;var T=new K(o,u.line,u.ch,a),I=l(T,S.tag);if(I)return{open:S,close:I}}},Z.scanForClosingTag=function(o,u,a,i){var R=new K(o,u.line,u.ch,i?{from:0,to:i}:null);return l(R,a)}})},p5ED:function(Ye,se,U){"use strict";var Z=U("+L6B"),z=U("2/Rp"),N=U("5Dmo"),V=U("3S7+"),W=U("k1fw"),M=U("9og8"),K=U("tJVT"),H=U("WmNS"),n=U.n(H),D=U("q1tI"),y=U.n(D),m=U("vHTk"),f=U.n(m),c=U("yEEn"),l=U("ZW9T"),d=U("1vsH"),o=U("V0Rq"),u=U("m3rI");se.a=function(a){var i,R,S,T,I,O,_,b=a.editOffice,p=b===void 0?"view":b,h=a.data,A=a.theme,E=a.type,v=a.filename,P=a.monacoEditor,x=a.className,C=a.style,j=a.close,B=a.onClose,w=a.hasMask,Y=a.disabledDownload,$=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),oe=Object(K.a)($,2),de=oe[0],Fe=oe[1],Ae=Object(D.useState)(""),Re=Object(K.a)(Ae,2),Me=Re[0],Be=Re[1],pe=Object(D.useState)(),fe=Object(K.a)(pe,2),ne=fe[0],xe=fe[1],ce=window.ENV==="build"?"/react/build":"",Pe=u.a.PROXY_SERVER||location.origin,He,ke=1024*1024,Ve=10*ke,et=Object(D.useRef)();(i=h)!==null&&i!==void 0&&i.startsWith("/api")&&E!=="txt"&&(h=u.a.API_SERVER+h),E==="office"&&(He=Object(d.T)(h).filesize,He>Ve&&(E="other")),v&&P&&(P.filename=v),Object(D.useEffect)(function(){var De,tt,ct=(De=document.cookie)===null||De===void 0||((tt=De.replace(/\s/g,""))===null||tt===void 0)?void 0:tt.split(";");ct==null||ct.map(function(ft){var ut=ft.split("=");ut[0]==="_educoder_session"&&Be(ut[1])})},[]),Object(D.useEffect)(function(){E==="office"&&le()},[E,h]);var le=function(){var De=Object(M.a)(n.a.mark(function tt(){var ct,ft,ut;return n.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return console.log("data:",h),ct=h,h.startsWith("http")||(ct=location.origin+ct),ft=new URL(ct).pathname.split("/").pop(),bt.next=6,Object(o.W)({attachment_id:ft});case 6:ut=bt.sent,xe(ut);case 8:case"end":return bt.stop()}},tt)}));return function(){return De.apply(this,arguments)}}(),_e=function(){if(h.startsWith("http")||h.startsWith("blob:")){Ce();return}Object(d.z)(v||"educoder",h,v)},Ce=function(){Object(d.x)(v||"educoder",decodeURIComponent(h))};return y.a.createElement("div",{style:Object(W.a)({},C||{}),className:"".concat(w&&f.a.bgBlack," ").concat(E?f.a.wrp:"hide")},j&&y.a.createElement("div",{className:f.a.close,ref:et},!Y&&y.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return et.current}},y.a.createElement("span",{onClick:Ce},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return et.current}},y.a.createElement("span",{className:"",onClick:B},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(f.a[x]," ").concat(x," ").concat(f.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&y.a.createElement(l.b,P)),E==="audio"&&y.a.createElement("audio",{src:"".concat(((R=h)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((S=h)===null||S===void 0?void 0:S.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),E==="video"&&y.a.createElement(y.a.Fragment,null,((T=h)===null||T===void 0?void 0:T.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),E==="office"&&ne&&y.a.createElement("iframe",{src:"".concat(ce,"/office.html?key=").concat(ne.key,"&url=").concat(Pe+ne.url,"&callbackUrl=").concat(Pe+ne.callbackUrl,"&fileType=").concat(ne.fileType,"&title=").concat(ne.title,"&model=").concat(p,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),E==="html"&&y.a.createElement("iframe",{src:h+"&disposition=inline"}),E==="pdf"&&y.a.createElement("iframe",{src:"".concat(ce,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!Y)}),E==="image"&&y.a.createElement("img",{src:"".concat(((I=h)===null||I===void 0?void 0:I.indexOf("http://"))>-1||((O=h)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(_=h)!==null&&_!==void 0&&_.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),E==="other"&&y.a.createElement("div",null,y.a.createElement(z.a,{type:"primary",size:"large",onClick:_e},y.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&y.a.createElement(z.a,{type:"primary",size:"large",onClick:_e},y.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ye,se,U){},pmY6:function(Ye,se,U){"use strict";U.d(se,"h",function(){return D}),U.d(se,"g",function(){return m}),U.d(se,"f",function(){return f}),U.d(se,"e",function(){return c}),U.d(se,"i",function(){return l}),U.d(se,"b",function(){return d}),U.d(se,"a",function(){return o}),U.d(se,"d",function(){return u}),U.d(se,"c",function(){return a});var Z=U("C/vA"),z=U("JYp7");const N=!1;let V=null;function W(i){V=i}if(N){const i="__is_disposable_tracked__";W(new class{trackDisposable(R){const S=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[i]||console.log(S)},3e3)}setParent(R,S){if(R&&R!==o.None)try{R[i]=!0}catch(T){}}markAsDisposed(R){if(R&&R!==o.None)try{R[i]=!0}catch(S){}}markAsSingleton(R){}})}function M(i){return V==null||V.trackDisposable(i),i}function K(i){V==null||V.markAsDisposed(i)}function H(i,R){V==null||V.setParent(i,R)}function n(i,R){if(!V)return;for(const S of i)V.setParent(S,R)}function D(i){return V==null||V.markAsSingleton(i),i}class y extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`);this.errors=i}}function m(i){return typeof i.dispose=="function"&&i.dispose.length===0}function f(i){if(z.a.is(i)){let R=[];for(const S of i)if(S)try{S.dispose()}catch(T){R.push(T)}if(R.length===1)throw R[0];if(R.length>1)throw new y(R);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function c(...i){const R=l(()=>f(i));return n(i,R),R}function l(i){const R=M({dispose:Object(Z.a)(()=>{K(R),i()})});return R}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{f(this._toDispose.values())}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return H(i,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(i),i}}d.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new d,M(this),H(this._store,this)}dispose(){K(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}}o.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){var R;if(this._isDisposed||i===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),i&&H(i,this),this._value=i}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,K(this),(i=this._value)===null||i===void 0||i.dispose(),this._value=void 0}clearAndLeak(){const i=this._value;return this._value=void 0,i&&H(i,null),i}}class a{constructor(i){this.object=i}dispose(){}}},psGv:function(Ye,se,U){var Z,z;(function(){var N;(function(){"use strict";var K=[,,function(y){function m(l){this.__parent=l,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var l=new m(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},m.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},m.prototype.has_match=function(l){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(l))return!0;return!1},m.prototype.set_indent=function(l,d){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(l){this.__items.push(l);var d=l.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=l.length-d:this.__character_count+=l.length},m.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function f(l,d){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),d=d||"",l.indent_level>0&&(d=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}f.prototype.get_indent_size=function(l,d){var o=this.__base_string_length;return d=d||0,l<0&&(o=0),o+=l*this.__indent_size,o+=d,o},f.prototype.get_indent_string=function(l,d){var o=this.__base_string;return d=d||0,l<0&&(l=0,o=""),d+=l*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},f.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var l=this.__cache.length,d=0,o="";this.__indent_size&&l>=this.__indent_size&&(d=Math.floor(l/this.__indent_size),l-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function c(l,d){this.__indent_cache=new f(l,d),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}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(l,d){return this.__indent_cache.get_indent_string(l,d)},c.prototype.get_indent_size=function(l,d){return this.__indent_cache.get_indent_size(l,d)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(l){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 o=this.__lines.join(`
|
|
`);return l!==`
|
|
`&&(o=o.replace(/[\n]/g,l)),o},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(l,d){return l=l||0,d=d||0,this.next_line.set_indent(l,d),this.__lines.length>1?(this.current_line.set_indent(l,d),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(l){for(var d=0;d<l.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),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(l){for(var d=this.__lines.length;l<d;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&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(l,d){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==d){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},y.exports.Output=c},function(y){function m(f,c,l,d){this.type=f,this.text=c,this.comments_before=null,this.newlines=l||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}y.exports.Token=m},,,function(y){function m(l,d){this.raw_options=f(l,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"])}m.prototype._get_array=function(l,d){var o=this.raw_options[l],u=d||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(u=o.concat()):typeof o=="string"&&(u=o.split(/[^a-zA-Z0-9_\/\-]+/)),u},m.prototype._get_boolean=function(l,d){var o=this.raw_options[l],u=o===void 0?!!d:!!o;return u},m.prototype._get_characters=function(l,d){var o=this.raw_options[l],u=d||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),u},m.prototype._get_number=function(l,d){var o=this.raw_options[l];d=parseInt(d,10),isNaN(d)&&(d=0);var u=parseInt(o,10);return isNaN(u)&&(u=d),u},m.prototype._get_selection=function(l,d,o){var u=this._get_selection_list(l,d,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[l]+"'");return u[0]},m.prototype._get_selection_list=function(l,d,o){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[d[0]],!this._is_valid_selection(o,d))throw new Error("Invalid Default Value!");var u=this._get_array(l,o);if(!this._is_valid_selection(u,d))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[l]+"'");return u},m.prototype._is_valid_selection=function(l,d){return l.length&&d.length&&!l.some(function(o){return d.indexOf(o)===-1})};function f(l,d){var o={};l=c(l);var u;for(u in l)u!==d&&(o[u]=l[u]);if(d&&l[d])for(u in l[d])o[u]=l[d][u];return o}function c(l){var d={},o;for(o in l){var u=o.replace(/-/g,"_");d[u]=l[o]}return d}y.exports.Options=m,y.exports.normalizeOpts=c,y.exports.mergeOpts=f},,function(y){var m=RegExp.prototype.hasOwnProperty("sticky");function f(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},f.prototype.peek=function(c){var l=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(l=this.__input.charAt(c)),l},f.prototype.__match=function(c,l){c.lastIndex=l;var d=c.exec(this.__input);return d&&!(m&&c.sticky)&&(d.index!==l&&(d=null)),d},f.prototype.test=function(c,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(c,l):!1},f.prototype.testChar=function(c,l){var d=this.peek(l);return c.lastIndex=0,d!==null&&c.test(d)},f.prototype.match=function(c){var l=this.__match(c,this.__position);return l?this.__position+=l[0].length:l=null,l},f.prototype.read=function(c,l,d){var o="",u;return c&&(u=this.match(c),u&&(o+=u[0])),l&&(u||!c)&&(o+=this.readUntil(l,d)),o},f.prototype.readUntil=function(c,l){var d="",o=this.__position;c.lastIndex=this.__position;var u=c.exec(this.__input);return u?(o=u.index,l&&(o+=u[0].length)):o=this.__input_length,d=this.__input.substring(this.__position,o),this.__position=o,d},f.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},f.prototype.get_regexp=function(c,l){var d=null,o="g";return l&&m&&(o="y"),typeof c=="string"&&c!==""?d=new RegExp(c,o):c&&(d=new RegExp(c.source,o)),d},f.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(c){var l=this.__position,d=this.readUntilAfter(c);return this.__position=l,d},f.prototype.lookBack=function(c){var l=this.__position-1;return l>=c.length&&this.__input.substring(l-c.length,l).toLowerCase()===c},y.exports.InputScanner=f},function(y,m,f){var c=f(8).InputScanner,l=f(3).Token,d=f(10).TokenStream,o=f(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(i,R){this._input=new c(i),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var i,R=new l(u.START,""),S=null,T=[],I=new d;R.type!==u.EOF;){for(i=this._get_next_token(R,S);this._is_comment(i);)I.add(i),i=this._get_next_token(R,S);I.isEmpty()||(i.comments_before=I,I=new d),i.parent=S,this._is_opening(i)?(T.push(S),S=i):S&&this._is_closing(i,S)&&(i.opened=S,S.closed=i,S=T.pop(),i.parent=S),i.previous=R,R.next=i,this.__tokens.add(i),R=i}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(i,R){this._readWhitespace();var S=this._input.read(/.+/g);return S?this._create_token(u.RAW,S):this._create_token(u.EOF,"")},a.prototype._is_comment=function(i){return!1},a.prototype._is_opening=function(i){return!1},a.prototype._is_closing=function(i,R){return!1},a.prototype._create_token=function(i,R){var S=new l(i,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=a,y.exports.TOKEN=u},function(y){function m(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__tokens[this.__position],this.__position+=1),f},m.prototype.peek=function(f){var c=null;return f=f||0,f+=this.__position,f>=0&&f<this.__tokens_length&&(c=this.__tokens[f]),c},m.prototype.add=function(f){this.__parent_token&&(f.parent=this.__parent_token),this.__tokens.push(f),this.__tokens_length+=1},y.exports.TokenStream=m},function(y,m,f){var c=f(12).Pattern;function l(d,o){c.call(this,d,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new c,l.prototype.__set_whitespace_patterns=function(d,o){d+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},l.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 o=this.__split(this._newline_regexp,d);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return d},l.prototype.matching=function(d,o){var u=this._create();return u.__set_whitespace_patterns(d,o),u._update(),u},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(d,o){d.lastIndex=0;for(var u=0,a=[],i=d.exec(o);i;)a.push(o.substring(u,i.index)),u=i.index+i[0].length,i=d.exec(o);return u<o.length?a.push(o.substring(u,o.length)):a.push(""),a},y.exports.WhitespacePattern=l},function(y){function m(f,c){this._input=f,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)}m.prototype.read=function(){var f=this._input.read(this._starting_pattern);return(!this._starting_pattern||f)&&(f+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),f},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(f){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(f),c._update(),c},m.prototype.until=function(f){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(f),c._update(),c},m.prototype.starting_with=function(f){var c=this._create();return c._starting_pattern=this._input.get_regexp(f,!0),c._update(),c},m.prototype.matching=function(f){var c=this._create();return c._match_pattern=this._input.get_regexp(f,!0),c._update(),c},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},y.exports.Pattern=m},function(y){function m(f,c){f=typeof f=="string"?f:f.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+c,"g")}m.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(f);l;)c[l[1]]=l[2],l=this.__directive_pattern.exec(f);return c},m.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},y.exports.Directives=m},function(y,m,f){var c=f(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(o,u){c.call(this,o,u),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var a=new c(o);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.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(o){var u=this._create();return u._disabled[o]=!0,u._update(),u},d.prototype.read_options=function(o){var u=this._create();for(var a in l)u._disabled[a]=o.templating.indexOf(a)===-1;return u._update(),u},d.prototype.exclude=function(o){var u=this._create();return u._excluded[o]=!0,u._update(),u},d.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 u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),o+=u,u=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},d.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("|")+")")},d.prototype._read_template=function(){var o="",u=this._input.peek();if(u==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(o=o||this.__patterns.erb.read())}else u==="{"&&(!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},y.exports.TemplatablePattern=d},,,,function(y,m,f){var c=f(19).Beautifier,l=f(20).Options;function d(o,u,a,i){var R=new c(o,u,a,i);return R.beautify()}y.exports=d,y.exports.defaultOptions=function(){return new l}},function(y,m,f){var c=f(20).Options,l=f(2).Output,d=f(21).Tokenizer,o=f(21).TOKEN,u=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,i=function(A,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=A.max_preserve_newlines,this.preserve_newlines=A.preserve_newlines,this._output=new l(A,E)};i.prototype.current_line_has_match=function(A){return this._output.current_line.has_match(A)},i.prototype.set_space_before_token=function(A,E){this._output.space_before_token=A,this._output.non_breaking_space=E},i.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},i.prototype.add_raw_token=function(A){this._output.add_raw_token(A)},i.prototype.print_preserved_newlines=function(A){var E=0;A.type!==o.TEXT&&A.previous.type!==o.TEXT&&(E=A.newlines?1:0),this.preserve_newlines&&(E=A.newlines<this.max_preserve_newlines+1?A.newlines:this.max_preserve_newlines+1);for(var v=0;v<E;v++)this.print_newline(v>0);return E!==0},i.prototype.traverse_whitespace=function(A){return A.whitespace_before||A.newlines?(this.print_preserved_newlines(A)||(this._output.space_before_token=!0),!0):!1},i.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},i.prototype.print_newline=function(A){this._output.add_new_line(A)},i.prototype.print_token=function(A){A.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(A.text))},i.prototype.indent=function(){this.indent_level++},i.prototype.get_full_indent=function(A){return A=this.indent_level+(A||0),A<1?"":this._output.get_indent_string(A)};var R=function(A){for(var E=null,v=A.next;v.type!==o.EOF&&A.closed!==v;){if(v.type===o.ATTRIBUTE&&v.text==="type"){v.next&&v.next.type===o.EQUALS&&v.next.next&&v.next.next.type===o.VALUE&&(E=v.next.next.text);break}v=v.next}return E},S=function(A,E){var v=null,P=null;return E.closed?(A==="script"?v="text/javascript":A==="style"&&(v="text/css"),v=R(E)||v,v.search("text/css")>-1?P="css":v.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?P="javascript":v.search(/(text|application|dojo)\/(x-)?(html)/)>-1?P="html":v.search(/test\/null/)>-1&&(P="null"),P):null};function T(A,E){return E.indexOf(A)!==-1}function I(A,E,v){this.parent=A||null,this.tag=E?E.tag_name:"",this.indent_level=v||0,this.parser_token=E||null}function O(A){this._printer=A,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(A){var E=new I(this._current_frame,A,this._printer.indent_level);this._current_frame=E},O.prototype._try_pop_frame=function(A){var E=null;return A&&(E=A.parser_token,this._printer.indent_level=A.indent_level,this._current_frame=A.parent),E},O.prototype._get_frame=function(A,E){for(var v=this._current_frame;v&&!(A.indexOf(v.tag)!==-1);){if(E&&E.indexOf(v.tag)!==-1){v=null;break}v=v.parent}return v},O.prototype.try_pop=function(A,E){var v=this._get_frame([A],E);return this._try_pop_frame(v)},O.prototype.indent_to_tag=function(A){var E=this._get_frame(A);E&&(this._printer.indent_level=E.indent_level)};function _(A,E,v,P){this._source_text=A||"",E=E||{},this._js_beautify=v,this._css_beautify=P,this._tag_stack=null;var x=new c(E,"html");this._options=x,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 A=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
|
|
`,A&&u.test(A)&&(E=A.match(u)[0])),A=A.replace(a,`
|
|
`);var v=A.match(/^[\t ]*/)[0],P={text:"",type:""},x=new b,C=new i(this._options,v),j=new d(A,this._options).tokenize();this._tag_stack=new O(C);for(var B=null,w=j.next();w.type!==o.EOF;)w.type===o.TAG_OPEN||w.type===o.COMMENT?(B=this._handle_tag_open(C,w,x,P),x=B):w.type===o.ATTRIBUTE||w.type===o.EQUALS||w.type===o.VALUE||w.type===o.TEXT&&!x.tag_complete?B=this._handle_inside_tag(C,w,x,j):w.type===o.TAG_CLOSE?B=this._handle_tag_close(C,w,x):w.type===o.TEXT?B=this._handle_text(C,w,x):C.add_raw_token(w),P=B,w=j.next();var Y=C._output.get_code(E);return Y},_.prototype._handle_tag_close=function(A,E,v){var P={text:E.text,type:E.type};return A.alignment_size=0,v.tag_complete=!0,A.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),v.is_unformatted?A.add_raw_token(E):(v.tag_start_char==="<"&&(A.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&v.has_wrapped_attrs&&A.print_newline(!1)),A.print_token(E)),v.indent_content&&!(v.is_unformatted||v.is_content_unformatted)&&(A.indent(),v.indent_content=!1),!v.is_inline_element&&!(v.is_unformatted||v.is_content_unformatted)&&A.set_wrap_point(),P},_.prototype._handle_inside_tag=function(A,E,v,P){var x=v.has_wrapped_attrs,C={text:E.text,type:E.type};if(A.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),v.is_unformatted)A.add_raw_token(E);else if(v.tag_start_char==="{"&&E.type===o.TEXT)A.print_preserved_newlines(E)?(E.newlines=0,A.add_raw_token(E)):A.print_token(E);else{if(E.type===o.ATTRIBUTE?(A.set_space_before_token(!0),v.attr_count+=1):(E.type===o.EQUALS||E.type===o.VALUE&&E.previous.type===o.EQUALS)&&A.set_space_before_token(!1),E.type===o.ATTRIBUTE&&v.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(A.traverse_whitespace(E),x=x||E.newlines!==0),this._is_wrap_attributes_force)){var j=v.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&v.attr_count===1){var B=!0,w=0,Y;do{if(Y=P.peek(w),Y.type===o.ATTRIBUTE){B=!1;break}w+=1}while(w<4&&Y.type!==o.EOF&&Y.type!==o.TAG_CLOSE);j=!B}j&&(A.print_newline(!1),x=!0)}A.print_token(E),x=x||A.previous_token_wrapped(),v.has_wrapped_attrs=x}return C},_.prototype._handle_text=function(A,E,v){var P={text:E.text,type:"TK_CONTENT"};return v.custom_beautifier_name?this._print_custom_beatifier_text(A,E,v):v.is_unformatted||v.is_content_unformatted?A.add_raw_token(E):(A.traverse_whitespace(E),A.print_token(E)),P},_.prototype._print_custom_beatifier_text=function(A,E,v){var P=this;if(E.text!==""){var x=E.text,C,j=1,B="",w="";v.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?C=this._js_beautify:v.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?C=this._css_beautify:v.custom_beautifier_name==="html"&&(C=function(Ae,Re){var Me=new _(Ae,Re,P._js_beautify,P._css_beautify);return Me.beautify()}),this._options.indent_scripts==="keep"?j=0:this._options.indent_scripts==="separate"&&(j=-A.indent_level);var Y=A.get_full_indent(j);if(x=x.replace(/\n[ \t]*$/,""),v.custom_beautifier_name!=="html"&&x[0]==="<"&&x.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(x);if(!$){A.add_raw_token(E);return}B=Y+$[1]+`
|
|
`,x=$[4],$[5]&&(w=Y+$[5]),x=x.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
|
|
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(E.whitespace_before=$[0]))}if(x)if(C){var oe=function(){this.eol=`
|
|
`};oe.prototype=this._options.raw_options;var de=new oe;x=C(Y+x,de)}else{var Fe=E.whitespace_before;Fe&&(x=x.replace(new RegExp(`
|
|
(`+Fe+")?","g"),`
|
|
`)),x=Y+x.replace(/\n/g,`
|
|
`+Y)}B&&(x?x=B+x+`
|
|
`+w:x=B+w),A.print_newline(!1),x&&(E.text=x,E.whitespace_before="",E.newlines=0,A.add_raw_token(E),A.print_newline(!0))}},_.prototype._handle_tag_open=function(A,E,v,P){var x=this._get_tag_open_token(E);return(v.is_unformatted||v.is_content_unformatted)&&!v.is_empty_element&&E.type===o.TAG_OPEN&&E.text.indexOf("</")===0?(A.add_raw_token(E),x.start_tag_token=this._tag_stack.try_pop(x.tag_name)):(A.traverse_whitespace(E),this._set_tag_position(A,E,x,v,P),x.is_inline_element||A.set_wrap_point(),A.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(x.alignment_size=E.text.length+1),!x.tag_complete&&!x.is_unformatted&&(A.alignment_size=x.alignment_size),x};var b=function(A,E){if(this.parent=A||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===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||E.closed&&E.closed.text==="/>";var P=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(P=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(P)))}};_.prototype._get_tag_open_token=function(A){var E=new b(this._tag_stack.get_parser_token(),A);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||T(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&&T(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&T(E.tag_check,this._options.content_unformatted),E.is_inline_element=T(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},_.prototype._set_tag_position=function(A,E,v,P,x){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||A.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=S(v.tag_check,E)))),T(v.tag_check,this._options.extra_liners)&&(A.print_newline(!1),A._output.just_added_blankline()||A.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 C=A.current_line_has_match(/{{#if/);C||A.print_newline(!1)}v.tag_name==="!--"&&x.type===o.TAG_CLOSE&&P.is_end_tag&&v.text.indexOf(`
|
|
`)===-1||(v.is_inline_element||v.is_unformatted||A.print_newline(!1),this._calcluate_parent_multiline(A,v))}else if(v.is_end_tag){var j=!1;j=v.start_tag_token&&v.start_tag_token.multiline_content,j=j||!v.is_inline_element&&!(P.is_inline_element||P.is_unformatted)&&!(x.type===o.TAG_CLOSE&&v.start_tag_token===P)&&x.type!=="TK_CONTENT",(v.is_content_unformatted||v.is_unformatted)&&(j=!1),j&&A.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)&&(x.type!=="TK_CONTENT"||v.is_content_unformatted)&&A.print_newline(!1),this._calcluate_parent_multiline(A,v)},_.prototype._calcluate_parent_multiline=function(A,E){E.parent&&A._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var p=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],h=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(A){var E=null;if(A.is_empty_element||!A.is_start_tag||!A.parent)return;if(A.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(A.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(A.tag_name==="dd"||A.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(A.parent.tag_name==="p"&&p.indexOf(A.tag_name)!==-1){var v=A.parent.parent;(!v||h.indexOf(v.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else A.tag_name==="rp"||A.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):A.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):A.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):A.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):A.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):A.tag_name==="tbody"||A.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"])):A.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"])):(A.tag_name==="th"||A.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 A.parent=this._tag_stack.get_parser_token(),E},y.exports.Beautifier=_},function(y,m,f){var c=f(6).Options;function l(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"])}l.prototype=new c,y.exports.Options=l},function(y,m,f){var c=f(9).Tokenizer,l=f(9).TOKEN,d=f(13).Directives,o=f(14).TemplatablePattern,u=f(12).Pattern,a={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:l.START,RAW:l.RAW,EOF:l.EOF},i=new d(/<\!--/,/-->/),R=function(S,T){c.call(this,S,T),this._current_tag_name="";var I=new o(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:I.until(/[\n\r\t <]/),single_quote:I.until_after(/'/),double_quote:I.until_after(/"/),attribute:I.until(/[\n\r\t =>]|\/>/),element_name:I.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(_)}};R.prototype=new c,R.prototype._is_comment=function(S){return!1},R.prototype._is_opening=function(S){return S.type===a.TAG_OPEN},R.prototype._is_closing=function(S,T){return S.type===a.TAG_CLOSE&&T&&((S.text===">"||S.text==="/>")&&T.text[0]==="<"||S.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(S,T){var I=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(a.EOF,""):(I=I||this._read_open_handlebars(O,T),I=I||this._read_attribute(O,S,T),I=I||this._read_close(O,T),I=I||this._read_raw_content(O,S,T),I=I||this._read_content_word(O),I=I||this._read_comment_or_cdata(O),I=I||this._read_processing(O),I=I||this._read_open(O,T),I=I||this._create_token(a.UNKNOWN,this._input.next()),I)},R.prototype._read_comment_or_cdata=function(S){var T=null,I=null,O=null;if(S==="<"){var _=this._input.peek(1);_==="!"&&(I=this.__patterns.comment.read(),I?(O=i.get_directives(I),O&&O.ignore==="start"&&(I+=i.readIgnored(this._input))):I=this.__patterns.cdata.read()),I&&(T=this._create_token(a.COMMENT,I),T.directives=O)}return T},R.prototype._read_processing=function(S){var T=null,I=null,O=null;if(S==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(I=this.__patterns.conditional_comment.read(),I=I||this.__patterns.processing.read()),I&&(T=this._create_token(a.COMMENT,I),T.directives=O)}return T},R.prototype._read_open=function(S,T){var I=null,O=null;return T||S==="<"&&(I=this._input.next(),this._input.peek()==="/"&&(I+=this._input.next()),I+=this.__patterns.element_name.read(),O=this._create_token(a.TAG_OPEN,I)),O},R.prototype._read_open_handlebars=function(S,T){var I=null,O=null;return T||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(I=this.__patterns.handlebars_comment.read(),I=I||this.__patterns.handlebars.read(),O=this._create_token(a.COMMENT,I)):(I=this.__patterns.handlebars_open.read(),O=this._create_token(a.TAG_OPEN,I))),O},R.prototype._read_close=function(S,T){var I=null,O=null;return T&&(T.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(I=this._input.next(),S==="/"&&(I+=this._input.next()),O=this._create_token(a.TAG_CLOSE,I)):T.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(a.TAG_CLOSE,"}}"))),O},R.prototype._read_attribute=function(S,T,I){var O=null,_="";if(I&&I.text[0]==="<")if(S==="=")O=this._create_token(a.EQUALS,this._input.next());else if(S==='"'||S==="'"){var b=this._input.next();S==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),O=this._create_token(a.VALUE,b)}else _=this.__patterns.attribute.read(),_&&(T.type===a.EQUALS?O=this._create_token(a.VALUE,_):O=this._create_token(a.ATTRIBUTE,_));return O},R.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},R.prototype._read_raw_content=function(S,T,I){var O="";if(I&&I.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(T.type===a.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var _=T.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var b=this._read_comment_or_cdata(S);if(b)return b.type=a.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(a.TEXT,O):null},R.prototype._read_content_word=function(S){var T="";if(this._options.unformatted_content_delimiter&&(S===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(a.TEXT,T)},y.exports.Tokenizer=R,y.exports.TOKEN=a}],H={};function n(y){var m=H[y];if(m!==void 0)return m.exports;var f=H[y]={exports:{}};return K[y](f,f.exports,n),f.exports}var D=n(18);N=D})();var V=N;if(!0)!(Z=[U,U("6UM0"),U("TXwP")],z=function(K){var H=U("6UM0"),n=U("TXwP");return{html_beautify:function(D,y){return V(D,y,H.js_beautify,n.css_beautify)}}}.apply(se,Z),z!==void 0&&(Ye.exports=z));else var W,M})()},qgvg:function(Ye,se){Ye.exports="data:image/gif;base64,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"},"rAM+":function(Ye,se,U){"use strict";U.d(se,"a",function(){return z});var Z=U("Qw5x");function z(N,V){var W;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(W=Object(Z.a)(N))||V&&N&&typeof N.length=="number"){W&&(N=W);var M=0,K=function(){};return{s:K,n:function(){return M>=N.length?{done:!0}:{done:!1,value:N[M++]}},e:function(m){throw m},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H=!0,n=!1,D;return{s:function(){W=N[Symbol.iterator]()},n:function(){var m=W.next();return H=m.done,m},e:function(m){n=!0,D=m},f:function(){try{!H&&W.return!=null&&W.return()}finally{if(n)throw D}}}}},rUJ1:function(Ye,se){const U=/[&<>"']/,Z=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,V={"&":"&","<":"<",">":">",'"':""","'":"'"},W=O=>V[O];function M(O,_){if(_){if(U.test(O))return O.replace(Z,W)}else if(z.test(O))return O.replace(N,W);return O}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(O){return O.replace(K,(_,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const n=/(^|[^\[])\^/g;function D(O,_){O=O.source||O,_=_||"";const b={replace:(p,h)=>(h=h.source||h,h=h.replace(n,"$1"),O=O.replace(p,h),b),getRegex:()=>new RegExp(O,_)};return b}const y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(O,_,b){if(O){let p;try{p=decodeURIComponent(H(b)).replace(y,"").toLowerCase()}catch(h){return null}if(p.indexOf("javascript:")===0||p.indexOf("vbscript:")===0||p.indexOf("data:")===0)return null}_&&!m.test(b)&&(b=u(_,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(p){return null}return b}const c={},l=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,_){c[" "+O]||(l.test(O)?c[" "+O]=O+"/":c[" "+O]=S(O,"/",!0)),O=c[" "+O];const b=O.indexOf(":")===-1;return _.substring(0,2)==="//"?b?_:O.replace(d,"$1")+_:_.charAt(0)==="/"?b?_:O.replace(o,"$1")+_:O+_}const a={exec:function(){}};function i(O){let _=1,b,p;for(;_<arguments.length;_++){b=arguments[_];for(p in b)Object.prototype.hasOwnProperty.call(b,p)&&(O[p]=b[p])}return O}function R(O,_){const b=O.replace(/\|/g,(A,E,v)=>{let P=!1,x=E;for(;--x>=0&&v[x]==="\\";)P=!P;return P?"|":" |"}),p=b.split(/ \|/);let h=0;if(p.length>_)p.splice(_);else for(;p.length<_;)p.push("");for(;h<p.length;h++)p[h]=p[h].trim().replace(/\\\|/g,"|");return p}function S(O,_,b){const p=O.length;if(p===0)return"";let h=0;for(;h<p;){const A=O.charAt(p-h-1);if(A===_&&!b)h++;else if(A!==_&&b)h++;else break}return O.substr(0,p-h)}function T(O,_){if(O.indexOf(_[1])===-1)return-1;const b=O.length;let p=0,h=0;for(;h<b;h++)if(O[h]==="\\")h++;else if(O[h]===_[0])p++;else if(O[h]===_[1]&&(p--,p<0))return h;return-1}function I(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")}Ye.exports={escape:M,unescape:H,edit:D,cleanUrl:f,resolveUrl:u,noopTest:a,merge:i,splitCells:R,rtrim:S,findClosingBracket:T,checkSanitizeDeprecation:I}},sR1s:function(Ye,se,U){"use strict";U.d(se,"b",function(){return V}),U.d(se,"a",function(){return W}),U.d(se,"c",function(){return M}),U.d(se,"d",function(){return K});var Z=U("U8pU"),z="RC_TABLE_KEY";function N(H){return H==null?[]:Array.isArray(H)?H:[H]}function V(H,n){if(!n&&typeof n!="number")return H;for(var D=N(n),y=H,m=0;m<D.length;m+=1){if(!y)return null;var f=D[m];y=y[f]}return y}function W(H){var n=[],D={};return H.forEach(function(y){for(var m=y||{},f=m.key,c=m.dataIndex,l=f||N(c).join("-")||z;D[l];)l="".concat(l,"_next");D[l]=!0,n.push(l)}),n}function M(){var H={};function n(f,c){c&&Object.keys(c).forEach(function(l){var d=c[l];d&&Object(Z.a)(d)==="object"?(f[l]=f[l]||{},n(f[l],d)):f[l]=d})}for(var D=arguments.length,y=new Array(D),m=0;m<D;m++)y[m]=arguments[m];return y.forEach(function(f){n(H,f)}),H}function K(H){return H!=null}},sboe:function(Ye,se,U){"use strict";U.d(se,"a",function(){return N});var Z=U("q1tI"),z=U.n(Z),N=Z.createContext(null)},t23M:function(Ye,se,U){"use strict";var Z=U("VTBJ"),z=U("1OyB"),N=U("vuIU"),V=U("Ji7U"),W=U("LK+K"),M=U("q1tI"),K=U.n(M),H=U("m+aA"),n=U("Zm9Q"),D=U("Kwbf"),y=U("c+Xe"),m=U("bdgK"),f="rc-observer-key",c=function(l){Object(V.a)(o,l);var d=Object(W.a)(o);function o(){var u;return Object(z.a)(this,o),u=d.apply(this,arguments),u.resizeObserver=null,u.childNode=null,u.currentElement=null,u.state={width:0,height:0,offsetHeight:0,offsetWidth:0},u.onResize=function(a){var i=u.props.onResize,R=a[0].target,S=R.getBoundingClientRect(),T=S.width,I=S.height,O=R.offsetWidth,_=R.offsetHeight,b=Math.floor(T),p=Math.floor(I);if(u.state.width!==b||u.state.height!==p||u.state.offsetWidth!==O||u.state.offsetHeight!==_){var h={width:b,height:p,offsetWidth:O,offsetHeight:_};u.setState(h),i&&Promise.resolve().then(function(){i(Object(Z.a)(Object(Z.a)({},h),{},{offsetWidth:O,offsetHeight:_}))})}},u.setChildNode=function(a){u.childNode=a},u}return Object(N.a)(o,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var a=this.props.disabled;if(a){this.destroyObserver();return}var i=Object(H.a)(this.childNode||this),R=i!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(i))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var a=this.props.children,i=Object(n.a)(a);if(i.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=i[0];if(M.isValidElement(R)&&Object(y.c)(R)){var S=R.ref;i[0]=M.cloneElement(R,{ref:Object(y.a)(S,this.setChildNode)})}return i.length===1?i[0]:i.map(function(T,I){return!M.isValidElement(T)||"key"in T&&T.key!==null?T:M.cloneElement(T,{key:"".concat(f,"-").concat(I)})})}}]),o}(M.Component);c.displayName="ResizeObserver",se.a=c},t9D7:function(Ye,se,U){"use strict";U.d(se,"b",function(){return K}),U.d(se,"g",function(){return n}),U.d(se,"d",function(){return D}),U.d(se,"e",function(){return y}),U.d(se,"a",function(){return m}),U.d(se,"f",function(){return l}),U.d(se,"c",function(){return d});var Z=U("Vhoy"),z=U("MI8n"),N=U("pmY6"),V=U("Cg/j"),W=U("ic2d"),M=U("nEHx");const K=Object(V.c)("themeService");var H;(function(o){function u(a){return a&&typeof a=="object"&&typeof a.id=="string"}o.isThemeColor=u})(H||(H={}));function n(o){return{id:o}}var D;(function(o){function u(I){return I&&typeof I=="object"&&typeof I.id=="string"&&(typeof I.color=="undefined"||H.isThemeColor(I.color))}o.isThemeIcon=u;const a=new RegExp(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function i(I){const O=a.exec(I);if(!O)return;let[,_]=O;return{id:_}}o.fromString=i;function R(I,O){let _=I.id;const b=_.lastIndexOf("~");return b!==-1&&(_=_.substring(0,b)),O&&(_=`${_}~${O}`),{id:_}}o.modify=R;function S(I,O){var _,b;return I.id===O.id&&((_=I.color)===null||_===void 0?void 0:_.id)===((b=O.color)===null||b===void 0?void 0:b.id)}o.isEqual=S;function T(I,O){return{id:I.id,color:O?n(O):void 0}}o.asThemeIcon=T,o.asClassNameArray=Z.a.asClassNameArray,o.asClassName=Z.a.asClassName,o.asCSSSelector=Z.a.asCSSSelector})(D||(D={}));function y(o){switch(o){case M.a.DARK:return"vs-dark";case M.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class f{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new z.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(N.i)(()=>{const u=this.themingParticipants.indexOf(o);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new f;W.a.add(m.ThemingContribution,c);function l(o){return c.onColorThemeChange(o)}class d extends N.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},tWlo:function(Ye,se){Ye.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkVCNENBMTM0OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkVCNENBMTM1OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RUI0Q0ExMzI4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RUI0Q0ExMzM4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7p3KzkAAAFvElEQVR42sRae0ybVRQ/peVRaFce8pwgj1Je5TFsEHGbMAkzmqiJyba4hYh/LJlxiRr9Z0aNGv8xvhKTGckM2zKWmGEgU7MsPnCZIrKBjMcKY9BCBMqjjEcLtFDwHPZVC12h934f8yS/P6Dfud/5nXvvueec+8neOPEuSCAxiDJEMSITkYKIRoQJv9sREwgTogfRjGhEjIt9sUKEbhSiEvEC4mGEbJNngxGRiAzEk8L/VhGtiPOIswgrjxEBHDrxiE8Qg4hPEYYtjPclMkGXxhhCfIFI2E4CNFtvIm4hXvdYHlJIKOIVRK/wjkCpCaQjWhAfIVSwfaIS3kHvypaKwLOI64hdcP+kAPEn4jmxBI4ivkXsgPsvNBt1gg1cBI4hvkLI4f8TuWDDMdYw+owQFdh3Y6gSCnL1oNOmQnxcHAQHB8HCwiLMzM7C8KgFjD23oN9khtXVVZZhyZZhxEV/CGQhalk9r1AoYO9jxfBokQGCgoK8SBHi42LBsCsfJq1TcOnHn+F2v4llJsimIoRx3Q8le0o9/6bwdRmRxGJ8ZEQ4vHjkEORkZYBcLvdrlvL0OeBwOuDv4RF/X0Ne2Y34GrHiaw+8ishnMT4tNRmOVlVCTPQDzKfY/vJ9kJWpY1Ej217ztYnpFHyH6UjGJXH4wPOgVIZw7VAi8XRFOSjkTKv1bc8T25PACdZDan95mV9LZjNRq1Wg02lZw+tbGwnQ/L/EMooyJASSkxIliZUp7ONUCTb/S+AI2cTqOZlMJgmBcI2GVUUp2LyOAJMwxvHN04EAnqQYDrsJUDFSyKrtdC5JRmDR4eBRoxokgQjs48nn5+fnJSNgt3ONRTaXEYFHeLSXlpd5Peclk1Yrr6ohQKhhuWR6ekYSAiOWMV7VDCKg5Z0/uwTLaNnlAssYd22fTgRieTRz9dmQlpIsmgCdwuWle3nVY4mAmkczLCxUsk0cEaHhVVUH8GqOT0xKRmB6ZpZX1UkE5ng0zeYhsNntkhBgqAs2yhwR4AoBrpUVaO/oEm38nelp6B/gJnCHCNzm1f79jxaWgsRLbDY7XKj/Dlb405I+ItDDqz2/sACnTp9DEqNc+qfO1MLwyKiYCewNEPov3EK+G59k39BOp3Nt+YiUViLQKNjBH8sV7EXNivhslgb4xb2J28SMtMSRmbrwBBYpZPOI+xw4J2aka23tzB4VETrdct6zoCECC7wjjWIy1tbewZT//9R4RYzxZOtZTwK0C2vEjHjT2Ov3sx2d3TA7ZxPzuhrB5nVdiQ8pNPPvKP+XkEjjbYKtXm0VOpHe5x01KDDI72dFtmI+EGz1IkDyOeIvnlETH/T/digqKoLXeLLts3UNgY0REXGQZpmpqtCmrjV1/ZWcrEzIzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(Ye,se,U){typeof window!="undefined"&&function(z,N){Ye.exports=N()}(this,function(){return function(Z){var z={};function N(V){if(z[V])return z[V].exports;var W=z[V]={i:V,l:!1,exports:{}};return Z[V].call(W.exports,W,W.exports,N),W.l=!0,W.exports}return N.m=Z,N.c=z,N.d=function(V,W,M){N.o(V,W)||Object.defineProperty(V,W,{enumerable:!0,get:M})},N.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},N.t=function(V,W){if(W&1&&(V=N(V)),W&8)return V;if(W&4&&typeof V=="object"&&V&&V.__esModule)return V;var M=Object.create(null);if(N.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:V}),W&2&&typeof V!="string")for(var K in V)N.d(M,K,function(H){return V[H]}.bind(null,K));return M},N.n=function(V){var W=V&&V.__esModule?function(){return V.default}:function(){return V};return N.d(W,"a",W),W},N.o=function(V,W){return Object.prototype.hasOwnProperty.call(V,W)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,z,N){"use strict";var V=Object.prototype.hasOwnProperty,W="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(W=!1));function K(y,m,f){this.fn=y,this.context=m,this.once=f||!1}function H(y,m,f,c,l){if(typeof f!="function")throw new TypeError("The listener must be a function");var d=new K(f,c||y,l),o=W?W+m:m;return y._events[o]?y._events[o].fn?y._events[o]=[y._events[o],d]:y._events[o].push(d):(y._events[o]=d,y._eventsCount++),y}function n(y,m){--y._eventsCount===0?y._events=new M:delete y._events[m]}function D(){this._events=new M,this._eventsCount=0}D.prototype.eventNames=function(){var m=[],f,c;if(this._eventsCount===0)return m;for(c in f=this._events)V.call(f,c)&&m.push(W?c.slice(1):c);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(f)):m},D.prototype.listeners=function(m){var f=W?W+m:m,c=this._events[f];if(!c)return[];if(c.fn)return[c.fn];for(var l=0,d=c.length,o=new Array(d);l<d;l++)o[l]=c[l].fn;return o},D.prototype.listenerCount=function(m){var f=W?W+m:m,c=this._events[f];return c?c.fn?1:c.length:0},D.prototype.emit=function(m,f,c,l,d,o){var u=W?W+m:m;if(!this._events[u])return!1;var a=this._events[u],i=arguments.length,R,S;if(a.fn){a.once&&this.removeListener(m,a.fn,void 0,!0);switch(i){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,f),!0;case 3:return a.fn.call(a.context,f,c),!0;case 4:return a.fn.call(a.context,f,c,l),!0;case 5:return a.fn.call(a.context,f,c,l,d),!0;case 6:return a.fn.call(a.context,f,c,l,d,o),!0}for(S=1,R=new Array(i-1);S<i;S++)R[S-1]=arguments[S];a.fn.apply(a.context,R)}else{var T=a.length,I;for(S=0;S<T;S++){a[S].once&&this.removeListener(m,a[S].fn,void 0,!0);switch(i){case 1:a[S].fn.call(a[S].context);break;case 2:a[S].fn.call(a[S].context,f);break;case 3:a[S].fn.call(a[S].context,f,c);break;case 4:a[S].fn.call(a[S].context,f,c,l);break;default:if(!R)for(I=1,R=new Array(i-1);I<i;I++)R[I-1]=arguments[I];a[S].fn.apply(a[S].context,R)}}}return!0},D.prototype.on=function(m,f,c){return H(this,m,f,c,!1)},D.prototype.once=function(m,f,c){return H(this,m,f,c,!0)},D.prototype.removeListener=function(m,f,c,l){var d=W?W+m:m;if(!this._events[d])return this;if(!f)return n(this,d),this;var o=this._events[d];if(o.fn)o.fn===f&&(!l||o.once)&&(!c||o.context===c)&&n(this,d);else{for(var u=0,a=[],i=o.length;u<i;u++)(o[u].fn!==f||l&&!o[u].once||c&&o[u].context!==c)&&a.push(o[u]);a.length?this._events[d]=a.length===1?a[0]:a:n(this,d)}return this},D.prototype.removeAllListeners=function(m){var f;return m?(f=W?W+m:m,this._events[f]&&n(this,f)):(this._events=new M,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=W,D.EventEmitter=D,Z.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,z,N){(function(V){var W=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(D,y,m){if(m=m||{},D=D.trim(),y=y.trim(),!y){if(!m.alwaysNormalize)return D;var f=n.parseURL(D);if(!f)throw new Error("Error trying to parse base URL.");return f.path=n.normalizePath(f.path),n.buildURLFromParts(f)}var c=n.parseURL(y);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return m.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):y;var l=n.parseURL(D);if(!l)throw new Error("Error trying to parse base URL.");if(!l.netLoc&&l.path&&l.path[0]!=="/"){var d=M.exec(l.path);l.netLoc=d[1],l.path=d[2]}l.netLoc&&!l.path&&(l.path="/");var o={scheme:l.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(o.netLoc=l.netLoc,c.path[0]!=="/"))if(!c.path)o.path=l.path,c.params||(o.params=l.params,c.query||(o.query=l.query));else{var u=l.path,a=u.substring(0,u.lastIndexOf("/")+1)+c.path;o.path=n.normalizePath(a)}return o.path===null&&(o.path=m.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(o)},parseURL:function(D){var y=W.exec(D);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(K,"");D.length!==(D=D.replace(H,"")).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,z,N){function V(m){var f={};function c(d){if(f[d])return f[d].exports;var o=f[d]={i:d,l:!1,exports:{}};return m[d].call(o.exports,o,o.exports,c),o.l=!0,o.exports}c.m=m,c.c=f,c.i=function(d){return d},c.d=function(d,o,u){c.o(d,o)||Object.defineProperty(d,o,{configurable:!1,enumerable:!0,get:u})},c.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},c.n=function(d){var o=d&&d.__esModule?function(){return d.default}:function(){return d};return c.d(o,"a",o),o},c.o=function(d,o){return Object.prototype.hasOwnProperty.call(d,o)},c.p="/",c.oe=function(d){throw console.error(d),d};var l=c(c.s=ENTRY_MODULE);return l.default||l}var W="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+W+").*?\\)";function K(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(m){return!isNaN(1*m)}function n(m,f,c){var l={};l[c]=[];var d=f.toString(),o=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return l;for(var u=o[1],a=new RegExp("(\\\\n|\\W)"+K(u)+M,"g"),i;i=a.exec(d);){if(i[3]==="dll-reference")continue;l[c].push(i[3])}for(a=new RegExp("\\("+K(u)+'\\("(dll-reference\\s('+W+'))"\\)\\)'+M,"g");i=a.exec(d);)m[i[2]]||(l[c].push(i[1]),m[i[2]]=N(i[1]).m),l[i[2]]=l[i[2]]||[],l[i[2]].push(i[4]);for(var R=Object.keys(l),S=0;S<R.length;S++)for(var T=0;T<l[R[S]].length;T++)H(l[R[S]][T])&&(l[R[S]][T]=1*l[R[S]][T]);return l}function D(m){var f=Object.keys(m);return f.reduce(function(c,l){return c||m[l].length>0},!1)}function y(m,f){for(var c={main:[f]},l={main:[]},d={main:{}};D(c);)for(var o=Object.keys(c),u=0;u<o.length;u++){var a=o[u],i=c[a],R=i.pop();if(d[a]=d[a]||{},d[a][R]||!m[a][R])continue;d[a][R]=!0,l[a]=l[a]||[],l[a].push(R);for(var S=n(m,m[a][R],a),T=Object.keys(S),I=0;I<T.length;I++)c[T[I]]=c[T[I]]||[],c[T[I]]=c[T[I]].concat(S[T[I]])}return l}Z.exports=function(m,f){f=f||{};var c={main:N.m},l=f.all?{main:Object.keys(c.main)}:y(c,m),d="";Object.keys(l).filter(function(R){return R!=="main"}).forEach(function(R){for(var S=0;l[R][S];)S++;l[R].push(S),c[R][S]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+R+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+l[R].map(function(T){return""+JSON.stringify(T)+": "+c[R][T].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+l.main.map(function(R){return""+JSON.stringify(R)+": "+c.main[R].toString()}).join(",")+"}))(self);";var o=new window.Blob([d],{type:"text/javascript"});if(f.bare)return o;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,a=u.createObjectURL(o),i=new window.Worker(a);return i.objectURL=a,i}},"./src/config.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"hlsDefaultConfig",function(){return I}),N.d(z,"mergeConfig",function(){return _}),N.d(z,"enableStreamingMode",function(){return b});var V=N("./src/controller/abr-controller.ts"),W=N("./src/controller/audio-stream-controller.ts"),M=N("./src/controller/audio-track-controller.ts"),K=N("./src/controller/subtitle-stream-controller.ts"),H=N("./src/controller/subtitle-track-controller.ts"),n=N("./src/controller/buffer-controller.ts"),D=N("./src/controller/timeline-controller.ts"),y=N("./src/controller/cap-level-controller.ts"),m=N("./src/controller/fps-controller.ts"),f=N("./src/controller/eme-controller.ts"),c=N("./src/controller/cmcd-controller.ts"),l=N("./src/utils/xhr-loader.ts"),d=N("./src/utils/fetch-loader.ts"),o=N("./src/utils/cues.ts"),u=N("./src/utils/mediakeys-helper.ts"),a=N("./src/utils/logger.ts");function i(){return i=Object.assign||function(p){for(var h=1;h<arguments.length;h++){var A=arguments[h];for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(p[E]=A[E])}return p},i.apply(this,arguments)}function R(p,h){var A=Object.keys(p);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(p);h&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(p,v).enumerable})),A.push.apply(A,E)}return A}function S(p){for(var h=1;h<arguments.length;h++){var A=arguments[h]!=null?arguments[h]:{};h%2?R(Object(A),!0).forEach(function(E){T(p,E,A[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(A)):R(Object(A)).forEach(function(E){Object.defineProperty(p,E,Object.getOwnPropertyDescriptor(A,E))})}return p}function T(p,h,A){return h in p?Object.defineProperty(p,h,{value:A,enumerable:!0,configurable:!0,writable:!0}):p[h]=A,p}var I=S(S({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:l.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:n.default,capLevelController:y.default,fpsController:m.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:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:H.default,timelineController:D.TimelineController,audioStreamController:W.default,audioTrackController:M.default,emeController:f.default,cmcdController:c.default});function O(){return{cueHandler:o.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 _(p,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i({},p,h)}function b(p){var h=p.loader;if(h!==d.default&&h!==l.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),p.progressive=!1;else{var A=Object(d.fetchSupported)();A&&(p.loader=d.default,p.progressive=!0,p.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/utils/ewma-bandwidth-estimator.ts"),M=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),H=N("./src/errors.ts"),n=N("./src/types/loader.ts"),D=N("./src/utils/logger.ts");function y(c,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function m(c,l,d){return l&&y(c.prototype,l),d&&y(c,d),c}var f=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 o=d.config;this.bwEstimator=new W.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var l=c.prototype;return l.registerListeners=function(){var o=this.hls;o.on(M.Events.FRAG_LOADING,this.onFragLoading,this),o.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(M.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(M.Events.FRAG_LOADING,this.onFragLoading,this),o.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(M.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(o,u){var a=u.frag;if(a.type===n.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=a,this.partCurrent=(i=u.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(o,u){var a=this.hls.config;u.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var o=this.fragCurrent,u=this.partCurrent,a=this.hls,i=a.autoLevelEnabled,R=a.config,S=a.media;if(!o||!S)return;var T=u?u.stats:o.stats,I=u?u.duration:o.duration;if(T.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||S.paused||!S.playbackRate||!S.readyState)return;var O=performance.now()-T.loading.start,_=Math.abs(S.playbackRate);if(O<=500*I/_)return;var b=a.levels,p=a.minAutoLevel,h=b[o.level],A=T.total||Math.max(T.loaded,Math.round(I*h.maxBitrate/8)),E=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/O),v=(A-T.loaded)/E,P=S.currentTime,x=(K.BufferHelper.bufferInfo(S,P,R.maxBufferHole).end-P)/_;if(x>=2*I/_||v<=x)return;var C=Number.POSITIVE_INFINITY,j;for(j=o.level-1;j>p;j--){var B=b[j].maxBitrate;if(C=I*B/(8*.8*E),C<x)break}if(C>=v)return;var w=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+o.sn+(u?" part "+u.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+j+`
|
|
Current BW estimate: `+(Object(V.isFiniteNumber)(w)?(w/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+v.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+C.toFixed(3)+` s
|
|
Time to underbuffer: `+x.toFixed(3)+" s"),a.nextLoadLevel=j,this.bwEstimator.sample(O,T.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),a.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:u,stats:T})},l.onFragLoaded=function(o,u){var a=u.frag,i=u.part;if(a.type===n.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(a.sn)){var R=i?i.stats:a.stats,S=i?i.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[a.level],I=(T.loaded?T.loaded.bytes:0)+R.loaded,O=(T.loaded?T.loaded.duration:0)+S;T.loaded={bytes:I,duration:O},T.realBitrate=Math.round(8*I/O)}if(a.bitrateTest){var _={stats:R,frag:a,part:i,id:a.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,_),a.bitrateTest=!1}}},l.onFragBuffered=function(o,u){var a=u.frag,i=u.part,R=i?i.stats:a.stats;if(R.aborted)return;if(a.type!==n.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var S=R.parsing.end-R.loading.start;this.bwEstimator.sample(S,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},l.onError=function(o,u){switch(u.details){case H.ErrorDetails.FRAG_LOAD_ERROR:case H.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var o=this.fragCurrent,u=this.partCurrent,a=this.hls,i=a.maxAutoLevel,R=a.config,S=a.minAutoLevel,T=a.media,I=u?u.duration:o?o.duration:0,O=T?T.currentTime:0,_=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,p=(K.BufferHelper.bufferInfo(T,O,R.maxBufferHole).end-O)/_,h=this.findBestLevel(b,S,i,p,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(h>=0)return h;D.logger.trace((p?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var A=I?Math.min(I,R.maxStarvationDelay):R.maxStarvationDelay,E=R.abrBandWidthFactor,v=R.abrBandWidthUpFactor;if(!p){var P=this.bitrateTestDelay;if(P){var x=I?Math.min(I,R.maxLoadingDelay):R.maxLoadingDelay;A=x-P,D.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*A)+" ms"),E=v=1}}return h=this.findBestLevel(b,S,i,p+A,E,v),Math.max(h,0)},l.findBestLevel=function(o,u,a,i,R,S){for(var T,I=this.fragCurrent,O=this.partCurrent,_=this.lastLoadedFragLevel,b=this.hls.levels,p=b[_],h=!!(p!=null&&(T=p.details)!==null&&T!==void 0&&T.live),A=p==null?void 0:p.codecSet,E=O?O.duration:I?I.duration:0,v=a;v>=u;v--){var P=b[v];if(!P||A&&P.codecSet!==A)continue;var x=P.details,C=(O?x==null?void 0:x.partTarget:x==null?void 0:x.averagetargetduration)||E,j=void 0;v<=_?j=R*o:j=S*o;var B=b[v].maxBitrate,w=B*C/j;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(j)+"/"+B+"/"+C+"/"+i+"/"+w),j>B&&(!w||h&&!this.bitrateTestDelay||w<i))return v}return-1},m(c,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,u=this.bwEstimator;if(o!==-1&&(!u||!u.canEstimate()))return o;var a=this.getNextABRAutoLevel();return o!==-1&&(a=Math.min(o,a)),a},set:function(o){this._nextAutoLevel=o}}]),c}();z.default=f},"./src/controller/audio-stream-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/controller/base-stream-controller.ts"),M=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),H=N("./src/controller/fragment-tracker.ts"),n=N("./src/types/level.ts"),D=N("./src/types/loader.ts"),y=N("./src/loader/fragment.ts"),m=N("./src/demux/chunk-cache.ts"),f=N("./src/demux/transmuxer-interface.ts"),c=N("./src/types/transmuxer.ts"),l=N("./src/controller/fragment-finders.ts"),d=N("./src/utils/discontinuities.ts"),o=N("./src/errors.ts"),u=N("./src/utils/logger.ts");function a(){return a=Object.assign||function(I){for(var O=1;O<arguments.length;O++){var _=arguments[O];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(I[b]=_[b])}return I},a.apply(this,arguments)}function i(I,O){I.prototype=Object.create(O.prototype),I.prototype.constructor=I,R(I,O)}function R(I,O){return R=Object.setPrototypeOf||function(b,p){return b.__proto__=p,b},R(I,O)}var S=100,T=function(I){i(O,I);function O(b,p){var h;return h=I.call(this,b,p,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var _=O.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var p=this.hls;p.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),p.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),p.on(M.Events.ERROR,this.onError,this),p.on(M.Events.BUFFER_RESET,this.onBufferReset,this),p.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),p.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var p=this.hls;p.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),p.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),p.off(M.Events.ERROR,this.onError,this),p.off(M.Events.BUFFER_RESET,this.onBufferReset,this),p.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),p.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(p,h){var A=h.frag,E=h.id,v=h.initPTS;if(E==="main"){var P=A.cc;this.initPTS[A.cc]=v,this.log("InitPTS for cc: "+P+" found from main: "+v),this.videoTrackCC=P,this.state===W.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(p){if(!this.levels){this.startPosition=p,this.state=W.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),this.fragLoadError=0,h>0&&p===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=W.State.IDLE):(this.loadedmetadata=!1,this.state=W.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=p,this.tick()},_.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_TRACK:{var p,h=this.levels,A=this.trackId,E=h==null||((p=h[A])===null||p===void 0)?void 0:p.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=W.State.WAITING_INIT_PTS}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var v,P=performance.now(),x=this.retryDate;(!x||P>=x||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=W.State.IDLE);break}case W.State.WAITING_INIT_PTS:{var C=this.waitingData;if(C){var j=C.frag,B=C.part,w=C.cache,Y=C.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.FRAG_LOADING;var $=w.flush(),oe={frag:j,part:B,payload:$,networkDetails:null};this._handleFragmentLoadProgress(oe),Y&&I.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var de=this.getLoadPosition(),Fe=K.BufferHelper.bufferInfo(this.mediaBuffer,de,this.config.maxBufferHole),Ae=Object(l.fragmentWithinToleranceTest)(Fe.end,this.config.maxFragLookUpTolerance,j);Ae<0&&(u.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+Fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=W.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var p=this.waitingData;p&&(this.fragmentTracker.removeFragment(p.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.IDLE)},_.onTickEnd=function(){var p=this.media;if(!p||!p.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:p,A=h.buffered;!this.loadedmetadata&&A.length&&(this.loadedmetadata=!0),this.lastCurrentTime=p.currentTime},_.doTickIdle=function(){var p,h,A=this.hls,E=this.levels,v=this.media,P=this.trackId,x=A.config;if(!E||!E[P])return;if(!v&&(this.startFragRequested||!x.startFragPrefetch))return;var C=E[P],j=C.details;if(!j||j.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(j)){this.state=W.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(B===null)return;var w=B.len,Y=this.getMaxBufferLength(),$=this.audioSwitch;if(w>=Y&&!$)return;if(!$&&this._streamEnded(B,j)){A.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=W.State.ENDED;return}var oe=j.fragments,de=oe[0].start,Fe=B.end;if($){var Ae=this.getLoadPosition();Fe=Ae,j.PTSKnown&&Ae<de&&((B.end>de||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),v.currentTime=de+.05))}var Re=this.getNextFragment(Fe,j);if(!Re){this.bufferFlushed=!0;return}((p=Re.decryptdata)===null||p===void 0?void 0:p.keyFormat)==="identity"&&!((h=Re.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(Re,j):this.loadFragment(Re,j,Fe)},_.getMaxBufferLength=function(){var p=I.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return h===null?p:Math.max(p,h.len)},_.onMediaDetaching=function(){this.videoBuffer=null,I.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(p,h){var A=h.audioTracks;this.resetTransmuxer(),this.levels=A.map(function(E){return new n.Level(E)})},_.onAudioTrackSwitching=function(p,h){var A=!!h.url;this.trackId=h.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),A?this.setInterval(S):this.resetTransmuxer(),A?(this.audioSwitch=!0,this.state=W.State.IDLE):this.state=W.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(p,h){this.mainDetails=h.details},_.onAudioTrackLoaded=function(p,h){var A,E=this.levels,v=h.details,P=h.id;if(!E){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+v.startSN+","+v.endSN+"],duration:"+v.totalduration);var x=E[P],C=0;if(v.live||(A=x.details)!==null&&A!==void 0&&A.live){var j=this.mainDetails;if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed||!j)return;!x.details&&v.hasProgramDateTime&&j.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(v,j),C=v.fragments[0].start):C=this.alignPlaylists(v,x.details)}x.details=v,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!v.live)&&this.setStartPosition(x.details,C),this.state===W.State.WAITING_TRACK&&!this.waitForCdnTuneIn(v)&&(this.state=W.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(p){var h,A=p.frag,E=p.part,v=p.payload,P=this.config,x=this.trackId,C=this.levels;if(!C){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+A.sn+" of level "+A.level+" will not be buffered");return}var j=C[x];console.assert(j,"Audio track is defined on fragment load progress");var B=j.details;console.assert(B,"Audio track details are defined on fragment load progress");var w=P.defaultAudioCodec||j.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new f.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[A.cc],oe=(h=A.initSegment)===null||h===void 0?void 0:h.data;if($!==void 0){var de=!1,Fe=E?E.index:-1,Ae=Fe!==-1,Re=new c.ChunkMetadata(A.level,A.sn,A.stats.chunkCount,v.byteLength,Fe,Ae);Y.push(v,oe,w,"",A,E,B.totalduration,de,Re,$)}else{u.logger.log("Unknown video PTS for cc "+A.cc+", waiting for video PTS before demuxing audio frag "+A.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+x);var Me=this.waitingData=this.waitingData||{frag:A,part:E,cache:new m.default,complete:!1},Be=Me.cache;Be.push(new Uint8Array(v)),this.waitingVideoCC=this.videoTrackCC,this.state=W.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(p){if(this.waitingData){this.waitingData.complete=!0;return}I.prototype._handleFragmentLoadComplete.call(this,p)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(p,h){var A=h.tracks.audio;A&&(this.mediaBuffer=A.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},_.onFragBuffered=function(p,h){var A=h.frag,E=h.part;if(A.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(A)){this.warn("Fragment "+A.sn+(E?" p: "+E.index:"")+" of level "+A.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}A.sn!=="initSegment"&&(this.fragPrevious=A,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(A,E)},_.onError=function(p,h){switch(h.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.AUDIO,h);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==W.State.ERROR&&this.state!==W.State.STOPPED&&(this.state=h.fatal?W.State.ERROR:W.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var A=!0,E=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);E&&E.len>.5&&(A=!this.reduceMaxBufferLength(E.len)),A&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,I.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(p,h){var A=h.type;A===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(p){var h,A="audio",E=this.hls,v=p.remuxResult,P=p.chunkMeta,x=this.getCurrentContext(P);if(!x){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var C=x.frag,j=x.part,B=v.audio,w=v.text,Y=v.id3,$=v.initSegment;if(this.fragContextChanged(C))return;if(this.state=W.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,C,P),E.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:C,id:A,tracks:$.tracks})),B){var oe=B.startPTS,de=B.endPTS,Fe=B.startDTS,Ae=B.endDTS;j&&(j.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:de,startDTS:Fe,endDTS:Ae}),C.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,oe,de,Fe,Ae),this.bufferFragmentData(B,C,j,P)}if(Y!=null&&(h=Y.samples)!==null&&h!==void 0&&h.length){var Re=a({frag:C,id:A},Y);E.trigger(M.Events.FRAG_PARSING_METADATA,Re)}if(w){var Me=a({frag:C,id:A},w);E.trigger(M.Events.FRAG_PARSING_USERDATA,Me)}},_._bufferInitSegment=function(p,h,A){if(this.state!==W.State.PARSING)return;p.video&&delete p.video;var E=p.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,p);var v=E.initSegment;if(v!=null&&v.byteLength){var P={type:"audio",frag:h,part:null,chunkMeta:A,parent:h.type,data:v};this.hls.trigger(M.Events.BUFFER_APPENDING,P)}this.tick()},_.loadFragment=function(p,h,A){var E=this.fragmentTracker.getState(p);this.fragCurrent=p,(this.audioSwitch||E===H.FragmentState.NOT_LOADED||E===H.FragmentState.PARTIAL)&&(p.sn==="initSegment"?this._loadInitSegment(p):h.live&&!Object(V.isFiniteNumber)(this.initPTS[p.cc])?(this.log("Waiting for video PTS in continuity counter "+p.cc+" of live stream before loading audio fragment "+p.sn+" of level "+this.trackId),this.state=W.State.WAITING_INIT_PTS):(this.startFragRequested=!0,I.prototype.loadFragment.call(this,p,h,A)))},_.completeAudioSwitch=function(){var p=this.hls,h=this.media,A=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),I.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,p.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:A})},O}(W.default);z.default=T},"./src/controller/audio-track-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/errors.ts"),M=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function H(f,c){for(var l=0;l<c.length;l++){var d=c[l];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(f,d.key,d)}}function n(f,c,l){return c&&H(f.prototype,c),l&&H(f,l),f}function D(f,c){f.prototype=Object.create(c.prototype),f.prototype.constructor=f,y(f,c)}function y(f,c){return y=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},y(f,c)}var m=function(f){D(c,f);function c(d){var o;return o=f.call(this,d,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var l=c.prototype;return l.registerListeners=function(){var o=this.hls;o.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(V.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(V.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,f.prototype.destroy.call(this)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},l.onManifestParsed=function(o,u){this.tracks=u.audioTracks||[]},l.onAudioTrackLoaded=function(o,u){var a=u.id,i=u.details,R=this.tracksInGroup[a];if(!R){this.warn("Invalid audio track id "+a);return}var S=R.details;R.details=u.details,this.log("audioTrack "+a+" loaded ["+i.startSN+"-"+i.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,u,S))},l.onLevelLoading=function(o,u){this.switchLevel(u.level)},l.onLevelSwitching=function(o,u){this.switchLevel(u.level)},l.switchLevel=function(o){var u=this.hls.levels[o];if(!(u!=null&&u.audioGroupIds))return;var a=u.audioGroupIds[u.urlId];if(this.groupId!==a){this.groupId=a;var i=this.tracks.filter(function(S){return!a||S.groupId===a});this.selectDefaultTrack&&!i.some(function(S){return S.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var R={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},l.onError=function(o,u){if(f.prototype.onError.call(this,o,u),u.fatal||!u.context)return;u.context.type===K.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},l.setAudioTrack=function(o){var u=this.tracksInGroup;if(o<0||o>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=u[this.trackId];this.log("Now switching to audio-track index "+o);var i=u[o],R=i.id,S=i.groupId,T=S===void 0?"":S,I=i.name,O=i.type,_=i.url;if(this.trackId=o,this.trackName=I,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:T,name:I,type:O,url:_}),i.details&&!i.details.live)return;var b=this.switchParams(i.url,a==null?void 0:a.details);this.loadPlaylist(b)},l.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,a=this.findTrackId(u)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(o){for(var u=this.tracksInGroup,a=0;a<u.length;a++){var i=u[a];if((!this.selectDefaultTrack||i.default)&&(!o||o===i.name))return i.id}return-1},l.loadPlaylist=function(o){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var a=u.id,i=u.groupId,R=u.url;if(o)try{R=o.addDirectives(R)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:R,id:a,groupId:i,deliveryDirectives:o||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),c}(M.default);z.default=m},"./src/controller/base-playlist-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return n});var V=N("./src/polyfills/number.ts"),W=N("./src/types/level.ts"),M=N("./src/controller/level-helper.ts"),K=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),n=function(){function D(m,f){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,f+":"),this.warn=K.logger.warn.bind(K.logger,f+":"),this.hls=m}var y=D.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(f,c){c.fatal&&c.type===H.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(f,c){var l=c==null?void 0:c.renditionReports;if(l)for(var d=0;d<l.length;d++){var o=l[d],u=""+o.URI;if(u===f.substr(-u.length)){var a=parseInt(o["LAST-MSN"]),i=parseInt(o["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var R=Math.min(c.age-c.partTarget,c.targetduration);i!==void 0&&R>c.partTarget&&(i+=1)}if(Object(V.isFiniteNumber)(a))return new W.HlsUrlParameters(a,Object(V.isFiniteNumber)(i)?i:void 0,W.HlsSkip.No)}}},y.loadPlaylist=function(f){},y.shouldLoadTrack=function(f){return this.canLoad&&f&&!!f.url&&(!f.details||f.details.live)},y.playlistLoaded=function(f,c,l){var d=this,o=c.details,u=c.stats,a=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(o.advancedDateTime=Date.now()-a,o.live||l!=null&&l.live){if(o.reloaded(l),l&&this.log("live playlist "+f+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),l&&o.fragments.length>0&&Object(M.mergeDetails)(l,o),!this.canLoad||!o.live)return;var i,R=void 0,S=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var T=this.hls.config.lowLatencyMode,I=o.lastPartSn,O=o.endSN,_=o.lastPartIndex,b=_!==-1,p=I===O,h=T?0:_;b?(R=p?O+1:I,S=p?h:_+1):R=O+1;var A=o.age,E=A+o.ageHeader,v=Math.min(E-o.partTarget,o.targetduration*1.5);if(v>0){if(l&&v>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+v+" with playlist age: "+o.age),v=0;else{var P=Math.floor(v/o.targetduration);if(R+=P,S!==void 0){var x=Math.round(v%o.targetduration/o.partTarget);S+=x}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+A.toFixed(2)+"s goal: "+v+" skip sn "+P+" to part "+S)}o.tuneInGoal=v}if(i=this.getDeliveryDirectives(o,c.deliveryDirectives,R,S),T||!p){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(o,c.deliveryDirectives,R,S);var C=Object(M.computeReloadInterval)(o,u);R!==void 0&&o.canBlockReload&&(C-=o.partTarget||1),this.log("reload live playlist "+f+" in "+Math.round(C)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(i)},C)}else this.clearTimer()},y.getDeliveryDirectives=function(f,c,l,d){var o=Object(W.getSkipValue)(f,l);return c!=null&&c.skip&&f.deltaUpdateFailed&&(l=c.msn,d=c.part,o=W.HlsSkip.No),new W.HlsUrlParameters(l,d,o)},y.retryLoadingOrFail=function(f){var c=this,l=this.hls.config,d=this.retryCount<l.levelLoadingMaxRetry;if(d){var o;if(this.retryCount++,f.details.indexOf("LoadTimeOut")>-1&&(o=f.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+f.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+f.details+'"')}}else this.warn('cannot recover from error "'+f.details+'"'),this.clearTimer(),f.fatal=!0;return d},D}()},"./src/controller/base-stream-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"State",function(){return O}),N.d(z,"default",function(){return _});var V=N("./src/polyfills/number.ts"),W=N("./src/task-loop.ts"),M=N("./src/controller/fragment-tracker.ts"),K=N("./src/utils/buffer-helper.ts"),H=N("./src/utils/logger.ts"),n=N("./src/events.ts"),D=N("./src/errors.ts"),y=N("./src/types/transmuxer.ts"),m=N("./src/utils/mp4-tools.ts"),f=N("./src/utils/discontinuities.ts"),c=N("./src/controller/fragment-finders.ts"),l=N("./src/controller/level-helper.ts"),d=N("./src/loader/fragment-loader.ts"),o=N("./src/crypt/decrypter.ts"),u=N("./src/utils/time-ranges.ts"),a=N("./src/types/loader.ts");function i(b,p){for(var h=0;h<p.length;h++){var A=p[h];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(b,A.key,A)}}function R(b,p,h){return p&&i(b.prototype,p),h&&i(b,h),b}function S(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function T(b,p){b.prototype=Object.create(p.prototype),b.prototype.constructor=b,I(b,p)}function I(b,p){return I=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},I(b,p)}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){T(p,b);function p(A,E,v){var P;return P=b.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=O.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=v,P.log=H.logger.log.bind(H.logger,v+":"),P.warn=H.logger.warn.bind(H.logger,v+":"),P.hls=A,P.fragmentLoader=new d.default(A.config),P.fragmentTracker=E,P.config=A.config,P.decrypter=new o.default(A,A.config),A.on(n.Events.KEY_LOADED,P.onKeyLoaded,S(P)),P}var h=p.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(E){},h.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},h._streamEnded=function(E,v){var P=this.fragCurrent,x=this.fragmentTracker;if(!v.live&&P&&P.sn===v.endSN&&!E.nextStart){var C=x.getState(P);return C===M.FragmentState.PARTIAL||C===M.FragmentState.OK}return!1},h.onMediaAttached=function(E,v){var P=this.media=this.mediaBuffer=v.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var x=this.config;this.levels&&x.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(x.startPosition)},h.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()},h.onMediaSeeking=function(){var E=this.config,v=this.fragCurrent,P=this.media,x=this.mediaBuffer,C=this.state,j=P?P.currentTime:0,B=K.BufferHelper.bufferInfo(x||P,j,E.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(j)?j.toFixed(3):j)+", state: "+C),C===O.ENDED)this.resetLoadingState();else if(v&&!B.len){var w=E.maxFragLookUpTolerance,Y=v.start-w,$=v.start+v.duration+w,oe=j>$;(j<Y||oe)&&(oe&&v.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),v.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=j),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(E,v){if(this.state!==O.KEY_LOADING||v.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var P=this.levels[v.frag.level].details;P&&this.loadFragment(v.frag,P,v.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},h.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)},h.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})},h.loadFragment=function(E,v,P){this._loadFragForPlayback(E,v,P)},h._loadFragForPlayback=function(E,v,P){var x=this,C=function(B){if(x.fragContextChanged(E)){x.warn("Fragment "+E.sn+(B.part?" p: "+B.part.index:"")+" of level "+E.level+" was dropped during download."),x.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,x._handleFragmentLoadProgress(B)};this._doFragLoad(E,v,P,C).then(function(j){if(!j)return;x.fragLoadError=0;var B=x.state;if(x.fragContextChanged(E)){(B===O.FRAG_LOADING||B===O.BACKTRACKING||!x.fragCurrent&&B===O.PARSING)&&(x.fragmentTracker.removeFragment(E),x.state=O.IDLE);return}if("payload"in j&&(x.log("Loaded fragment "+E.sn+" of level "+E.level),x.hls.trigger(n.Events.FRAG_LOADED,j),x.state===O.BACKTRACKING)){x.fragmentTracker.backtrack(E,j),x.resetFragmentLoading(E);return}x._handleFragmentLoadComplete(j)}).catch(function(j){x.warn(j),x.resetFragmentLoading(E)})},h.flushMainBuffer=function(E,v,P){if(P===void 0&&(P=null),!(E-v))return;var x={startOffset:E,endOffset:v,type:P};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,x)},h._loadInitSegment=function(E){var v=this;this._doFragLoad(E).then(function(P){if(!P||v.fragContextChanged(E)||!v.levels)throw new Error("init load aborted");return P}).then(function(P){var x=v.hls,C=P.payload,j=E.decryptdata;if(C&&C.byteLength>0&&j&&j.key&&j.iv&&j.method==="AES-128"){var B=self.performance.now();return v.decrypter.webCryptoDecrypt(new Uint8Array(C),j.key.buffer,j.iv.buffer).then(function(w){var Y=self.performance.now();return x.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:w,stats:{tstart:B,tdecrypt:Y}}),P.payload=w,P})}return P}).then(function(P){var x=v.fragCurrent,C=v.hls,j=v.levels;if(!j)throw new Error("init load aborted, missing levels");var B=j[E.level].details;console.assert(B,"Level details are defined when init segment is loaded");var w=E.stats;v.state=O.IDLE,v.fragLoadError=0,E.data=new Uint8Array(P.payload),w.parsing.start=w.buffering.start=self.performance.now(),w.parsing.end=w.buffering.end=self.performance.now(),P.frag===x&&C.trigger(n.Events.FRAG_BUFFERED,{stats:w,frag:x,part:null,id:E.type}),v.tick()}).catch(function(P){v.warn(P),v.resetFragmentLoading(E)})},h.fragContextChanged=function(E){var v=this.fragCurrent;return!E||!v||E.level!==v.level||E.sn!==v.sn||E.urlId!==v.urlId},h.fragBufferedComplete=function(E,v){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(v?" part: "+v.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+u.default.toString(K.BufferHelper.getBuffered(P))),this.state=O.IDLE,this.tick()},h._handleFragmentLoadComplete=function(E){var v=this.transmuxer;if(!v)return;var P=E.frag,x=E.part,C=E.partsLoaded,j=!C||C.length===0||C.some(function(w){return!w}),B=new y.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,x?x.index:-1,!j);v.flush(B)},h._handleFragmentLoadProgress=function(E){},h._doFragLoad=function(E,v,P,x){var C=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(E.start,P||0),this.config.lowLatencyMode&&v){var j=v.partList;if(j&&x){P>E.end&&v.fragmentHint&&(E=v.fragmentHint);var B=this.getNextPart(j,E,P);if(B>-1){var w=j[B];return this.log("Loading part sn: "+E.sn+" p: "+w.index+" cc: "+E.cc+" of playlist ["+v.startSN+"-"+v.endSN+"] parts [0-"+B+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=w.start+w.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:j[B],targetBufferTime:P}),this.doFragPartsLoad(E,j,B,x).catch(function(Y){return C.handleFragLoadError(Y)})}else if(!E.url||this.loadedEndOfParts(j,P))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(v?"of ["+v.startSN+"-"+v.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(P.toFixed(3))),Object(V.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:P}),this.fragmentLoader.load(E,x).catch(function(Y){return C.handleFragLoadError(Y)})},h.doFragPartsLoad=function(E,v,P,x){var C=this;return new Promise(function(j,B){var w=[],Y=function $(oe){var de=v[oe];C.fragmentLoader.loadPart(E,de,x).then(function(Fe){w[de.index]=Fe;var Ae=Fe.part;C.hls.trigger(n.Events.FRAG_LOADED,Fe);var Re=v[oe+1];if(Re&&Re.fragment===E)$(oe+1);else return j({frag:E,part:Ae,partsLoaded:w})}).catch(B)};Y(P)})},h.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},h._handleTransmuxerFlush=function(E){var v=this.getCurrentContext(E);if(!v||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var P=v.frag,x=v.part,C=v.level,j=self.performance.now();P.stats.parsing.end=j,x&&(x.stats.parsing.end=j),this.updateLevelTiming(P,x,C,E.partial)},h.getCurrentContext=function(E){var v=this.levels,P=E.level,x=E.sn,C=E.part;if(!v||!v[P])return this.warn("Levels object was unset while buffering fragment "+x+" of level "+P+". The current chunk will not be buffered."),null;var j=v[P],B=C>-1?Object(l.getPartWith)(j,x,C):null,w=B?B.fragment:Object(l.getFragmentWithSN)(j,x,this.fragCurrent);return w?{frag:w,part:B,level:j}:null},h.bufferFragmentData=function(E,v,P,x){if(!E||this.state!==O.PARSING)return;var C=E.data1,j=E.data2,B=C;if(C&&j&&(B=Object(m.appendUint8Array)(C,j)),!B||!B.length)return;var w={type:E.type,frag:v,part:P,chunkMeta:x,parent:v.type,data:B};this.hls.trigger(n.Events.BUFFER_APPENDING,w),E.dropped&&E.independent&&!P&&this.flushBufferGap(v)},h.flushBufferGap=function(E){var v=this.media;if(!v)return;if(!K.BufferHelper.isBuffered(v,v.currentTime)){this.flushMainBuffer(0,E.start);return}var P=v.currentTime,x=K.BufferHelper.bufferInfo(v,P,0),C=E.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,C*.25),B=Math.max(Math.min(E.start-j,x.end-j),P+j);E.start-B>j&&this.flushMainBuffer(B,E.start)},h.getFwdBufferInfo=function(E,v){var P=this.config,x=this.getLoadPosition();if(!Object(V.isFiniteNumber)(x))return null;var C=K.BufferHelper.bufferInfo(E,x,P.maxBufferHole);if(C.len===0&&C.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(x,v);if(j&&C.nextStart<j.end)return K.BufferHelper.bufferInfo(E,x,Math.max(C.nextStart,P.maxBufferHole))}return C},h.getMaxBufferLength=function(E){var v=this.config,P;return E?P=Math.max(8*v.maxBufferSize/E,v.maxBufferLength):P=v.maxBufferLength,Math.min(P,v.maxMaxBufferLength)},h.reduceMaxBufferLength=function(E){var v=this.config,P=E||v.maxBufferLength;return v.maxMaxBufferLength>=P?(v.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+v.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(E,v){var P,x,C=v.fragments,j=C.length;if(!j)return null;var B=this.config,w=C[0].start,Y;if(v.live){var $=B.initialLiveManifestSize;if(j<$)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+$+")"),null;!v.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(v,C),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:E)}else E<=w&&(Y=C[0]);if(!Y){var oe=B.lowLatencyMode?v.partEnd:v.fragmentEnd;Y=this.getFragmentAtPosition(E,oe,v)}return(P=Y)!==null&&P!==void 0&&P.initSegment&&!((x=Y)!==null&&x!==void 0&&x.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},h.getNextPart=function(E,v,P){for(var x=-1,C=!1,j=!0,B=0,w=E.length;B<w;B++){var Y=E[B];if(j=j&&!Y.independent,x>-1&&P<Y.start)break;var $=Y.loaded;!$&&(C||Y.independent||j)&&Y.fragment===v&&(x=B),C=$}return x},h.loadedEndOfParts=function(E,v){var P=E[E.length-1];return P&&v>P.start&&P.loaded},h.getInitialLiveFragment=function(E,v){var P=this.fragPrevious,x=null;if(P){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),x=Object(c.findFragmentByPDT)(v,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!x){var C=P.sn+1;if(C>=E.startSN&&C<=E.endSN){var j=v[C-E.startSN];P.cc===j.cc&&(x=j,this.log("Live playlist, switching playlist, load frag with next SN: "+x.sn))}x||(x=Object(c.findFragWithCC)(v,P.cc),x&&this.log("Live playlist, switching playlist, load frag with same CC: "+x.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(x=this.getFragmentAtPosition(B,this.bitrateTest?E.fragmentEnd:E.edge,E))}return x},h.getFragmentAtPosition=function(E,v,P){var x=this.config,C=this.fragPrevious,j=P.fragments,B=P.endSN,w=P.fragmentHint,Y=x.maxFragLookUpTolerance,$=!!(x.lowLatencyMode&&P.partList&&w);$&&w&&!this.bitrateTest&&(j=j.concat(w),B=w.sn);var oe;if(E<v){var de=E>v-Y?0:Y;oe=Object(c.findFragmentByPTS)(C,j,E,de)}else oe=j[j.length-1];if(oe){var Fe=oe.sn-P.startSN,Ae=C&&oe.level===C.level,Re=j[Fe+1],Me=this.fragmentTracker.getState(oe);if(Me===M.FragmentState.BACKTRACKED){oe=null;for(var Be=Fe;j[Be]&&this.fragmentTracker.getState(j[Be])===M.FragmentState.BACKTRACKED;)C?oe=j[Be--]:oe=j[--Be];oe||(oe=Re)}else C&&oe.sn===C.sn&&!$&&(Ae&&(oe.sn<B&&this.fragmentTracker.getState(Re)!==M.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Re.sn),oe=Re):oe=null))}return oe},h.synchronizeToLiveEdge=function(E){var v=this.config,P=this.media;if(!P)return;var x=this.hls.liveSyncPosition,C=P.currentTime,j=E.fragments[0].start,B=E.edge,w=C>=j-v.maxFragLookUpTolerance&&C<=B;if(x!==null&&P.duration>x&&(C<x||!w)){var Y=v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:v.liveMaxLatencyDurationCount*E.targetduration;(!w&&P.readyState<4||C<B-Y)&&(this.loadedmetadata||(this.nextLoadPosition=x),P.readyState&&(this.warn("Playback: "+C.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+x.toFixed(3)),P.currentTime=x))}},h.alignPlaylists=function(E,v){var P=this.levels,x=this.levelLastLoaded,C=this.fragPrevious,j=x!==null?P[x]:null,B=E.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var w=E.fragments[0].start,Y=!v,$=E.alignedSliding&&Object(V.isFiniteNumber)(w);if(Y||!$&&!w){Object(f.alignStream)(C,j,E);var oe=E.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(v?v.startSN:"na")+"->"+E.startSN+" prev-sn: "+(C?C.sn:"na")+" fragments: "+B),oe}return w},h.waitForCdnTuneIn=function(E){var v=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*v)},h.setStartPosition=function(E,v){var P=this.startPosition;if(P<v&&(P=-1),P===-1||this.lastCurrentTime===-1){var x=E.startTimeOffset;Object(V.isFiniteNumber)(x)?(P=v+x,x<0&&(P+=E.totalduration),P=Math.min(Math.max(v,P),v+E.totalduration),this.log("Start time offset "+x+" found in playlist, adjust startPosition to "+P),this.startPosition=P):E.live?P=this.hls.liveSyncPosition||v:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},h.getLoadPosition=function(){var E=this.media,v=0;return this.loadedmetadata&&E?v=E.currentTime:this.nextLoadPosition&&(v=this.nextLoadPosition),v},h.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))},h.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=O.IDLE)},h.onFragmentOrKeyLoadError=function(E,v){if(v.fatal)return;var P=v.frag;if(!P||P.type!==E)return;var x=this.fragCurrent;console.assert(x&&P.sn===x.sn&&P.level===x.level&&P.urlId===x.urlId,"Frag load error must match current frag to retry");var C=this.config;if(this.fragLoadError+1<=C.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var j=Math.min(Math.pow(2,this.fragLoadError)*C.fragLoadingRetryDelay,C.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+E+" "+P.level+" failed to load, retrying in "+j+"ms"),this.retryDate=self.performance.now()+j,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else v.levelRetry?(E===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(H.logger.error(v.details+" reaches max retry, redispatch as fatal ..."),v.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},h.afterBufferFlushed=function(E,v,P){if(!E)return;var x=K.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(v,x,P),this.state===O.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},h.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},h.updateLevelTiming=function(E,v,P,x){var C=this,j=P.details;console.assert(!!j,"level.details must be defined");var B=Object.keys(E.elementaryStreams).reduce(function(w,Y){var $=E.elementaryStreams[Y];if($){var oe=$.endPTS-$.startPTS;if(oe<=0)return C.warn("Could not parse fragment "+E.sn+" "+Y+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),C.resetTransmuxer(),w||!1;var de=x?0:Object(l.updateFragPTSDTS)(j,E,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return C.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:j,level:P,drift:de,type:Y,frag:E,start:$.startPTS,end:$.endPTS}),!0}return w},!1);B?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:v})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(p,[{key:"state",get:function(){return this._state},set:function(E){var v=this._state;v!==E&&(this._state=E,this.log(v+"->"+E))}}]),p}(W.default)},"./src/controller/buffer-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return c});var V=N("./src/polyfills/number.ts"),W=N("./src/events.ts"),M=N("./src/utils/logger.ts"),K=N("./src/errors.ts"),H=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),D=N("./src/loader/fragment.ts"),y=N("./src/controller/buffer-operation-queue.ts"),m=Object(n.getMediaSource)(),f=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function l(o){var u=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 a=u.hls,i=u.media,R=u.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),i&&(u.updateMediaElementDuration(),a.trigger(W.Events.MEDIA_ATTACHED,{media:i})),R&&R.removeEventListener("sourceopen",u._onMediaSourceOpen),u.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=o,this._initSourceBuffer(),this.registerListeners()}var d=l.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 u=this.hls;u.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(W.Events.BUFFER_RESET,this.onBufferReset,this),u.on(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(W.Events.BUFFER_EOS,this.onBufferEos,this),u.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(W.Events.FRAG_PARSED,this.onFragParsed,this),u.on(W.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var u=this.hls;u.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(W.Events.BUFFER_RESET,this.onBufferReset,this),u.off(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(W.Events.BUFFER_EOS,this.onBufferEos,this),u.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(W.Events.FRAG_PARSED,this.onFragParsed,this),u.off(W.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(u,a){var i=2;(a.audio&&!a.video||!a.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(u,a){var i=this.media=a.media;if(i&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(R),this._objectUrl=i.src}},d.onMediaDetaching=function(){var u=this.media,a=this.mediaSource,i=this._objectUrl;if(a){if(M.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(R){M.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(i&&self.URL.revokeObjectURL(i),u.src===i?(u.removeAttribute("src"),u.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(W.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(a){var i=u.sourceBuffer[a];try{i&&(u.removeBufferListeners(a),u.mediaSource&&u.mediaSource.removeSourceBuffer(i),u.sourceBuffer[a]=void 0)}catch(R){M.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",R)}}),this._initSourceBuffer()},d.onBufferCodecs=function(u,a){var i=this,R=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(S){if(R){var T=i.tracks[S];if(T&&typeof T.buffer.changeType=="function"){var I=a[S],O=I.codec,_=I.levelCodec,b=I.container,p=(T.levelCodec||T.codec).replace(f,"$1"),h=(_||O).replace(f,"$1");if(p!==h){var A=b+";codecs="+(_||O);i.appendChangeType(S,A)}}}else i.pendingTracks[S]=a[S]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(u,a){var i=this,R=this.operationQueue,S={execute:function(){var I=i.sourceBuffer[u];I&&(M.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+a),I.changeType(a)),R.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(I){M.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",I)}};R.append(S,u)},d.onBufferAppending=function(u,a){var i=this,R=this.hls,S=this.operationQueue,T=this.tracks,I=a.data,O=a.type,_=a.frag,b=a.part,p=a.chunkMeta,h=p.buffering[O],A=self.performance.now();h.start=A;var E=_.stats.buffering,v=b?b.stats.buffering:null;E.start===0&&(E.start=A),v&&v.start===0&&(v.start=A);var P=T.audio,x=O==="audio"&&p.id===1&&(P==null?void 0:P.container)==="audio/mpeg",C={execute:function(){if(h.executeStart=self.performance.now(),x){var B=i.sourceBuffer[O];if(B){var w=_.start-B.timestampOffset;Math.abs(w)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+w+") sn: "+_.sn+")"),B.timestampOffset=_.start)}}i.appendExecutor(I,O)},onStart:function(){},onComplete:function(){var B=self.performance.now();h.executeEnd=h.end=B,E.first===0&&(E.first=B),v&&v.first===0&&(v.first=B);var w=i.sourceBuffer,Y={};for(var $ in w)Y[$]=H.BufferHelper.getBuffered(w[$]);i.appendError=0,i.hls.trigger(W.Events.BUFFER_APPENDED,{type:O,frag:_,part:b,chunkMeta:p,parent:_.type,timeRanges:Y})},onError:function(B){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",B);var w={type:K.ErrorTypes.MEDIA_ERROR,parent:_.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?w.details=K.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,w.details=K.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>R.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),w.fatal=!0)),R.trigger(W.Events.ERROR,w)}};S.append(C,O)},d.onBufferFlushing=function(u,a){var i=this,R=this.operationQueue,S=function(I){return{execute:i.removeExecutor.bind(i,I,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(W.Events.BUFFER_FLUSHED,{type:I})},onError:function(_){M.logger.warn("[buffer-controller]: Failed to remove from "+I+" SourceBuffer",_)}}};a.type?R.append(S(a.type),a.type):this.getSourceBufferTypes().forEach(function(T){R.append(S(T),T)})},d.onFragParsed=function(u,a){var i=this,R=a.frag,S=a.part,T=[],I=S?S.elementaryStreams:R.elementaryStreams;I[D.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(I[D.ElementaryStreamTypes.AUDIO]&&T.push("audio"),I[D.ElementaryStreamTypes.VIDEO]&&T.push("video"));var O=function(){var b=self.performance.now();R.stats.buffering.end=b,S&&(S.stats.buffering.end=b);var p=S?S.stats:R.stats;i.hls.trigger(W.Events.FRAG_BUFFERED,{frag:R,part:S,stats:p,id:R.type})};T.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(O,T)},d.onFragChanged=function(u,a){this.flushBackBuffer()},d.onBufferEos=function(u,a){var i=this,R=this.getSourceBufferTypes().reduce(function(S,T){var I=i.sourceBuffer[T];return(!a.type||a.type===T)&&(I&&!I.ended&&(I.ended=!0,M.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),S&&!!(!I||I.ended)},!0);R&&this.blockBuffers(function(){var S=i.mediaSource;if(!S||S.readyState!=="open")return;S.endOfStream()})},d.onLevelUpdated=function(u,a){var i=a.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var u=this.hls,a=this.details,i=this.media,R=this.sourceBuffer;if(!i||a===null)return;var S=this.getSourceBufferTypes();if(!S.length)return;var T=a.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(V.isFiniteNumber)(T)||T<0)return;var I=i.currentTime,O=a.levelTargetDuration,_=Math.max(T,O),b=Math.floor(I/O)*O-_;S.forEach(function(p){var h=R[p];if(h){var A=H.BufferHelper.getBuffered(h);A.length>0&&b>A.start(0)&&(u.trigger(W.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),a.live&&u.trigger(W.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),u.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:p}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,a=this.hls,i=this.media,R=this.mediaSource,S=u.fragments[0].start+u.totalduration,T=i.duration,I=Object(V.isFiniteNumber)(R.duration)?R.duration:0;u.live&&a.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(u)):(S>I&&S>T||!Object(V.isFiniteNumber)(T))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),R.duration=S)},d.updateSeekableRange=function(u){var a=this.mediaSource,i=u.fragments,R=i.length;if(R&&u.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var S=Math.max(0,i[0].start),T=Math.max(S,S+u.totalduration);a.setLiveSeekableRange(S,T)}},d.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,a=this.operationQueue,i=this.pendingTracks,R=Object.keys(i).length;if(R&&!u||R===2){this.createSourceBuffers(i),this.pendingTracks={};var S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(W.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(T){a.executeNext(T)})}},d.createSourceBuffers=function(u){var a=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var S in u)if(!a[S]){var T=u[S];if(!T)throw Error("source buffer exists for track "+S+", however track does not");var I=T.levelCodec||T.codec,O=T.container+";codecs="+I;M.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var _=a[S]=i.addSourceBuffer(O),b=S;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[S]={buffer:_,codec:I,container:T.container,levelCodec:T.levelCodec,id:T.id},R++}catch(p){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+p.message),this.hls.trigger(W.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,mimeType:O})}}R&&this.hls.trigger(W.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(u){var a=this.operationQueue,i=a.current(u);i.onStart()},d._onSBUpdateEnd=function(u){var a=this.operationQueue,i=a.current(u);i.onComplete(),a.shiftAndExecuteNext(u)},d._onSBUpdateError=function(u,a){M.logger.error("[buffer-controller]: "+u+" SourceBuffer error",a),this.hls.trigger(W.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(u);i&&i.onError(a)},d.removeExecutor=function(u,a,i){var R=this.media,S=this.mediaSource,T=this.operationQueue,I=this.sourceBuffer,O=I[u];if(!R||!S||!O){M.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(u);return}var _=Object(V.isFiniteNumber)(R.duration)?R.duration:Infinity,b=Object(V.isFiniteNumber)(S.duration)?S.duration:Infinity,p=Math.max(0,a),h=Math.min(i,_,b);h>p?(M.logger.log("[buffer-controller]: Removing ["+p+","+h+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(p,h)):T.shiftAndExecuteNext(u)},d.appendExecutor=function(u,a){var i=this.operationQueue,R=this.sourceBuffer,S=R[a];if(!S){M.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(a);return}S.ended=!1,console.assert(!S.updating,a+" sourceBuffer must not be updating"),S.appendBuffer(u)},d.blockBuffers=function(u,a){var i=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var R=this.operationQueue,S=a.map(function(T){return R.appendBlocker(T)});Promise.all(S).then(function(){u(),a.forEach(function(T){var I=i.sourceBuffer[T];(!I||!I.updating)&&R.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(u,a,i){var R=this.sourceBuffer[u];if(!R)return;var S=i.bind(this,u);this.listeners[u].push({event:a,listener:S}),R.addEventListener(a,S)},d.removeBufferListeners=function(u){var a=this.sourceBuffer[u];if(!a)return;this.listeners[u].forEach(function(i){a.removeEventListener(i.event,i.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return W});var V=N("./src/utils/logger.ts"),W=function(){function M(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var K=M.prototype;return K.append=function(n,D){var y=this.queues[D];y.push(n),y.length===1&&this.buffers[D]&&this.executeNext(D)},K.insertAbort=function(n,D){var y=this.queues[D];y.unshift(n),this.executeNext(D)},K.appendBlocker=function(n){var D,y=new Promise(function(f){D=f}),m={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,n),y},K.executeNext=function(n){var D=this.buffers,y=this.queues,m=D[n],f=y[n];if(f.length){var c=f[0];try{c.execute()}catch(l){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(l),(!m||!m.updating)&&(f.shift(),this.executeNext(n))}}},K.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},K.current=function(n){return this.queues[n][0]},M}()},"./src/controller/cap-level-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/events.ts");function W(H,n){for(var D=0;D<n.length;D++){var y=n[D];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(H,y.key,y)}}function M(H,n,D){return n&&W(H.prototype,n),D&&W(H,D),H}var K=function(){function H(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=H.prototype;return n.setStreamController=function(y){this.streamController=y},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 y=this.hls;y.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var y=this.hls;y.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(y,m){H.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},n.onMediaAttaching=function(y,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},n.onManifestParsed=function(y,m){var f=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,f.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onBufferCodecs=function(y,m){var f=this.hls;f.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(y.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},n.getMaxLevel=function(y){var m=this,f=this.hls.levels;if(!f.length)return-1;var c=f.filter(function(l,d){return H.isLevelAllowed(d,m.restrictedLevels)&&d<=y});return this.clientRect=null,H.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 y=this.media,m={width:0,height:0};if(y){var f=y.getBoundingClientRect();m.width=f.width,m.height=f.height,!m.width&&!m.height&&(m.width=f.right-f.left||y.width||0,m.height=f.bottom-f.top||y.height||0)}return this.clientRect=m,m},H.isLevelAllowed=function(y,m){return m===void 0&&(m=[]),m.indexOf(y)===-1},H.getMaxLevelByMediaSize=function(y,m,f){if(!y||!y.length)return-1;for(var c=function(a,i){return i?a.width!==i.width||a.height!==i.height:!0},l=y.length-1,d=0;d<y.length;d+=1){var o=y[d];if((o.width>=m||o.height>=f)&&c(o,y[d+1])){l=d;break}}return l},M(H,[{key:"mediaWidth",get:function(){return this.getDimensions().width*H.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*H.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(m){}return y}}]),H}();z.default=K},"./src/controller/cmcd-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return c});var V=N("./src/events.ts"),W=N("./src/types/cmcd.ts"),M=N("./src/utils/buffer-helper.ts"),K=N("./src/utils/logger.ts");function H(l,d){for(var o=0;o<d.length;o++){var u=d[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function n(l,d,o){return d&&H(l.prototype,d),o&&H(l,o),l}function D(l,d){var o=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(o)return(o=o.call(l)).next.bind(o);if(Array.isArray(l)||(o=y(l))||d&&l&&typeof l.length=="number"){o&&(l=o);var u=0;return function(){return u>=l.length?{done:!0}:{done:!1,value:l[u++]}}}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 y(l,d){if(!l)return;if(typeof l=="string")return m(l,d);var o=Object.prototype.toString.call(l).slice(8,-1);if(o==="Object"&&l.constructor&&(o=l.constructor.name),o==="Map"||o==="Set")return Array.from(l);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(l,d)}function m(l,d){(d==null||d>l.length)&&(d=l.length);for(var o=0,u=new Array(d);o<d;o++)u[o]=l[o];return u}function f(){return f=Object.assign||function(l){for(var d=1;d<arguments.length;d++){var o=arguments[d];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(l[u]=o[u])}return l},f.apply(this,arguments)}var c=function(){function l(o){var u=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(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(R){try{u.apply(R,{ot:W.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(S){K.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(R){try{var S=R.frag,T=u.hls.levels[S.level],I=u.getObjectType(S),O={d:S.duration*1e3,ot:I};(I===W.CMCDObjectType.VIDEO||I===W.CMCDObjectType.AUDIO||I==W.CMCDObjectType.MUXED)&&(O.br=T.bitrate/1e3,O.tb=u.getTopBandwidth(I),O.bl=u.getBufferLength(I)),u.apply(R,O)}catch(_){K.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=o;var a=this.config=o.config,i=a.cmcd;i!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||l.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var d=l.prototype;return d.registerListeners=function(){var u=this.hls;u.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var u=this.hls;u.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.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(u,a){this.media=a.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(u,a){var i,R;this.audioBuffer=(i=a.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(R=a.tracks.video)===null||R===void 0?void 0:R.buffer},d.createData=function(){var u;return{v:W.CMCDVersion,sf:W.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(u,a){a===void 0&&(a={}),f(a,this.createData());var i=a.ot===W.CMCDObjectType.INIT||a.ot===W.CMCDObjectType.VIDEO||a.ot===W.CMCDObjectType.MUXED;if(this.starved&&i&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var R=l.toHeaders(a);if(!Object.keys(R).length)return;u.headers||(u.headers={}),f(u.headers,R)}else{var S=l.toQuery(a);if(!S)return;u.url=l.appendQueryToUri(u.url,S)}},d.getObjectType=function(u){var a=u.type;return a==="subtitle"?W.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?W.CMCDObjectType.INIT:a==="audio"?W.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?W.CMCDObjectType.VIDEO:W.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(u){for(var a=0,i=u===W.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=D(i),S;!(S=R()).done;){var T=S.value;T.bitrate>a&&(a=T.bitrate)}return a>0?a:NaN},d.getBufferLength=function(u){var a=this.hls.media,i=u===W.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!a)return NaN;var R=M.BufferHelper.bufferInfo(i,a.currentTime,this.config.maxBufferHole);return R.len*1e3},d.createPlaylistLoader=function(){var u=this.config.pLoader,a=this.applyPlaylistData,i=u||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new i(T)}var S=R.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(I,O,_){a(I),this.loader.load(I,O,_)},n(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},d.createFragmentLoader=function(){var u=this.config.fLoader,a=this.applyFragmentData,i=u||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new i(T)}var S=R.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(I,O,_){a(I),this.loader.load(I,O,_)},n(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},l.uuid=function(){var u=URL.createObjectURL(new Blob),a=u.toString();return URL.revokeObjectURL(u),a.substr(a.lastIndexOf("/")+1)},l.serialize=function(u){for(var a=[],i=function(x){return!Number.isNaN(x)&&x!=null&&x!==""&&x!==!1},R=function(x){return Math.round(x)},S=function(x){return R(x/100)*100},T=function(x){return encodeURIComponent(x)},I={br:R,d:R,bl:S,dl:S,mtp:S,nor:T,rtp:S,tb:R},O=Object.keys(u||{}).sort(),_=D(O),b;!(b=_()).done;){var p=b.value,h=u[p];if(!i(h))continue;if(p==="v"&&h===1)continue;if(p=="pr"&&h===1)continue;var A=I[p];A&&(h=A(h));var E=typeof h,v=void 0;p==="ot"||p==="sf"||p==="st"?v=p+"="+h:E==="boolean"?v=p:E==="number"?v=p+"="+h:v=p+"="+JSON.stringify(h),a.push(v)}return a.join(",")},l.toHeaders=function(u){for(var a=Object.keys(u),i={},R=["Object","Request","Session","Status"],S=[{},{},{},{}],T={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},I=0,O=a;I<O.length;I++){var _=O[I],b=T[_]!=null?T[_]:1;S[b][_]=u[_]}for(var p=0;p<S.length;p++){var h=l.serialize(S[p]);h&&(i["CMCD-"+R[p]]=h)}return i},l.toQuery=function(u){return"CMCD="+encodeURIComponent(l.serialize(u))},l.appendQueryToUri=function(u,a){if(!a)return u;var i=u.includes("?")?"&":"?";return""+u+i+a},l}()},"./src/controller/eme-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),K=N("./src/utils/mediakeys-helper.ts");function H(c,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function n(c,l,d){return l&&H(c.prototype,l),d&&H(c,d),c}var D=3,y=function(l,d,o){var u={audioCapabilities:[],videoCapabilities:[]};return l.forEach(function(a){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:o.audioRobustness||""})}),d.forEach(function(a){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:o.videoRobustness||""})}),[u]},m=function(l,d,o,u){switch(l){case K.KeySystems.WIDEVINE:return y(d,o,u);default:throw new Error("Unknown key-system: "+l)}},f=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 l=c.prototype;return l.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},l._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)},l._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)},l.getLicenseServerUrl=function(o){switch(o){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},l._attemptKeySystemAccess=function(o,u,a){var i=this,R=m(o,u,a,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var S=this.requestMediaKeySystemAccess(o,R);this.mediaKeysPromise=S.then(function(T){return i._onMediaKeySystemAccessObtained(o,T)}),S.catch(function(T){M.logger.error('Failed to obtain key-system "'+o+'" access:',T)})},l._onMediaKeySystemAccessObtained=function(o,u){var a=this;M.logger.log('Access for key-system "'+o+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:o};this._mediaKeysList.push(i);var R=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(S){return i.mediaKeys=S,M.logger.log('Media-keys created for key-system "'+o+'"'),a._onMediaKeysCreated(),S});return R.catch(function(S){M.logger.error("Failed to create media-keys:",S)}),R},l._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),o._onNewMediaKeySession(u.mediaKeysSession))})},l._onNewMediaKeySession=function(o){var u=this;M.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(a){u._onKeySessionMessage(o,a.message)},!1)},l._onKeySessionMessage=function(o,u){M.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(a){M.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),o.update(a)})},l.onMediaEncrypted=function(o){var u=this;if(M.logger.log('Media is encrypted using "'+o.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:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(R){if(!u._media)return;u._attemptSetMediaKeys(R),u._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(a).catch(a)},l._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.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:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},l._generateRequestWithPreferredKeySession=function(o,u){var a=this,i=this._mediaKeysList[0];if(!i){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var R=i.mediaKeysSession;if(!R){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+o+'" init data type'),i.mediaKeysSessionInitialized=!0,R.generateRequest(o,u).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(S){M.logger.error("Error generating key-session request:",S),a.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},l._createLicenseXhr=function(o,u,a){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,o,u,a);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,i,o),R=void 0}catch(S){M.logger.error(S)}try{i.readyState||i.open("POST",o,!0),R&&R.call(this.hls,i,o)}catch(S){throw new Error("issue setting up KeySystem license XHR "+S)}return i},l._onLicenseRequestReadyStageChange=function(o,u,a,i){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var R=o.response,S=this._licenseResponseCallback;if(S)try{R=S.call(this.hls,o,u)}catch(I){M.logger.error(I)}i(R)}else{if(M.logger.error("License Request XHR failed ("+u+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=D-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(a,i)}break}},l._generateLicenseRequestChallenge=function(o,u){switch(o.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},l._requestLicense=function(o,u){M.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(a.mediaKeySystemDomain),R=this._createLicenseXhr(i,o,u);M.logger.log("Sending license request to URL: "+i);var S=this._generateLicenseRequestChallenge(a,o);R.send(S)}catch(T){M.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(o,u){if(!this._emeEnabled)return;var a=u.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var o=this._media,u=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(o,u){if(!this._emeEnabled)return;var a=u.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),i=u.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,a,i)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();z.default=f},"./src/controller/fps-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/utils/logger.ts"),M=function(){function K(n){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=n,this.registerListeners()}var H=K.prototype;return H.setStreamController=function(D){this.streamController=D},H.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},H.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},H.onMediaAttaching=function(D,y){var m=this.hls.config;if(m.capLevelOnFPSDrop){var f=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=f,f&&typeof f.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},H.checkFPS=function(D,y,m){var f=performance.now();if(y){if(this.lastTime){var c=f-this.lastTime,l=m-this.lastDroppedFrames,d=y-this.lastDecodedFrames,o=1e3*l/c,u=this.hls;if(u.trigger(V.Events.FPS_DROP,{currentDropped:l,currentDecoded:d,totalDroppedFrames:m}),o>0&&l>u.config.fpsDroppedMonitoringThreshold*d){var a=u.currentLevel;W.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=a)&&(a=a-1,u.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:u.currentLevel}),u.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=f,this.lastDroppedFrames=m,this.lastDecodedFrames=y}},H.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var y=D.getVideoPlaybackQuality();this.checkFPS(D,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},K}();z.default=M},"./src/controller/fragment-finders.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"findFragmentByPDT",function(){return M}),N.d(z,"findFragmentByPTS",function(){return K}),N.d(z,"fragmentWithinToleranceTest",function(){return H}),N.d(z,"pdtWithinToleranceTest",function(){return n}),N.d(z,"findFragWithCC",function(){return D});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/binary-search.ts");function M(y,m,f){if(m===null||!Array.isArray(y)||!y.length||!Object(V.isFiniteNumber)(m))return null;var c=y[0].programDateTime;if(m<(c||0))return null;var l=y[y.length-1].endProgramDateTime;if(m>=(l||0))return null;f=f||0;for(var d=0;d<y.length;++d){var o=y[d];if(n(m,f,o))return o}return null}function K(y,m,f,c){f===void 0&&(f=0),c===void 0&&(c=0);var l=null;if(y?l=m[y.sn-m[0].sn+1]||null:f===0&&m[0].start===0&&(l=m[0]),l&&H(f,c,l)===0)return l;var d=W.default.search(m,H.bind(null,f,c));return d||l}function H(y,m,f){y===void 0&&(y=0),m===void 0&&(m=0);var c=Math.min(m,f.duration+(f.deltaPTS?f.deltaPTS:0));return f.start+f.duration-c<=y?1:f.start-c>y&&f.start?-1:0}function n(y,m,f){var c=Math.min(m,f.duration+(f.deltaPTS?f.deltaPTS:0))*1e3,l=f.endProgramDateTime||0;return l-c>y}function D(y,m){return W.default.search(y,function(f){return f.cc<m?1:f.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"FragmentState",function(){return M}),N.d(z,"FragmentTracker",function(){return K});var V=N("./src/events.ts"),W=N("./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 K=function(){function D(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var y=D.prototype;return y._registerListeners=function(){var f=this.hls;f.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var f=this.hls;f.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(f,c){if(c===W.PlaylistLevelType.MAIN){var l=this.activeFragment,d=this.activeParts;if(!l)return null;if(d)for(var o=d.length;o--;){var u=d[o],a=u?u.end:l.appendedPTS;if(u.start<=f&&a!==void 0&&f<=a)return o>9&&(this.activeParts=d.slice(o-9)),u}else if(l.start<=f&&l.appendedPTS!==void 0&&f<=l.appendedPTS)return l}return this.getBufferedFrag(f,c)},y.getBufferedFrag=function(f,c){for(var l=this.fragments,d=Object.keys(l),o=d.length;o--;){var u=l[d[o]];if((u==null?void 0:u.body.type)===c&&u.buffered){var a=u.body;if(a.start<=f&&f<=a.end)return a}}return null},y.detectEvictedFragments=function(f,c,l){var d=this;Object.keys(this.fragments).forEach(function(o){var u=d.fragments[o];if(!u)return;if(!u.buffered){u.body.type===l&&d.removeFragment(u.body);return}var a=u.range[f];if(!a)return;a.time.some(function(i){var R=!d.isTimeBuffered(i.startPTS,i.endPTS,c);return R&&d.removeFragment(u.body),R})})},y.detectPartialFragments=function(f){var c=this,l=this.timeRanges,d=f.frag,o=f.part;if(!l||d.sn==="initSegment")return;var u=n(d),a=this.fragments[u];if(!a)return;Object.keys(l).forEach(function(i){var R=d.elementaryStreams[i];if(!R)return;var S=l[i],T=o!==null||R.partial===!0;a.range[i]=c.getBufferedTimes(d,o,T,S)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},y.fragBuffered=function(f){var c=n(f),l=this.fragments[c];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},y.getBufferedTimes=function(f,c,l,d){for(var o={time:[],partial:l},u=c?c.start:f.start,a=c?c.end:f.end,i=f.minEndPTS||a,R=f.maxStartPTS||u,S=0;S<d.length;S++){var T=d.start(S)-this.bufferPadding,I=d.end(S)+this.bufferPadding;if(R>=T&&i<=I){o.time.push({startPTS:Math.max(u,d.start(S)),endPTS:Math.min(a,d.end(S))});break}else if(u<I&&a>T)o.partial=!0,o.time.push({startPTS:Math.max(u,d.start(S)),endPTS:Math.min(a,d.end(S))});else if(a<=T)break}return o},y.getPartialFragment=function(f){var c=null,l,d,o,u=0,a=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(R){var S=i[R];if(!S)return;H(S)&&(d=S.body.start-a,o=S.body.end+a,f>=d&&f<=o&&(l=Math.min(f-d,o-f),u<=l&&(c=S.body,u=l)))}),c},y.getState=function(f){var c=n(f),l=this.fragments[c];return l?l.buffered?H(l)?M.PARTIAL:M.OK:l.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},y.backtrack=function(f,c){var l=n(f),d=this.fragments[l];if(!d||d.backtrack)return null;var o=d.backtrack=c||d.loaded;return d.loaded=null,o},y.getBacktrackData=function(f){var c=n(f),l=this.fragments[c];if(l){var d,o=l.backtrack;if(o!=null&&(d=o.payload)!==null&&d!==void 0&&d.byteLength)return o;this.removeFragment(f)}return null},y.isTimeBuffered=function(f,c,l){for(var d,o,u=0;u<l.length;u++){if(d=l.start(u)-this.bufferPadding,o=l.end(u)+this.bufferPadding,f>=d&&c<=o)return!0;if(c<=d)return!1}return!1},y.onFragLoaded=function(f,c){var l=c.frag,d=c.part;if(l.sn==="initSegment"||l.bitrateTest||d)return;var o=n(l);this.fragments[o]={body:l,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(f,c){var l=this,d=c.frag,o=c.part,u=c.timeRanges;if(d.type===W.PlaylistLevelType.MAIN)if(this.activeFragment=d,o){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(o)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(i){var R=u[i];if(l.detectEvictedFragments(i,R),!o)for(var S=0;S<R.length;S++)d.appendedPTS=Math.max(R.end(S),d.appendedPTS||0)})},y.onFragBuffered=function(f,c){this.detectPartialFragments(c)},y.hasFragment=function(f){var c=n(f);return!!this.fragments[c]},y.removeFragmentsInRange=function(f,c,l){var d=this;Object.keys(this.fragments).forEach(function(o){var u=d.fragments[o];if(!u)return;if(u.buffered){var a=u.body;a.type===l&&a.start<c&&a.end>f&&d.removeFragment(a)}})},y.removeFragment=function(f){var c=n(f);f.stats.loaded=0,f.clearElementaryStreamInfo(),delete this.fragments[c]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function H(D){var y,m;return D.buffered&&(((y=D.range.video)===null||y===void 0?void 0:y.partial)||((m=D.range.audio)===null||m===void 0?void 0:m.partial))}function n(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"STALL_MINIMUM_DURATION_MS",function(){return H}),N.d(z,"MAX_START_GAP_JUMP",function(){return n}),N.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),N.d(z,"SKIP_BUFFER_RANGE_START",function(){return y}),N.d(z,"default",function(){return m});var V=N("./src/utils/buffer-helper.ts"),W=N("./src/errors.ts"),M=N("./src/events.ts"),K=N("./src/utils/logger.ts"),H=250,n=2,D=.1,y=.05,m=function(){function f(l,d,o,u){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=l,this.media=d,this.fragmentTracker=o,this.hls=u}var c=f.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(d){var o=this.config,u=this.media,a=this.stalled,i=u.currentTime,R=u.seeking,S=this.seeking&&!R,T=!this.seeking&&R;if(this.seeking=R,i!==d){if(this.moved=!0,a!==null){if(this.stallReported){var I=self.performance.now()-a;K.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(I)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||S)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!V.BufferHelper.getBuffered(u).length)return;var O=V.BufferHelper.bufferInfo(u,i,0),_=O.len>0,b=O.nextStart||0;if(!_&&!b)return;if(R){var p=O.len>n,h=!b||b-i>n&&!this.fragmentTracker.getPartialFragment(i);if(p||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var A,E=Math.max(b,O.start||0)-i,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=v==null||((A=v.details)===null||A===void 0)?void 0:A.live,x=P?v.details.targetduration*2:n;if(E>0&&E<=x){this._trySkipBufferHole(null);return}}var C=self.performance.now();if(a===null){this.stalled=C;return}var j=C-a;!R&&j>=H&&this._reportStall(O.len);var B=V.BufferHelper.bufferInfo(u,i,o.maxBufferHole);this._tryFixBufferStall(B,j)},c._tryFixBufferStall=function(d,o){var u=this.config,a=this.fragmentTracker,i=this.media,R=i.currentTime,S=a.getPartialFragment(R);if(S){var T=this._trySkipBufferHole(S);if(T)return}d.len>u.maxBufferHole&&o>u.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(d){var o=this.hls,u=this.media,a=this.stallReported;a||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+d+")"),o.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var o=this.config,u=this.hls,a=this.media,i=a.currentTime,R=0,S=V.BufferHelper.getBuffered(a),T=0;T<S.length;T++){var I=S.start(T);if(i+o.maxBufferHole>=R&&i<I){var O=Math.max(I+y,a.currentTime+D);return K.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+O),this.moved=!0,this.stalled=null,a.currentTime=O,d&&u.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+O,frag:d}),O}R=S.end(T)}return 0},c._tryNudgeBuffer=function(){var d=this.config,o=this.hls,u=this.media,a=u.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<d.nudgeMaxRetry){var R=a+i*d.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+a+" to "+R),u.currentTime=R,o.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+d.nudgeMaxRetry+" nudges"),o.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},f}()},"./src/controller/id3-track-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/utils/texttrack-utils.ts"),M=N("./src/demux/id3.ts"),K=.25,H=function(){function n(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var D=n.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var m=this.hls;m.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var m=this.hls;m.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(m,f){this.media=f.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(W.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(m){if(!this.media)return;for(var f=0;f<m.length;f++){var c=m[f];if(c.kind==="metadata"&&c.label==="id3")return Object(W.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(m,f){if(!this.media)return;var c=f.frag,l=f.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<l.length;o++){var u=M.getID3Frames(l[o].data);if(u){var a=l[o].pts,i=o<l.length-1?l[o+1].pts:c.end,R=i-a;R<=0&&(i=a+K);for(var S=0;S<u.length;S++){var T=u[S];if(!M.isTimeStampFrame(T)){var I=new d(a,i,"");I.value=T,this.id3Track.addCue(I)}}}}},D.onBufferFlushing=function(m,f){var c=f.startOffset,l=f.endOffset,d=f.type;if(!d||d==="audio"){var o=this.id3Track;o&&Object(W.removeCuesInRange)(o,c,l)}},n}();z.default=H},"./src/controller/latency-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return n});var V=N("./src/errors.ts"),W=N("./src/events.ts"),M=N("./src/utils/logger.ts");function K(D,y){for(var m=0;m<y.length;m++){var f=y[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(D,f.key,f)}}function H(D,y,m){return y&&K(D.prototype,y),m&&K(D,m),D}var n=function(){function D(m){var f=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 f.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var y=D.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(W.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(W.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(W.Events.ERROR,this.onError)},y.onMediaAttached=function(f,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(f,c){var l=c.details;this.levelDetails=l,l.advanced&&this.timeupdate(),!l.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(f,c){if(c.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var f=this.media,c=this.levelDetails;if(!f||!c)return;this.currentTime=f.currentTime;var l=this.computeLatency();if(l===null)return;this._latency=l;var d=this.config,o=d.lowLatencyMode,u=d.maxLiveSyncPlaybackRate;if(!o||u===1)return;var a=this.targetLatency;if(a===null)return;var i=l-a,R=Math.min(this.maxLatency,a+c.targetduration),S=i<R;if(c.live&&S&&i>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,u)),I=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;f.playbackRate=Math.min(T,Math.max(1,I))}else f.playbackRate!==1&&f.playbackRate!==0&&(f.playbackRate=1)},y.estimateLiveEdge=function(){var f=this.levelDetails;return f===null?null:f.edge+f.age},y.computeLatency=function(){var f=this.estimateLiveEdge();return f===null?null:f-this.currentTime},H(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var f=this.config,c=this.levelDetails;return f.liveMaxLatencyDuration!==void 0?f.liveMaxLatencyDuration:c?f.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var f=this.levelDetails;if(f===null)return null;var c=f.holdBack,l=f.partHoldBack,d=f.targetduration,o=this.config,u=o.liveSyncDuration,a=o.liveSyncDurationCount,i=o.lowLatencyMode,R=this.hls.userConfig,S=i&&l||c;(R.liveSyncDuration||R.liveSyncDurationCount||S===0)&&(S=u!==void 0?u:a*d);var T=d,I=1;return S+Math.min(this.stallCount*I,T)}},{key:"liveSyncPosition",get:function(){var f=this.estimateLiveEdge(),c=this.targetLatency,l=this.levelDetails;if(f===null||c===null||l===null)return null;var d=l.edge,o=f-c-this.edgeStalled,u=d-l.totalduration,a=d-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(u,o),a)}},{key:"drift",get:function(){var f=this.levelDetails;return f===null?1:f.drift}},{key:"edgeStalled",get:function(){var f=this.levelDetails;if(f===null)return 0;var c=(this.config.lowLatencyMode&&f.partTarget||f.targetduration)*3;return Math.max(f.age-c,0)}},{key:"forwardBufferLength",get:function(){var f=this.media,c=this.levelDetails;if(!f||!c)return 0;var l=f.buffered.length;return l?f.buffered.end(l-1):c.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return o});var V=N("./src/types/level.ts"),W=N("./src/events.ts"),M=N("./src/errors.ts"),K=N("./src/utils/codecs.ts"),H=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),D=N("./src/types/loader.ts");function y(){return y=Object.assign||function(u){for(var a=1;a<arguments.length;a++){var i=arguments[a];for(var R in i)Object.prototype.hasOwnProperty.call(i,R)&&(u[R]=i[R])}return u},y.apply(this,arguments)}function m(u,a){for(var i=0;i<a.length;i++){var R=a[i];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(u,R.key,R)}}function f(u,a,i){return a&&m(u.prototype,a),i&&m(u,i),u}function c(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,l(u,a)}function l(u,a){return l=Object.setPrototypeOf||function(R,S){return R.__proto__=S,R},l(u,a)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(u){c(a,u);function a(R){var S;return S=u.call(this,R,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var i=a.prototype;return i._registerListeners=function(){var S=this.hls;S.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(W.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var S=this.hls;S.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),S.off(W.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},i.startLoad=function(){var S=this._levels;S.forEach(function(T){T.loadError=0}),u.prototype.startLoad.call(this)},i.onManifestLoaded=function(S,T){var I=[],O=[],_=[],b,p={},h,A=!1,E=!1,v=!1;if(T.levels.forEach(function(j){var B=j.attrs;A=A||!!(j.width&&j.height),E=E||!!j.videoCodec,v=v||!!j.audioCodec,d&&j.audioCodec&&j.audioCodec.indexOf("mp4a.40.34")!==-1&&(j.audioCodec=void 0);var w=j.bitrate+"-"+j.attrs.RESOLUTION+"-"+j.attrs.CODECS;h=p[w],h?h.url.push(j.url):(h=new V.Level(j),p[w]=h,I.push(h)),B&&(B.AUDIO&&Object(H.addGroupId)(h,"audio",B.AUDIO),B.SUBTITLES&&Object(H.addGroupId)(h,"text",B.SUBTITLES))}),(A||E)&&v&&(I=I.filter(function(j){var B=j.videoCodec,w=j.width,Y=j.height;return!!B||!!(w&&Y)})),I=I.filter(function(j){var B=j.audioCodec,w=j.videoCodec;return(!B||Object(K.isCodecSupportedInMp4)(B,"audio"))&&(!w||Object(K.isCodecSupportedInMp4)(w,"video"))}),T.audioTracks&&(O=T.audioTracks.filter(function(j){return!j.audioCodec||Object(K.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(O)),T.subtitles&&(_=T.subtitles,Object(H.assignTrackIdsByGroup)(_)),I.length>0){b=I[0].bitrate,I.sort(function(j,B){return j.bitrate-B.bitrate}),this._levels=I;for(var P=0;P<I.length;P++)if(I[P].bitrate===b){this._firstLevel=P,this.log("manifest loaded, "+I.length+" level(s) found, first bitrate: "+b);break}var x=v&&!E,C={levels:I,audioTracks:O,subtitleTracks:_,firstLevel:this._firstLevel,stats:T.stats,audio:v,video:E,altAudio:!x&&O.some(function(j){return!!j.url})};this.hls.trigger(W.Events.MANIFEST_PARSED,C),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(W.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(S,T){if(u.prototype.onError.call(this,S,T),T.fatal)return;var I=T.context,O=this._levels[this.currentLevelIndex];if(I&&(I.type===D.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&I.groupId===O.audioGroupIds[O.urlId]||I.type===D.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&I.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,b=!0,p;switch(T.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(T.frag){var h=this._levels[T.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(p=T.frag.level)):p=T.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:I&&(I.deliveryDirectives&&(b=!1),p=I.level),_=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:p=T.level,_=!0;break}p!==void 0&&this.recoverLevel(T,p,_,b)},i.recoverLevel=function(S,T,I,O){var _=S.details,b=this._levels[T];if(b.loadError++,I){var p=this.retryLoadingOrFail(S);if(p)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var h=b.url.length;if(h>1&&b.loadError<h)S.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var A=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==A&&this._levels[A].loadError===0&&(this.warn(_+": switch to "+A),S.levelRetry=!0,this.hls.nextAutoLevel=A)}}},i.redundantFailover=function(S){var T=this._levels[S],I=T.url.length;if(I>1){var O=(T.urlId+1)%I;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(_){_.urlId=O}),this.level=S}},i.onFragLoaded=function(S,T){var I=T.frag;if(I!==void 0&&I.type===D.PlaylistLevelType.MAIN){var O=this._levels[I.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},i.onLevelLoaded=function(S,T){var I,O=T.level,_=T.details,b=this._levels[O];if(!b){var p;this.warn("Invalid level index "+O),(p=T.deliveryDirectives)!==null&&p!==void 0&&p.skip&&(_.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(O,T,b.details)):(I=T.deliveryDirectives)!==null&&I!==void 0&&I.skip&&(_.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(S,T){var I=this.hls.levels[this.currentLevelIndex];if(!I)return;if(I.audioGroupIds){for(var O=-1,_=this.hls.audioTracks[T.id].groupId,b=0;b<I.audioGroupIds.length;b++)if(I.audioGroupIds[b]===_){O=b;break}O!==I.urlId&&(I.urlId=O,this.startLoad())}},i.loadPlaylist=function(S){var T=this.currentLevelIndex,I=this._levels[T];if(this.canLoad&&I&&I.url.length>0){var O=I.urlId,_=I.url[O];if(S)try{_=S.addDirectives(_)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+T+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+O+" "+_),this.clearTimer(),this.hls.trigger(W.Events.LEVEL_LOADING,{url:_,level:T,id:O,deliveryDirectives:S||null})}},i.removeLevel=function(S,T){var I=function(b,p){return p!==T},O=this._levels.filter(function(_,b){return b!==S?!0:_.url.length>1&&T!==void 0?(_.url=_.url.filter(I),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(I)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(I)),_.urlId=0,!0):!1}).map(function(_,b){var p=_.details;return p!=null&&p.fragments&&p.fragments.forEach(function(h){h.level=b}),_});this._levels=O,this.hls.trigger(W.Events.LEVELS_UPDATED,{levels:O})},f(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var T,I=this._levels;if(I.length===0)return;if(this.currentLevelIndex===S&&(T=I[S])!==null&&T!==void 0&&T.details)return;if(S<0||S>=I.length){var O=S<0;if(this.hls.trigger(W.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:O,reason:"invalid level idx"}),O)return;S=Math.min(S,I.length-1)}this.clearTimer();var _=this.currentLevelIndex,b=I[_],p=I[S];this.log("switching to level "+S+" from "+_),this.currentLevelIndex=S;var h=y({},p,{level:S,maxBitrate:p.maxBitrate,uri:p.uri,urlId:p.urlId});delete h._urlId,this.hls.trigger(W.Events.LEVEL_SWITCHING,h);var A=p.details;if(!A||A.live){var E=this.switchParams(p.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),a}(n.default)},"./src/controller/level-helper.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"addGroupId",function(){return M}),N.d(z,"assignTrackIdsByGroup",function(){return K}),N.d(z,"updatePTS",function(){return H}),N.d(z,"updateFragPTSDTS",function(){return D}),N.d(z,"mergeDetails",function(){return y}),N.d(z,"mapPartIntersection",function(){return m}),N.d(z,"mapFragmentIntersection",function(){return f}),N.d(z,"adjustSliding",function(){return c}),N.d(z,"addSliding",function(){return l}),N.d(z,"computeReloadInterval",function(){return d}),N.d(z,"getFragmentWithSN",function(){return o}),N.d(z,"getPartWith",function(){return u});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/logger.ts");function M(a,i,R){switch(i){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(R);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(R);break}}function K(a){var i={};a.forEach(function(R){var S=R.groupId||"";R.id=i[S]=i[S]||0,i[S]++})}function H(a,i,R){var S=a[i],T=a[R];n(S,T)}function n(a,i){var R=i.startPTS;if(Object(V.isFiniteNumber)(R)){var S=0,T;i.sn>a.sn?(S=R-a.start,T=a):(S=a.start-R,T=i),T.duration!==S&&(T.duration=S)}else if(i.sn>a.sn){var I=a.cc===i.cc;I&&a.minEndPTS?i.start=a.start+(a.minEndPTS-a.start):i.start=a.start+a.duration}else i.start=Math.max(a.start-i.duration,0)}function D(a,i,R,S,T,I){var O=S-R;O<=0&&(W.logger.warn("Fragment should have a positive duration",i),S=R+i.duration,I=T+i.duration);var _=R,b=S,p=i.startPTS,h=i.endPTS;if(Object(V.isFiniteNumber)(p)){var A=Math.abs(p-R);Object(V.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(A,i.deltaPTS):i.deltaPTS=A,_=Math.max(R,p),R=Math.min(R,p),T=Math.min(T,i.startDTS),b=Math.min(S,h),S=Math.max(S,h),I=Math.max(I,i.endDTS)}i.duration=S-R;var E=R-i.start;i.appendedPTS=S,i.start=i.startPTS=R,i.maxStartPTS=_,i.startDTS=T,i.endPTS=S,i.minEndPTS=b,i.endDTS=I;var v=i.sn;if(!a||v<a.startSN||v>a.endSN)return 0;var P,x=v-a.startSN,C=a.fragments;for(C[x]=i,P=x;P>0;P--)n(C[P],C[P-1]);for(P=x;P<C.length-1;P++)n(C[P],C[P+1]);return a.fragmentHint&&n(C[C.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,E}function y(a,i){for(var R=null,S=a.fragments,T=S.length-1;T>=0;T--){var I=S[T].initSegment;if(I){R=I;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,_;if(f(a,i,function(P,x){P.relurl&&(O=P.cc-x.cc),Object(V.isFiniteNumber)(P.startPTS)&&Object(V.isFiniteNumber)(P.endPTS)&&(x.start=x.startPTS=P.startPTS,x.startDTS=P.startDTS,x.appendedPTS=P.appendedPTS,x.maxStartPTS=P.maxStartPTS,x.endPTS=P.endPTS,x.endDTS=P.endDTS,x.minEndPTS=P.minEndPTS,x.duration=P.endPTS-P.startPTS,x.duration&&(_=x),i.PTSKnown=i.alignedSliding=!0),x.elementaryStreams=P.elementaryStreams,x.loader=P.loader,x.stats=P.stats,x.urlId=P.urlId,P.initSegment&&(x.initSegment=P.initSegment,R=P.initSegment)}),R){var b=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;b.forEach(function(P){var x;(!P.initSegment||P.initSegment.relurl===((x=R)===null||x===void 0?void 0:x.relurl))&&(P.initSegment=R)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(P){return!P}),i.deltaUpdateFailed)){W.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=i.skippedSegments;p--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var h=i.fragments;if(O){W.logger.warn("discontinuity sliding from playlist, take drift into account");for(var A=0;A<h.length;A++)h[A].cc+=O}i.skippedSegments&&(i.startCC=i.fragments[0].cc),m(a.partList,i.partList,function(P,x){x.elementaryStreams=P.elementaryStreams,x.stats=P.stats}),_?D(i,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):c(a,i),h.length&&(i.totalduration=i.edge-h[0].start),i.driftStartTime=a.driftStartTime,i.driftStart=a.driftStart;var E=i.advancedDateTime;if(i.advanced&&E){var v=i.edge;i.driftStart||(i.driftStartTime=E,i.driftStart=v),i.driftEndTime=E,i.driftEnd=v}else i.driftEndTime=a.driftEndTime,i.driftEnd=a.driftEnd,i.advancedDateTime=a.advancedDateTime}function m(a,i,R){if(a&&i)for(var S=0,T=0,I=a.length;T<=I;T++){var O=a[T],_=i[T+S];O&&_&&O.index===_.index&&O.fragment.sn===_.fragment.sn?R(O,_):S--}}function f(a,i,R){for(var S=i.skippedSegments,T=Math.max(a.startSN,i.startSN)-i.startSN,I=(a.fragmentHint?1:0)+(S?i.endSN:Math.min(a.endSN,i.endSN))-i.startSN,O=i.startSN-a.startSN,_=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,b=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,p=T;p<=I;p++){var h=b[O+p],A=_[p];S&&!A&&p<S&&(A=i.fragments[p]=h),h&&A&&R(h,A)}}function c(a,i){var R=i.startSN+i.skippedSegments-a.startSN,S=a.fragments;if(R<0||R>=S.length)return;l(i,S[R].start)}function l(a,i){if(i){for(var R=a.fragments,S=a.skippedSegments;S<R.length;S++)R[S].start+=i;a.fragmentHint&&(a.fragmentHint.start+=i)}}function d(a,i){var R=1e3*a.levelTargetDuration,S=R/2,T=a.age,I=T>0&&T<R*3,O=i.loading.end-i.loading.start,_,b=a.availabilityDelay;if(a.updated===!1)if(I){var p=333*a.misses;_=Math.max(Math.min(S,O*2),p),a.availabilityDelay=(a.availabilityDelay||0)+_}else _=S;else I?(b=Math.min(b||R/2,T),a.availabilityDelay=b,_=b+R-T):_=R-O;return Math.round(_)}function o(a,i,R){if(!a||!a.details)return null;var S=a.details,T=S.fragments[i-S.startSN];return T||(T=S.fragmentHint,T&&T.sn===i?T:i<S.startSN&&R&&R.sn===i?R:null)}function u(a,i,R){if(!a||!a.details)return null;var S=a.details.partList;if(S)for(var T=S.length;T--;){var I=S[T];if(I.index===R&&I.fragment.sn===i)return I}return null}},"./src/controller/stream-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return S});var V=N("./src/polyfills/number.ts"),W=N("./src/controller/base-stream-controller.ts"),M=N("./src/is-supported.ts"),K=N("./src/events.ts"),H=N("./src/utils/buffer-helper.ts"),n=N("./src/controller/fragment-tracker.ts"),D=N("./src/types/loader.ts"),y=N("./src/loader/fragment.ts"),m=N("./src/demux/transmuxer-interface.ts"),f=N("./src/types/transmuxer.ts"),c=N("./src/controller/gap-controller.ts"),l=N("./src/errors.ts"),d=N("./src/utils/logger.ts");function o(T,I){for(var O=0;O<I.length;O++){var _=I[O];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(T,_.key,_)}}function u(T,I,O){return I&&o(T.prototype,I),O&&o(T,O),T}function a(T,I){T.prototype=Object.create(I.prototype),T.prototype.constructor=T,i(T,I)}function i(T,I){return i=Object.setPrototypeOf||function(_,b){return _.__proto__=b,_},i(T,I)}var R=100,S=function(T){a(I,T);function I(_,b){var p;return p=T.call(this,_,b,"[stream-controller]")||this,p.audioCodecSwap=!1,p.gapController=null,p.level=-1,p._forceStartLoad=!1,p.altAudio=!1,p.audioOnly=!1,p.fragPlaying=null,p.onvplaying=null,p.onvseeked=null,p.fragLastKbps=0,p.stalled=!1,p.couldBacktrack=!1,p.audioCodecSwitch=!1,p.videoBuffer=null,p._registerListeners(),p}var O=I.prototype;return O._registerListeners=function(){var b=this.hls;b.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(K.Events.ERROR,this.onError,this),b.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var b=this.hls;b.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(K.Events.ERROR,this.onError,this),b.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(b){if(this.levels){var p=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var A=h.startLevel;A===-1&&(h.config.testBandwidth?(A=0,this.bitrateTest=!0):A=h.nextAutoLevel),this.level=h.nextLoadLevel=A,this.loadedmetadata=!1}p>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),b=p),this.state=W.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=W.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_LEVEL:{var b,p=this.levels,h=this.level,A=p==null||((b=p[h])===null||b===void 0)?void 0:b.details;if(A&&(!A.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(A))break;this.state=W.State.IDLE;break}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var E,v=self.performance.now(),P=this.retryDate;(!P||v>=P||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=W.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var b,p,h=this.hls,A=this.levelLastLoaded,E=this.levels,v=this.media,P=h.config,x=h.nextLoadLevel;if(A===null||!v&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[x])return;var C=E[x];this.level=h.nextLoadLevel=x;var j=C.details;if(!j||this.state===W.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==x){this.state=W.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:v,D.PlaylistLevelType.MAIN);if(B===null)return;var w=B.len,Y=this.getMaxBufferLength(C.maxBitrate);if(w>=Y)return;if(this._streamEnded(B,j)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,$),this.state=W.State.ENDED;return}var oe=B.end,de=this.getNextFragment(oe,j);if(this.couldBacktrack&&!this.fragPrevious&&de&&de.sn!=="initSegment"){var Fe=de.sn-j.startSN;Fe>1&&(de=j.fragments[Fe-1],this.fragmentTracker.removeFragment(de))}if(de&&this.fragmentTracker.getState(de)===n.FragmentState.OK&&this.nextLoadPosition>oe){var Ae=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(v,Ae,D.PlaylistLevelType.MAIN),de=this.getNextFragment(this.nextLoadPosition,j)}if(!de)return;de.initSegment&&!de.initSegment.data&&!this.bitrateTest&&(de=de.initSegment),((b=de.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((p=de.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(de,j):this.loadFragment(de,j,oe)},O.loadFragment=function(b,p,h){var A,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,T.prototype.loadFragment.call(this,b,p,h)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((A=this.media)===null||A===void 0?void 0:A.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(b){var p=this.fragmentTracker.getAppendedFrag(b,D.PlaylistLevelType.MAIN);return p&&"fragment"in p?p.fragment:p},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,p=this.media;if(p!=null&&p.readyState){var h,A=this.getAppendedFrag(p.currentTime);if(A&&A.start>1&&this.flushMainBuffer(0,A.start-1),!p.paused&&b){var E=this.hls.nextLoadLevel,v=b[E],P=this.fragLastKbps;P&&this.fragCurrent?h=this.fragCurrent.duration*v.maxBitrate/(1e3*P)+1:h=0}else h=0;var x=this.getBufferedFrag(p.currentTime+h);if(x){var C=this.followingBufferedFrag(x);if(C){this.abortCurrentFrag();var j=C.maxStartPTS?C.maxStartPTS:C.start,B=C.duration,w=Math.max(x.end,j+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(w,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===W.State.KEY_LOADING&&(this.state=W.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(b,p){T.prototype.flushMainBuffer.call(this,b,p,this.altAudio?"video":null)},O.onMediaAttached=function(b,p){T.prototype.onMediaAttached.call(this,b,p);var h=p.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,h,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),T.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var b=this.media,p=b?b.currentTime:null;Object(V.isFiniteNumber)(p)&&this.log("Media seeked to "+p.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(b,p){var h=!1,A=!1,E;p.levels.forEach(function(v){E=v.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(h=!0),E.indexOf("mp4a.40.5")!==-1&&(A=!0))}),this.audioCodecSwitch=h&&A&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=p.levels,this.startFragRequested=!1},O.onLevelLoading=function(b,p){var h=this.levels;if(!h||this.state!==W.State.IDLE)return;var A=h[p.level];(!A.details||A.details.live&&this.levelLastLoaded!==p.level||this.waitForCdnTuneIn(A.details))&&(this.state=W.State.WAITING_LEVEL)},O.onLevelLoaded=function(b,p){var h,A=this.levels,E=p.level,v=p.details,P=v.totalduration;if(!A){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+v.startSN+","+v.endSN+"], cc ["+v.startCC+", "+v.endCC+"] duration:"+P);var x=this.fragCurrent;x&&(this.state===W.State.FRAG_LOADING||this.state===W.State.FRAG_LOADING_WAITING_RETRY)&&(x.level!==p.level&&x.loader&&(this.state=W.State.IDLE,x.loader.abort()));var C=A[E],j=0;if(v.live||(h=C.details)!==null&&h!==void 0&&h.live){if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed)return;j=this.alignPlaylists(v,C.details)}if(C.details=v,this.levelLastLoaded=E,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:v,level:E}),this.state===W.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(v))return;this.state=W.State.IDLE}this.startFragRequested?v.live&&this.synchronizeToLiveEdge(v):this.setStartPosition(v,j),this.tick()},O._handleFragmentLoadProgress=function(b){var p,h=b.frag,A=b.part,E=b.payload,v=this.levels;if(!v){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var P=v[h.level],x=P.details;if(!x){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var C=P.videoCodec,j=x.PTSKnown||!x.live,B=(p=h.initSegment)===null||p===void 0?void 0:p.data,w=this._getAudioCodec(P),Y=this.transmuxer=this.transmuxer||new m.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=A?A.index:-1,oe=$!==-1,de=new f.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,E.byteLength,$,oe),Fe=this.initPTS[h.cc];Y.push(E,B,w,C,h,A,x.totalduration,j,de,Fe)},O.onAudioTrackSwitching=function(b,p){var h=this.altAudio,A=!!p.url,E=p.id;if(!A){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var v=this.fragCurrent;v!=null&&v.loader&&(this.log("Switching to main audio track, cancel main fragment load"),v.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;h&&P.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:E})}},O.onAudioTrackSwitched=function(b,p){var h=p.id,A=!!this.hls.audioTracks[h].url;if(A){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=A,this.tick()},O.onBufferCreated=function(b,p){var h=p.tracks,A,E,v=!1;for(var P in h){var x=h[P];if(x.id==="main"){if(E=P,A=x,P==="video"){var C=h[P];C&&(this.videoBuffer=C.buffer)}}else v=!0}v&&A?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=A.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(b,p){var h=p.frag,A=p.part;if(h&&h.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(A?" p: "+A.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===W.State.PARSED&&(this.state=W.State.IDLE);return}var E=A?A.stats:h.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,A)},O.onError=function(b,p){switch(p.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,p);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==W.State.ERROR&&(p.fatal?(this.warn(""+p.details),this.state=W.State.ERROR):!p.levelRetry&&this.state===W.State.WAITING_LEVEL&&(this.state=W.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="main"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var h=!0,A=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);A&&A.len>.5&&(h=!this.reduceMaxBufferLength(A.len)),h&&(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,p=this.gapController;if(!b||!p||!b.readyState)return;var h=H.BufferHelper.getBuffered(b);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):p.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=W.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(b,p){var h=p.type;if(h!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var A=(h===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(A,h,D.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(b,p){this.levels=p.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var b=this.media,p=b.currentTime,h=this.startPosition;if(h>=0&&p<h){if(b.seeking){d.logger.log("could not seek to "+h+", already seeking at "+p);return}var A=H.BufferHelper.getBuffered(b),E=A.length?A.start(0):0,v=E-h;v>0&&(v<this.config.maxBufferHole||v<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+v+" to match buffer start"),h+=v,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+p),b.currentTime=h}},O._getAudioCodec=function(b){var p=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&p&&(this.log("Swapping audio codec"),p.indexOf("mp4a.40.5")!==-1?p="mp4a.40.2":p="mp4a.40.5"),p},O._loadBitrateTestFrag=function(b){var p=this;this._doFragLoad(b).then(function(h){var A=p.hls;if(!h||A.nextLoadLevel||p.fragContextChanged(b))return;p.fragLoadError=0,p.state=W.State.IDLE,p.startFragRequested=!1,p.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),A.trigger(K.Events.FRAG_LOADED,h)})},O._handleTransmuxComplete=function(b){var p,h="main",A=this.hls,E=b.remuxResult,v=b.chunkMeta,P=this.getCurrentContext(v);if(!P){this.warn("The loading context changed while buffering fragment "+v.sn+" of level "+v.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(v.level);return}var x=P.frag,C=P.part,j=P.level,B=E.video,w=E.text,Y=E.id3,$=E.initSegment,oe=this.altAudio?void 0:E.audio;if(this.fragContextChanged(x))return;if(this.state=W.State.PARSING,$){$.tracks&&(this._bufferInitSegment(j,$.tracks,x,v),A.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:h,tracks:$.tracks}));var de=$.initPTS,Fe=$.timescale;Object(V.isFiniteNumber)(de)&&(this.initPTS[x.cc]=de,A.trigger(K.Events.INIT_PTS_FOUND,{frag:x,id:h,initPTS:de,timescale:Fe}))}if(B&&E.independent!==!1){if(j.details){var Ae=B.startPTS,Re=B.endPTS,Me=B.startDTS,Be=B.endDTS;if(C)C.elementaryStreams[B.type]={startPTS:Ae,endPTS:Re,startDTS:Me,endDTS:Be};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var pe=this.getLoadPosition()+this.config.maxBufferHole;if(pe<Ae){this.backtrack(x);return}x.setElementaryStreamInfo(B.type,x.start,Re,x.start,Be,!0)}x.setElementaryStreamInfo(B.type,Ae,Re,Me,Be),this.bufferFragmentData(B,x,C,v)}}else if(E.independent===!1){this.backtrack(x);return}if(oe){var fe=oe.startPTS,ne=oe.endPTS,xe=oe.startDTS,ce=oe.endDTS;C&&(C.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:ne,startDTS:xe,endDTS:ce}),x.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,fe,ne,xe,ce),this.bufferFragmentData(oe,x,C,v)}if(Y!=null&&(p=Y.samples)!==null&&p!==void 0&&p.length){var Pe={frag:x,id:h,samples:Y.samples};A.trigger(K.Events.FRAG_PARSING_METADATA,Pe)}if(w){var He={frag:x,id:h,samples:w.samples};A.trigger(K.Events.FRAG_PARSING_USERDATA,He)}},O._bufferInitSegment=function(b,p,h,A){var E=this;if(this.state!==W.State.PARSING)return;this.audioOnly=!!p.audio&&!p.video,this.altAudio&&!this.audioOnly&&delete p.audio;var v=p.audio,P=p.video,x=p.audiovideo;if(v){var C=b.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(C&&(C.indexOf("mp4a.40.5")!==-1?C="mp4a.40.2":C="mp4a.40.5"),v.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(C="mp4a.40.5")),j.indexOf("android")!==-1&&v.container!=="audio/mpeg"&&(C="mp4a.40.2",this.log("Android: force audio codec to "+C)),b.audioCodec&&b.audioCodec!==C&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+C+'"'),v.levelCodec=C,v.id="main",this.log("Init audio buffer, container:"+v.container+", codecs[selected/level/parsed]=["+(C||"")+"/"+(b.audioCodec||"")+"/"+v.codec+"]")}P&&(P.levelCodec=b.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+P.codec+"]")),x&&this.log("Init audiovideo buffer, container:"+x.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+x.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,p),Object.keys(p).forEach(function(B){var w=p[B],Y=w.initSegment;Y!=null&&Y.byteLength&&E.hls.trigger(K.Events.BUFFER_APPENDING,{type:B,data:Y,frag:h,part:null,chunkMeta:A,parent:h.type})}),this.tick()},O.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var p=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,p?this.resetFragmentLoading(b):this.state=W.State.BACKTRACKING},O.checkFragmentChanged=function(){var b=this.media,p=null;if(b&&b.readyState>1&&b.seeking===!1){var h=b.currentTime;if(H.BufferHelper.isBuffered(b,h)?p=this.getAppendedFrag(h):H.BufferHelper.isBuffered(b,h+.1)&&(p=this.getAppendedFrag(h+.1)),p){var A=this.fragPlaying,E=p.level;(!A||p.sn!==A.sn||A.level!==E||p.urlId!==A.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:p}),(!A||A.level!==E)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=p)}}},u(I,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var p=this.getAppendedFrag(b.currentTime);if(p)return p.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var p=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(p)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),I}(W.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"SubtitleStreamController",function(){return a});var V=N("./src/events.ts"),W=N("./src/utils/logger.ts"),M=N("./src/utils/buffer-helper.ts"),K=N("./src/controller/fragment-finders.ts"),H=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),D=N("./src/controller/fragment-tracker.ts"),y=N("./src/controller/base-stream-controller.ts"),m=N("./src/types/loader.ts"),f=N("./src/types/level.ts");function c(i,R){for(var S=0;S<R.length;S++){var T=R[S];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(i,T.key,T)}}function l(i,R,S){return R&&c(i.prototype,R),S&&c(i,S),i}function d(i,R){i.prototype=Object.create(R.prototype),i.prototype.constructor=i,o(i,R)}function o(i,R){return o=Object.setPrototypeOf||function(T,I){return T.__proto__=I,T},o(i,R)}var u=500,a=function(i){d(R,i);function R(T,I){var O;return O=i.call(this,T,I,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var S=R.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var I=this.hls;I.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),I.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),I.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),I.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),I.on(V.Events.ERROR,this.onError,this),I.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),I.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),I.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),I.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),I.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S._unregisterListeners=function(){var I=this.hls;I.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),I.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),I.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),I.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),I.off(V.Events.ERROR,this.onError,this),I.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),I.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),I.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),I.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),I.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(u),this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(I,O){this.mainDetails=O.details},S.onSubtitleFragProcessed=function(I,O){var _=O.frag,b=O.success;if(this.fragPrevious=_,this.state=y.State.IDLE,!b)return;var p=this.tracksBuffered[this.currentTrackId];if(!p)return;for(var h,A=_.start,E=0;E<p.length;E++)if(A>=p[E].start&&A<=p[E].end){h=p[E];break}var v=_.start+_.duration;h?h.end=v:(h={start:A,end:v},p.push(h)),this.fragmentTracker.fragBuffered(_)},S.onBufferFlushing=function(I,O){var _=O.startOffset,b=O.endOffset;if(_===0&&b!==Number.POSITIVE_INFINITY){var p=this.currentTrackId,h=this.levels;if(!h.length||!h[p]||!h[p].details)return;var A=h[p].details,E=A.targetduration,v=b-E;if(v<=0)return;O.endOffsetSubtitles=Math.max(0,v),this.tracksBuffered.forEach(function(P){for(var x=0;x<P.length;){if(P[x].end<=v){P.shift();continue}else if(P[x].start<v)P[x].start=v;else break;x++}}),this.fragmentTracker.removeFragmentsInRange(_,v,m.PlaylistLevelType.SUBTITLE)}},S.onError=function(I,O){var _,b=O.frag;if(!b||b.type!==m.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},S.onSubtitleTracksUpdated=function(I,O){var _=this,b=O.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(p){return new f.Level(p)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(p){_.tracksBuffered[p.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(I,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(u)},S.onSubtitleTrackLoaded=function(I,O){var _,b=O.details,p=O.id,h=this.currentTrackId,A=this.levels;if(!A.length)return;var E=A[h];if(p>=A.length||p!==h||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(_=E.details)!==null&&_!==void 0&&_.live){var v=this.mainDetails;if(b.deltaUpdateFailed||!v)return;var P=v.fragments[0];if(!E.details)b.hasProgramDateTime&&v.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(b,v):P&&Object(n.addSliding)(b,P.start);else{var x=this.alignPlaylists(b,E.details);x===0&&P&&Object(n.addSliding)(b,P.start)}}if(E.details=b,this.levelLastLoaded=p,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var C=Object(K.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);C||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},S._handleFragmentLoadComplete=function(I){var O=I.frag,_=I.payload,b=O.decryptdata,p=this.hls;if(this.fragContextChanged(O))return;if(_&&_.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),b.key.buffer,b.iv.buffer).then(function(A){var E=performance.now();p.trigger(V.Events.FRAG_DECRYPTED,{frag:O,payload:A,stats:{tstart:h,tdecrypt:E}})})}},S.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var I,O=this.currentTrackId,_=this.levels;if(!_.length||!_[O]||!_[O].details)return;var b=_[O].details,p=b.targetduration,h=this.config,A=this.media,E=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,A.currentTime-p,h.maxBufferHole),v=E.end,P=E.len,x=this.getMaxBufferLength()+p;if(P>x)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var C=b.fragments,j=C.length,B=b.edge,w,Y=this.fragPrevious;if(v<B){var $=h.maxFragLookUpTolerance;Y&&b.hasProgramDateTime&&(w=Object(K.findFragmentByPDT)(C,Y.endProgramDateTime,$)),w||(w=Object(K.findFragmentByPTS)(Y,C,v,$),!w&&Y&&Y.start<C[0].start&&(w=C[0]))}else w=C[j-1];(I=w)!==null&&I!==void 0&&I.encrypted?(W.logger.log("Loading key for "+w.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:w})):w&&this.fragmentTracker.getState(w)===D.FragmentState.NOT_LOADED&&this.loadFragment(w,b,v)}},S.loadFragment=function(I,O,_){this.fragCurrent=I,i.prototype.loadFragment.call(this,I,O,_)},l(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(y.default)},"./src/controller/subtitle-track-controller.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/utils/texttrack-utils.ts"),M=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function H(c,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function n(c,l,d){return l&&H(c.prototype,l),d&&H(c,d),c}function D(c,l){c.prototype=Object.create(l.prototype),c.prototype.constructor=c,y(c,l)}function y(c,l){return y=Object.setPrototypeOf||function(o,u){return o.__proto__=u,o},y(c,l)}var m=function(c){D(l,c);function l(o){var u;return u=c.call(this,o,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var d=l.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 u=this.hls;u.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(V.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var u=this.hls;u.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(V.Events.ERROR,this.onError,this)},d.onMediaAttached=function(u,a){if(this.media=a.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(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},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 u=f(this.media.textTracks);u.forEach(function(a){Object(W.clearCurrentCues)(a)}),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(u,a){this.tracks=a.subtitleTracks},d.onSubtitleTrackLoaded=function(u,a){var i=a.id,R=a.details,S=this.trackId,T=this.tracksInGroup[S];if(!T){this.warn("Invalid subtitle track id "+i);return}var I=T.details;T.details=a.details,this.log("subtitle track "+i+" loaded ["+R.startSN+"-"+R.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,a,I))},d.onLevelLoading=function(u,a){this.switchLevel(a.level)},d.onLevelSwitching=function(u,a){this.switchLevel(a.level)},d.switchLevel=function(u){var a=this.hls.levels[u];if(!(a!=null&&a.textGroupIds))return;var i=a.textGroupIds[a.urlId];if(this.groupId!==i){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,S=this.tracks.filter(function(O){return!i||O.groupId===i});this.tracksInGroup=S;var T=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=i;var I={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,I),T!==-1&&this.setSubtitleTrack(T,R)}},d.findTrackId=function(u){for(var a=this.tracksInGroup,i=0;i<a.length;i++){var R=a[i];if((!this.selectDefaultTrack||R.default)&&(!u||u===R.name))return R.id}return-1},d.onError=function(u,a){if(c.prototype.onError.call(this,u,a),a.fatal||!a.context)return;a.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},d.loadPlaylist=function(u){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var i=a.id,R=a.groupId,S=a.url;if(u)try{S=u.addDirectives(S)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:S,id:i,groupId:R,deliveryDirectives:u||null})}},d.toggleTrackModes=function(u){var a=this,i=this.media,R=this.subtitleDisplay,S=this.trackId;if(!i)return;var T=f(i.textTracks),I=T.filter(function(b){return b.groupId===a.groupId});if(u===-1)[].slice.call(T).forEach(function(b){b.mode="disabled"});else{var O=I[S];O&&(O.mode="disabled")}var _=I[u];_&&(_.mode=R?"showing":"hidden")},d.setSubtitleTrack=function(u,a){var i,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(i=R[u])!==null&&i!==void 0&&i.details)||u<-1||u>=R.length)return;this.clearTimer();var S=R[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,S){var T=S.id,I=S.groupId,O=I===void 0?"":I,_=S.name,b=S.type,p=S.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:O,name:_,type:b,url:p});var h=this.switchParams(S.url,a==null?void 0:a.details);this.loadPlaylist(h)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:u})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,a=f(this.media.textTracks),i=0;i<a.length;i++)if(a[i].mode==="hidden")u=i;else if(a[i].mode==="showing"){u=i;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},n(l,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,a)}}]),l}(M.default);function f(c){for(var l=[],d=0;d<c.length;d++){var o=c[d];o.kind==="subtitles"&&o.label&&l.push(c[d])}return l}z.default=m},"./src/controller/timeline-controller.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"TimelineController",function(){return f});var V=N("./src/polyfills/number.ts"),W=N("./src/events.ts"),M=N("./src/utils/cea-608-parser.ts"),K=N("./src/utils/output-filter.ts"),H=N("./src/utils/webvtt-parser.ts"),n=N("./src/utils/texttrack-utils.ts"),D=N("./src/utils/imsc1-ttml-parser.ts"),y=N("./src/types/loader.ts"),m=N("./src/utils/logger.ts"),f=function(){function o(a){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=a,this.config=a.config,this.Cues=a.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 i=new K.default(this,"textTrack1"),R=new K.default(this,"textTrack2"),S=new K.default(this,"textTrack3"),T=new K.default(this,"textTrack4");this.cea608Parser1=new M.default(1,i,R),this.cea608Parser2=new M.default(3,S,T)}a.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(W.Events.FRAG_LOADING,this.onFragLoading,this),a.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=o.prototype;return u.destroy=function(){var i=this.hls;i.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(W.Events.FRAG_LOADING,this.onFragLoading,this),i.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(i,R,S,T,I){for(var O=!1,_=I.length;_--;){var b=I[_],p=l(b[0],b[1],R,S);if(p>=0&&(b[0]=Math.min(b[0],R),b[1]=Math.max(b[1],S),O=!0,p/(S-R)>.5))return}if(O||I.push([R,S]),this.config.renderTextTracksNatively){var h=this.captionsTracks[i];this.Cues.newCue(h,R,S,T)}else{var A=this.Cues.newCue(null,R,S,T);this.hls.trigger(W.Events.CUES_PARSED,{type:"captions",cues:A,track:i})}},u.onInitPtsFound=function(i,R){var S=this,T=R.frag,I=R.id,O=R.initPTS,_=R.timescale,b=this.unparsedVttFrags;I==="main"&&(this.initPTS[T.cc]=O,this.timescale[T.cc]=_),b.length&&(this.unparsedVttFrags=[],b.forEach(function(p){S.onFragLoaded(W.Events.FRAG_LOADED,p)}))},u.getExistingTrack=function(i){var R=this.media;if(R)for(var S=0;S<R.textTracks.length;S++){var T=R.textTracks[S];if(T[i])return T}return null},u.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},u.createNativeTrack=function(i){if(this.captionsTracks[i])return;var R=this.captionsProperties,S=this.captionsTracks,T=this.media,I=R[i],O=I.label,_=I.languageCode,b=this.getExistingTrack(i);if(b)S[i]=b,Object(n.clearCurrentCues)(S[i]),Object(n.sendAddTrackEvent)(S[i],T);else{var p=this.createTextTrack("captions",O,_);p&&(p[i]=!0,S[i]=p)}},u.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var R=this.captionsProperties[i];if(!R)return;var S=R.label,T={_id:i,label:S,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[i]=T,this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},u.createTextTrack=function(i,R,S){var T=this.media;return T?T.addTextTrack(i,R,S):void 0},u.onMediaAttaching=function(i,R){this.media=R.media,this._cleanTracks()},u.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(R){Object(n.clearCurrentCues)(i[R]),delete i[R]}),this.nonNativeCaptionsTracks={}},u.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())},u._cleanTracks=function(){var i=this.media;if(!i)return;var R=i.textTracks;if(R)for(var S=0;S<R.length;S++)Object(n.clearCurrentCues)(R[S])},u.onSubtitleTracksUpdated=function(i,R){var S=this;this.textTracks=[];var T=R.subtitleTracks||[],I=T.some(function(p){return p.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||I&&this.config.enableIMSC1){var O=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(p,h){var A;if(h<_.length){for(var E=null,v=0;v<_.length;v++)if(c(_[v],p)){E=_[v];break}E&&(A=E)}A?Object(n.clearCurrentCues)(A):(A=S.createTextTrack("subtitles",p.name,p.lang),A&&(A.mode="disabled")),A&&(A.groupId=p.groupId,S.textTracks.push(A))})}else if(!O&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(p){return{label:p.name,kind:p.type.toLowerCase(),default:p.default,subtitleTrack:p}});this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},u.onManifestLoaded=function(i,R){var S=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(T){var I=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!I)return;var O="textTrack"+I[1],_=S.captionsProperties[O];if(!_)return;_.label=T.name,T.lang&&(_.languageCode=T.lang),_.media=T})},u.onFragLoading=function(i,R){var S=this.cea608Parser1,T=this.cea608Parser2,I=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(S&&T))return;if(R.frag.type===y.PlaylistLevelType.MAIN){var _,b,p=R.frag.sn,h=(_=R==null||((b=R.part)===null||b===void 0)?void 0:b.index)!=null?_:-1;p===I+1||p===I&&h===O+1||(S.reset(),T.reset()),this.lastSn=p,this.lastPartIndex=h}},u.onFragLoaded=function(i,R){var S=R.frag,T=R.payload,I=this.initPTS,O=this.unparsedVttFrags;if(S.type===y.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(V.isFiniteNumber)(I[S.cc])){O.push(R),I.length&&this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Missing initial subtitle PTS")});return}var _=S.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var b=this.tracks[S.level],p=this.vttCCs;p[S.cc]||(p[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc),b&&b.textCodec===D.IMSC1_CODEC?this._parseIMSC1(S,T):this._parseVTTs(S,T,p)}}else this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(i,R){var S=this,T=this.hls;Object(D.parseIMSC1)(R,this.initPTS[i.cc],this.timescale[i.cc],function(I){S._appendCues(I,i.level),T.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(I){m.logger.log("Failed to parse IMSC1: "+I),T.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:I})})},u._parseVTTs=function(i,R,S){var T=this,I=this.hls;Object(H.parseWebVTT)(R,this.initPTS[i.cc],this.timescale[i.cc],S,i.cc,i.start,function(O){T._appendCues(O,i.level),I.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(O){T._fallbackToIMSC1(i,R),m.logger.log("Failed to parse VTT cue: "+O),I.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:O})})},u._fallbackToIMSC1=function(i,R){var S=this,T=this.tracks[i.level];T.textCodec||Object(D.parseIMSC1)(R,this.initPTS[i.cc],this.timescale[i.cc],function(){T.textCodec=D.IMSC1_CODEC,S._parseIMSC1(i,R)},function(){T.textCodec="wvtt"})},u._appendCues=function(i,R){var S=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[R];if(T.mode==="disabled")return;i.forEach(function(_){return Object(n.addCueToTrack)(T,_)})}else{var I=this.tracks[R],O=I.default?"default":"subtitles"+R;S.trigger(W.Events.CUES_PARSED,{type:"subtitles",cues:i,track:O})}},u.onFragDecrypted=function(i,R){var S=R.frag;if(S.type===y.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[S.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(W.Events.FRAG_LOADED,R)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(i,R){var S=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(S&&T))return;for(var I=0;I<R.samples.length;I++){var O=R.samples[I].bytes;if(O){var _=this.extractCea608Data(O);S.addData(R.samples[I].pts,_[0]),T.addData(R.samples[I].pts,_[1])}}},u.onBufferFlushing=function(i,R){var S=R.startOffset,T=R.endOffset,I=R.endOffsetSubtitles,O=R.type,_=this.media;if(!_||_.currentTime<T)return;if(!O||O==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(h){return Object(n.removeCuesInRange)(b[h],S,T)})}if(this.config.renderTextTracksNatively&&(S===0&&I!==void 0)){var p=this.textTracks;Object.keys(p).forEach(function(h){return Object(n.removeCuesInRange)(p[h],S,I)})}},u.extractCea608Data=function(i){for(var R=i[0]&31,S=2,T=[[],[]],I=0;I<R;I++){var O=i[S++],_=127&i[S++],b=127&i[S++],p=(4&O)!==0,h=3&O;if(_===0&&b===0)continue;p&&((h===0||h===1)&&(T[h].push(_),T[h].push(b)))}return T},o}();function c(o,u){return o&&o.label===u.name&&!(o.textTrack1||o.textTrack2)}function l(o,u,a,i){return Math.min(u,i)-Math.max(o,a)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(K,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=H}var M=W.prototype;return M.decrypt=function(H,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,H)},W}()},"./src/crypt/aes-decryptor.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"removePadding",function(){return W}),N.d(z,"default",function(){return M});var V=N("./src/utils/typed-array.ts");function W(K){var H=K.byteLength,n=H&&new DataView(K.buffer).getUint8(H-1);return n?Object(V.sliceUint8)(K,0,H-n):K}var M=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var H=K.prototype;return H.uint8ArrayToUint32Array_=function(D){for(var y=new DataView(D),m=new Uint32Array(4),f=0;f<4;f++)m[f]=y.getUint32(f*4);return m},H.initTable=function(){var D=this.sBox,y=this.invSBox,m=this.subMix,f=m[0],c=m[1],l=m[2],d=m[3],o=this.invSubMix,u=o[0],a=o[1],i=o[2],R=o[3],S=new Uint32Array(256),T=0,I=0,O=0;for(O=0;O<256;O++)O<128?S[O]=O<<1:S[O]=O<<1^283;for(O=0;O<256;O++){var _=I^I<<1^I<<2^I<<3^I<<4;_=_>>>8^_&255^99,D[T]=_,y[_]=T;var b=S[T],p=S[b],h=S[p],A=S[_]*257^_*16843008;f[T]=A<<24|A>>>8,c[T]=A<<16|A>>>16,l[T]=A<<8|A>>>24,d[T]=A,A=h*16843009^p*65537^b*257^T*16843008,u[_]=A<<24|A>>>8,a[_]=A<<16|A>>>16,i[_]=A<<8|A>>>24,R[_]=A,T?(T=b^S[S[S[h^b]]],I^=S[S[I]]):T=I=1}},H.expandKey=function(D){for(var y=this.uint8ArrayToUint32Array_(D),m=!0,f=0;f<y.length&&m;)m=y[f]===this.key[f],f++;if(m)return;this.key=y;var c=this.keySize=y.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var l=this.ksRows=(c+6+1)*4,d,o,u=this.keySchedule=new Uint32Array(l),a=this.invKeySchedule=new Uint32Array(l),i=this.sBox,R=this.rcon,S=this.invSubMix,T=S[0],I=S[1],O=S[2],_=S[3],b,p;for(d=0;d<l;d++){if(d<c){b=u[d]=y[d];continue}p=b,d%c===0?(p=p<<8|p>>>24,p=i[p>>>24]<<24|i[p>>>16&255]<<16|i[p>>>8&255]<<8|i[p&255],p^=R[d/c|0]<<24):c>6&&d%c===4&&(p=i[p>>>24]<<24|i[p>>>16&255]<<16|i[p>>>8&255]<<8|i[p&255]),u[d]=b=(u[d-c]^p)>>>0}for(o=0;o<l;o++)d=l-o,o&3?p=u[d]:p=u[d-4],o<4||d<=4?a[o]=p:a[o]=T[i[p>>>24]]^I[i[p>>>16&255]]^O[i[p>>>8&255]]^_[i[p&255]],a[o]=a[o]>>>0},H.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},H.decrypt=function(D,y,m){for(var f=this.keySize+6,c=this.invKeySchedule,l=this.invSBox,d=this.invSubMix,o=d[0],u=d[1],a=d[2],i=d[3],R=this.uint8ArrayToUint32Array_(m),S=R[0],T=R[1],I=R[2],O=R[3],_=new Int32Array(D),b=new Int32Array(_.length),p,h,A,E,v,P,x,C,j,B,w,Y,$,oe,de=this.networkToHostOrderSwap;y<_.length;){for(j=de(_[y]),B=de(_[y+1]),w=de(_[y+2]),Y=de(_[y+3]),v=j^c[0],P=Y^c[1],x=w^c[2],C=B^c[3],$=4,oe=1;oe<f;oe++)p=o[v>>>24]^u[P>>16&255]^a[x>>8&255]^i[C&255]^c[$],h=o[P>>>24]^u[x>>16&255]^a[C>>8&255]^i[v&255]^c[$+1],A=o[x>>>24]^u[C>>16&255]^a[v>>8&255]^i[P&255]^c[$+2],E=o[C>>>24]^u[v>>16&255]^a[P>>8&255]^i[x&255]^c[$+3],v=p,P=h,x=A,C=E,$=$+4;p=l[v>>>24]<<24^l[P>>16&255]<<16^l[x>>8&255]<<8^l[C&255]^c[$],h=l[P>>>24]<<24^l[x>>16&255]<<16^l[C>>8&255]<<8^l[v&255]^c[$+1],A=l[x>>>24]<<24^l[C>>16&255]<<16^l[v>>8&255]<<8^l[P&255]^c[$+2],E=l[C>>>24]<<24^l[v>>16&255]<<16^l[P>>8&255]<<8^l[x&255]^c[$+3],b[y]=de(p^S),b[y+1]=de(E^T),b[y+2]=de(A^I),b[y+3]=de(h^O),S=j,T=B,I=w,O=Y,y=y+4}return b.buffer},K}()},"./src/crypt/decrypter.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return y});var V=N("./src/crypt/aes-crypto.ts"),W=N("./src/crypt/fast-aes-key.ts"),M=N("./src/crypt/aes-decryptor.ts"),K=N("./src/utils/logger.ts"),H=N("./src/utils/mp4-tools.ts"),n=N("./src/utils/typed-array.ts"),D=16,y=function(){function m(c,l,d){var o=d===void 0?{}:d,u=o.removePKCS7Padding,a=u===void 0?!0:u;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=l,this.removePKCS7Padding=a,a)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var f=m.prototype;return f.destroy=function(){this.observer=null},f.isSync=function(){return this.config.enableSoftwareAES},f.flush=function(){var l=this.currentResult;if(!l){this.reset();return}var d=new Uint8Array(l);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(d):d},f.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},f.decrypt=function(l,d,o,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(l),d,o);var a=this.flush();a&&u(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(l),d,o).then(u)},f.softwareDecrypt=function(l,d,o){var u=this.currentIV,a=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(l=Object(H.appendUint8Array)(i,l),this.remainderData=null);var R=this.getValidChunk(l);if(!R.length)return null;u&&(o=u);var S=this.softwareDecrypter;S||(S=this.softwareDecrypter=new M.default),S.expandKey(d);var T=a;return this.currentResult=S.decrypt(R.buffer,0,o),this.currentIV=Object(n.sliceUint8)(R,-16).buffer,T||null},f.webCryptoDecrypt=function(l,d,o){var u=this,a=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new W.default(a,d)),this.fastAesKey.expandKey().then(function(i){if(!a)return Promise.reject(new Error("web crypto not initialized"));var R=new V.default(a,o);return R.decrypt(l.buffer,i)}).catch(function(i){return u.onWebCryptoError(i,l,d,o)})},f.onWebCryptoError=function(l,d,o,u){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",l),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,o,u)},f.getValidChunk=function(l){var d=l,o=l.length-l.length%D;return o!==l.length&&(d=Object(n.sliceUint8)(l,0,o),this.remainderData=Object(n.sliceUint8)(l,o)),d},f.logOnce=function(l){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+l),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(K,H){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=H}var M=W.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},W}()},"./src/demux/aacdemuxer.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/demux/base-audio-demuxer.ts"),W=N("./src/demux/adts.ts"),M=N("./src/utils/logger.ts"),K=N("./src/demux/id3.ts");function H(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,n(y,m)}function n(y,m){return n=Object.setPrototypeOf||function(c,l){return c.__proto__=l,c},n(y,m)}var D=function(y){H(m,y);function m(c,l){var d;return d=y.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=c,d.config=l,d}var f=m.prototype;return f.resetInitSegment=function(l,d,o){y.prototype.resetInitSegment.call(this,l,d,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var d=K.getID3Data(l,0)||[],o=d.length,u=l.length;o<u;o++)if(W.probe(l,o))return M.logger.log("ADTS sync word found !"),!0;return!1},f.canParse=function(l,d){return W.canParse(l,d)},f.appendFrame=function(l,d,o){W.initTrackConfig(l,this.observer,d,o,l.manifestCodec);var u=W.appendFrame(l,d,o,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},m}(V.default);D.minProbeByteLength=9,z.default=D},"./src/demux/adts.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"getAudioConfig",function(){return K}),N.d(z,"isHeaderPattern",function(){return H}),N.d(z,"getHeaderLength",function(){return n}),N.d(z,"getFullFrameLength",function(){return D}),N.d(z,"canGetFrameLength",function(){return y}),N.d(z,"isHeader",function(){return m}),N.d(z,"canParse",function(){return f}),N.d(z,"probe",function(){return c}),N.d(z,"initTrackConfig",function(){return l}),N.d(z,"getFrameDuration",function(){return d}),N.d(z,"parseFrameHeader",function(){return o}),N.d(z,"appendFrame",function(){return u});var V=N("./src/utils/logger.ts"),W=N("./src/errors.ts"),M=N("./src/events.ts");function K(a,i,R,S){var T,I,O,_,b=navigator.userAgent.toLowerCase(),p=S,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((i[R+2]&192)>>>6)+1;var A=(i[R+2]&60)>>>2;if(A>h.length-1){a.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return O=(i[R+2]&1)<<2,O|=(i[R+3]&192)>>>6,V.logger.log("manifest codec:"+S+", ADTS type:"+T+", samplingIndex:"+A),/firefox/i.test(b)?A>=6?(T=5,_=new Array(4),I=A-3):(T=2,_=new Array(2),I=A):b.indexOf("android")!==-1?(T=2,_=new Array(2),I=A):(T=5,_=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&A>=6?I=A-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(A>=6&&O===1||/vivaldi/i.test(b))||!S&&O===1)&&(T=2,_=new Array(2)),I=A)),_[0]=T<<3,_[0]|=(A&14)>>1,_[1]|=(A&1)<<7,_[1]|=O<<3,T===5&&(_[1]|=(I&14)>>1,_[2]=(I&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:h[A],channelCount:O,codec:"mp4a.40."+T,manifestCodec:p}}function H(a,i){return a[i]===255&&(a[i+1]&246)===240}function n(a,i){return a[i+1]&1?7:9}function D(a,i){return(a[i+3]&3)<<11|a[i+4]<<3|(a[i+5]&224)>>>5}function y(a,i){return i+5<a.length}function m(a,i){return i+1<a.length&&H(a,i)}function f(a,i){return y(a,i)&&H(a,i)&&D(a,i)<=a.length-i}function c(a,i){if(m(a,i)){var R=n(a,i);if(i+R>=a.length)return!1;var S=D(a,i);if(S<=R)return!1;var T=i+S;return T===a.length||m(a,T)}return!1}function l(a,i,R,S,T){if(!a.samplerate){var I=K(i,R,S,T);if(!I)return;a.config=I.config,a.samplerate=I.samplerate,a.channelCount=I.channelCount,a.codec=I.codec,a.manifestCodec=I.manifestCodec,V.logger.log("parsed codec:"+a.codec+", rate:"+I.samplerate+", channels:"+I.channelCount)}}function d(a){return 1024*9e4/a}function o(a,i,R,S,T){var I=n(a,i),O=D(a,i);if(O-=I,O>0){var _=R+S*T;return{headerLength:I,frameLength:O,stamp:_}}}function u(a,i,R,S,T){var I=d(a.samplerate),O=o(i,R,S,T,I);if(O){var _=O.frameLength,b=O.headerLength,p=O.stamp,h=b+_,A=Math.max(0,R+h-i.length),E;A?(E=new Uint8Array(h-b),E.set(i.subarray(R+b,i.length),0)):E=i.subarray(R+b,R+h);var v={unit:E,pts:p};return A||a.samples.push(v),{sample:v,length:h,missing:A}}}},"./src/demux/base-audio-demuxer.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"initPTSFn",function(){return D});var V=N("./src/polyfills/number.ts"),W=N("./src/demux/id3.ts"),M=N("./src/demux/dummy-demuxed-track.ts"),K=N("./src/utils/mp4-tools.ts"),H=N("./src/utils/typed-array.ts"),n=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=y.prototype;return m.resetInitSegment=function(c,l,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(c,l){return!1},m.appendFrame=function(c,l,d){},m.demux=function(c,l){this.cachedData&&(c=Object(K.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=W.getID3Data(c,0),o=d?d.length:0,u,a,i=this._audioTrack,R=this._id3Track,S=d?W.getTimeStamp(d):void 0,T=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(S,l)),d&&d.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),a=this.initPTS;o<T;){if(this.canParse(c,o)){var I=this.appendFrame(i,c,o);I?(this.frameIndex++,a=I.sample.pts,o+=I.length,u=o):o=T}else W.canParse(c,o)?(d=W.getID3Data(c,o),R.samples.push({pts:a,dts:a,data:d}),o+=d.length,u=o):o++;if(o===T&&u!==T){var O=Object(H.sliceUint8)(c,u);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:i,avcTrack:Object(M.dummyTrack)(),id3Track:R,textTrack:Object(M.dummyTrack)()}},m.demuxSampleAes=function(c,l,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(c){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},m.destroy=function(){},y}(),D=function(m,f){return Object(V.isFiniteNumber)(m)?m*90:f*9e4};z.default=n},"./src/demux/chunk-cache.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function M(){this.chunks=[],this.dataLength=0}var K=M.prototype;return K.push=function(n){this.chunks.push(n),this.dataLength+=n.length},K.flush=function(){var n=this.chunks,D=this.dataLength,y;if(n.length)n.length===1?y=n[0]:y=W(n,D);else return new Uint8Array(0);return this.reset(),y},K.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function W(M,K){for(var H=new Uint8Array(K),n=0,D=0;D<M.length;D++){var y=M[D];H.set(y,n),n+=y.length}return H}},"./src/demux/dummy-demuxed-track.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"dummyTrack",function(){return V});function V(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/utils/logger.ts"),W=function(){function M(H){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=H,this.bytesAvailable=H.byteLength,this.word=0,this.bitsAvailable=0}var K=M.prototype;return K.loadWord=function(){var n=this.data,D=this.bytesAvailable,y=n.byteLength-D,m=new Uint8Array(4),f=Math.min(4,D);if(f===0)throw new Error("no bytes available");m.set(n.subarray(y,y+f)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=f*8,this.bytesAvailable-=f},K.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)},K.readBits=function(n){var D=Math.min(this.bitsAvailable,n),y=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?y<<D|this.readBits(D):y},K.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},K.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(n){for(var D=8,y=8,m,f=0;f<n;f++)y!==0&&(m=this.readEG(),y=(D+m+256)%256),D=y===0?D:y},K.readSPS=function(){var n=0,D=0,y=0,m=0,f,c,l,d=this.readUByte.bind(this),o=this.readBits.bind(this),u=this.readUEG.bind(this),a=this.readBoolean.bind(this),i=this.skipBits.bind(this),R=this.skipEG.bind(this),S=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);d();var I=d();if(o(5),i(3),d(),S(),I===100||I===110||I===122||I===244||I===44||I===83||I===86||I===118||I===128){var O=u();if(O===3&&i(1),S(),S(),i(1),a())for(c=O!==3?8:12,l=0;l<c;l++)a()&&(l<6?T(16):T(64))}S();var _=u();if(_===0)u();else if(_===1)for(i(1),R(),R(),f=u(),l=0;l<f;l++)R();S(),i(1);var b=u(),p=u(),h=o(1);h===0&&i(1),i(1),a()&&(n=u(),D=u(),y=u(),m=u());var A=[1,1];if(a()&&a()){var E=d();switch(E){case 1:A=[1,1];break;case 2:A=[12,11];break;case 3:A=[10,11];break;case 4:A=[16,11];break;case 5:A=[40,33];break;case 6:A=[24,11];break;case 7:A=[20,11];break;case 8:A=[32,11];break;case 9:A=[80,33];break;case 10:A=[18,11];break;case 11:A=[15,11];break;case 12:A=[64,33];break;case 13:A=[160,99];break;case 14:A=[4,3];break;case 15:A=[3,2];break;case 16:A=[2,1];break;case 255:{A=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((b+1)*16-n*2-D*2),height:(2-h)*(p+1)*16-(h?2:4)*(y+m),pixelRatio:A}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();z.default=W},"./src/demux/id3.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"isHeader",function(){return V}),N.d(z,"isFooter",function(){return W}),N.d(z,"getID3Data",function(){return M}),N.d(z,"canParse",function(){return H}),N.d(z,"getTimeStamp",function(){return n}),N.d(z,"isTimeStampFrame",function(){return D}),N.d(z,"getID3Frames",function(){return m}),N.d(z,"decodeFrame",function(){return f}),N.d(z,"utf8ArrayToStr",function(){return u}),N.d(z,"testables",function(){return a});var V=function(T,I){return I+10<=T.length&&(T[I]===73&&T[I+1]===68&&T[I+2]===51&&(T[I+3]<255&&T[I+4]<255&&(T[I+6]<128&&T[I+7]<128&&T[I+8]<128&&T[I+9]<128)))},W=function(T,I){return I+10<=T.length&&(T[I]===51&&T[I+1]===68&&T[I+2]===73&&(T[I+3]<255&&T[I+4]<255&&(T[I+6]<128&&T[I+7]<128&&T[I+8]<128&&T[I+9]<128)))},M=function(T,I){for(var O=I,_=0;V(T,I);){_+=10;var b=K(T,I+6);_+=b,W(T,I+10)&&(_+=10),I+=_}return _>0?T.subarray(O,O+_):void 0},K=function(T,I){var O=0;return O=(T[I]&127)<<21,O|=(T[I+1]&127)<<14,O|=(T[I+2]&127)<<7,O|=T[I+3]&127,O},H=function(T,I){return V(T,I)&&K(T,I+6)+10<=T.length-I},n=function(T){for(var I=m(T),O=0;O<I.length;O++){var _=I[O];if(D(_))return o(_)}return},D=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},y=function(T){var I=String.fromCharCode(T[0],T[1],T[2],T[3]),O=K(T,4),_=10;return{type:I,size:O,data:T.subarray(_,_+O)}},m=function(T){for(var I=0,O=[];V(T,I);){var _=K(T,I+6);I+=10;for(var b=I+_;I+8<b;){var p=y(T.subarray(I)),h=f(p);h&&O.push(h),I+=p.size+10}W(T,I)&&(I+=10)}return O},f=function(T){return T.type==="PRIV"?c(T):T.type[0]==="W"?d(T):l(T)},c=function(T){if(T.size<2)return;var I=u(T.data,!0),O=new Uint8Array(T.data.subarray(I.length+1));return{key:T.type,info:I,data:O.buffer}},l=function(T){if(T.size<2)return;if(T.type==="TXXX"){var I=1,O=u(T.data.subarray(I),!0);I+=O.length+1;var _=u(T.data.subarray(I));return{key:T.type,info:O,data:_}}var b=u(T.data.subarray(1));return{key:T.type,data:b}},d=function(T){if(T.type==="WXXX"){if(T.size<2)return;var I=1,O=u(T.data.subarray(I),!0);I+=O.length+1;var _=u(T.data.subarray(I));return{key:T.type,info:O,data:_}}var b=u(T.data);return{key:T.type,data:b}},o=function(T){if(T.data.byteLength===8){var I=new Uint8Array(T.data),O=I[3]&1,_=(I[4]<<23)+(I[5]<<15)+(I[6]<<7)+I[7];return _/=45,O&&(_+=4772185884e-2),Math.round(_)}return},u=function(T,I){I===void 0&&(I=!1);var O=R();if(O){var _=O.decode(T);if(I){var b=_.indexOf("\0");return b!==-1?_.substring(0,b):_}return _.replace(/\0/g,"")}for(var p=T.length,h,A,E,v="",P=0;P<p;){if(h=T[P++],h===0&&I)return v;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:v+=String.fromCharCode(h);break;case 12:case 13:A=T[P++],v+=String.fromCharCode((h&31)<<6|A&63);break;case 14:A=T[P++],E=T[P++],v+=String.fromCharCode((h&15)<<12|(A&63)<<6|(E&63)<<0);break;default:}}return v},a={decodeTextFrame:l},i;function R(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/demux/base-audio-demuxer.ts"),W=N("./src/demux/id3.ts"),M=N("./src/utils/logger.ts"),K=N("./src/demux/mpegaudio.ts");function H(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,n(y,m)}function n(y,m){return n=Object.setPrototypeOf||function(c,l){return c.__proto__=l,c},n(y,m)}var D=function(y){H(m,y);function m(){return y.apply(this,arguments)||this}var f=m.prototype;return f.resetInitSegment=function(l,d,o){y.prototype.resetInitSegment.call(this,l,d,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var d=W.getID3Data(l,0)||[],o=d.length,u=l.length;o<u;o++)if(K.probe(l,o))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},f.canParse=function(l,d){return K.canParse(l,d)},f.appendFrame=function(l,d,o){return this.initPTS===null?void 0:K.appendFrame(l,d,o,this.initPTS,this.frameIndex)},m}(V.default);D.minProbeByteLength=4,z.default=D},"./src/demux/mp4demuxer.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/utils/mp4-tools.ts"),W=N("./src/demux/dummy-demuxed-track.ts"),M=function(){function K(n,D){this.remainderData=null,this.config=void 0,this.config=D}var H=K.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},K.probe=function(D){return Object(V.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},H.demux=function(D){var y=D,m=Object(W.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(V.appendUint8Array)(this.remainderData,D));var f=Object(V.segmentValidRange)(y);this.remainderData=f.remainder,m.samples=f.valid||new Uint8Array}else m.samples=y;return{audioTrack:Object(W.dummyTrack)(),avcTrack:m,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},H.flush=function(){var D=Object(W.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(W.dummyTrack)(),avcTrack:D,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},H.demuxSampleAes=function(D,y,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.destroy=function(){},K}();M.minProbeByteLength=1024,z.default=M},"./src/demux/mpegaudio.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"appendFrame",function(){return n}),N.d(z,"parseHeader",function(){return D}),N.d(z,"isHeaderPattern",function(){return y}),N.d(z,"isHeader",function(){return m}),N.d(z,"canParse",function(){return f}),N.d(z,"probe",function(){return c});var V=null,W=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H=[0,1,1,4];function n(l,d,o,u,a){if(o+24>d.length)return;var i=D(d,o);if(i&&o+i.frameLength<=d.length){var R=i.samplesPerFrame*9e4/i.sampleRate,S=u+a*R,T={unit:d.subarray(o,o+i.frameLength),pts:S,dts:S};return l.config=[],l.channelCount=i.channelCount,l.samplerate=i.sampleRate,l.samples.push(T),{sample:T,length:i.frameLength,missing:0}}}function D(l,d){var o=l[d+1]>>3&3,u=l[d+1]>>1&3,a=l[d+2]>>4&15,i=l[d+2]>>2&3;if(o!==1&&a!==0&&a!==15&&i!==3){var R=l[d+2]>>1&1,S=l[d+3]>>6,T=o===3?3-u:u===3?3:4,I=W[T*14+a-1]*1e3,O=o===3?0:o===2?1:2,_=M[O*3+i],b=S===3?1:2,p=K[o][u],h=H[u],A=p*8*h,E=Math.floor(p*I/_+R)*h;if(V===null){var v=navigator.userAgent||"",P=v.match(/Chrome\/(\d+)/i);V=P?parseInt(P[1]):0}var x=!!V&&V<=87;return x&&u===2&&I>=224e3&&S===0&&(l[d+3]=l[d+3]|128),{sampleRate:_,channelCount:b,frameLength:E,samplesPerFrame:A}}}function y(l,d){return l[d]===255&&(l[d+1]&224)===224&&(l[d+1]&6)!==0}function m(l,d){return d+1<l.length&&y(l,d)}function f(l,d){var o=4;return y(l,d)&&o<=l.length-d}function c(l,d){if(d+1<l.length&&y(l,d)){var o=4,u=D(l,d),a=o;u!=null&&u.frameLength&&(a=u.frameLength);var i=d+a;return i===l.length||m(l,i)}return!1}},"./src/demux/sample-aes.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/crypt/decrypter.ts"),W=N("./src/demux/tsdemuxer.ts"),M=function(){function K(n,D,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new V.default(n,D,{removePKCS7Padding:!1})}var H=K.prototype;return H.decryptBuffer=function(D,y){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,y)},H.decryptAacSample=function(D,y,m,f){var c=D[y].unit,l=c.subarray(16,c.length-c.length%16),d=l.buffer.slice(l.byteOffset,l.byteOffset+l.length),o=this;this.decryptBuffer(d,function(u){var a=new Uint8Array(u);c.set(a,16),f||o.decryptAacSamples(D,y+1,m)})},H.decryptAacSamples=function(D,y,m){for(;;y++){if(y>=D.length){m();return}if(D[y].unit.length<32)continue;var f=this.decrypter.isSync();if(this.decryptAacSample(D,y,m,f),!f)return}},H.getAvcEncryptedData=function(D){for(var y=Math.floor((D.length-48)/160)*16+16,m=new Int8Array(y),f=0,c=32;c<=D.length-16;c+=160,f+=16)m.set(D.subarray(c,c+16),f);return m},H.getAvcDecryptedUnit=function(D,y){for(var m=new Uint8Array(y),f=0,c=32;c<=D.length-16;c+=160,f+=16)D.set(m.subarray(f,f+16),c);return D},H.decryptAvcSample=function(D,y,m,f,c,l){var d=Object(W.discardEPB)(c.data),o=this.getAvcEncryptedData(d),u=this;this.decryptBuffer(o.buffer,function(a){c.data=u.getAvcDecryptedUnit(d,a),l||u.decryptAvcSamples(D,y,m+1,f)})},H.decryptAvcSamples=function(D,y,m,f){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,m=0){if(y>=D.length){f();return}for(var c=D[y].units;!(m>=c.length);m++){var l=c[m];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(D,y,m,f,l,d),!d)return}}},K}();z.default=M},"./src/demux/transmuxer-interface.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return c});var V=N("./node_modules/webworkify-webpack/index.js"),W=N.n(V),M=N("./src/events.ts"),K=N("./src/demux/transmuxer.ts"),H=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),D=N("./src/utils/mediasource-helper.ts"),y=N("./node_modules/eventemitter3/index.js"),m=N.n(y),f=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function l(o,u,a,i){var R=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=o,this.id=u,this.onTransmuxComplete=a,this.onFlush=i;var S=o.config,T=function(p,h){h=h||{},h.frag=R.frag,h.id=R.id,o.trigger(p,h)};this.observer=new y.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,T),this.observer.on(M.Events.ERROR,T);var I={mp4:f.isTypeSupported("video/mp4"),mpeg:f.isTypeSupported("audio/mpeg"),mp3:f.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(S.enableWorker&&typeof Worker!="undefined"){H.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){o.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:I,vendor:O,id:u,config:JSON.stringify(S)})}catch(b){H.logger.warn("Error in worker:",b),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new K.default(this.observer,I,S,O,u),this.worker=null}}else this.transmuxer=new K.default(this.observer,I,S,O,u)}var d=l.prototype;return d.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},d.push=function(u,a,i,R,S,T,I,O,_,b){var p=this;_.transmuxing.start=self.performance.now();var h=this.transmuxer,A=this.worker,E=T?T.start:S.start,v=S.decryptdata,P=this.frag,x=!(P&&S.cc===P.cc),C=!(P&&_.level===P.level),j=P?_.sn-P.sn:-1,B=this.part?_.part-this.part.index:1,w=!C&&(j===1||j===0&&B===1),Y=self.performance.now();(C||j||S.stats.parsing.start===0)&&(S.stats.parsing.start=Y),T&&(B||!w)&&(T.stats.parsing.start=Y);var $=new K.TransmuxState(x,w,O,C,E);if(!w||x){H.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
|
|
discontinuity: `+x+`
|
|
trackSwitch: `+C+`
|
|
contiguous: `+w+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+E);var oe=new K.TransmuxConfig(i,R,a,I,b);this.configureTransmuxer(oe)}if(this.frag=S,this.part=T,A)A.postMessage({cmd:"demux",data:u,decryptdata:v,chunkMeta:_,state:$},u instanceof ArrayBuffer?[u]:[]);else if(h){var de=h.push(u,v,_,$);Object(K.isPromise)(de)?de.then(function(Fe){p.handleTransmuxComplete(Fe)}):this.handleTransmuxComplete(de)}},d.flush=function(u){var a=this;u.transmuxing.start=self.performance.now();var i=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:u});else if(i){var S=i.flush(u);Object(K.isPromise)(S)?S.then(function(T){a.handleFlushResult(T,u)}):this.handleFlushResult(S,u)}},d.handleFlushResult=function(u,a){var i=this;u.forEach(function(R){i.handleTransmuxComplete(R)}),this.onFlush(a)},d.onWorkerMessage=function(u){var a=u.data,i=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,i.trigger(a.event,a.data);break}}},d.configureTransmuxer=function(u){var a=this.worker,i=this.transmuxer;a?a.postMessage({cmd:"configure",config:u}):i&&i.configure(u)},d.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},l}()},"./src/demux/transmuxer-worker.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return n});var V=N("./src/demux/transmuxer.ts"),W=N("./src/events.ts"),M=N("./src/utils/logger.ts"),K=N("./node_modules/eventemitter3/index.js"),H=N.n(K);function n(c){var l=new K.EventEmitter,d=function(u,a){c.postMessage({event:u,data:a})};l.on(W.Events.FRAG_DECRYPTED,d),l.on(W.Events.ERROR,d),c.addEventListener("message",function(o){var u=o.data;switch(u.cmd){case"init":{var a=JSON.parse(u.config);c.transmuxer=new V.default(l,u.typeSupported,a,u.vendor,u.id),Object(M.enableLogs)(a.debug),d("init",null);break}case"configure":{c.transmuxer.configure(u.config);break}case"demux":{var i=c.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(V.isPromise)(i)?i.then(function(T){D(c,T)}):D(c,i);break}case"flush":{var R=u.chunkMeta,S=c.transmuxer.flush(R);Object(V.isPromise)(S)?S.then(function(T){m(c,T,R)}):m(c,S,R);break}default:break}})}function D(c,l){if(f(l.remuxResult))return;var d=[],o=l.remuxResult,u=o.audio,a=o.video;u&&y(d,u),a&&y(d,a),c.postMessage({event:"transmuxComplete",data:l},d)}function y(c,l){l.data1&&c.push(l.data1.buffer),l.data2&&c.push(l.data2.buffer)}function m(c,l,d){l.forEach(function(o){D(c,o)}),c.postMessage({event:"flush",data:d})}function f(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return a}),N.d(z,"isPromise",function(){return S}),N.d(z,"TransmuxConfig",function(){return T}),N.d(z,"TransmuxState",function(){return I});var V=N("./src/events.ts"),W=N("./src/errors.ts"),M=N("./src/crypt/decrypter.ts"),K=N("./src/demux/aacdemuxer.ts"),H=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),D=N("./src/demux/mp3demuxer.ts"),y=N("./src/remux/mp4-remuxer.ts"),m=N("./src/remux/passthrough-remuxer.ts"),f=N("./src/demux/chunk-cache.ts"),c=N("./src/utils/mp4-tools.ts"),l=N("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(O){l.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var o=[{demux:n.default,remux:y.default},{demux:H.default,remux:m.default},{demux:K.default,remux:y.default},{demux:D.default,remux:y.default}],u=1024;o.forEach(function(O){var _=O.demux;u=Math.max(u,_.minProbeByteLength)});var a=function(){function O(b,p,h,A,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 f.default,this.observer=b,this.typeSupported=p,this.config=h,this.vendor=A,this.id=E}var _=O.prototype;return _.configure=function(p){this.transmuxConfig=p,this.decrypter&&this.decrypter.reset()},_.push=function(p,h,A,E){var v=this,P=A.transmuxing;P.executeStart=d();var x=new Uint8Array(p),C=this.cache,j=this.config,B=this.currentTransmuxState,w=this.transmuxConfig;E&&(this.currentTransmuxState=E);var Y=i(x,h);if(Y&&Y.method==="AES-128"){var $=this.getDecrypter();if(j.enableSoftwareAES){var oe=$.softwareDecrypt(x,Y.key.buffer,Y.iv.buffer);if(!oe)return P.executeEnd=d(),R(A);x=new Uint8Array(oe)}else return this.decryptionPromise=$.webCryptoDecrypt(x,Y.key.buffer,Y.iv.buffer).then(function(Ve){var et=v.push(Ve,null,A);return v.decryptionPromise=null,et}),this.decryptionPromise}var de=E||B,Fe=de.contiguous,Ae=de.discontinuity,Re=de.trackSwitch,Me=de.accurateTimeOffset,Be=de.timeOffset,pe=w.audioCodec,fe=w.videoCodec,ne=w.defaultInitPts,xe=w.duration,ce=w.initSegmentData;if((Ae||Re)&&this.resetInitSegment(ce,pe,fe,xe),Ae&&this.resetInitialTimestamp(ne),Fe||this.resetContiguity(),this.needsProbing(x,Ae,Re)){if(C.dataLength){var Pe=C.flush();x=Object(c.appendUint8Array)(Pe,x)}this.configureTransmuxer(x,w)}var He=this.transmux(x,Y,Be,Me,A),ke=this.currentTransmuxState;return ke.contiguous=!0,ke.discontinuity=!1,ke.trackSwitch=!1,P.executeEnd=d(),He},_.flush=function(p){var h=this,A=p.transmuxing;A.executeStart=d();var E=this.decrypter,v=this.cache,P=this.currentTransmuxState,x=this.decryptionPromise;if(x)return x.then(function(){return h.flush(p)});var C=[],j=P.timeOffset;if(E){var B=E.flush();B&&C.push(this.push(B,null,p))}var w=v.dataLength;v.reset();var Y=this.demuxer,$=this.remuxer;if(!Y||!$)return w>=u&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),A.executeEnd=d(),[R(p)];var oe=Y.flush(j);return S(oe)?oe.then(function(de){return h.flushRemux(C,de,p),C}):(this.flushRemux(C,oe,p),C)},_.flushRemux=function(p,h,A){var E=h.audioTrack,v=h.avcTrack,P=h.id3Track,x=h.textTrack,C=this.currentTransmuxState,j=C.accurateTimeOffset,B=C.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+A.sn+(A.part>-1?" p: "+A.part:"")+" of level "+A.level);var w=this.remuxer.remux(E,v,P,x,B,j,!0,this.id);p.push({remuxResult:w,chunkMeta:A}),A.transmuxing.executeEnd=d()},_.resetInitialTimestamp=function(p){var h=this.demuxer,A=this.remuxer;if(!h||!A)return;h.resetTimeStamp(p),A.resetTimeStamp(p)},_.resetContiguity=function(){var p=this.demuxer,h=this.remuxer;if(!p||!h)return;p.resetContiguity(),h.resetNextTimestamp()},_.resetInitSegment=function(p,h,A,E){var v=this.demuxer,P=this.remuxer;if(!v||!P)return;v.resetInitSegment(h,A,E),P.resetInitSegment(p,h,A)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(p,h,A,E,v){var P;return h&&h.method==="SAMPLE-AES"?P=this.transmuxSampleAes(p,h,A,E,v):P=this.transmuxUnencrypted(p,A,E,v),P},_.transmuxUnencrypted=function(p,h,A,E){var v=this.demuxer.demux(p,h,!1,!this.config.progressive),P=v.audioTrack,x=v.avcTrack,C=v.id3Track,j=v.textTrack,B=this.remuxer.remux(P,x,C,j,h,A,!1,this.id);return{remuxResult:B,chunkMeta:E}},_.transmuxSampleAes=function(p,h,A,E,v){var P=this;return this.demuxer.demuxSampleAes(p,h,A).then(function(x){var C=P.remuxer.remux(x.audioTrack,x.avcTrack,x.id3Track,x.textTrack,A,E,!1,P.id);return{remuxResult:C,chunkMeta:v}})},_.configureTransmuxer=function(p,h){for(var A=this.config,E=this.observer,v=this.typeSupported,P=this.vendor,x=h.audioCodec,C=h.defaultInitPts,j=h.duration,B=h.initSegmentData,w=h.videoCodec,Y,$=0,oe=o.length;$<oe;$++)if(o[$].demux.probe(p)){Y=o[$];break}Y||(l.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:H.default,remux:m.default});var de=this.demuxer,Fe=this.remuxer,Ae=Y.remux,Re=Y.demux;(!Fe||!(Fe instanceof Ae))&&(this.remuxer=new Ae(E,A,v,P)),(!de||!(de instanceof Re))&&(this.demuxer=new Re(E,A,v),this.probe=Re.probe),this.resetInitSegment(B,x,w,j),this.resetInitialTimestamp(C)},_.needsProbing=function(p,h,A){return!this.demuxer||!this.remuxer||h||A},_.getDecrypter=function(){var p=this.decrypter;return p||(p=this.decrypter=new M.default(this.observer,this.config)),p},O}();function i(O,_){var b=null;return O.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(b=_),b}var R=function(_){return{remuxResult:{},chunkMeta:_}};function S(O){return"then"in O&&O.then instanceof Function}var T=function(_,b,p,h,A){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=p,this.duration=h,this.defaultInitPts=A},I=function(_,b,p,h,A){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=p,this.trackSwitch=h,this.timeOffset=A}},"./src/demux/tsdemuxer.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"discardEPB",function(){return R});var V=N("./src/demux/adts.ts"),W=N("./src/demux/mpegaudio.ts"),M=N("./src/demux/exp-golomb.ts"),K=N("./src/demux/id3.ts"),H=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),D=N("./src/utils/mp4-tools.ts"),y=N("./src/utils/logger.ts"),m=N("./src/errors.ts"),f={video:1,audio:2,id3:3,text:4},c=function(){function S(I,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=I,this.config=O,this.typeSupported=_}S.probe=function(O){var _=S.syncOffset(O);return _<0?!1:(_&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},S.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},S.createTrack=function(O,_){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:f[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?_:void 0}};var T=S.prototype;return T.resetInitSegment=function(O,_,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=S.createTrack("video",b),this._audioTrack=S.createTrack("audio",b),this._id3Track=S.createTrack("id3",b),this._txtTrack=S.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=_,this._duration=b},T.resetTimeStamp=function(){},T.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},T.demux=function(O,_,b,p){b===void 0&&(b=!1),p===void 0&&(p=!1),b||(this.sampleAes=null);var h,A=this._avcTrack,E=this._audioTrack,v=this._id3Track,P=A.pid,x=A.pesData,C=E.pid,j=v.pid,B=E.pesData,w=v.pesData,Y=!1,$=this.pmtParsed,oe=this._pmtId,de=O.length;if(this.remainderData&&(O=Object(D.appendUint8Array)(this.remainderData,O),de=O.length,this.remainderData=null),de<188&&!p)return this.remainderData=O,{audioTrack:E,avcTrack:A,id3Track:v,textTrack:this._txtTrack};var Fe=Math.max(0,S.syncOffset(O));de-=(de+Fe)%188,de<O.byteLength&&!p&&(this.remainderData=new Uint8Array(O.buffer,de,O.buffer.byteLength-de));for(var Ae=Fe;Ae<de;Ae+=188)if(O[Ae]===71){var Re=!!(O[Ae+1]&64),Me=((O[Ae+1]&31)<<8)+O[Ae+2],Be=(O[Ae+3]&48)>>4,pe=void 0;if(Be>1){if(pe=Ae+5+O[Ae+4],pe===Ae+188)continue}else pe=Ae+4;switch(Me){case P:Re&&(x&&(h=u(x))&&this.parseAVCPES(h,!1),x={data:[],size:0}),x&&(x.data.push(O.subarray(pe,Ae+188)),x.size+=Ae+188-pe);break;case C:Re&&(B&&(h=u(B))&&(E.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),B={data:[],size:0}),B&&(B.data.push(O.subarray(pe,Ae+188)),B.size+=Ae+188-pe);break;case j:Re&&(w&&(h=u(w))&&this.parseID3PES(h),w={data:[],size:0}),w&&(w.data.push(O.subarray(pe,Ae+188)),w.size+=Ae+188-pe);break;case 0:Re&&(pe+=O[pe]+1),oe=this._pmtId=d(O,pe);break;case oe:{Re&&(pe+=O[pe]+1);var fe=o(O,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);P=fe.avc,P>0&&(A.pid=P),C=fe.audio,C>0&&(E.pid=C,E.isAAC=fe.isAAC),j=fe.id3,j>0&&(v.pid=j),Y&&!$&&(y.logger.log("reparse from beginning"),Y=!1,Ae=Fe-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});A.pesData=x,E.pesData=B,v.pesData=w;var ne={audioTrack:E,avcTrack:A,id3Track:v,textTrack:this._txtTrack};return p&&this.extractRemainingSamples(ne),ne},T.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):_},T.extractRemainingSamples=function(O){var _=O.audioTrack,b=O.avcTrack,p=O.id3Track,h=b.pesData,A=_.pesData,E=p.pesData,v;h&&(v=u(h))?(this.parseAVCPES(v,!0),b.pesData=null):b.pesData=h,A&&(v=u(A))?(_.isAAC?this.parseAACPES(v):this.parseMPEGPES(v),_.pesData=null):(A!=null&&A.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=A),E&&(v=u(E))?(this.parseID3PES(v),p.pesData=null):p.pesData=E},T.demuxSampleAes=function(O,_,b){var p=this.demux(O,b,!0,!this.config.progressive),h=this.sampleAes=new H.default(this.observer,this.config,_);return this.decrypt(p,h)},T.decrypt=function(O,_){return new Promise(function(b){var p=O.audioTrack,h=O.avcTrack;p.samples&&p.isAAC?_.decryptAacSamples(p.samples,0,function(){h.samples?_.decryptAvcSamples(h.samples,0,0,function(){b(O)}):b(O)}):h.samples&&_.decryptAvcSamples(h.samples,0,0,function(){b(O)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(O,_){var b=this,p=this._avcTrack,h=this.parseAVCNALu(O.data),A=!1,E=this.avcSample,v,P=!1;O.data=null,E&&h.length&&!p.audFound&&(a(E,p),E=this.avcSample=l(!1,O.pts,O.dts,"")),h.forEach(function(x){switch(x.type){case 1:{v=!0,E||(E=b.avcSample=l(!0,O.pts,O.dts,"")),A&&(E.debug+="NDR "),E.frame=!0;var C=x.data;if(P&&C.length>4){var j=new M.default(C).readSliceType();(j===2||j===4||j===7||j===9)&&(E.key=!0)}break}case 5:v=!0,E||(E=b.avcSample=l(!0,O.pts,O.dts,"")),A&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{v=!0,A&&E&&(E.debug+="SEI ");var B=new M.default(R(x.data));B.readUByte();for(var w=0,Y=0,$=!1,oe=0;!$&&B.bytesAvailable>1;){w=0;do oe=B.readUByte(),w+=oe;while(oe===255);Y=0;do oe=B.readUByte(),Y+=oe;while(oe===255);if(w===4&&B.bytesAvailable!==0){$=!0;var de=B.readUByte();if(de===181){var Fe=B.readUShort();if(Fe===49){var Ae=B.readUInt();if(Ae===1195456820){var Re=B.readUByte();if(Re===3){for(var Me=B.readUByte(),Be=B.readUByte(),pe=31&Me,fe=[Me,Be],ne=0;ne<pe;ne++)fe.push(B.readUByte()),fe.push(B.readUByte()),fe.push(B.readUByte());i(b._txtTrack.samples,{type:3,pts:O.pts,bytes:fe})}}}}}else if(w===5&&B.bytesAvailable!==0){if($=!0,Y>16){for(var xe=[],ce=0;ce<16;ce++)xe.push(B.readUByte().toString(16)),(ce===3||ce===5||ce===7||ce===9)&&xe.push("-");for(var Pe=Y-16,He=new Uint8Array(Pe),ke=0;ke<Pe;ke++)He[ke]=B.readUByte();i(b._txtTrack.samples,{pts:O.pts,payloadType:w,uuid:xe.join(""),userData:Object(K.utf8ArrayToStr)(He),userDataBytes:He})}}else if(Y<B.bytesAvailable)for(var Ve=0;Ve<Y;Ve++)B.readUByte()}break}case 7:if(v=!0,P=!0,A&&E&&(E.debug+="SPS "),!p.sps){var et=new M.default(x.data),le=et.readSPS();p.width=le.width,p.height=le.height,p.pixelRatio=le.pixelRatio,p.sps=[x.data],p.duration=b._duration;for(var _e=x.data.subarray(1,4),Ce="avc1.",De=0;De<3;De++){var tt=_e[De].toString(16);tt.length<2&&(tt="0"+tt),Ce+=tt}p.codec=Ce}break;case 8:v=!0,A&&E&&(E.debug+="PPS "),p.pps||(p.pps=[x.data]);break;case 9:v=!1,p.audFound=!0,E&&a(E,p),E=b.avcSample=l(!1,O.pts,O.dts,A?"AUD ":"");break;case 12:v=!1;break;default:v=!1,E&&(E.debug+="unknown NAL "+x.type+" ");break}if(E&&v){var ct=E.units;ct.push(x)}}),_&&E&&(a(E,p),this.avcSample=null)},T.getLastNalUnit=function(){var O,_=this.avcSample,b;if(!_||_.units.length===0){var p=this._avcTrack.samples;_=p[p.length-1]}if((O=_)!==null&&O!==void 0&&O.units){var h=_.units;b=h[h.length-1]}return b},T.parseAVCNALu=function(O){var _=O.byteLength,b=this._avcTrack,p=b.naluState||0,h=p,A=[],E=0,v,P,x,C=-1,j=0;for(p===-1&&(C=0,j=O[0]&31,p=0,E=1);E<_;){if(v=O[E++],!p){p=v?0:1;continue}if(p===1){p=v?0:2;continue}if(!v)p=3;else if(v===1){if(C>=0){var B={data:O.subarray(C,E-p-1),type:j};A.push(B)}else{var w=this.getLastNalUnit();if(w&&(h&&E<=4-h&&(w.state&&(w.data=w.data.subarray(0,w.data.byteLength-h))),P=E-p-1,P>0)){var Y=new Uint8Array(w.data.byteLength+P);Y.set(w.data,0),Y.set(O.subarray(0,P),w.data.byteLength),w.data=Y,w.state=0}}E<_?(x=O[E]&31,C=E,j=x,p=0):p=-1}else p=0}if(C>=0&&p>=0){var $={data:O.subarray(C,_),type:j,state:p};A.push($)}if(A.length===0){var oe=this.getLastNalUnit();if(oe){var de=new Uint8Array(oe.data.byteLength+O.byteLength);de.set(oe.data,0),de.set(O,oe.data.byteLength),oe.data=de}}return b.naluState=p,A},T.parseAACPES=function(O){var _=0,b=this._audioTrack,p=this.aacOverFlow,h=O.data;if(p){this.aacOverFlow=null;var A=p.sample.unit.byteLength,E=Math.min(p.missing,A),v=A-E;p.sample.unit.set(h.subarray(0,E),v),b.samples.push(p.sample),_=p.missing}var P,x;for(P=_,x=h.length;P<x-1&&!V.isHeader(h,P);P++);if(P!==_){var C,j;if(P<x-1?(C="AAC PES did not start with ADTS header,offset:"+P,j=!1):(C="no ADTS header found in AAC PES",j=!0),y.logger.warn("parsing error:"+C),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:j,reason:C}),j)return}V.initTrackConfig(b,this.observer,h,P,this.audioCodec);var B;if(O.pts!==void 0)B=O.pts;else if(p){var w=V.getFrameDuration(b.samplerate);B=p.sample.pts+w}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;P<x;)if(V.isHeader(h,P)){if(P+5<x){var $=V.appendFrame(b,h,P,B,Y);if($)if($.missing)this.aacOverFlow=$;else{P+=$.length,Y++;continue}}break}else P++},T.parseMPEGPES=function(O){var _=O.data,b=_.length,p=0,h=0,A=O.pts;if(A===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<b;)if(W.isHeader(_,h)){var E=W.appendFrame(this._audioTrack,_,h,A,p);if(E)h+=E.length,p++;else break}else h++},T.parseID3PES=function(O){if(O.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},S}();c.minProbeByteLength=188;function l(S,T,I,O){return{key:S,frame:!1,pts:T,dts:I,units:[],debug:O,length:0}}function d(S,T){return(S[T+10]&31)<<8|S[T+11]}function o(S,T,I,O){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(S[T+1]&15)<<8|S[T+2],p=T+3+b-4,h=(S[T+10]&15)<<8|S[T+11];for(T+=12+h;T<p;){var A=(S[T+1]&31)<<8|S[T+2];switch(S[T]){case 207:if(!O){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=A);break;case 21:_.id3===-1&&(_.id3=A);break;case 219:if(!O){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=A);break;case 3:case 4:I?_.audio===-1&&(_.audio=A,_.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((S[T+3]&15)<<8|S[T+4])+5}return _}function u(S){var T=0,I,O,_,b,p,h=S.data;if(!S||S.size===0)return null;for(;h[0].length<19&&h.length>1;){var A=new Uint8Array(h[0].length+h[1].length);A.set(h[0]),A.set(h[1],h[0].length),h[0]=A,h.splice(1,1)}I=h[0];var E=(I[0]<<16)+(I[1]<<8)+I[2];if(E===1){if(O=(I[4]<<8)+I[5],O&&O>S.size-6)return null;var v=I[7];v&192&&(b=(I[9]&14)*536870912+(I[10]&255)*4194304+(I[11]&254)*16384+(I[12]&255)*128+(I[13]&254)/2,v&64?(p=(I[14]&14)*536870912+(I[15]&255)*4194304+(I[16]&254)*16384+(I[17]&255)*128+(I[18]&254)/2,b-p>60*9e4&&(y.logger.warn(Math.round((b-p)/9e4)+"s delta between PTS and DTS, align them"),b=p)):p=b),_=I[8];var P=_+9;if(S.size<=P)return null;S.size-=P;for(var x=new Uint8Array(S.size),C=0,j=h.length;C<j;C++){I=h[C];var B=I.byteLength;if(P)if(P>B){P-=B;continue}else I=I.subarray(P),B-=P,P=0;x.set(I,T),T+=B}return O&&(O-=_+3),{data:x,pts:b,dts:p,len:O}}return null}function a(S,T){if(S.units.length&&S.frame){if(S.pts===void 0){var I=T.samples,O=I.length;if(O){var _=I[O-1];S.pts=_.pts,S.dts=_.dts}else{T.dropped++;return}}T.samples.push(S)}S.debug.length&&y.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function i(S,T){var I=S.length;if(I>0){if(T.pts>=S[I-1].pts)S.push(T);else for(var O=I-1;O>=0;O--)if(T.pts<S[O].pts){S.splice(O,0,T);break}}else S.push(T)}function R(S){for(var T=S.byteLength,I=[],O=1;O<T-2;)S[O]===0&&S[O+1]===0&&S[O+2]===3?(I.push(O+2),O+=2):O++;if(I.length===0)return S;var _=T-I.length,b=new Uint8Array(_),p=0;for(O=0;O<_;p++,O++)p===I[0]&&(p++,I.shift()),b[O]=S[p];return b}z.default=c},"./src/errors.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"ErrorTypes",function(){return V}),N.d(z,"ErrorDetails",function(){return W});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 W;(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"})(W||(W={}))},"./src/events.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"Events",function(){return V});var V;(function(W){W.MEDIA_ATTACHING="hlsMediaAttaching",W.MEDIA_ATTACHED="hlsMediaAttached",W.MEDIA_DETACHING="hlsMediaDetaching",W.MEDIA_DETACHED="hlsMediaDetached",W.BUFFER_RESET="hlsBufferReset",W.BUFFER_CODECS="hlsBufferCodecs",W.BUFFER_CREATED="hlsBufferCreated",W.BUFFER_APPENDING="hlsBufferAppending",W.BUFFER_APPENDED="hlsBufferAppended",W.BUFFER_EOS="hlsBufferEos",W.BUFFER_FLUSHING="hlsBufferFlushing",W.BUFFER_FLUSHED="hlsBufferFlushed",W.MANIFEST_LOADING="hlsManifestLoading",W.MANIFEST_LOADED="hlsManifestLoaded",W.MANIFEST_PARSED="hlsManifestParsed",W.LEVEL_SWITCHING="hlsLevelSwitching",W.LEVEL_SWITCHED="hlsLevelSwitched",W.LEVEL_LOADING="hlsLevelLoading",W.LEVEL_LOADED="hlsLevelLoaded",W.LEVEL_UPDATED="hlsLevelUpdated",W.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",W.LEVELS_UPDATED="hlsLevelsUpdated",W.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",W.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",W.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",W.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",W.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",W.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",W.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",W.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",W.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",W.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",W.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",W.CUES_PARSED="hlsCuesParsed",W.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",W.INIT_PTS_FOUND="hlsInitPtsFound",W.FRAG_LOADING="hlsFragLoading",W.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",W.FRAG_LOADED="hlsFragLoaded",W.FRAG_DECRYPTED="hlsFragDecrypted",W.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",W.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",W.FRAG_PARSING_METADATA="hlsFragParsingMetadata",W.FRAG_PARSED="hlsFragParsed",W.FRAG_BUFFERED="hlsFragBuffered",W.FRAG_CHANGED="hlsFragChanged",W.FPS_DROP="hlsFpsDrop",W.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",W.ERROR="hlsError",W.DESTROYING="hlsDestroying",W.KEY_LOADING="hlsKeyLoading",W.KEY_LOADED="hlsKeyLoaded",W.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",W.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return S});var V=N("./node_modules/url-toolkit/src/url-toolkit.js"),W=N.n(V),M=N("./src/loader/playlist-loader.ts"),K=N("./src/loader/key-loader.ts"),H=N("./src/controller/id3-track-controller.ts"),n=N("./src/controller/latency-controller.ts"),D=N("./src/controller/level-controller.ts"),y=N("./src/controller/fragment-tracker.ts"),m=N("./src/controller/stream-controller.ts"),f=N("./src/is-supported.ts"),c=N("./src/utils/logger.ts"),l=N("./src/config.ts"),d=N("./node_modules/eventemitter3/index.js"),o=N.n(d),u=N("./src/events.ts"),a=N("./src/errors.ts");function i(T,I){for(var O=0;O<I.length;O++){var _=I[O];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(T,_.key,_)}}function R(T,I,O){return I&&i(T.prototype,I),O&&i(T,O),T}var S=function(){T.isSupported=function(){return Object(f.isSupported)()};function T(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(l.mergeConfig)(T.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(l.enableStreamingMode)(_);var b=_.abrController,p=_.bufferController,h=_.capLevelController,A=_.fpsController,E=this.abrController=new b(this),v=this.bufferController=new p(this),P=this.capLevelController=new h(this),x=new A(this),C=new M.default(this),j=new K.default(this),B=new H.default(this),w=this.levelController=new D.default(this),Y=new y.FragmentTracker(this),$=this.streamController=new m.default(this,Y);P.setStreamController($),x.setStreamController($);var oe=[w,$];this.networkControllers=oe;var de=[C,j,E,v,P,x,B,Y];this.audioTrackController=this.createController(_.audioTrackController,null,oe),this.createController(_.audioStreamController,Y,oe),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,oe),this.createController(_.subtitleStreamController,Y,oe),this.createController(_.timelineController,null,de),this.emeController=this.createController(_.emeController,null,de),this.cmcdController=this.createController(_.cmcdController,null,de),this.latencyController=this.createController(n.default,null,de),this.coreComponents=de}var I=T.prototype;return I.createController=function(_,b,p){if(_){var h=b?new _(this,b):new _(this);return p&&p.push(h),h}return null},I.on=function(_,b,p){p===void 0&&(p=this),this._emitter.on(_,b,p)},I.once=function(_,b,p){p===void 0&&(p=this),this._emitter.once(_,b,p)},I.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},I.off=function(_,b,p,h){p===void 0&&(p=this),this._emitter.off(_,b,p,h)},I.listeners=function(_){return this._emitter.listeners(_)},I.emit=function(_,b,p){return this._emitter.emit(_,b,p)},I.trigger=function(_,b){if(this.config.debug)return this.emit(_,_,b);try{return this.emit(_,_,b)}catch(p){c.logger.error("An internal error happened while handling event "+_+'. Error message: "'+p.message+'". Here is a stacktrace:',p),this.trigger(u.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:p})}return!1},I.listenerCount=function(_){return this._emitter.listenerCount(_)},I.destroy=function(){c.logger.log("destroy"),this.trigger(u.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},I.attachMedia=function(_){c.logger.log("attachMedia"),this._media=_,this.trigger(u.Events.MEDIA_ATTACHING,{media:_})},I.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},I.loadSource=function(_){this.stopLoad();var b=this.media,p=this.url,h=this.url=V.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});c.logger.log("loadSource:"+h),b&&p&&p!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(u.Events.MANIFEST_LOADING,{url:_})},I.startLoad=function(_){_===void 0&&(_=-1),c.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(b){b.startLoad(_)})},I.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},I.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},I.recoverMediaError=function(){c.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},I.removeLevel=function(_,b){b===void 0&&(b=0),this.levelController.removeLevel(_,b)},R(T,[{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 p=_.length,h=0;h<p;h++)if(_[h].maxBitrate>b)return h;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,b=this.autoLevelCapping,p;return b===-1&&_&&_.length?p=_.length-1:p=b,p}},{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 u.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:l.hlsDefaultConfig},set:function(_){T.defaultConfig=_}}]),T}();S.defaultConfig=void 0},"./src/is-supported.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"isSupported",function(){return M}),N.d(z,"changeTypeSupported",function(){return K});var V=N("./src/utils/mediasource-helper.ts");function W(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var H=Object(V.getMediaSource)();if(!H)return!1;var n=W(),D=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!D&&!!y}function K(){var H,n=W();return typeof(n==null||((H=n.prototype)===null||H===void 0)?void 0:H.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return c}),N.d(z,"LoadError",function(){return d});var V=N("./src/polyfills/number.ts"),W=N("./src/errors.ts");function M(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,y(o,u)}function K(o){var u=typeof Map=="function"?new Map:void 0;return K=function(i){if(i===null||!D(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(i))return u.get(i);u.set(i,R)}function R(){return H(i,arguments,m(this).constructor)}return R.prototype=Object.create(i.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),y(R,i)},K(o)}function H(o,u,a){return n()?H=Reflect.construct:H=function(R,S,T){var I=[null];I.push.apply(I,S);var O=Function.bind.apply(R,I),_=new O;return T&&y(_,T.prototype),_},H.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(o){return!1}}function D(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function y(o,u){return y=Object.setPrototypeOf||function(i,R){return i.__proto__=R,i},y(o,u)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(o)}var f=Math.pow(2,17),c=function(){function o(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var u=o.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(i,R){var S=this,T=i.url;if(!T)return Promise.reject(new d({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var I=this.config,O=I.fLoader,_=I.loader;return new Promise(function(b,p){S.loader&&S.loader.destroy();var h=S.loader=i.loader=O?new O(I):new _(I),A=l(i),E={timeout:I.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:I.fragLoadingMaxRetryTimeout,highWaterMark:f};i.stats=h.stats,h.load(A,E,{onSuccess:function(P,x,C,j){S.resetLoader(i,h),b({frag:i,part:null,payload:P.data,networkDetails:j})},onError:function(P,x,C){S.resetLoader(i,h),p(new d({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:P,networkDetails:C}))},onAbort:function(P,x,C){S.resetLoader(i,h),p(new d({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:C}))},onTimeout:function(P,x,C){S.resetLoader(i,h),p(new d({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:C}))},onProgress:function(P,x,C,j){R&&R({frag:i,part:null,payload:C,networkDetails:j})}})})},u.loadPart=function(i,R,S){var T=this;this.abort();var I=this.config,O=I.fLoader,_=I.loader;return new Promise(function(b,p){T.loader&&T.loader.destroy();var h=T.loader=i.loader=O?new O(I):new _(I),A=l(i,R),E={timeout:I.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:I.fragLoadingMaxRetryTimeout,highWaterMark:f};R.stats=h.stats,h.load(A,E,{onSuccess:function(P,x,C,j){T.resetLoader(i,h),T.updateStatsFromPart(i,R);var B={frag:i,part:R,payload:P.data,networkDetails:j};S(B),b(B)},onError:function(P,x,C){T.resetLoader(i,h),p(new d({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:R,response:P,networkDetails:C}))},onAbort:function(P,x,C){i.stats.aborted=R.stats.aborted,T.resetLoader(i,h),p(new d({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:R,networkDetails:C}))},onTimeout:function(P,x,C){T.resetLoader(i,h),p(new d({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:R,networkDetails:C}))}})})},u.updateStatsFromPart=function(i,R){var S=i.stats,T=R.stats,I=T.total;if(S.loaded+=T.loaded,I){var O=Math.round(i.duration/R.duration),_=Math.min(Math.round(S.loaded/I),O),b=O-_,p=b*Math.round(S.loaded/_);S.total=S.loaded+p}else S.total=Math.max(S.loaded,S.total);var h=S.loading,A=T.loading;h.start?h.first+=A.first-A.start:(h.start=A.start,h.first=A.first),h.end=A.end},u.resetLoader=function(i,R){i.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},o}();function l(o,u){u===void 0&&(u=null);var a=u||o,i={frag:o,part:u,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},R=a.byteRangeStartOffset,S=a.byteRangeEndOffset;return Object(V.isFiniteNumber)(R)&&Object(V.isFiniteNumber)(S)&&(i.rangeStart=R,i.rangeEnd=S),i}var d=function(o){M(u,o);function u(a){for(var i,R=arguments.length,S=new Array(R>1?R-1:0),T=1;T<R;T++)S[T-1]=arguments[T];return i=o.call.apply(o,[this].concat(S))||this,i.data=void 0,i.data=a,i}return u}(K(Error))},"./src/loader/fragment.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"ElementaryStreamTypes",function(){return c}),N.d(z,"BaseSegment",function(){return l}),N.d(z,"Fragment",function(){return d}),N.d(z,"Part",function(){return o});var V=N("./src/polyfills/number.ts"),W=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(W),K=N("./src/utils/logger.ts"),H=N("./src/loader/level-key.ts"),n=N("./src/loader/load-stats.ts");function D(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,y(u,a)}function y(u,a){return y=Object.setPrototypeOf||function(R,S){return R.__proto__=S,R},y(u,a)}function m(u,a){for(var i=0;i<a.length;i++){var R=a[i];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(u,R.key,R)}}function f(u,a,i){return a&&m(u.prototype,a),i&&m(u,i),u}var c;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(c||(c={}));var l=function(){function u(i){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[c.AUDIO]=null,R[c.VIDEO]=null,R[c.AUDIOVIDEO]=null,R),this.baseurl=i}var a=u.prototype;return a.setByteRange=function(R,S){var T=R.split("@",2),I=[];T.length===1?I[0]=S?S.byteRangeEndOffset:0:I[0]=parseInt(T[1]),I[1]=parseInt(T[0])+I[0],this._byteRange=I},f(u,[{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(W.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),u}(),d=function(u){D(a,u);function a(R,S){var T;return T=u.call(this,S)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new n.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=R,T}var i=a.prototype;return i.createInitializationVector=function(S){for(var T=new Uint8Array(16),I=12;I<16;I++)T[I]=S>>8*(15-I)&255;return T},i.setDecryptDataFromLevelKey=function(S,T){var I=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(I=H.LevelKey.fromURI(S.uri),I.method=S.method,I.iv=this.createInitializationVector(T),I.keyFormat="identity"),I},i.setElementaryStreamInfo=function(S,T,I,O,_,b){b===void 0&&(b=!1);var p=this.elementaryStreams,h=p[S];if(!h){p[S]={startPTS:T,endPTS:I,startDTS:O,endDTS:_,partial:b};return}h.startPTS=Math.min(h.startPTS,T),h.endPTS=Math.max(h.endPTS,I),h.startDTS=Math.min(h.startDTS,O),h.endDTS=Math.max(h.endDTS,_)},i.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[c.AUDIO]=null,S[c.VIDEO]=null,S[c.AUDIOVIDEO]=null},f(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var S=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),a}(l),o=function(u){D(a,u);function a(i,R,S,T,I){var O;O=u.call(this,S)||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=i.decimalFloatingPoint("DURATION"),O.gap=i.bool("GAP"),O.independent=i.bool("INDEPENDENT"),O.relurl=i.enumeratedString("URI"),O.fragment=R,O.index=T;var _=i.enumeratedString("BYTERANGE");return _&&O.setByteRange(_,I),I&&(O.fragOffset=I.fragOffset+I.duration),O}return f(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),a}(l)},"./src/loader/key-loader.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return K});var V=N("./src/events.ts"),W=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),K=function(){function H(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=H.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 y in this.loaders){var m=this.loaders[y];m&&m.destroy()}this.loaders={}},n.onKeyLoading=function(y,m){var f=m.frag,c=f.type,l=this.loaders[c];if(!f.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=f.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(l&&(M.logger.warn("abort previous key loader for type:"+c),l.abort()),!d){M.logger.warn("key uri is falsy");return}var u=o.loader,a=f.loader=this.loaders[c]=new u(o);this.decrypturl=d,this.decryptkey=null;var i={url:d,frag:f,responseType:"arraybuffer"},R={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(i,R,S)}else this.decryptkey&&(f.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:f}))},n.loadsuccess=function(y,m,f){var c=f.frag;if(!c.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(y.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:c})},n.loaderror=function(y,m){var f=m.frag,c=f.loader;c&&c.abort(),delete this.loaders[f.type],this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:f,response:y})},n.loadtimeout=function(y,m){var f=m.frag,c=f.loader;c&&c.abort(),delete this.loaders[f.type],this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:f})},H}()},"./src/loader/level-details.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"LevelDetails",function(){return H});var V=N("./src/polyfills/number.ts");function W(n,D){for(var y=0;y<D.length;y++){var m=D[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function M(n,D,y){return D&&W(n.prototype,D),y&&W(n,y),n}var K=10,H=function(){function n(y){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=y}var D=n.prototype;return D.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var f=this.lastPartSn-m.lastPartSn,c=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!c||!!f,this.advanced=this.endSN>m.endSN||f>0||f===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.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||K}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var f=this.driftEnd-this.driftStart;return f*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"LevelKey",function(){return H});var V=N("./node_modules/url-toolkit/src/url-toolkit.js"),W=N.n(V);function M(n,D){for(var y=0;y<D.length;y++){var m=D[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function K(n,D,y){return D&&M(n.prototype,D),y&&M(n,y),n}var H=function(){n.fromURL=function(y,m){return new n(y,m)},n.fromURI=function(y){return new n(y)};function n(D,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(V.buildAbsoluteURL)(D,y,{alwaysNormalize:!0}):this._uri=D}return K(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"LoadStats",function(){return V});var V=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return a});var V=N("./src/polyfills/number.ts"),W=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(W),K=N("./src/loader/fragment.ts"),H=N("./src/loader/level-details.ts"),n=N("./src/loader/level-key.ts"),D=N("./src/utils/attr-list.ts"),y=N("./src/utils/logger.ts"),m=N("./src/utils/codecs.ts"),f=/#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,l=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("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function u(I){var O,_;return o.test((O=(_=W.parseURL(I))===null||_===void 0?void 0:_.path)!=null?O:"")}var a=function(){function I(){}return I.findGroup=function(_,b){for(var p=0;p<_.length;p++){var h=_[p];if(h.id===b)return h}},I.convertAVC1ToAVCOTI=function(_){var b=_.split(".");if(b.length>2){var p=b.shift()+".";return p+=parseInt(b.shift()).toString(16),p+=("000"+parseInt(b.shift()).toString(16)).substr(-4),p}return _},I.resolve=function(_,b){return W.buildAbsoluteURL(b,_,{alwaysNormalize:!0})},I.parseMasterPlaylist=function(_,b){var p=[],h={},A=!1;f.lastIndex=0;for(var E;(E=f.exec(_))!=null;)if(E[1]){var v=new D.AttrList(E[1]),P={attrs:v,bitrate:v.decimalInteger("AVERAGE-BANDWIDTH")||v.decimalInteger("BANDWIDTH"),name:v.NAME,url:I.resolve(E[2],b)},x=v.decimalResolution("RESOLUTION");x&&(P.width=x.width,P.height=x.height),i((v.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=I.convertAVC1ToAVCOTI(P.videoCodec)),p.push(P)}else if(E[3]){var C=new D.AttrList(E[3]);C["DATA-ID"]&&(A=!0,h[C["DATA-ID"]]=C)}return{levels:p,sessionData:A?h:null}},I.parseMasterPlaylistMedia=function(_,b,p,h){h===void 0&&(h=[]);var A,E=[],v=0;for(c.lastIndex=0;(A=c.exec(_))!==null;){var P=new D.AttrList(A[1]);if(P.TYPE===p){var x={attrs:P,bitrate:0,id:v++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:p,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?I.resolve(P.URI,b):""};if(h.length){var C=I.findGroup(h,x.groupId)||h[0];R(x,C,"audioCodec"),R(x,C,"textCodec")}E.push(x)}}return E},I.parseLevelPlaylist=function(_,b,p,h,A){var E=new H.LevelDetails(b),v=E.fragments,P=null,x=0,C=0,j=0,B=0,w=null,Y=new K.Fragment(h,b),$,oe,de,Fe=-1,Ae=!1;for(l.lastIndex=0,E.m3u8=_;($=l.exec(_))!==null;){Ae&&(Ae=!1,Y=new K.Fragment(h,b),Y.start=j,Y.sn=x,Y.cc=B,Y.level=p,P&&(Y.initSegment=P,Y.rawProgramDateTime=P.rawProgramDateTime));var Re=$[1];if(Re){Y.duration=parseFloat(Re);var Me=(" "+$[2]).slice(1);Y.title=Me||null,Y.tagList.push(Me?["INF",Re,Me]:["INF",Re])}else if($[3])Object(V.isFiniteNumber)(Y.duration)&&(Y.start=j,de&&(Y.levelkey=de),Y.sn=x,Y.level=p,Y.cc=B,Y.urlId=A,v.push(Y),Y.relurl=(" "+$[3]).slice(1),T(Y,w),w=Y,j+=Y.duration,x++,C=0,Ae=!0);else if($[4]){var Be=(" "+$[4]).slice(1);w?Y.setByteRange(Be,w):Y.setByteRange(Be)}else if($[5])Y.rawProgramDateTime=(" "+$[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Fe===-1&&(Fe=v.length);else{if($=$[0].match(d),!$){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<$.length&&!(typeof $[oe]!="undefined");oe++);var pe=(" "+$[oe]).slice(1),fe=(" "+$[oe+1]).slice(1),ne=$[oe+2]?(" "+$[oe+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":E.type=fe.toUpperCase();break;case"MEDIA-SEQUENCE":x=E.startSN=parseInt(fe);break;case"SKIP":{var xe=new D.AttrList(fe),ce=xe.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(ce)){E.skippedSegments=ce;for(var Pe=ce;Pe--;)v.unshift(null);x+=ce}var He=xe.enumeratedString("RECENTLY-REMOVED-DATERANGES");He&&(E.recentlyRemovedDateranges=He.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(fe);break;case"VERSION":E.version=parseInt(fe);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(fe||ne)&&Y.tagList.push(ne?[fe,ne]:[fe]);break;case"DIS":B++;case"GAP":Y.tagList.push([pe]);break;case"BITRATE":Y.tagList.push([pe,fe]);break;case"DISCONTINUITY-SEQ":B=parseInt(fe);break;case"KEY":{var ke,Ve=new D.AttrList(fe),et=Ve.enumeratedString("METHOD"),le=Ve.URI,_e=Ve.hexadecimalInteger("IV"),Ce=Ve.enumeratedString("KEYFORMATVERSIONS"),De=Ve.enumeratedString("KEYID"),tt=(ke=Ve.enumeratedString("KEYFORMAT"))!=null?ke:"identity",ct=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ct.indexOf(tt)>-1){y.logger.warn("Keyformat "+tt+" is not supported from the manifest");continue}else if(tt!=="identity")continue;et&&(de=n.LevelKey.fromURL(b,le),le&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(et)>=0&&(de.method=et,de.keyFormat=tt,De&&(de.keyID=De),Ce&&(de.keyFormatVersions=Ce),de.iv=_e));break}case"START":{var ft=new D.AttrList(fe),ut=ft.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(ut)&&(E.startTimeOffset=ut);break}case"MAP":{var xt=new D.AttrList(fe);Y.relurl=xt.URI,xt.BYTERANGE&&Y.setByteRange(xt.BYTERANGE),Y.level=p,Y.sn="initSegment",de&&(Y.levelkey=de),Y.initSegment=null,P=Y,Ae=!0;break}case"SERVER-CONTROL":{var bt=new D.AttrList(fe);E.canBlockReload=bt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=bt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&bt.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=bt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=bt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new D.AttrList(fe);E.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Oe=E.partList;Oe||(Oe=E.partList=[]);var nt=C>0?Oe[Oe.length-1]:void 0,lt=C++,Ke=new K.Part(new D.AttrList(fe),Y,b,lt,nt);Oe.push(Ke),Y.duration+=Ke.duration;break}case"PRELOAD-HINT":{var Xe=new D.AttrList(fe);E.preloadHint=Xe;break}case"RENDITION-REPORT":{var Se=new D.AttrList(fe);E.renditionReports=E.renditionReports||[],E.renditionReports.push(Se);break}default:y.logger.warn("line parsed but not handled: "+$);break}}}w&&!w.relurl?(v.pop(),j-=w.duration,E.partList&&(E.fragmentHint=w)):E.partList&&(T(Y,w),Y.cc=B,E.fragmentHint=Y);var ge=v.length,Ee=v[0],ie=v[ge-1];if(j+=E.skippedSegments*E.targetduration,j>0&&ge&&ie){E.averagetargetduration=j/ge;var ae=ie.sn;E.endSN=ae!=="initSegment"?ae:0,Ee&&(E.startCC=Ee.cc,Ee.initSegment||E.fragments.every(function(he){return he.relurl&&u(he.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new K.Fragment(h,b),Y.relurl=ie.relurl,Y.level=p,Y.sn="initSegment",Ee.initSegment=Y,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(j+=E.fragmentHint.duration),E.totalduration=j,E.endCC=B,Fe>0&&S(v,Fe),E},I}();function i(I,O){["video","audio","text"].forEach(function(_){var b=I.filter(function(h){return Object(m.isCodecType)(h,_)});if(b.length){var p=b.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});O[_+"Codec"]=p.length>0?p[0]:b[0],I=I.filter(function(h){return b.indexOf(h)===-1})}}),O.unknownCodecs=I}function R(I,O,_){var b=O[_];b&&(I[_]=b)}function S(I,O){for(var _=I[O],b=O;b--;){var p=I[b];if(!p)return;p.programDateTime=_.programDateTime-p.duration*1e3,_=p}}function T(I,O){I.rawProgramDateTime?I.programDateTime=Date.parse(I.rawProgramDateTime):O!=null&&O.programDateTime&&(I.programDateTime=O.endProgramDateTime),Object(V.isFiniteNumber)(I.programDateTime)||(I.programDateTime=null,I.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/events.ts"),M=N("./src/errors.ts"),K=N("./src/utils/logger.ts"),H=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),D=N("./src/types/loader.ts"),y=N("./src/utils/attr-list.ts");function m(l){var d=l.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 f(l,d){var o=l.url;return(o===void 0||o.indexOf("data:")===0)&&(o=d.url),o}var c=function(){function l(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var d=l.prototype;return d.registerListeners=function(){var u=this.hls;u.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var u=this.hls;u.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(u){var a=this.hls.config,i=a.pLoader,R=a.loader,S=i||R,T=new S(a);return u.loader=T,this.loaders[u.type]=T,T},d.getInternalLoader=function(u){return this.loaders[u.type]},d.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},d.destroyInternalLoaders=function(){for(var u in this.loaders){var a=this.loaders[u];a&&a.destroy(),this.resetInternalLoader(u)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(u,a){var i=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},d.onLevelLoading=function(u,a){var i=a.id,R=a.level,S=a.url,T=a.deliveryDirectives;this.load({id:i,groupId:null,level:R,responseType:"text",type:D.PlaylistContextType.LEVEL,url:S,deliveryDirectives:T})},d.onAudioTrackLoading=function(u,a){var i=a.id,R=a.groupId,S=a.url,T=a.deliveryDirectives;this.load({id:i,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(u,a){var i=a.id,R=a.groupId,S=a.url,T=a.deliveryDirectives;this.load({id:i,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:T})},d.load=function(u){var a,i=this.hls.config,R=this.getInternalLoader(u);if(R){var S=R.context;if(S&&S.url===u.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),R.abort()}var T,I,O,_;switch(u.type){case D.PlaylistContextType.MANIFEST:T=i.manifestLoadingMaxRetry,I=i.manifestLoadingTimeOut,O=i.manifestLoadingRetryDelay,_=i.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:T=0,I=i.levelLoadingTimeOut;break;default:T=i.levelLoadingMaxRetry,I=i.levelLoadingTimeOut,O=i.levelLoadingRetryDelay,_=i.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(u),(a=u.deliveryDirectives)!==null&&a!==void 0&&a.part){var b;if(u.type===D.PlaylistContextType.LEVEL&&u.level!==null?b=this.hls.levels[u.level].details:u.type===D.PlaylistContextType.AUDIO_TRACK&&u.id!==null?b=this.hls.audioTracks[u.id].details:u.type===D.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(b=this.hls.subtitleTracks[u.id].details),b){var p=b.partTarget,h=b.targetduration;p&&h&&(I=Math.min(Math.max(p*3,h*.8)*1e3,I))}}var A={timeout:I,maxRetry:T,retryDelay:O,maxRetryDelay:_,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(u,A,E)},d.loadsuccess=function(u,a,i,R){if(R===void 0&&(R=null),i.isSidxRequest){this.handleSidxRequest(u,i),this.handlePlaylistLoaded(u,a,i,R);return}this.resetInternalLoader(i.type);var S=u.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,i,"no EXTM3U delimiter",R);return}a.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,a,i,R):this.handleMasterPlaylist(u,a,i,R)},d.loaderror=function(u,a,i){i===void 0&&(i=null),this.handleNetworkError(a,i,!1,u)},d.loadtimeout=function(u,a,i){i===void 0&&(i=null),this.handleNetworkError(a,i,!0)},d.handleMasterPlaylist=function(u,a,i,R){var S=this.hls,T=u.data,I=f(u,i),O=n.default.parseMasterPlaylist(T,I),_=O.levels,b=O.sessionData;if(!_.length){this.handleManifestParsingError(u,i,"no level found in manifest",R);return}var p=_.map(function(x){return{id:x.attrs.AUDIO,audioCodec:x.audioCodec}}),h=_.map(function(x){return{id:x.attrs.SUBTITLES,textCodec:x.textCodec}}),A=n.default.parseMasterPlaylistMedia(T,I,"AUDIO",p),E=n.default.parseMasterPlaylistMedia(T,I,"SUBTITLES",h),v=n.default.parseMasterPlaylistMedia(T,I,"CLOSED-CAPTIONS");if(A.length){var P=A.some(function(x){return!x.url});!P&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),A.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}S.trigger(W.Events.MANIFEST_LOADED,{levels:_,audioTracks:A,subtitles:E,captions:v,url:I,stats:a,networkDetails:R,sessionData:b})},d.handleTrackOrLevelPlaylist=function(u,a,i,R){var S=this.hls,T=i.id,I=i.level,O=i.type,_=f(u,i),b=Object(V.isFiniteNumber)(T)?T:0,p=Object(V.isFiniteNumber)(I)?I:b,h=m(i),A=n.default.parseLevelPlaylist(u.data,_,p,h,b);if(!A.fragments.length){S.trigger(W.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(O===D.PlaylistContextType.MANIFEST){var E={attrs:new y.AttrList({}),bitrate:0,details:A,name:"",url:_};S.trigger(W.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:_,stats:a,networkDetails:R,sessionData:null})}if(a.parsing.end=performance.now(),A.needSidxRanges){var v,P=(v=A.fragments[0].initSegment)===null||v===void 0?void 0:v.url;this.load({url:P,isSidxRequest:!0,type:O,level:I,levelDetails:A,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=A,this.handlePlaylistLoaded(u,a,i,R)},d.handleSidxRequest=function(u,a){var i=Object(H.parseSegmentIndex)(new Uint8Array(u.data));if(!i)return;var R=i.references,S=a.levelDetails;R.forEach(function(T,I){var O=T.info,_=S.fragments[I];_.byteRange.length===0&&_.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),_.initSegment&&_.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(u,a,i,R){this.hls.trigger(W.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===D.PlaylistContextType.MANIFEST,url:u.url,reason:i,response:u,context:a,networkDetails:R})},d.handleNetworkError=function(u,a,i,R){i===void 0&&(i=!1),K.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var S=M.ErrorDetails.UNKNOWN,T=!1,I=this.getInternalLoader(u);switch(u.type){case D.PlaylistContextType.MANIFEST:S=i?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case D.PlaylistContextType.LEVEL:S=i?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.AUDIO_TRACK:S=i?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:S=i?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}I&&this.resetInternalLoader(u.type);var O={type:M.ErrorTypes.NETWORK_ERROR,details:S,fatal:T,url:u.url,loader:I,context:u,networkDetails:a};R&&(O.response=R),this.hls.trigger(W.Events.ERROR,O)},d.handlePlaylistLoaded=function(u,a,i,R){var S=i.type,T=i.level,I=i.id,O=i.groupId,_=i.loader,b=i.levelDetails,p=i.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(u,i,"invalid target duration",R);return}if(!_)return;b.live&&(_.getCacheAge&&(b.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(S){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(W.Events.LEVEL_LOADED,{details:b,level:T||0,id:I||0,stats:a,networkDetails:R,deliveryDirectives:p});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(W.Events.AUDIO_TRACK_LOADED,{details:b,id:I||0,groupId:O||"",stats:a,networkDetails:R,deliveryDirectives:p});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADED,{details:b,id:I||0,groupId:O||"",stats:a,networkDetails:R,deliveryDirectives:p});break}},l}();z.default=c},"./src/polyfills/number.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"isFiniteNumber",function(){return V}),N.d(z,"MAX_SAFE_INTEGER",function(){return W});var V=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},W=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,z,N){"use strict";N.r(z);var V=function(){function W(){}return W.getSilentFrame=function(K,H){switch(K){case"mp4a.40.2":if(H===1)return new Uint8Array([0,200,0,128,35,128]);if(H===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(H===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(H===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(H===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(H===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(H===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(H===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(H===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},W}();z.default=V},"./src/remux/mp4-generator.ts":function(Z,z,N){"use strict";N.r(z);var V=Math.pow(2,32)-1,W=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 H;for(H in M.types)M.types.hasOwnProperty(H)&&(M.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.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 y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=m,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 f=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,f,l,f,c),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,y))},M.box=function(H){for(var n=8,D=arguments.length,y=new Array(D>1?D-1:0),m=1;m<D;m++)y[m-1]=arguments[m];for(var f=y.length,c=f;f--;)n+=y[f].byteLength;var l=new Uint8Array(n);for(l[0]=n>>24&255,l[1]=n>>16&255,l[2]=n>>8&255,l[3]=n&255,l.set(H,4),f=0,n=8;f<c;f++)l.set(y[f],n),n+=y[f].byteLength;return l},M.hdlr=function(H){return M.box(M.types.hdlr,M.HDLR_TYPES[H])},M.mdat=function(H){return M.box(M.types.mdat,H)},M.mdhd=function(H,n){n*=H;var D=Math.floor(n/(V+1)),y=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,H>>24&255,H>>16&255,H>>8&255,H&255,D>>24,D>>16&255,D>>8&255,D&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},M.mdia=function(H){return M.box(M.types.mdia,M.mdhd(H.timescale,H.duration),M.hdlr(H.type),M.minf(H))},M.mfhd=function(H){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},M.minf=function(H){return H.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(H)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(H))},M.moof=function(H,n,D){return M.box(M.types.moof,M.mfhd(H),M.traf(D,n))},M.moov=function(H){for(var n=H.length,D=[];n--;)D[n]=M.trak(H[n]);return M.box.apply(null,[M.types.moov,M.mvhd(H[0].timescale,H[0].duration)].concat(D).concat(M.mvex(H)))},M.mvex=function(H){for(var n=H.length,D=[];n--;)D[n]=M.trex(H[n]);return M.box.apply(null,[M.types.mvex].concat(D))},M.mvhd=function(H,n){n*=H;var D=Math.floor(n/(V+1)),y=Math.floor(n%(V+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,D>>24,D>>16&255,D>>8&255,D&255,y>>24,y>>16&255,y>>8&255,y&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,m)},M.sdtp=function(H){var n=H.samples||[],D=new Uint8Array(4+n.length),y,m;for(y=0;y<n.length;y++)m=n[y].flags,D[y+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return M.box(M.types.sdtp,D)},M.stbl=function(H){return M.box(M.types.stbl,M.stsd(H),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(H){var n=[],D=[],y,m,f;for(y=0;y<H.sps.length;y++)m=H.sps[y],f=m.byteLength,n.push(f>>>8&255),n.push(f&255),n=n.concat(Array.prototype.slice.call(m));for(y=0;y<H.pps.length;y++)m=H.pps[y],f=m.byteLength,D.push(f>>>8&255),D.push(f&255),D=D.concat(Array.prototype.slice.call(m));var c=M.box(M.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|H.sps.length].concat(n).concat([H.pps.length]).concat(D))),l=H.width,d=H.height,o=H.pixelRatio[0],u=H.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,l>>8&255,l&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([o>>24,o>>16&255,o>>8&255,o&255,u>>24,u>>16&255,u>>8&255,u&255])))},M.esds=function(H){var n=H.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(H.config).concat([6,1,2]))},M.mp4a=function(H){var n=H.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,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),M.box(M.types.esds,M.esds(H)))},M.mp3=function(H){var n=H.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,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},M.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(H)):M.box(M.types.stsd,M.STSD,M.mp4a(H)):M.box(M.types.stsd,M.STSD,M.avc1(H))},M.tkhd=function(H){var n=H.id,D=H.duration*H.timescale,y=H.width,m=H.height,f=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,f>>24,f>>16&255,f>>8&255,f&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,y>>8&255,y&255,0,0,m>>8&255,m&255,0,0]))},M.traf=function(H,n){var D=M.sdtp(H),y=H.id,m=Math.floor(n/(V+1)),f=Math.floor(n%(V+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,f>>24,f>>16&255,f>>8&255,f&255])),M.trun(H,D.length+16+20+8+16+8+8),D)},M.trak=function(H){return H.duration=H.duration||4294967295,M.box(M.types.trak,M.tkhd(H),M.mdia(H))},M.trex=function(H){var n=H.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(H,n){var D=H.samples||[],y=D.length,m=12+16*y,f=new Uint8Array(m),c,l,d,o,u,a;for(n+=8+m,f.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<y;c++)l=D[c],d=l.duration,o=l.size,u=l.flags,a=l.cts,f.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*c);return M.box(M.types.trun,f)},M.initSegment=function(H){M.types||M.init();var n=M.moov(H),D=new Uint8Array(M.FTYP.byteLength+n.byteLength);return D.set(M.FTYP),D.set(n,M.FTYP.byteLength),D},M}();W.types=void 0,W.HDLR_TYPES=void 0,W.STTS=void 0,W.STSC=void 0,W.STCO=void 0,W.STSZ=void 0,W.VMHD=void 0,W.SMHD=void 0,W.STSD=void 0,W.FTYP=void 0,W.DINF=void 0,z.default=W},"./src/remux/mp4-remuxer.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return a}),N.d(z,"normalizePts",function(){return i});var V=N("./src/polyfills/number.ts"),W=N("./src/remux/aac-helper.ts"),M=N("./src/remux/mp4-generator.ts"),K=N("./src/events.ts"),H=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),D=N("./src/types/loader.ts"),y=N("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(I){for(var O=1;O<arguments.length;O++){var _=arguments[O];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(I[b]=_[b])}return I},m.apply(this,arguments)}var f=10*1e3,c=1024,l=1152,d=null,o=null,u=!1,a=function(){function I(_,b,p,h){if(h===void 0&&(h=""),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=p,this.ISGenerated=!1,d===null){var A=navigator.userAgent||"",E=A.match(/Chrome\/(\d+)/i);d=E?parseInt(E[1]):0}if(o===null){var v=navigator.userAgent.match(/Safari\/(\d+)/i);o=v?parseInt(v[1]):0}u=!!d&&d<75||!!o&&o<600}var O=I.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 p=!1,h=b.reduce(function(A,E){var v=E.pts-A;return v<-4294967296?(p=!0,i(A,E.pts)):v>0?A:E.pts},b[0].pts);return p&&n.logger.debug("PTS rollover detected"),h},O.remux=function(b,p,h,A,E,v,P,x){var C,j,B,w,Y,$,oe=E,de=E,Fe=b.pid>-1,Ae=p.pid>-1,Re=p.samples.length,Me=b.samples.length>0,Be=Re>1,pe=(!Fe||Me)&&(!Ae||Be)||this.ISGenerated||P;if(pe){this.ISGenerated||(B=this.generateIS(b,p,E));var fe=this.isVideoContiguous,ne=-1;if(Be&&(ne=R(p.samples),!fe&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,ne>0){n.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Re+" video samples due to a missing keyframe");var xe=this.getVideoStartPts(p.samples);p.samples=p.samples.slice(ne),p.dropped+=ne,de+=(p.samples[0].pts-xe)/(p.timescale||9e4)}else ne===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Re+" video samples"),$=!1);if(this.ISGenerated){if(Me&&Be){var ce=this.getVideoStartPts(p.samples),Pe=i(b.samples[0].pts,ce)-ce,He=Pe/p.inputTimeScale;oe+=Math.max(0,He),de+=Math.max(0,-He)}if(Me){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(b,p,E)),j=this.remuxAudio(b,oe,this.isAudioContiguous,v,Ae||Be||x===D.PlaylistLevelType.AUDIO?de:void 0),Be){var ke=j?j.endPTS-j.startPTS:0;p.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(b,p,E)),C=this.remuxVideo(p,de,fe,ke)}}else Be&&(C=this.remuxVideo(p,de,fe,0));C&&(C.firstKeyFrame=ne,C.independent=ne!==-1)}}return this.ISGenerated&&(h.samples.length&&(Y=this.remuxID3(h,E)),A.samples.length&&(w=this.remuxText(A,E))),{audio:j,video:C,initSegment:B,independent:$,text:w,id3:Y}},O.generateIS=function(b,p,h){var A=b.samples,E=p.samples,v=this.typeSupported,P={},x=!Object(V.isFiniteNumber)(this._initPTS),C="audio/mp4",j,B,w;if(x&&(j=B=Infinity),b.config&&A.length&&(b.timescale=b.samplerate,b.isAAC||(v.mpeg?(C="audio/mpeg",b.codec=""):v.mp3&&(b.codec="mp3")),P.audio={id:"audio",container:C,codec:b.codec,initSegment:!b.isAAC&&v.mpeg?new Uint8Array(0):M.default.initSegment([b]),metadata:{channelCount:b.channelCount}},x&&(w=b.inputTimeScale,j=B=A[0].pts-Math.round(w*h))),p.sps&&p.pps&&E.length&&(p.timescale=p.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:p.codec,initSegment:M.default.initSegment([p]),metadata:{width:p.width,height:p.height}},x)){w=p.inputTimeScale;var Y=this.getVideoStartPts(E),$=Math.round(w*h);B=Math.min(B,i(E[0].dts,Y)-$),j=Math.min(j,Y-$)}if(Object.keys(P).length)return this.ISGenerated=!0,x&&(this._initPTS=j,this._initDTS=B),{tracks:P,initPTS:j,timescale:w}},O.remuxVideo=function(b,p,h,A){var E=b.inputTimeScale,v=b.samples,P=[],x=v.length,C=this._initPTS,j=this.nextAvcDts,B=8,w,Y,$,oe=Number.POSITIVE_INFINITY,de=Number.NEGATIVE_INFINITY,Fe=0,Ae=!1;if(!h||j===null){var Re=p*E,Me=v[0].pts-i(v[0].dts,v[0].pts);j=Re-Me}for(var Be=0;Be<x;Be++){var pe=v[Be];if(pe.pts=i(pe.pts-C,j),pe.dts=i(pe.dts-C,j),pe.dts>pe.pts){var fe=9e4*.2;Fe=Math.max(Math.min(Fe,pe.pts-pe.dts),-1*fe)}pe.dts<v[Be>0?Be-1:Be].dts&&(Ae=!0)}Ae&&v.sort(function(vt,qe){var Qe=vt.dts-qe.dts,Ue=vt.pts-qe.pts;return Qe||Ue}),Y=v[0].dts,$=v[v.length-1].dts;var ne=Math.round(($-Y)/(x-1));if(Fe<0){if(Fe<ne*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var xe=Fe,ce=0;ce<x;ce++)v[ce].dts=xe=Math.max(xe,v[ce].pts-ne),v[ce].pts=Math.max(xe,v[ce].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Fe,!0)+" ms to overcome this issue");for(var Pe=0;Pe<x;Pe++)v[Pe].dts=v[Pe].dts+Fe}Y=v[0].dts}if(h){var He=Y-j,ke=He>ne,Ve=He<-1;if(ke||Ve){ke?n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(He,!0)+" ms ("+He+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-He,!0)+" ms ("+He+"dts) overlapping between fragments detected"),Y=j;var et=v[0].pts-He;v[0].dts=Y,v[0].pts=et,n.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(et,!0)+"/"+Object(y.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(He,!0)+" ms")}}u&&(Y=Math.max(0,Y));for(var le=0,_e=0,Ce=0;Ce<x;Ce++){for(var De=v[Ce],tt=De.units,ct=tt.length,ft=0,ut=0;ut<ct;ut++)ft+=tt[ut].data.length;_e+=ft,le+=ct,De.length=ft,De.dts=Math.max(De.dts,Y),De.pts=Math.max(De.pts,De.dts,0),oe=Math.min(De.pts,oe),de=Math.max(De.pts,de)}$=v[x-1].dts;var xt=_e+4*le+8,bt;try{bt=new Uint8Array(xt)}catch(vt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:xt,reason:"fail allocating video mdat "+xt});return}var Ne=new DataView(bt.buffer);Ne.setUint32(0,xt),bt.set(M.default.types.mdat,4);for(var Oe=0;Oe<x;Oe++){for(var nt=v[Oe],lt=nt.units,Ke=0,Xe=0,Se=lt.length;Xe<Se;Xe++){var ge=lt[Xe],Ee=ge.data,ie=ge.data.byteLength;Ne.setUint32(B,ie),B+=4,bt.set(Ee,B),B+=ie,Ke+=4+ie}if(Oe<x-1)w=v[Oe+1].dts-nt.dts;else{var ae=this.config,he=nt.dts-v[Oe>0?Oe-1:Oe].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var ve=Math.floor(ae.maxBufferHole*E),Te=(A?oe+A*E:this.nextAudioPts)-nt.pts;Te>ve?(w=Te-he,w<0&&(w=he),n.logger.log("[mp4-remuxer]: It is approximately "+Te/90+" ms to the next segment; using duration "+w/90+" ms for the last video frame.")):w=he}else w=he}var Ge=Math.round(nt.pts-nt.dts);P.push(new S(nt.key,w,Ke,Ge))}if(P.length&&d&&d<70){var ot=P[0].flags;ot.dependsOn=2,ot.isNonSync=0}console.assert(w!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=$+w,this.isVideoContiguous=!0;var Tt=M.default.moof(b.sequenceNumber++,Y,m({},b,{samples:P})),Ot="video",wt={data1:Tt,data2:bt,startPTS:oe/E,endPTS:(de+w)/E,startDTS:Y/E,endDTS:j/E,type:Ot,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(bt.length,"MDAT length must not be zero"),wt},O.remuxAudio=function(b,p,h,A,E){var v=b.inputTimeScale,P=b.samplerate?b.samplerate:v,x=v/P,C=b.isAAC?c:l,j=C*x,B=this._initPTS,w=!b.isAAC&&this.typeSupported.mpeg,Y=[],$=b.samples,oe=w?0:8,de=this.nextAudioPts||-1,Fe=p*v;if(this.isAudioContiguous=h=h||$.length&&de>0&&(A&&Math.abs(Fe-de)<9e3||Math.abs(i($[0].pts-B,Fe)-de)<20*j),$.forEach(function(Ee){Ee.pts=i(Ee.pts-B,Fe)}),!h||de<0){if($=$.filter(function(Ee){return Ee.pts>=0}),!$.length)return;E===0?de=0:A?de=Math.max(0,Fe):de=$[0].pts}if(b.isAAC)for(var Ae=E!==void 0,Re=this.config.maxAudioFramesDrift,Me=0,Be=de;Me<$.length;Me++){var pe=$[Me],fe=pe.pts,ne=fe-Be,xe=Math.abs(1e3*ne/v);if(ne<=-Re*j&&Ae)Me===0&&(n.logger.warn("Audio frame @ "+(fe/v).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/v)+" ms."),this.nextAudioPts=de=Be=fe);else if(ne>=Re*j&&xe<f&&Ae){var ce=Math.round(ne/j);Be=fe-ce*j,Be<0&&(ce--,Be+=j),Me===0&&(this.nextAudioPts=de=Be),n.logger.warn("[mp4-remuxer]: Injecting "+ce+" audio frame @ "+(Be/v).toFixed(3)+"s due to "+Math.round(1e3*ne/v)+" ms gap.");for(var Pe=0;Pe<ce;Pe++){var He=Math.max(Be,0),ke=W.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);ke||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ke=pe.unit.subarray()),$.splice(Me,0,{unit:ke,pts:He}),Be+=j,Me++}}pe.pts=Be,Be+=j}for(var Ve=null,et=null,le,_e=0,Ce=$.length;Ce--;)_e+=$[Ce].unit.byteLength;for(var De=0,tt=$.length;De<tt;De++){var ct=$[De],ft=ct.unit,ut=ct.pts;if(et!==null){var xt=Y[De-1];xt.duration=Math.round((ut-et)/x)}else if(h&&b.isAAC&&(ut=de),Ve=ut,_e>0){_e+=oe;try{le=new Uint8Array(_e)}catch(Ee){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_e,reason:"fail allocating audio mdat "+_e});return}if(!w){var bt=new DataView(le.buffer);bt.setUint32(0,_e),le.set(M.default.types.mdat,4)}}else return;le.set(ft,oe);var Ne=ft.byteLength;oe+=Ne,Y.push(new S(!0,C,Ne,0)),et=ut}var Oe=Y.length;if(!Oe)return;var nt=Y[Y.length-1];this.nextAudioPts=de=et+x*nt.duration;var lt=w?new Uint8Array(0):M.default.moof(b.sequenceNumber++,Ve/x,m({},b,{samples:Y}));b.samples=[];var Ke=Ve/v,Xe=de/v,Se="audio",ge={data1:lt,data2:le,startPTS:Ke,endPTS:Xe,startDTS:Ke,endDTS:Xe,type:Se,hasAudio:!0,hasVideo:!1,nb:Oe};return this.isAudioContiguous=!0,console.assert(le.length,"MDAT length must not be zero"),ge},O.remuxEmptyAudio=function(b,p,h,A){var E=b.inputTimeScale,v=b.samplerate?b.samplerate:E,P=E/v,x=this.nextAudioPts,C=(x!==null?x:A.startDTS*E)+this._initDTS,j=A.endDTS*E+this._initDTS,B=P*c,w=Math.ceil((j-C)/B),Y=W.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],oe=0;oe<w;oe++){var de=C+oe*B;$.push({unit:Y,pts:de,dts:de})}return b.samples=$,this.remuxAudio(b,p,h,!1)},O.remuxID3=function(b,p){var h=b.samples.length;if(!h)return;for(var A=b.inputTimeScale,E=this._initPTS,v=this._initDTS,P=0;P<h;P++){var x=b.samples[P];x.pts=i(x.pts-E,p*A)/A,x.dts=i(x.dts-v,p*A)/A}var C=b.samples;return b.samples=[],{samples:C}},O.remuxText=function(b,p){var h=b.samples.length;if(!h)return;for(var A=b.inputTimeScale,E=this._initPTS,v=0;v<h;v++){var P=b.samples[v];P.pts=i(P.pts-E,p*A)/A}b.samples.sort(function(C,j){return C.pts-j.pts});var x=b.samples;return b.samples=[],{samples:x}},I}();function i(I,O){var _;if(O===null)return I;for(O<I?_=-8589934592:_=8589934592;Math.abs(I-O)>4294967296;)I+=_;return I}function R(I){for(var O=0;O<I.length;O++)if(I[O].key)return O;return-1}var S=function(O,_,b,p){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=b,this.cts=p,this.flags=new T(O)},T=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,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/utils/mp4-tools.ts"),M=N("./src/loader/fragment.ts"),K=N("./src/utils/logger.ts"),H=function(){function y(){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 m=y.prototype;return m.destroy=function(){},m.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(c,l,d){this.audioCodec=l,this.videoCodec=d,this.generateInitSegment(c),this.emitInitSegment=!0},m.generateInitSegment=function(c){var l=this.audioCodec,d=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(W.parseInitSegment)(c);l||(l=D(o.audio,M.ElementaryStreamTypes.AUDIO)),d||(d=D(o.video,M.ElementaryStreamTypes.VIDEO));var u={};o.audio&&o.video?u.audiovideo={container:"video/mp4",codec:l+","+d,initSegment:c,id:"main"}:o.audio?u.audio={container:"audio/mp4",codec:l,initSegment:c,id:"audio"}:o.video?u.video={container:"video/mp4",codec:d,initSegment:c,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},m.remux=function(c,l,d,o,u){var a=this.initPTS,i=this.lastEndDTS,R={audio:void 0,video:void 0,text:o,id3:d,initSegment:void 0};Object(V.isFiniteNumber)(i)||(i=this.lastEndDTS=u||0);var S=l.samples;if(!S||!S.length)return R;var T={initPTS:void 0,timescale:1},I=this.initData;if((!I||!I.length)&&(this.generateInitSegment(S),I=this.initData),!I||!I.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(a)||(this.initPTS=T.initPTS=a=n(I,S,i));var O=Object(W.getDuration)(S,I),_=i,b=O+_;Object(W.offsetStartDTS)(I,S,a),O>0?this.lastEndDTS=b:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var p=!!I.audio,h=!!I.video,A="";p&&(A+="audio"),h&&(A+="video");var E={data1:S,startPTS:_,startDTS:_,endPTS:b,endDTS:b,type:A,hasAudio:p,hasVideo:h,nb:1,dropped:0};return R.audio=E.type==="audio"?E:void 0,R.video=E.type!=="audio"?E:void 0,R.text=o,R.id3=d,R.initSegment=T,R},y}(),n=function(m,f,c){return Object(W.getStartDTS)(m,f)-c};function D(y,m){var f=y==null?void 0:y.codec;return f&&f.length>4?f:f==="hvc1"?"hvc1.1.c.L120.90":f==="av01"?"av01.0.04M.08":f==="avc1"||m===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=H},"./src/task-loop.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=W.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(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!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(){},W}()},"./src/types/cmcd.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"CMCDVersion",function(){return V}),N.d(z,"CMCDObjectType",function(){return W}),N.d(z,"CMCDStreamingFormat",function(){return M}),N.d(z,"CMCDStreamType",function(){return K});var V=1,W;(function(H){H.MANIFEST="m",H.AUDIO="a",H.VIDEO="v",H.MUXED="av",H.INIT="i",H.CAPTION="c",H.TIMED_TEXT="tt",H.KEY="k",H.OTHER="o"})(W||(W={}));var M;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(M||(M={}));var K;(function(H){H.VOD="v",H.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"HlsSkip",function(){return M}),N.d(z,"getSkipValue",function(){return K}),N.d(z,"HlsUrlParameters",function(){return H}),N.d(z,"Level",function(){return n});function V(D,y){for(var m=0;m<y.length;m++){var f=y[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(D,f.key,f)}}function W(D,y,m){return y&&V(D.prototype,y),m&&V(D,m),D}var M;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(M||(M={}));function K(D,y){var m=D.canSkipUntil,f=D.canSkipDateRanges,c=D.endSN,l=y!==void 0?y-c:0;return m&&l<m?f?M.v2:M.Yes:M.No}var H=function(){function D(m,f,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=f,this.skip=c}var y=D.prototype;return y.addDirectives=function(f){var c=new self.URL(f);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(y){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=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return W(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(m){var f=m%this.url.length;this._urlId!==f&&(this.details=void 0,this._urlId=f)}}]),D}()},"./src/types/loader.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"PlaylistContextType",function(){return V}),N.d(z,"PlaylistLevelType",function(){return W});var V;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var W;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(W||(W={}))},"./src/types/transmuxer.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"ChunkMetadata",function(){return V});var V=function(K,H,n,D,y,m){D===void 0&&(D=0),y===void 0&&(y=-1),m===void 0&&(m=!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=W(),this.buffering={audio:W(),video:W(),audiovideo:W()},this.level=K,this.sn=H,this.id=n,this.size=D,this.part=y,this.partial=m};function W(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"AttrList",function(){return M});var V=/^(\d+)x(\d+)$/,W=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function K(n){typeof n=="string"&&(n=K.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var H=K.prototype;return H.decimalInteger=function(D){var y=parseInt(this[D],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},H.hexadecimalInteger=function(D){if(this[D]){var y=(this[D]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var m=new Uint8Array(y.length/2),f=0;f<y.length/2;f++)m[f]=parseInt(y.slice(f*2,f*2+2),16);return m}else return null},H.hexadecimalIntegerAsNumber=function(D){var y=parseInt(this[D],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},H.decimalFloatingPoint=function(D){return parseFloat(this[D])},H.optionalFloat=function(D,y){var m=this[D];return m?parseFloat(m):y},H.enumeratedString=function(D){return this[D]},H.bool=function(D){return this[D]==="YES"},H.decimalResolution=function(D){var y=V.exec(this[D]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},K.parseAttrList=function(D){var y,m={},f='"';for(W.lastIndex=0;(y=W.exec(D))!==null;){var c=y[2];c.indexOf(f)===0&&c.lastIndexOf(f)===c.length-1&&(c=c.slice(1,-1)),m[y[1]]=c}return m},K}()},"./src/utils/binary-search.ts":function(Z,z,N){"use strict";N.r(z);var V={search:function(M,K){for(var H=0,n=M.length-1,D=null,y=null;H<=n;){D=(H+n)/2|0,y=M[D];var m=K(y);if(m>0)H=D+1;else if(m<0)n=D-1;else return y}return null}};z.default=V},"./src/utils/buffer-helper.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"BufferHelper",function(){return M});var V=N("./src/utils/logger.ts"),W={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function K(){}return K.isBuffered=function(n,D){try{if(n){for(var y=K.getBuffered(n),m=0;m<y.length;m++)if(D>=y.start(m)&&D<=y.end(m))return!0}}catch(f){}return!1},K.bufferInfo=function(n,D,y){try{if(n){var m=K.getBuffered(n),f=[],c;for(c=0;c<m.length;c++)f.push({start:m.start(c),end:m.end(c)});return this.bufferedInfo(f,D,y)}}catch(l){}return{len:0,start:D,end:D,nextStart:void 0}},K.bufferedInfo=function(n,D,y){D=Math.max(0,D),n.sort(function(T,I){var O=T.start-I.start;return O||I.end-T.end});var m=[];if(y)for(var f=0;f<n.length;f++){var c=m.length;if(c){var l=m[c-1].end;n[f].start-l<y?n[f].end>l&&(m[c-1].end=n[f].end):m.push(n[f])}else m.push(n[f])}else m=n;for(var d=0,o,u=D,a=D,i=0;i<m.length;i++){var R=m[i].start,S=m[i].end;if(D+y>=R&&D<S)u=R,a=S,d=a-D;else if(D+y<R){o=R;break}}return{len:d,start:u||0,end:a||0,nextStart:o}},K.getBuffered=function(n){try{return n.buffered}catch(D){return V.logger.log("failed to get media.buffered",D),W}},K}()},"./src/utils/cea-608-parser.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"Row",function(){return a}),N.d(z,"CaptionScreen",function(){return i});var V=N("./src/utils/logger.ts"),W={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 p=b;return W.hasOwnProperty(b)&&(p=W[b]),String.fromCharCode(p)},K=15,H=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},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},f=["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 l=function(){function _(){this.time=null,this.verboseLevel=c.ERROR}var b=_.prototype;return b.log=function(h,A){this.verboseLevel>=h&&V.logger.log(this.time+" ["+h+"] "+A)},_}(),d=function(b){for(var p=[],h=0;h<b.length;h++)p.push(b[h].toString(16));return p},o=function(){function _(p,h,A,E,v){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=p||"white",this.underline=h||!1,this.italics=A||!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(h){for(var A=["foreground","underline","italics","background","flash"],E=0;E<A.length;E++){var v=A[E];h.hasOwnProperty(v)&&(this[v]=h[v])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},b.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),u=function(){function _(p,h,A,E,v,P){this.uchar=void 0,this.penState=void 0,this.uchar=p||" ",this.penState=new o(h,A,E,v,P)}var b=_.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(h,A){this.uchar=h,this.penState.copy(A)},b.setPenState=function(h){this.penState.copy(h)},b.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},b.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),a=function(){function _(p){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<H;h++)this.chars.push(new u);this.logger=p,this.pos=0,this.currPenState=new o}var b=_.prototype;return b.equals=function(h){for(var A=!0,E=0;E<H;E++)if(!this.chars[E].equals(h.chars[E])){A=!1;break}return A},b.copy=function(h){for(var A=0;A<H;A++)this.chars[A].copy(h.chars[A])},b.isEmpty=function(){for(var h=!0,A=0;A<H;A++)if(!this.chars[A].isEmpty()){h=!1;break}return h},b.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>H&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},b.moveCursor=function(h){var A=this.pos+h;if(h>1)for(var E=this.pos+1;E<A+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(A)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(h){h>=144&&this.backSpace();var A=M(h);if(this.pos>=H){this.logger.log(c.ERROR,"Cannot insert "+h.toString(16)+" ("+A+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(A,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(h){var A;for(A=h;A<H;A++)this.chars[A].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 h=[],A=!0,E=0;E<H;E++){var v=this.chars[E].uchar;v!==" "&&(A=!1),h.push(v)}return A?"":h.join("")},b.setPenStyles=function(h){this.currPenState.setStyles(h);var A=this.chars[this.pos];A.setPenState(this.currPenState)},_}(),i=function(){function _(p){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<K;h++)this.rows.push(new a(p));this.logger=p,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=_.prototype;return b.reset=function(){for(var h=0;h<K;h++)this.rows[h].clear();this.currRow=K-1},b.equals=function(h){for(var A=!0,E=0;E<K;E++)if(!this.rows[E].equals(h.rows[E])){A=!1;break}return A},b.copy=function(h){for(var A=0;A<K;A++)this.rows[A].copy(h.rows[A])},b.isEmpty=function(){for(var h=!0,A=0;A<K;A++)if(!this.rows[A].isEmpty()){h=!1;break}return h},b.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},b.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},b.insertChar=function(h){var A=this.rows[this.currRow];A.insertChar(h)},b.setPen=function(h){var A=this.rows[this.currRow];A.setPenStyles(h)},b.moveCursor=function(h){var A=this.rows[this.currRow];A.moveCursor(h)},b.setCursor=function(h){this.logger.log(c.INFO,"setCursor: "+h);var A=this.rows[this.currRow];A.setCursor(h)},b.setPAC=function(h){this.logger.log(c.INFO,"pacData = "+JSON.stringify(h));var A=h.row-1;if(this.nrRollUpRows&&A<this.nrRollUpRows-1&&(A=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==A){for(var E=0;E<K;E++)this.rows[E].clear();var v=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var x=P.rows[v].cueStartTime,C=this.logger.time;if(x&&C!==null&&x<C)for(var j=0;j<this.nrRollUpRows;j++)this.rows[A-this.nrRollUpRows+j+1].copy(P.rows[v+j])}}this.currRow=A;var B=this.rows[this.currRow];if(h.indent!==null){var w=h.indent,Y=Math.max(w-1,0);B.setCursor(h.indent),h.color=B.chars[Y].penState.foreground}var $={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen($)},b.setBkgData=function(h){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},b.setRollUpRows=function(h){this.nrRollUpRows=h},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 h=this.currRow+1-this.nrRollUpRows,A=this.rows.splice(h,1)[0];A.clear(),this.rows.splice(this.currRow,0,A),this.logger.log(c.INFO,"Rolling up")},b.getDisplayText=function(h){h=h||!1;for(var A=[],E="",v=-1,P=0;P<K;P++){var x=this.rows[P].getTextString();x&&(v=P+1,h?A.push("Row "+v+": '"+x+"'"):A.push(x.trim()))}return A.length>0&&(h?E="["+A.join(" | ")+"]":E=A.join(`
|
|
`)),E},b.getTextAndFormat=function(){return this.rows},_}(),R=function(){function _(p,h,A){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=p,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new i(A),this.nonDisplayedMemory=new i(A),this.lastOutputScreen=new i(A),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=A}var b=_.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(h){this.outputFilter=h},b.setPAC=function(h){this.writeScreen.setPAC(h)},b.setBkgData=function(h){this.writeScreen.setBkgData(h)},b.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(c.INFO,"MODE="+h),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=h},b.insertChars=function(h){for(var A=0;A<h.length;A++)this.writeScreen.insertChar(h[A]);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(h){this.logger.log(c.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},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 h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(h){this.logger.log(c.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},b.ccMIDROW=function(h){var A={flash:!1};if(A.underline=h%2===1,A.italics=h>=46,A.italics)A.foreground="white";else{var E=Math.floor(h/2)-16,v=["white","green","blue","cyan","red","yellow","magenta"];A.foreground=v[E]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(A)),this.writeScreen.setPen(A)},b.outputDataUpdate=function(h){h===void 0&&(h=!1);var A=this.logger.time;if(A===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=A:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,A,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:A),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},_}(),S=function(){function _(p,h,A){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new l;this.channels=[null,new R(p,h,E),new R(p+1,A,E)],this.cmdHistory=O(),this.logger=E}var b=_.prototype;return b.getHandler=function(h){return this.channels[h].getHandler()},b.setHandler=function(h,A){this.channels[h].setHandler(A)},b.addData=function(h,A){var E,v,P,x=!1;this.logger.time=h;for(var C=0;C<A.length;C+=2){if(v=A[C]&127,P=A[C+1]&127,v===0&&P===0)continue;if(this.logger.log(c.DATA,"["+d([A[C],A[C+1]])+"] -> ("+d([v,P])+")"),E=this.parseCmd(v,P),E||(E=this.parseMidrow(v,P)),E||(E=this.parsePAC(v,P)),E||(E=this.parseBackgroundAttributes(v,P)),!E&&(x=this.parseChars(v,P),x)){var j=this.currentChannel;if(j&&j>0){var B=this.channels[j];B.insertChars(x)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!x&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+d([v,P])+" orig: "+d([A[C],A[C+1]]))}},b.parseCmd=function(h,A){var E=this.cmdHistory,v=(h===20||h===28||h===21||h===29)&&A>=32&&A<=47,P=(h===23||h===31)&&A>=33&&A<=35;if(!(v||P))return!1;if(I(h,A,E))return T(null,null,E),this.logger.log(c.DEBUG,"Repeated command ("+d([h,A])+") is dropped"),!0;var x=h===20||h===21||h===23?1:2,C=this.channels[x];return h===20||h===21||h===28||h===29?A===32?C.ccRCL():A===33?C.ccBS():A===34?C.ccAOF():A===35?C.ccAON():A===36?C.ccDER():A===37?C.ccRU(2):A===38?C.ccRU(3):A===39?C.ccRU(4):A===40?C.ccFON():A===41?C.ccRDC():A===42?C.ccTR():A===43?C.ccRTD():A===44?C.ccEDM():A===45?C.ccCR():A===46?C.ccENM():A===47&&C.ccEOC():C.ccTO(A-32),T(h,A,E),this.currentChannel=x,!0},b.parseMidrow=function(h,A){var E=0;if((h===17||h===25)&&A>=32&&A<=47){if(h===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(A),this.logger.log(c.DEBUG,"MIDROW ("+d([h,A])+")"),!0):!1}return!1},b.parsePAC=function(h,A){var E,v=this.cmdHistory,P=(h>=17&&h<=23||h>=25&&h<=31)&&A>=64&&A<=127,x=(h===16||h===24)&&A>=64&&A<=95;if(!(P||x))return!1;if(I(h,A,v))return T(null,null,v),!0;var C=h<=23?1:2;A>=64&&A<=95?E=C===1?n[h]:y[h]:E=C===1?D[h]:m[h];var j=this.channels[C];return j?(j.setPAC(this.interpretPAC(E,A)),T(h,A,v),this.currentChannel=C,!0):!1},b.interpretPAC=function(h,A){var E,v={color:null,italics:!1,indent:null,underline:!1,row:h};return A>95?E=A-96:E=A-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(h,A){var E,v=null,P=null;if(h>=25?(E=2,P=h-8):(E=1,P=h),P>=17&&P<=19){var x;P===17?x=A+80:P===18?x=A+112:x=A+144,this.logger.log(c.INFO,"Special char '"+M(x)+"' in channel "+E),v=[x]}else h>=32&&h<=127&&(v=A===0?[h]:[h,A]);if(v){var C=d(v);this.logger.log(c.DEBUG,"Char codes = "+C.join(",")),T(h,A,this.cmdHistory)}return v},b.parseBackgroundAttributes=function(h,A){var E=(h===16||h===24)&&A>=32&&A<=47,v=(h===23||h===31)&&A>=45&&A<=47;if(!(E||v))return!1;var P,x={};h===16||h===24?(P=Math.floor((A-32)/2),x.background=f[P],A%2===1&&(x.background=x.background+"_semi")):A===45?x.background="transparent":(x.foreground="black",A===47&&(x.underline=!0));var C=h<=23?1:2,j=this.channels[C];return j.setBkgData(x),T(h,A,this.cmdHistory),!0},b.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var A=this.channels[h];A&&A.reset()}this.cmdHistory=O()},b.cueSplitAtTime=function(h){for(var A=0;A<this.channels.length;A++){var E=this.channels[A];E&&E.cueSplitAtTime(h)}},_}();function T(_,b,p){p.a=_,p.b=b}function I(_,b,p){return p.a===_&&p.b===b}function O(){return{a:null,b:null}}z.default=S},"./src/utils/codecs.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"isCodecType",function(){return W}),N.d(z,"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 W(K,H){var n=V[H];return!!n&&n[K.slice(0,4)]===!0}function M(K,H){return MediaSource.isTypeSupported((H||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/utils/vttparser.ts"),W=N("./src/utils/webvtt-parser.ts"),M=N("./src/utils/texttrack-utils.ts"),K=/\s/,H={newCue:function(D,y,m,f){for(var c=[],l,d,o,u,a,i=self.VTTCue||self.TextTrackCue,R=0;R<f.rows.length;R++)if(l=f.rows[R],o=!0,u=0,a="",!l.isEmpty()){for(var S=0;S<l.chars.length;S++)K.test(l.chars[S].uchar)&&o?u++:(a+=l.chars[S].uchar,o=!1);l.cueStartTime=y,y===m&&(m+=1e-4),u>=16?u--:u++;var T=Object(V.fixLineBreaks)(a.trim()),I=Object(W.generateCueId)(y,m,T);(!D||!D.cues||!D.cues.getCueById(I))&&(d=new i(y,m,T),d.id=I,d.line=R+1,d.align="left",d.position=10+Math.min(80,Math.floor(u*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}};z.default=H},"./src/utils/discontinuities.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"findFirstFragWithCC",function(){return K}),N.d(z,"shouldAlignOnDiscontinuities",function(){return H}),N.d(z,"findDiscontinuousReferenceFrag",function(){return n}),N.d(z,"adjustSlidingStart",function(){return y}),N.d(z,"alignStream",function(){return m}),N.d(z,"alignPDT",function(){return c}),N.d(z,"alignFragmentByPDTDelta",function(){return l}),N.d(z,"alignMediaPlaylistByPDT",function(){return d});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/logger.ts"),M=N("./src/controller/level-helper.ts");function K(o,u){for(var a=null,i=0,R=o.length;i<R;i++){var S=o[i];if(S&&S.cc===u){a=S;break}}return a}function H(o,u,a){return!!(u.details&&(a.endCC>a.startCC||o&&o.cc<a.startCC))}function n(o,u){var a=o.fragments,i=u.fragments;if(!i.length||!a.length){W.logger.log("No fragments to align");return}var R=K(a,i[0].cc);if(!R||R&&!R.startPTS){W.logger.log("No frag in previous level to align on");return}return R}function D(o,u){if(o){var a=o.start+u;o.start=o.startPTS=a,o.endPTS=a+o.duration}}function y(o,u){for(var a=u.fragments,i=0,R=a.length;i<R;i++)D(a[i],o);u.fragmentHint&&D(u.fragmentHint,o),u.alignedSliding=!0}function m(o,u,a){if(!u)return;f(o,a,u),!a.alignedSliding&&u.details&&c(a,u.details),!a.alignedSliding&&u.details&&!a.skippedSegments&&Object(M.adjustSliding)(u.details,a)}function f(o,u,a){if(H(o,a,u)){var i=n(a.details,u);i&&Object(V.isFiniteNumber)(i.start)&&(W.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),y(i.start,u))}}function c(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,i=o.fragments[0].programDateTime,R=(i-a)/1e3+u.fragments[0].start;R&&Object(V.isFiniteNumber)(R)&&(W.logger.log("Adjusting PTS using programDateTime delta "+(i-a)+"ms, sliding:"+R.toFixed(3)+" "+o.url+" "),y(R,o))}function l(o,u){var a=o.programDateTime;if(!a)return;var i=(a-u)/1e3;o.start=o.startPTS=i,o.endPTS=i+o.duration}function d(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,i=u.fragments[0].start,R=a-i*1e3;o.fragments.forEach(function(S){l(S,R)}),o.fragmentHint&&l(o.fragmentHint,R),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/utils/ewma.ts"),W=function(){function M(H,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(H),this.fast_=new V.default(n)}var K=M.prototype;return K.update=function(n,D){var y=this.slow_,m=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new V.default(n,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new V.default(D,m.getEstimate(),m.getTotalWeight()))},K.sample=function(n,D){n=Math.max(n,this.minDelayMs_);var y=8*D,m=n/1e3,f=y/m;this.fast_.sample(m,f),this.slow_.sample(m,f)},K.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},M}();z.default=W},"./src/utils/ewma.ts":function(Z,z,N){"use strict";N.r(z);var V=function(){function W(K,H,n){H===void 0&&(H=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=H,this.totalWeight_=n}var M=W.prototype;return M.sample=function(H,n){var D=Math.pow(this.alpha_,H);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=H},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}return this.estimate_},W}();z.default=V},"./src/utils/fetch-loader.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"fetchSupported",function(){return l});var V=N("./src/polyfills/number.ts"),W=N("./src/loader/load-stats.ts"),M=N("./src/demux/chunk-cache.ts");function K(i,R){i.prototype=Object.create(R.prototype),i.prototype.constructor=i,m(i,R)}function H(i){var R=typeof Map=="function"?new Map:void 0;return H=function(T){if(T===null||!y(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(T))return R.get(T);R.set(T,I)}function I(){return n(T,arguments,f(this).constructor)}return I.prototype=Object.create(T.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),m(I,T)},H(i)}function n(i,R,S){return D()?n=Reflect.construct:n=function(I,O,_){var b=[null];b.push.apply(b,O);var p=Function.bind.apply(I,b),h=new p;return _&&m(h,_.prototype),h},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(i){return!1}}function y(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function m(i,R){return m=Object.setPrototypeOf||function(T,I){return T.__proto__=I,T},m(i,R)}function f(i){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},f(i)}function c(){return c=Object.assign||function(i){for(var R=1;R<arguments.length;R++){var S=arguments[R];for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(i[T]=S[T])}return i},c.apply(this,arguments)}function l(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var d=function(){function i(S){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=S.fetchSetup||u,this.controller=new self.AbortController,this.stats=new W.LoadStats}var R=i.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(T,I,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 p=o(T,this.controller.signal),h=O.onProgress,A=T.responseType==="arraybuffer",E=A?"byteLength":"length";this.context=T,this.config=I,this.callbacks=O,this.request=this.fetchSetup(T,p),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),O.onTimeout(b,T,_.response)},I.timeout),self.fetch(this.request).then(function(v){if(_.response=_.loader=v,!v.ok){var P=v.status,x=v.statusText;throw new a(x||"fetch, bad network response",P,v)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(v.headers.get("Content-Length")||"0"),h&&Object(V.isFiniteNumber)(I.highWaterMark)?_.loadProgressively(v,b,T,I.highWaterMark,h):A?v.arrayBuffer():v.text()}).then(function(v){var P=_.response;self.clearTimeout(_.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=v[E];var x={url:P.url,data:v};h&&!Object(V.isFiniteNumber)(I.highWaterMark)&&h(b,T,v,P),O.onSuccess(x,b,T,P)}).catch(function(v){if(self.clearTimeout(_.requestTimeout),b.aborted)return;var P=v.code||0;O.onError({code:P,text:v.message},T,v.details)})},R.getCacheAge=function(){var T=null;if(this.response){var I=this.response.headers.get("age");T=I?parseFloat(I):null}return T},R.loadProgressively=function(T,I,O,_,b){_===void 0&&(_=0);var p=new M.default,h=T.body.getReader(),A=function E(){return h.read().then(function(v){if(v.done)return p.dataLength&&b(I,O,p.flush(),T),Promise.resolve(new ArrayBuffer(0));var P=v.value,x=P.length;return I.loaded+=x,x<_||p.dataLength?(p.push(P),p.dataLength>=_&&b(I,O,p.flush(),T)):b(I,O,P,T),E()}).catch(function(){return Promise.reject()})};return A()},i}();function o(i,R){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(c({},i.headers))};return i.rangeEnd&&S.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),S}function u(i,R){return new self.Request(i.url,R)}var a=function(i){K(R,i);function R(S,T,I){var O;return O=i.call(this,S)||this,O.code=void 0,O.details=void 0,O.code=T,O.details=I,O}return R}(H(Error));z.default=d},"./src/utils/imsc1-ttml-parser.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"IMSC1_CODEC",function(){return y}),N.d(z,"parseIMSC1",function(){return l});var V=N("./src/utils/mp4-tools.ts"),W=N("./src/utils/vttparser.ts"),M=N("./src/utils/vttcue.ts"),K=N("./src/demux/id3.ts"),H=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var p=arguments[b];for(var h in p)Object.prototype.hasOwnProperty.call(p,h)&&(_[h]=p[h])}return _},D.apply(this,arguments)}var y="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,f=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function l(_,b,p,h,A){var E=Object(V.findBox)(new Uint8Array(_),["mdat"]);if(E.length===0){A(new Error("Could not parse IMSC1 mdat"));return}var v=E[0],P=Object(K.utf8ArrayToStr)(new Uint8Array(_,v.start,v.end-v.start)),x=Object(H.toTimescaleFromScale)(b,1,p);try{h(d(P,x))}catch(C){A(C)}}function d(_,b){var p=new DOMParser,h=p.parseFromString(_,"text/xml"),A=h.getElementsByTagName("tt")[0];if(!A)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},v=Object.keys(E).reduce(function(B,w){return B[w]=A.getAttribute("ttp:"+w)||E[w],B},{}),P=A.getAttribute("xml:space")!=="preserve",x=u(o(A,"styling","style")),C=u(o(A,"layout","region")),j=o(A,"body","[begin]");return[].map.call(j,function(B){var w=a(B,P);if(!w||!B.hasAttribute("begin"))return null;var Y=T(B.getAttribute("begin"),v),$=T(B.getAttribute("dur"),v),oe=T(B.getAttribute("end"),v);if(Y===null)throw S(B);if(oe===null){if($===null)throw S(B);oe=Y+$}var de=new M.default(Y-b,oe-b,w);de.id=Object(n.generateCueId)(de.startTime,de.endTime,de.text);var Fe=C[B.getAttribute("region")],Ae=x[B.getAttribute("style")];de.position=10,de.size=80;var Re=i(Fe,Ae),Me=Re.textAlign;if(Me){var Be=c[Me];Be&&(de.lineAlign=Be),de.align=Me}return D(de,Re),de}).filter(function(B){return B!==null})}function o(_,b,p){var h=_.getElementsByTagName(b)[0];return h?[].slice.call(h.querySelectorAll(p)):[]}function u(_){return _.reduce(function(b,p){var h=p.getAttribute("xml:id");return h&&(b[h]=p),b},{})}function a(_,b){return[].slice.call(_.childNodes).reduce(function(p,h,A){var E;return h.nodeName==="br"&&A?p+`
|
|
`:(E=h.childNodes)!==null&&E!==void 0&&E.length?a(h,b):b?p+h.textContent.trim().replace(/\s+/g," "):p+h.textContent},"")}function i(_,b){var p="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(A,E){var v=R(b,p,E)||R(_,p,E);return v&&(A[E]=v),A},{})}function R(_,b,p){return _.hasAttributeNS(b,p)?_.getAttributeNS(b,p):null}function S(_){return new Error("Could not parse ttml timestamp "+_)}function T(_,b){if(!_)return null;var p=Object(W.parseTimeStamp)(_);return p===null&&(m.test(_)?p=I(_,b):f.test(_)&&(p=O(_,b))),p}function I(_,b){var p=m.exec(_),h=(p[4]|0)+(p[5]|0)/b.subFrameRate;return(p[1]|0)*3600+(p[2]|0)*60+(p[3]|0)+h/b.frameRate}function O(_,b){var p=f.exec(_),h=Number(p[1]),A=p[2];switch(A){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/b.frameRate;case"t":return h/b.tickRate}return h}},"./src/utils/logger.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"enableLogs",function(){return n}),N.d(z,"logger",function(){return D});var V=function(){},W={trace:V,debug:V,log:V,warn:V,info:V,error:V},M=W;function K(y){var m=self.console[y];return m?m.bind(self.console,"["+y+"] >"):V}function H(y){for(var m=arguments.length,f=new Array(m>1?m-1:0),c=1;c<m;c++)f[c-1]=arguments[c];f.forEach(function(l){M[l]=y[l]?y[l].bind(y):K(l)})}function n(y){if(self.console&&y===!0||typeof y=="object"){H(y,"debug","log","info","warn","error");try{M.log()}catch(m){M=W}}else M=W}var D=M},"./src/utils/mediakeys-helper.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"KeySystems",function(){return V}),N.d(z,"requestMediaKeySystemAccess",function(){return W});var V;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(V||(V={}));var W=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"bin2str",function(){return H}),N.d(z,"readUint16",function(){return n}),N.d(z,"readUint32",function(){return D}),N.d(z,"writeUint32",function(){return y}),N.d(z,"findBox",function(){return m}),N.d(z,"parseSegmentIndex",function(){return f}),N.d(z,"parseInitSegment",function(){return c}),N.d(z,"getStartDTS",function(){return l}),N.d(z,"getDuration",function(){return d}),N.d(z,"computeRawDurationFromSamples",function(){return o}),N.d(z,"offsetStartDTS",function(){return u}),N.d(z,"segmentValidRange",function(){return a}),N.d(z,"appendUint8Array",function(){return i});var V=N("./src/utils/typed-array.ts"),W=N("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,K=[].push;function H(R){return String.fromCharCode.apply(null,R)}function n(R,S){"data"in R&&(S+=R.start,R=R.data);var T=R[S]<<8|R[S+1];return T<0?65536+T:T}function D(R,S){"data"in R&&(S+=R.start,R=R.data);var T=R[S]<<24|R[S+1]<<16|R[S+2]<<8|R[S+3];return T<0?4294967296+T:T}function y(R,S,T){"data"in R&&(S+=R.start,R=R.data),R[S]=T>>24,R[S+1]=T>>16&255,R[S+2]=T>>8&255,R[S+3]=T&255}function m(R,S){var T=[];if(!S.length)return T;var I,O,_;"data"in R?(I=R.data,O=R.start,_=R.end):(I=R,O=0,_=I.byteLength);for(var b=O;b<_;){var p=D(I,b),h=H(I.subarray(b+4,b+8)),A=p>1?b+p:_;if(h===S[0])if(S.length===1)T.push({data:I,start:b+8,end:A});else{var E=m({data:I,start:b+8,end:A},S.slice(1));E.length&&K.apply(T,E)}b=A}return T}function f(R){var S=m(R,["moov"]),T=S[0],I=T?T.end:null,O=m(R,["sidx"]);if(!O||!O[0])return null;var _=[],b=O[0],p=b.data[0],h=p===0?8:16,A=D(b,h);h+=4;var E=0,v=0;p===0?h+=8:h+=16,h+=2;var P=b.end+v,x=n(b,h);h+=2;for(var C=0;C<x;C++){var j=h,B=D(b,j);j+=4;var w=B&2147483647,Y=(B&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=D(b,j);j+=4,_.push({referenceSize:w,subsegmentDuration:$,info:{duration:$/A,start:P,end:P+w-1}}),P+=w,j+=4,h=j}return{earliestPresentationTime:E,timescale:A,version:p,referencesCount:x,references:_,moovEndOffset:I}}function c(R){for(var S=[],T=m(R,["moov","trak"]),I=0;I<T.length;I++){var O=T[I],_=m(O,["tkhd"])[0];if(_){var b=_.data[_.start],p=b===0?12:20,h=D(_,p),A=m(O,["mdia","mdhd"])[0];if(A){b=A.data[A.start],p=b===0?12:20;var E=D(A,p),v=m(O,["mdia","hdlr"])[0];if(v){var P=H(v.data.subarray(v.start+8,v.start+12)),x={soun:W.ElementaryStreamTypes.AUDIO,vide:W.ElementaryStreamTypes.VIDEO}[P];if(x){var C=m(O,["mdia","minf","stbl","stsd"])[0],j=void 0;C&&(j=H(C.data.subarray(C.start+12,C.start+16))),S[h]={timescale:E,type:x},S[x]={timescale:E,id:h,codec:j}}}}}}var B=m(R,["moov","mvex","trex"]);return B.forEach(function(w){var Y=D(w,4),$=S[Y];$&&($.default={duration:D(w,12),flags:D(w,20)})}),S}function l(R,S){return m(S,["moof","traf"]).reduce(function(T,I){var O=m(I,["tfdt"])[0],_=O.data[O.start],b=m(I,["tfhd"]).reduce(function(p,h){var A=D(h,4),E=R[A];if(E){var v=D(O,4);_===1&&(v*=Math.pow(2,32),v+=D(O,8));var P=E.timescale||9e4,x=v/P;if(isFinite(x)&&(p===null||x<p))return x}return p},null);return b!==null&&isFinite(b)&&(T===null||b<T)?b:T},null)||0}function d(R,S){for(var T=0,I=0,O=0,_=m(R,["moof","traf"]),b=0;b<_.length;b++){var p=_[b],h=m(p,["tfhd"])[0],A=D(h,4),E=S[A];if(!E)continue;var v=E.default,P=D(h,0)|(v==null?void 0:v.flags),x=v==null?void 0:v.duration;P&8&&(P&2?x=D(h,12):x=D(h,8));for(var C=E.timescale||9e4,j=m(p,["trun"]),B=0;B<j.length;B++){if(x){var w=D(j[B],4);T=x*w}else T=o(j[B]);E.type===W.ElementaryStreamTypes.VIDEO?I+=T/C:E.type===W.ElementaryStreamTypes.AUDIO&&(O+=T/C)}}if(I===0&&O===0){var Y=f(R);if(Y!=null&&Y.references)return Y.references.reduce(function($,oe){return $+oe.info.duration||0},0)}return I||O}function o(R){var S=D(R,0),T=8;S&1&&(T+=4),S&4&&(T+=4);for(var I=0,O=D(R,4),_=0;_<O;_++){if(S&256){var b=D(R,T);I+=b,T+=4}S&512&&(T+=4),S&1024&&(T+=4),S&2048&&(T+=4)}return I}function u(R,S,T){m(S,["moof","traf"]).forEach(function(I){m(I,["tfhd"]).forEach(function(O){var _=D(O,4),b=R[_];if(!b)return;var p=b.timescale||9e4;m(I,["tfdt"]).forEach(function(h){var A=h.data[h.start],E=D(h,4);if(A===0)y(h,4,E-T*p);else{E*=Math.pow(2,32),E+=D(h,8),E-=T*p,E=Math.max(E,0);var v=Math.floor(E/(M+1)),P=Math.floor(E%(M+1));y(h,4,v),y(h,8,P)}})})})}function a(R){var S={valid:null,remainder:null},T=m(R,["moof"]);if(T){if(T.length<2)return S.remainder=R,S}else return S;var I=T[T.length-1];return S.valid=Object(V.sliceUint8)(R,0,I.start-8),S.remainder=Object(V.sliceUint8)(R,I.start-8),S}function i(R,S){var T=new Uint8Array(R.length+S.length);return T.set(R),T.set(S,R.length),T}},"./src/utils/output-filter.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(K,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=H}var M=W.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(H,n,D){(this.startTime===null||this.startTime>H)&&(this.startTime=H),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},W}()},"./src/utils/texttrack-utils.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"sendAddTrackEvent",function(){return W}),N.d(z,"addCueToTrack",function(){return M}),N.d(z,"clearCurrentCues",function(){return K}),N.d(z,"removeCuesInRange",function(){return H}),N.d(z,"getCuesInRange",function(){return D});var V=N("./src/utils/logger.ts");function W(y,m){var f;try{f=new Event("addtrack")}catch(c){f=document.createEvent("Event"),f.initEvent("addtrack",!1,!1)}f.track=y,m.dispatchEvent(f)}function M(y,m){var f=y.mode;if(f==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(m.id))try{if(y.addCue(m),!y.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(l){V.logger.debug("[texttrack-utils]: "+l);var c=new self.TextTrackCue(m.startTime,m.endTime,m.text);c.id=m.id,y.addCue(c)}f==="disabled"&&(y.mode=f)}function K(y){var m=y.mode;if(m==="disabled"&&(y.mode="hidden"),y.cues)for(var f=y.cues.length;f--;)y.removeCue(y.cues[f]);m==="disabled"&&(y.mode=m)}function H(y,m,f){var c=y.mode;if(c==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var l=D(y.cues,m,f),d=0;d<l.length;d++)y.removeCue(l[d]);c==="disabled"&&(y.mode=c)}function n(y,m){if(m<y[0].startTime)return 0;var f=y.length-1;if(m>y[f].endTime)return-1;for(var c=0,l=f;c<=l;){var d=Math.floor((l+c)/2);if(m<y[d].startTime)l=d-1;else if(m>y[d].startTime&&c<f)c=d+1;else return d}return y[c].startTime-m<m-y[l].startTime?c:l}function D(y,m,f){var c=[],l=n(y,m);if(l>-1)for(var d=l,o=y.length;d<o;d++){var u=y[d];if(u.startTime>=m&&u.endTime<=f)c.push(u);else if(u.startTime>f)return c}return c}},"./src/utils/time-ranges.ts":function(Z,z,N){"use strict";N.r(z);var V={toString:function(M){for(var K="",H=M.length,n=0;n<H;n++)K+="["+M.start(n).toFixed(3)+","+M.end(n).toFixed(3)+"]";return K}};z.default=V},"./src/utils/timescale-conversion.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"toTimescaleFromBase",function(){return W}),N.d(z,"toTimescaleFromScale",function(){return M}),N.d(z,"toMsFromMpegTsClock",function(){return K}),N.d(z,"toMpegTsClockFromTimescale",function(){return H});var V=9e4;function W(n,D,y,m){y===void 0&&(y=1),m===void 0&&(m=!1);var f=n*D*y;return m?Math.round(f):f}function M(n,D,y,m){return y===void 0&&(y=1),m===void 0&&(m=!1),W(n,D,1/y,m)}function K(n,D){return D===void 0&&(D=!1),W(n,1e3,1/V,D)}function H(n,D){return D===void 0&&(D=1),W(n,V,1/D)}},"./src/utils/typed-array.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"sliceUint8",function(){return V});function V(W,M,K){return Uint8Array.prototype.slice?W.slice(M,K):new Uint8Array(Array.prototype.slice.call(W,M,K))}},"./src/utils/vttcue.ts":function(Z,z,N){"use strict";N.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],W=["start","middle","end","left","right"];function M(y,m){if(typeof m!="string")return!1;if(!Array.isArray(y))return!1;var f=m.toLowerCase();return~y.indexOf(f)?f:!1}function K(y){return M(V,y)}function H(y){return M(W,y)}function n(y){for(var m=arguments.length,f=new Array(m>1?m-1:0),c=1;c<m;c++)f[c-1]=arguments[c];for(var l=1;l<arguments.length;l++){var d=arguments[l];for(var o in d)y[o]=d[o]}return y}function D(y,m,f){var c=this,l={enumerable:!0};c.hasBeenReset=!1;var d="",o=!1,u=y,a=m,i=f,R=null,S="",T=!0,I="auto",O="start",_=50,b="middle",p=50,h="middle";Object.defineProperty(c,"id",n({},l,{get:function(){return d},set:function(E){d=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},l,{get:function(){return o},set:function(E){o=!!E}})),Object.defineProperty(c,"startTime",n({},l,{get:function(){return u},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");u=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},l,{get:function(){return a},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");a=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},l,{get:function(){return i},set:function(E){i=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},l,{get:function(){return R},set:function(E){R=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},l,{get:function(){return S},set:function(E){var v=K(E);if(v===!1)throw new SyntaxError("An invalid or illegal string was specified.");S=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},l,{get:function(){return T},set:function(E){T=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},l,{get:function(){return I},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");I=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},l,{get:function(){return O},set:function(E){var v=H(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");O=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},l,{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({},l,{get:function(){return b},set:function(E){var v=H(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");b=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},l,{get:function(){return p},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");p=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},l,{get:function(){return h},set:function(E){var v=H(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");h=v,this.hasBeenReset=!0}})),c.displayState=void 0}return D.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"parseTimeStamp",function(){return M}),N.d(z,"fixLineBreaks",function(){return m}),N.d(z,"VTTParser",function(){return f});var V=N("./src/utils/vttcue.ts"),W=function(){function c(){}var l=c.prototype;return l.decode=function(o,u){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},c}();function M(c){function l(o,u,a,i){return(o|0)*3600+(u|0)*60+(a|0)+parseFloat(i||0)}var d=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?l(d[2],d[3],0,d[4]):l(d[1],d[2],d[3],d[4]):null}var K=function(){function c(){this.values=Object.create(null)}var l=c.prototype;return l.set=function(o,u){!this.get(o)&&u!==""&&(this.values[o]=u)},l.get=function(o,u,a){return a?this.has(o)?this.values[o]:u[a]:this.has(o)?this.values[o]:u},l.has=function(o){return o in this.values},l.alt=function(o,u,a){for(var i=0;i<a.length;++i)if(u===a[i]){this.set(o,u);break}},l.integer=function(o,u){/^-?\d+$/.test(u)&&this.set(o,parseInt(u,10))},l.percent=function(o,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var a=parseFloat(u);if(a>=0&&a<=100)return this.set(o,a),!0}return!1},c}();function H(c,l,d,o){var u=o?c.split(o):[c];for(var a in u){if(typeof u[a]!="string")continue;var i=u[a].split(d);if(i.length!==2)continue;var R=i[0],S=i[1];l(R,S)}}var n=new V.default(0,0,""),D=n.align==="middle"?"middle":"center";function y(c,l,d){var o=c;function u(){var R=M(c);if(R===null)throw new Error("Malformed timestamp: "+o);return c=c.replace(/^[^\sa-zA-Z-]+/,""),R}function a(R,S){var T=new K;H(R,function(_,b){var p;switch(_){case"region":for(var h=d.length-1;h>=0;h--)if(d[h].id===b){T.set(_,d[h].region);break}break;case"vertical":T.alt(_,b,["rl","lr"]);break;case"line":p=b.split(","),T.integer(_,p[0]),T.percent(_,p[0])&&T.set("snapToLines",!1),T.alt(_,p[0],["auto"]),p.length===2&&T.alt("lineAlign",p[1],["start",D,"end"]);break;case"position":p=b.split(","),T.percent(_,p[0]),p.length===2&&T.alt("positionAlign",p[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":T.percent(_,b);break;case"align":T.alt(_,b,["start",D,"end","left","right"]);break}},/:/,/\s/),S.region=T.get("region",null),S.vertical=T.get("vertical","");var I=T.get("line","auto");I==="auto"&&n.line===-1&&(I=-1),S.line=I,S.lineAlign=T.get("lineAlign","start"),S.snapToLines=T.get("snapToLines",!0),S.size=T.get("size",100),S.align=T.get("align",D);var O=T.get("position","auto");O==="auto"&&n.position===50&&(O=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=O}function i(){c=c.replace(/^\s+/,"")}if(i(),l.startTime=u(),i(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);c=c.substr(3),i(),l.endTime=u(),i(),a(c,l)}function m(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var f=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new W,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=c.prototype;return l.parse=function(o){var u=this;o&&(u.buffer+=u.decoder.decode(o,{stream:!0}));function a(){var O=u.buffer,_=0;for(O=m(O);_<O.length&&O[_]!=="\r"&&O[_]!==`
|
|
`;)++_;var b=O.substr(0,_);return O[_]==="\r"&&++_,O[_]===`
|
|
`&&++_,u.buffer=O.substr(_),b}function i(O){H(O,function(_,b){},/:/)}try{var R="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;R=a();var S=R.match(/^()?WEBVTT([ \t].*)?$/);if(!S||!S[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var T=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;T?T=!1:R=a();switch(u.state){case"HEADER":/:/.test(R)?i(R):R||(u.state="ID");continue;case"NOTE":R||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){u.state="NOTE";break}if(!R)continue;if(u.cue=new V.default(0,0,""),u.state="CUE",R.indexOf("-->")===-1){u.cue.id=R;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{y(R,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var I=R.indexOf("-->")!==-1;if(!R||I&&(T=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
|
|
`),u.cue.text+=R}continue;case"BADCUE":R||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
|
|
|
|
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){o.onparsingerror&&o.onparsingerror(u)}return o.onflush&&o.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(Z,z,N){"use strict";N.r(z),N.d(z,"generateCueId",function(){return f}),N.d(z,"parseWebVTT",function(){return l});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/vttparser.ts"),M=N("./src/demux/id3.ts"),K=N("./src/utils/timescale-conversion.ts"),H=N("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(o,u,a){return a===void 0&&(a=0),o.substr(a,u.length)===u},y=function(o){var u=parseInt(o.substr(-3)),a=parseInt(o.substr(-6,2)),i=parseInt(o.substr(-9,2)),R=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(u)||!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(i)||!Object(V.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return u+=1e3*a,u+=60*1e3*i,u+=60*60*1e3*R,u},m=function(o){for(var u=5381,a=o.length;a;)u=u*33^o.charCodeAt(--a);return(u>>>0).toString()};function f(d,o,u){return m(d.toString())+m(o.toString())+m(u)}var c=function(o,u,a){var i=o[u],R=o[i.prevCC];if(!R||!R.new&&i.new){o.ccOffset=o.presentationOffset=i.start,i.new=!1;return}for(;(S=R)!==null&&S!==void 0&&S.new;){var S;o.ccOffset+=i.start-R.start,i.new=!1,i=R,R=o[i.prevCC]}o.presentationOffset=a};function l(d,o,u,a,i,R,S,T){var I=new W.VTTParser,O=Object(M.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),_=[],b=Object(K.toMpegTsClockFromTimescale)(o,u),p="00:00.000",h=0,A=0,E,v=!0,P=!1;I.oncue=function(x){var C=a[i],j=a.ccOffset,B=(h-b)/9e4;if(C!=null&&C.new&&(A!==void 0?j=a.ccOffset=C.start:c(a,i,B)),B&&(j=B-a.presentationOffset),P){var w=x.endTime-x.startTime,Y=Object(H.normalizePts)((x.startTime+j-A)*9e4,R*9e4)/9e4;x.startTime=Y,x.endTime=Y+w}var $=x.text.trim();x.text=decodeURIComponent(encodeURIComponent($)),x.id||(x.id=f(x.startTime,x.endTime,$)),x.endTime>0&&_.push(x)},I.onparsingerror=function(x){E=x},I.onflush=function(){if(E){T(E);return}S(_)},O.forEach(function(x){if(v)if(D(x,"X-TIMESTAMP-MAP=")){v=!1,P=!0,x.substr(16).split(",").forEach(function(C){D(C,"LOCAL:")?p=C.substr(6):D(C,"MPEGTS:")&&(h=parseInt(C.substr(7)))});try{A=y(p)/1e3}catch(C){P=!1,E=C}return}else x===""&&(v=!1);I.parse(x+`
|
|
`)}),I.flush()}},"./src/utils/xhr-loader.ts":function(Z,z,N){"use strict";N.r(z);var V=N("./src/utils/logger.ts"),W=N("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,K=function(){function H(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 W.LoadStats,this.retryDelay=0}var n=H.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},n.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(y,m,f){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=m,this.callbacks=f,this.retryDelay=m.retryDelay,this.loadInternal()},n.loadInternal=function(){var y=this.config,m=this.context;if(!y)return;var f=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var l=this.xhrSetup;try{if(l)try{l(f,m.url)}catch(u){f.open("GET",m.url,!0),l(f,m.url)}f.readyState||f.open("GET",m.url,!0);var d=this.context.headers;if(d)for(var o in d)f.setRequestHeader(o,d[o])}catch(u){this.callbacks.onError({code:f.status,text:u.message},m,f);return}m.rangeEnd&&f.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),f.onreadystatechange=this.readystatechange.bind(this),f.onprogress=this.loadprogress.bind(this),f.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),f.send()},n.readystatechange=function(){var y=this.context,m=this.loader,f=this.stats;if(!y||!m)return;var c=m.readyState,l=this.config;if(f.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),f.loading.first===0&&(f.loading.first=Math.max(self.performance.now(),f.loading.start)),c===4){m.onreadystatechange=null,m.onprogress=null;var d=m.status;if(d>=200&&d<300){f.loading.end=Math.max(self.performance.now(),f.loading.first);var o,u;if(y.responseType==="arraybuffer"?(o=m.response,u=o.byteLength):(o=m.responseText,u=o.length),f.loaded=f.total=u,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(f,y,o,m),!this.callbacks)return;var i={url:m.responseURL,data:o};this.callbacks.onSuccess(i,f,y,m)}else f.retry>=l.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+y.url),this.callbacks.onError({code:d,text:m.statusText},y,m)):(V.logger.warn(d+" while loading "+y.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,l.maxRetryDelay),f.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},n.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(y){var m=this.stats;m.loaded=y.loaded,y.lengthComputable&&(m.total=y.total)},n.getCacheAge=function(){var y=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");y=m?parseFloat(m):null}return y},H}();z.default=K}}).default})},vHTk:function(Ye,se,U){Ye.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Ye,se,U){"use strict";U.d(se,"a",function(){return ft});var Z=U("rePB"),z=U("VTBJ"),N=U("KQm4"),V=U("U8pU"),W=U("ODXe"),M=U("q1tI"),K=U("TSYQ"),H=U.n(K),n=U("Gytx"),D=U.n(n),y=U("Kwbf"),m=U("t23M"),f=U("qx4F"),c=U("6eGT"),l=U("IBYe"),d=U("Ff2n"),o=U("c+Xe"),u=U("fyJ8"),a=U("biw7");function i(Ne,Oe,nt,lt,Ke){var Xe=nt[Ne]||{},Se=nt[Oe]||{},ge,Ee;Xe.fixed==="left"?ge=lt.left[Ne]:Se.fixed==="right"&&(Ee=lt.right[Oe]);var ie=!1,ae=!1,he=!1,ve=!1,Te=nt[Oe+1],Ge=nt[Ne-1];if(Ke==="rtl"){if(ge!==void 0){var ot=Ge&&Ge.fixed==="left";ve=!ot}else if(Ee!==void 0){var Tt=Te&&Te.fixed==="right";he=!Tt}}else if(ge!==void 0){var Ot=Te&&Te.fixed==="left";ie=!Ot}else if(Ee!==void 0){var wt=Ge&&Ge.fixed==="right";ae=!wt}return{fixLeft:ge,fixRight:Ee,lastFixLeft:ie,firstFixRight:ae,lastFixRight:he,firstFixLeft:ve,isSticky:lt.isSticky}}var R=U("sR1s");function S(Ne){var Oe=Ne.cells,nt=Ne.stickyOffsets,lt=Ne.flattenColumns,Ke=Ne.rowComponent,Xe=Ne.cellComponent,Se=Ne.onHeaderRow,ge=Ne.index,Ee=M.useContext(a.a),ie=Ee.prefixCls,ae=Ee.direction,he;Se&&(he=Se(Oe.map(function(Te){return Te.column}),ge));var ve=Object(R.a)(Oe.map(function(Te){return Te.column}));return M.createElement(Ke,Object.assign({},he),Oe.map(function(Te,Ge){var ot=Te.column,Tt=i(Te.colStart,Te.colEnd,lt,nt,ae),Ot;return ot&&ot.onHeaderCell&&(Ot=Te.column.onHeaderCell(ot)),M.createElement(u.a,Object.assign({},Te,{ellipsis:ot.ellipsis,align:ot.align,component:Xe,prefixCls:ie,key:ve[Ge]},Tt,{additionalProps:Ot,rowType:"header"}))}))}S.displayName="HeaderRow";var T=S;function I(Ne){var Oe=[];function nt(Se,ge){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Oe[Ee]=Oe[Ee]||[];var ie=ge,ae=Se.filter(Boolean).map(function(he){var ve={key:he.key,className:he.className||"",children:he.title,column:he,colStart:ie},Te=1,Ge=he.children;return Ge&&Ge.length>0&&(Te=nt(Ge,ie,Ee+1).reduce(function(ot,Tt){return ot+Tt},0),ve.hasSubColumns=!0),"colSpan"in he&&(Te=he.colSpan),"rowSpan"in he&&(ve.rowSpan=he.rowSpan),ve.colSpan=Te,ve.colEnd=ve.colStart+Te-1,Oe[Ee].push(ve),ie+=Te,Te});return ae}nt(Ne,0);for(var lt=Oe.length,Ke=function(ge){Oe[ge].forEach(function(Ee){!("rowSpan"in Ee)&&!Ee.hasSubColumns&&(Ee.rowSpan=lt-ge)})},Xe=0;Xe<lt;Xe+=1)Ke(Xe);return Oe}function O(Ne){var Oe=Ne.stickyOffsets,nt=Ne.columns,lt=Ne.flattenColumns,Ke=Ne.onHeaderRow,Xe=M.useContext(a.a),Se=Xe.prefixCls,ge=Xe.getComponent,Ee=M.useMemo(function(){return I(nt)},[nt]),ie=ge(["header","wrapper"],"thead"),ae=ge(["header","row"],"tr"),he=ge(["header","cell"],"th");return M.createElement(ie,{className:"".concat(Se,"-thead")},Ee.map(function(ve,Te){var Ge=M.createElement(T,{key:Te,flattenColumns:lt,cells:ve,stickyOffsets:Oe,rowComponent:ae,cellComponent:he,onHeaderRow:Ke,index:Te});return Ge}))}var _=O,b=U("hW8S");function p(Ne){for(var Oe=Ne.colWidths,nt=Ne.columns,lt=Ne.columCount,Ke=[],Xe=lt||nt.length,Se=!1,ge=Xe-1;ge>=0;ge-=1){var Ee=Oe[ge],ie=nt&&nt[ge],ae=ie&&ie[b.a];(Ee||ae||Se)&&(Ke.unshift(M.createElement("col",Object.assign({key:ge,style:{width:Ee,minWidth:Ee}},ae))),Se=!0)}return M.createElement("colgroup",null,Ke)}var h=p;function A(Ne,Oe){return Object(M.useMemo)(function(){for(var nt=[],lt=0;lt<Oe;lt+=1){var Ke=Ne[lt];if(Ke!==void 0)nt[lt]=Ke;else return null}return nt},[Ne.join("_"),Oe])}var E=M.forwardRef(function(Ne,Oe){var nt=Ne.noData,lt=Ne.columns,Ke=Ne.flattenColumns,Xe=Ne.colWidths,Se=Ne.columCount,ge=Ne.stickyOffsets,Ee=Ne.direction,ie=Ne.fixHeader,ae=Ne.offsetHeader,he=Ne.stickyClassName,ve=Ne.onScroll,Te=Object(d.a)(Ne,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ge=M.useContext(a.a),ot=Ge.prefixCls,Tt=Ge.scrollbarSize,Ot=Ge.isSticky,wt=Ot&&!ie?0:Tt,vt=M.useRef(null),qe=M.useCallback(function(Je){Object(o.b)(Oe,Je),Object(o.b)(vt,Je)},[]);M.useEffect(function(){var Je;function mt(We){var it=We.currentTarget,st=We.deltaX;st&&(ve({currentTarget:it,scrollLeft:it.scrollLeft+st}),We.preventDefault())}return(Je=vt.current)===null||Je===void 0||Je.addEventListener("wheel",mt),function(){var We;(We=vt.current)===null||We===void 0||We.removeEventListener("wheel",mt)}},[]);var Qe=Ke[Ke.length-1],Ue={fixed:Qe?Qe.fixed:null,onHeaderCell:function(){return{className:"".concat(ot,"-cell-scrollbar")}}},ue=Object(M.useMemo)(function(){return wt?[].concat(Object(N.a)(lt),[Ue]):lt},[wt,lt]),me=Object(M.useMemo)(function(){return wt?[].concat(Object(N.a)(Ke),[Ue]):Ke},[wt,Ke]),$e=Object(M.useMemo)(function(){var Je=ge.right,mt=ge.left;return Object(z.a)(Object(z.a)({},ge),{},{left:Ee==="rtl"?[].concat(Object(N.a)(mt.map(function(We){return We+wt})),[0]):mt,right:Ee==="rtl"?Je:[].concat(Object(N.a)(Je.map(function(We){return We+wt})),[0]),isSticky:Ot})},[wt,ge,Ot]),je=A(Xe,Se);return M.createElement("div",{style:Object(z.a)({overflow:"hidden"},Ot?{top:ae}:{}),ref:qe,className:H()("".concat(ot,"-header"),Object(Z.a)({},he,!!he))},M.createElement("table",{style:{tableLayout:"fixed",visibility:nt||je?null:"hidden"}},M.createElement(h,{colWidths:je?[].concat(Object(N.a)(je),[wt]):[],columCount:Se+1,columns:me}),M.createElement(_,Object.assign({},Te,{stickyOffsets:$e,columns:ue,flattenColumns:me}))))});E.displayName="FixedHeader";var v=E,P=M.createContext(null),x=P;function C(Ne){var Oe=Ne.prefixCls,nt=Ne.children,lt=Ne.component,Ke=Ne.cellComponent,Xe=Ne.fixHeader,Se=Ne.fixColumn,ge=Ne.horizonScroll,Ee=Ne.className,ie=Ne.expanded,ae=Ne.componentWidth,he=Ne.colSpan,ve=M.useContext(a.a),Te=ve.scrollbarSize;return M.useMemo(function(){var Ge=nt;return Se&&(Ge=M.createElement("div",{style:{width:ae-(Xe?Te:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Oe,"-expanded-row-fixed")},Ge)),M.createElement(lt,{className:Ee,style:{display:ie?null:"none"}},M.createElement(u.a,{component:Ke,prefixCls:Oe,colSpan:he},Ge))},[nt,lt,Xe,ge,Ee,ie,ae,he,Te])}var j=C;function B(Ne){var Oe=Ne.className,nt=Ne.style,lt=Ne.record,Ke=Ne.index,Xe=Ne.rowKey,Se=Ne.getRowKey,ge=Ne.rowExpandable,Ee=Ne.expandedKeys,ie=Ne.onRow,ae=Ne.indent,he=ae===void 0?0:ae,ve=Ne.rowComponent,Te=Ne.cellComponent,Ge=Ne.childrenColumnName,ot=M.useContext(a.a),Tt=ot.prefixCls,Ot=ot.fixedInfoList,wt=M.useContext(x),vt=wt.fixHeader,qe=wt.fixColumn,Qe=wt.horizonScroll,Ue=wt.componentWidth,ue=wt.flattenColumns,me=wt.expandableType,$e=wt.expandRowByClick,je=wt.onTriggerExpand,Je=wt.rowClassName,mt=wt.expandedRowClassName,We=wt.indentSize,it=wt.expandIcon,st=wt.expandedRowRender,dt=wt.expandIconColumnIndex,Et=M.useState(!1),jt=Object(W.a)(Et,2),en=jt[0],Yt=jt[1],Ct=Ee&&Ee.has(Ne.recordKey);M.useEffect(function(){Ct&&Yt(!0)},[Ct]);var pn=me==="row"&&(!ge||ge(lt)),Rt=me==="nest",zt=Ge&<&<[Ge],Pt=pn||Rt,qt;ie&&(qt=ie(lt,Ke));var yn=function(L){if($e&&Pt&&je(lt,L),qt&&qt.onClick){for(var k,G=arguments.length,te=new Array(G>1?G-1:0),J=1;J<G;J++)te[J-1]=arguments[J];(k=qt).onClick.apply(k,[L].concat(te))}},wn;typeof Je=="string"?wn=Je:typeof Je=="function"&&(wn=Je(lt,Ke,he));var yt=Object(R.a)(ue),Vt=M.createElement(ve,Object.assign({},qt,{"data-row-key":Xe,className:H()(Oe,"".concat(Tt,"-row"),"".concat(Tt,"-row-level-").concat(he),wn,qt&&qt.className),style:Object(z.a)(Object(z.a)({},nt),qt?qt.style:null),onClick:yn}),ue.map(function(Q,L){var k=Q.render,G=Q.dataIndex,te=Q.className,J=yt[L],Ie=Ot[L],at;L===(dt||0)&&Rt&&(at=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(We*he,"px")},className:"".concat(Tt,"-row-indent indent-level-").concat(he)}),it({prefixCls:Tt,expanded:Ct,expandable:zt,record:lt,onExpand:je})));var St;return Q.onCell&&(St=Q.onCell(lt,Ke)),M.createElement(u.a,Object.assign({className:te,ellipsis:Q.ellipsis,align:Q.align,component:Te,prefixCls:Tt,key:J,record:lt,index:Ke,dataIndex:G,render:k,shouldCellUpdate:Q.shouldCellUpdate},Ie,{appendNode:at,additionalProps:St}))})),Mn;if(pn&&(en||Ct)){var Un=st(lt,Ke,he+1,Ct),Pn=mt&&mt(lt,Ke,he);Mn=M.createElement(j,{expanded:Ct,className:H()("".concat(Tt,"-expanded-row"),"".concat(Tt,"-expanded-row-level-").concat(he+1),Pn),prefixCls:Tt,fixHeader:vt,fixColumn:qe,horizonScroll:Qe,component:ve,componentWidth:Ue,cellComponent:Te,colSpan:ue.length},Un)}var Vn;return zt&&Ct&&(Vn=(lt[Ge]||[]).map(function(Q,L){var k=Se(Q,L);return M.createElement(B,Object.assign({},Ne,{key:k,rowKey:k,record:Q,recordKey:k,index:L,indent:he+1}))})),M.createElement(M.Fragment,null,Vt,Mn,Vn)}B.displayName="BodyRow";var w=B,Y=M.createContext(null),$=Y;function oe(Ne){var Oe=Ne.columnKey,nt=Ne.onColumnResize,lt=M.useRef();return M.useEffect(function(){lt.current&&nt(Oe,lt.current.offsetWidth)},[]),M.createElement(m.a,{onResize:function(Xe){var Se=Xe.offsetWidth;nt(Oe,Se)}},M.createElement("td",{ref:lt,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function de(Ne){var Oe=Ne.data,nt=Ne.getRowKey,lt=Ne.measureColumnWidth,Ke=Ne.expandedKeys,Xe=Ne.onRow,Se=Ne.rowExpandable,ge=Ne.emptyNode,Ee=Ne.childrenColumnName,ie=M.useContext($),ae=ie.onColumnResize,he=M.useContext(a.a),ve=he.prefixCls,Te=he.getComponent,Ge=M.useContext(x),ot=Ge.fixHeader,Tt=Ge.horizonScroll,Ot=Ge.flattenColumns,wt=Ge.componentWidth;return M.useMemo(function(){var vt=Te(["body","wrapper"],"tbody"),qe=Te(["body","row"],"tr"),Qe=Te(["body","cell"],"td"),Ue;Oe.length?Ue=Oe.map(function(me,$e){var je=nt(me,$e);return M.createElement(w,{key:je,rowKey:je,record:me,recordKey:je,index:$e,rowComponent:qe,cellComponent:Qe,expandedKeys:Ke,onRow:Xe,getRowKey:nt,rowExpandable:Se,childrenColumnName:Ee})}):Ue=M.createElement(j,{expanded:!0,className:"".concat(ve,"-placeholder"),prefixCls:ve,fixHeader:ot,fixColumn:Tt,horizonScroll:Tt,component:qe,componentWidth:wt,cellComponent:Qe,colSpan:Ot.length},ge);var ue=Object(R.a)(Ot);return M.createElement(vt,{className:"".concat(ve,"-tbody")},lt&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(ve,"-measure-row"),style:{height:0}},ue.map(function(me){return M.createElement(oe,{key:me,columnKey:me,onColumnResize:ae})})),Ue)},[Oe,ve,Xe,lt,Ke,nt,Te,wt,ge,Ot])}var Fe=M.memo(de);Fe.displayName="Body";var Ae=Fe,Re=U("wRmb"),Me=U("xEkU"),Be=U.n(Me);function pe(Ne){var Oe=Object(M.useRef)(Ne),nt=Object(M.useState)({}),lt=Object(W.a)(nt,2),Ke=lt[1],Xe=Object(M.useRef)(null),Se=Object(M.useRef)([]);function ge(Ee){Xe.current===null&&(Se.current=[],Xe.current=Be()(function(){Se.current.forEach(function(ie){Oe.current=ie(Oe.current)}),Xe.current=null,Ke({})})),Se.current.push(Ee)}return Object(M.useEffect)(function(){return function(){Be.a.cancel(Xe.current)}},[]),[Oe.current,ge]}function fe(Ne){var Oe=Object(M.useRef)(Ne),nt=Object(M.useRef)(null);function lt(){window.clearTimeout(nt.current)}function Ke(Se){Oe.current=Se,lt(),nt.current=window.setTimeout(function(){Oe.current=null,nt.current=null},100)}function Xe(){return Oe.current}return Object(M.useEffect)(function(){return lt},[]),[Ke,Xe]}function ne(Ne,Oe,nt){var lt=Object(M.useMemo)(function(){for(var Ke=[],Xe=[],Se=0,ge=0,Ee=0;Ee<Oe;Ee+=1)if(nt==="rtl"){Xe[Ee]=ge,ge+=Ne[Ee]||0;var ie=Oe-Ee-1;Ke[ie]=Se,Se+=Ne[ie]||0}else{Ke[Ee]=Se,Se+=Ne[Ee]||0;var ae=Oe-Ee-1;Xe[ae]=ge,ge+=Ne[ae]||0}return{left:Ke,right:Xe}},[Ne,Oe,nt]);return lt}var xe=ne;function ce(Ne){var Oe=Ne.className,nt=Ne.children;return M.createElement("div",{className:Oe},nt)}var Pe=ce,He=U("n6Qo");function ke(Ne){var Oe,nt=Ne.prefixCls,lt=Ne.record,Ke=Ne.onExpand,Xe=Ne.expanded,Se=Ne.expandable,ge="".concat(nt,"-row-expand-icon");if(!Se)return M.createElement("span",{className:H()(ge,"".concat(nt,"-row-spaced"))});var Ee=function(ae){Ke(lt,ae),ae.stopPropagation()};return M.createElement("span",{className:H()(ge,(Oe={},Object(Z.a)(Oe,"".concat(nt,"-row-expanded"),Xe),Object(Z.a)(Oe,"".concat(nt,"-row-collapsed"),!Xe),Oe)),onClick:Ee})}function Ve(Ne,Oe,nt){var lt=[];function Ke(Xe){(Xe||[]).forEach(function(Se,ge){lt.push(Oe(Se,ge)),Ke(Se[nt])})}return Ke(Ne),lt}var et=U("zT1h"),le=U("y0+3"),_e=function(Oe,nt){var lt,Ke,Xe=Oe.scrollBodyRef,Se=Oe.onScroll,ge=Oe.offsetScroll,Ee=M.useContext(a.a),ie=Ee.prefixCls,ae=((lt=Xe.current)===null||lt===void 0?void 0:lt.scrollWidth)||0,he=((Ke=Xe.current)===null||Ke===void 0?void 0:Ke.clientWidth)||0,ve=ae&&he*(he/ae),Te=M.useRef(),Ge=pe({scrollLeft:0,isHiddenScrollBar:!1}),ot=Object(W.a)(Ge,2),Tt=ot[0],Ot=ot[1],wt=M.useRef({delta:0,x:0}),vt=M.useState(!1),qe=Object(W.a)(vt,2),Qe=qe[0],Ue=qe[1],ue=function(){Ue(!1)},me=function(We){We.persist(),wt.current.delta=We.pageX-Tt.scrollLeft,wt.current.x=0,Ue(!0),We.preventDefault()},$e=function(We){var it,st=We||((it=window)===null||it===void 0?void 0:it.event),dt=st.buttons;if(!Qe||dt===0){Qe&&Ue(!1);return}var Et=wt.current.x+We.pageX-wt.current.x-wt.current.delta;Et<=0&&(Et=0),Et+ve>=he&&(Et=he-ve),Se({scrollLeft:Et/he*(ae+2)}),wt.current.x=We.pageX},je=function(){var We=Object(le.b)(Xe.current).top,it=We+Xe.current.offsetHeight,st=document.documentElement.scrollTop+window.innerHeight;it-Object(f.a)()<=st||We>=st-ge?Ot(function(dt){return Object(z.a)(Object(z.a)({},dt),{},{isHiddenScrollBar:!0})}):Ot(function(dt){return Object(z.a)(Object(z.a)({},dt),{},{isHiddenScrollBar:!1})})},Je=function(We){Ot(function(it){return Object(z.a)(Object(z.a)({},it),{},{scrollLeft:We/ae*he||0})})};return M.useImperativeHandle(nt,function(){return{setScrollLeft:Je}}),M.useEffect(function(){var mt=Object(et.a)(document.body,"mouseup",ue,!1),We=Object(et.a)(document.body,"mousemove",$e,!1);return je(),function(){mt.remove(),We.remove()}},[ve,Qe]),M.useEffect(function(){var mt=Object(et.a)(window,"scroll",je,!1),We=Object(et.a)(window,"resize",je,!1);return function(){mt.remove(),We.remove()}},[]),M.useEffect(function(){Tt.isHiddenScrollBar||Ot(function(mt){var We,it;return Object(z.a)(Object(z.a)({},mt),{},{scrollLeft:Xe.current.scrollLeft/((We=Xe.current)===null||We===void 0?void 0:We.scrollWidth)*((it=Xe.current)===null||it===void 0?void 0:it.clientWidth)})})},[Tt.isHiddenScrollBar]),ae<=he||!ve||Tt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(f.a)(),width:he,bottom:ge},className:"".concat(ie,"-sticky-scroll")},M.createElement("div",{onMouseDown:me,ref:Te,className:H()("".concat(ie,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(ie,"-sticky-scroll-bar-active"),Qe)),style:{width:"".concat(ve,"px"),transform:"translate3d(".concat(Tt.scrollLeft,"px, 0, 0)")}}))},Ce=M.forwardRef(_e);function De(Ne,Oe){return M.useMemo(function(){var nt=!!Ne;return{isSticky:nt,stickyClassName:nt?"".concat(Oe,"-sticky-header"):"",offsetHeader:Object(V.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object(V.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,Oe])}var tt=[],ct={},ft="rc-table-internal-hook",ut=M.memo(function(Ne){var Oe=Ne.children;return Oe},function(Ne,Oe){return D()(Ne.props,Oe.props)?Ne.pingLeft!==Oe.pingLeft||Ne.pingRight!==Oe.pingRight:!1});function xt(Ne){var Oe,nt=Ne.prefixCls,lt=Ne.className,Ke=Ne.rowClassName,Xe=Ne.style,Se=Ne.data,ge=Ne.rowKey,Ee=Ne.scroll,ie=Ne.tableLayout,ae=Ne.direction,he=Ne.title,ve=Ne.footer,Te=Ne.summary,Ge=Ne.id,ot=Ne.showHeader,Tt=Ne.components,Ot=Ne.emptyText,wt=Ne.onRow,vt=Ne.onHeaderRow,qe=Ne.internalHooks,Qe=Ne.transformColumns,Ue=Ne.internalRefs,ue=Ne.sticky,me=Se||tt,$e=!!me.length,je=M.useState(0),Je=Object(W.a)(je,2),mt=Je[0],We=Je[1];M.useEffect(function(){We(Object(f.a)())});var it=M.useMemo(function(){return Object(R.c)(Tt,{})},[Tt]),st=M.useCallback(function(xn,gn){return Object(R.b)(it,xn)||gn},[it]),dt=M.useMemo(function(){return typeof ge=="function"?ge:function(xn){var gn=xn&&xn[ge];return gn}},[ge]),Et=Object(b.c)(Ne),jt=Et.expandIcon,en=Et.expandedRowKeys,Yt=Et.defaultExpandedRowKeys,Ct=Et.defaultExpandAllRows,pn=Et.expandedRowRender,Rt=Et.onExpand,zt=Et.onExpandedRowsChange,Pt=Et.expandRowByClick,qt=Et.rowExpandable,yn=Et.expandIconColumnIndex,wn=Et.expandedRowClassName,yt=Et.childrenColumnName,Vt=Et.indentSize,Mn=jt||ke,Un=yt||"children",Pn=M.useMemo(function(){return pn?"row":Ne.expandable&&qe===ft&&Ne.expandable.__PARENT_RENDER_ICON__||me.some(function(xn){return xn&&Object(V.a)(xn)==="object"&&xn[Un]})?"nest":!1},[!!pn,me]),Vn=M.useState(function(){return Yt||(Ct?Ve(me,dt,Un):[])}),Q=Object(W.a)(Vn,2),L=Q[0],k=Q[1],G=M.useMemo(function(){return new Set(en||L||[])},[en,L]),te=M.useCallback(function(xn){var gn=dt(xn,me.indexOf(xn)),En,$n=G.has(gn);$n?(G.delete(gn),En=Object(N.a)(G)):En=[].concat(Object(N.a)(G),[gn]),k(En),Rt&&Rt(!$n,xn),zt&&zt(En)},[dt,G,me,Rt,zt]),J=M.useState(0),Ie=Object(W.a)(J,2),at=Ie[0],St=Ie[1],Ft=Object(Re.b)(Object(z.a)(Object(z.a)(Object(z.a)({},Ne),Et),{},{expandable:!!pn,expandedKeys:G,getRowKey:dt,onTriggerExpand:te,expandIcon:Mn,expandIconColumnIndex:yn,direction:ae}),qe===ft?Qe:null),ye=Object(W.a)(Ft,2),Ut=ye[0],$t=ye[1],Sn=M.useMemo(function(){return{columns:Ut,flattenColumns:$t}},[Ut,$t]),Hn=M.useRef(),Kn=M.useRef(),In=M.useRef(),pr=M.useState(!1),ur=Object(W.a)(pr,2),Bn=ur[0],cr=ur[1],Ar=M.useState(!1),Cr=Object(W.a)(Ar,2),Yn=Cr[0],Wr=Cr[1],Pr=pe(new Map),yr=Object(W.a)(Pr,2),Qr=yr[0],br=yr[1],dr=Object(R.a)($t),Nr=dr.map(function(xn){return Qr.get(xn)}),Hr=M.useMemo(function(){return Nr},[Nr.join("_")]),Er=xe(Hr,$t.length,ae),_n=Ee&&Object(R.d)(Ee.y),sn=Ee&&Object(R.d)(Ee.x),Ln=sn&&$t.some(function(xn){var gn=xn.fixed;return gn}),un=M.useRef(),Rn=De(ue,nt),bn=Rn.isSticky,Or=Rn.offsetHeader,jn=Rn.offsetScroll,Xn=Rn.stickyClassName,Kr,Rr,Gr;_n&&(Rr={overflowY:"scroll",maxHeight:Ee.y}),sn&&(Kr={overflowX:"auto"},_n||(Rr={overflowY:"hidden"}),Gr={width:Ee.x===!0?"auto":Ee.x,minWidth:"100%"});var Ir=M.useCallback(function(xn,gn){br(function(En){var $n=new Map(En);return $n.set(xn,gn),$n})},[]),Dr=fe(null),jr=Object(W.a)(Dr,2),_r=jr[0],zr=jr[1];function Jr(xn,gn){if(!gn)return;typeof gn=="function"?gn(xn):gn.scrollLeft!==xn&&(gn.scrollLeft=xn)}var sr=function(gn){var En=gn.currentTarget,$n=gn.scrollLeft,qr=typeof $n=="number"?$n:En.scrollLeft,Vr=En||ct;if(!zr()||zr()===Vr){var $r;_r(Vr),Jr(qr,Kn.current),Jr(qr,In.current),Jr(qr,($r=un.current)===null||$r===void 0?void 0:$r.setScrollLeft)}if(En){var Ai=En.scrollWidth,Gi=En.clientWidth;cr(qr>0),Wr(qr<Ai-Gi)}},ri=function(){In.current&&sr({currentTarget:In.current})},Gt=function(gn){var En=gn.width;ri(),St(Hn.current?Hn.current.offsetWidth:En)};M.useEffect(function(){return ri},[]),M.useEffect(function(){sn&&ri()},[sn]),M.useEffect(function(){qe===ft&&Ue&&(Ue.body.current=In.current)});var tn=st(["table"],"table"),Xt=M.useMemo(function(){return ie||(Ln?Ee.x==="max-content"?"auto":"fixed":_n||$t.some(function(xn){var gn=xn.ellipsis;return gn})?"fixed":"auto")},[_n,Ln,$t,ie]),on,dn={colWidths:Hr,columCount:$t.length,stickyOffsets:Er,onHeaderRow:vt,fixHeader:_n},An=M.useMemo(function(){return $e?null:typeof Ot=="function"?Ot():Ot},[$e,Ot]),hn=M.createElement(Ae,{data:me,measureColumnWidth:_n||sn||bn,expandedKeys:G,rowExpandable:qt,getRowKey:dt,onRow:wt,emptyNode:An,childrenColumnName:Un}),kn=M.createElement(h,{colWidths:$t.map(function(xn){var gn=xn.width;return gn}),columns:$t}),qn=Te&&M.createElement(He.b,null,Te(me)),ln=st(["body"]);if(_n||bn){var rn;typeof ln=="function"?(rn=ln(me,{scrollbarSize:mt,ref:In,onScroll:sr}),dn.colWidths=$t.map(function(xn,gn){var En=xn.width,$n=gn===Ut.length-1?En-mt:En;return typeof $n=="number"&&!Number.isNaN($n)?$n:(Object(y.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):rn=M.createElement("div",{style:Object(z.a)(Object(z.a)({},Kr),Rr),onScroll:sr,ref:In,className:H()("".concat(nt,"-body"))},M.createElement(tn,{style:Object(z.a)(Object(z.a)({},Gr),{},{tableLayout:Xt})},kn,hn,qn),bn&&M.createElement(Ce,{ref:un,offsetScroll:jn,scrollBodyRef:In,onScroll:sr})),on=M.createElement(M.Fragment,null,ot!==!1&&M.createElement(v,Object.assign({noData:!me.length},dn,Sn,{direction:ae,offsetHeader:Or,stickyClassName:Xn,ref:Kn,onScroll:sr})),rn)}else on=M.createElement("div",{style:Object(z.a)(Object(z.a)({},Kr),Rr),className:H()("".concat(nt,"-content")),onScroll:sr,ref:In},M.createElement(tn,{style:Object(z.a)(Object(z.a)({},Gr),{},{tableLayout:Xt})},kn,ot!==!1&&M.createElement(_,Object.assign({},dn,Sn)),hn,qn));var mn=Object(b.b)(Ne),Qn=M.createElement("div",Object.assign({className:H()(nt,lt,(Oe={},Object(Z.a)(Oe,"".concat(nt,"-rtl"),ae==="rtl"),Object(Z.a)(Oe,"".concat(nt,"-ping-left"),Bn),Object(Z.a)(Oe,"".concat(nt,"-ping-right"),Yn),Object(Z.a)(Oe,"".concat(nt,"-layout-fixed"),ie==="fixed"),Object(Z.a)(Oe,"".concat(nt,"-fixed-header"),_n),Object(Z.a)(Oe,"".concat(nt,"-fixed-column"),Ln),Object(Z.a)(Oe,"".concat(nt,"-scroll-horizontal"),sn),Object(Z.a)(Oe,"".concat(nt,"-has-fix-left"),$t[0]&&$t[0].fixed),Object(Z.a)(Oe,"".concat(nt,"-has-fix-right"),$t[$t.length-1]&&$t[$t.length-1].fixed==="right"),Oe)),style:Xe,id:Ge,ref:Hn},mn),M.createElement(ut,{pingLeft:Bn,pingRight:Yn,props:Object(z.a)(Object(z.a)({},Ne),{},{stickyOffsets:Er,mergedExpandedKeys:G})},he&&M.createElement(Pe,{className:"".concat(nt,"-title")},he(me)),M.createElement("div",{className:"".concat(nt,"-container")},on),ve&&M.createElement(Pe,{className:"".concat(nt,"-footer")},ve(me))));sn&&(Qn=M.createElement(m.a,{onResize:Gt},Qn));var Gn=M.useMemo(function(){return{prefixCls:nt,getComponent:st,scrollbarSize:mt,direction:ae,fixedInfoList:$t.map(function(xn,gn){return i(gn,gn,$t,Er,ae)}),isSticky:bn}},[nt,st,mt,ae,$t,Er,ae,bn]),an=M.useMemo(function(){return Object(z.a)(Object(z.a)({},Sn),{},{tableLayout:Xt,rowClassName:Ke,expandedRowClassName:wn,componentWidth:at,fixHeader:_n,fixColumn:Ln,horizonScroll:sn,expandIcon:Mn,expandableType:Pn,expandRowByClick:Pt,expandedRowRender:pn,onTriggerExpand:te,expandIconColumnIndex:yn,indentSize:Vt})},[Sn,Xt,Ke,wn,at,_n,Ln,sn,Mn,Pn,Pt,pn,te,yn,Vt]),Zr=M.useMemo(function(){return{onColumnResize:Ir}},[Ir]);return M.createElement(a.a.Provider,{value:Gn},M.createElement(x.Provider,{value:an},M.createElement($.Provider,{value:Zr},Qn)))}xt.Column=l.a,xt.ColumnGroup=c.a,xt.Summary=He.a,xt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var bt=se.b=xt},wRmb:function(Ye,se,U){"use strict";U.d(se,"a",function(){return D});var Z=U("rePB"),z=U("KQm4"),N=U("VTBJ"),V=U("Ff2n"),W=U("q1tI"),M=U.n(W),K=U("Kwbf"),H=U("Zm9Q"),n=U("hW8S");function D(l){return Object(H.a)(l).filter(function(d){return W.isValidElement(d)}).map(function(d){var o=d.key,u=d.props,a=u.children,i=Object(V.a)(u,["children"]),R=Object(N.a)({key:o},i);return a&&(R.children=D(a)),R})}function y(l){return l.reduce(function(d,o){var u=o.fixed,a=u===!0?"left":u,i=o.children;return i&&i.length>0?[].concat(Object(z.a)(d),Object(z.a)(y(i).map(function(R){return Object(N.a)({fixed:a},R)}))):[].concat(Object(z.a)(d),[Object(N.a)(Object(N.a)({},o),{},{fixed:a})])},[])}function m(l){for(var d=!0,o=0;o<l.length;o+=1){var u=l[o];if(d&&u.fixed!=="left")d=!1;else if(!d&&u.fixed==="left"){Object(K.a)(!1,"Index ".concat(o-1," of `columns` missing `fixed='left'` prop."));break}}for(var a=!0,i=l.length-1;i>=0;i-=1){var R=l[i];if(a&&R.fixed!=="right")a=!1;else if(!a&&R.fixed==="right"){Object(K.a)(!1,"Index ".concat(i+1," of `columns` missing `fixed='right'` prop."));break}}}function f(l){return l.map(function(d){var o=d.fixed,u=Object(V.a)(d,["fixed"]),a=o;return o==="left"?a="right":o==="right"&&(a="left"),Object(N.a)({fixed:a},u)})}function c(l,d){var o=l.prefixCls,u=l.columns,a=l.children,i=l.expandable,R=l.expandedKeys,S=l.getRowKey,T=l.onTriggerExpand,I=l.expandIcon,O=l.rowExpandable,_=l.expandIconColumnIndex,b=l.direction,p=l.expandRowByClick,h=W.useMemo(function(){return u||D(a)},[u,a]),A=W.useMemo(function(){if(i){var P,x=_||0,C=h[x],j=(P={},Object(Z.a)(P,n.a,{className:"".concat(o,"-expand-icon-col")}),Object(Z.a)(P,"title",""),Object(Z.a)(P,"fixed",C?C.fixed:null),Object(Z.a)(P,"className","".concat(o,"-row-expand-icon-cell")),Object(Z.a)(P,"render",function(Y,$,oe){var de=S($,oe),Fe=R.has(de),Ae=O?O($):!0,Re=I({prefixCls:o,expanded:Fe,expandable:Ae,record:$,onExpand:T});return p?W.createElement("span",{onClick:function(Be){return Be.stopPropagation()}},Re):Re}),P),B=h.slice();return x>=0&&B.splice(x,0,j),B}return h},[i,h,S,R,I,b]),E=W.useMemo(function(){var P=A;return d&&(P=d(P)),P.length||(P=[{render:function(){return null}}]),P},[d,A,b]),v=W.useMemo(function(){return b==="rtl"?f(y(E)):y(E)},[E,b]);return[E,v]}se.b=c},"y0+3":function(Ye,se,U){"use strict";U.d(se,"a",function(){return y}),U.d(se,"b",function(){return f});var Z=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},N={cssFloat:1,styleFloat:1,float:1};function V(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function W(c,l,d){if(l=l.toLowerCase(),d==="auto"){if(l==="height")return c.offsetHeight;if(l==="width")return c.offsetWidth}return l in z||(z[l]=Z.test(l)),z[l]?parseFloat(d)||0:d}function M(c,l){var d=arguments.length,o=V(c);return l=N[l]?"cssFloat"in c.style?"cssFloat":"styleFloat":l,d===1?o:W(c,l,o[l]||c.style[l])}function K(c,l,d){var o=arguments.length;if(l=N[l]?"cssFloat"in c.style?"cssFloat":"styleFloat":l,o===3)return typeof d=="number"&&Z.test(l)&&(d="".concat(d,"px")),c.style[l]=d,d;for(var u in l)l.hasOwnProperty(u)&&K(c,u,l[u]);return V(c)}function H(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),l=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:l}}function y(){var c=document.documentElement.clientWidth,l=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:l}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function f(c){var l=c.getBoundingClientRect(),d=document.documentElement;return{left:l.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||document.body.clientLeft||0),top:l.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||document.body.clientTop||0)}}},yslc:function(Ye,se){Ye.exports="data:image/png;base64,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"}}]);
|