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.
440 lines
1.3 MiB
440 lines
1.3 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[75,5,7,8,13],{"+NIl":function(xt,ve,G){(function(Z){Z(G("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(V,P){"use strict";function z(c,s){c.cmdState.push(s)}function I(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function k(c){var s=c.cmdState.pop();s&&s.closeBracket()}function K(c){for(var s=c.cmdState,d=s.length-1;d>=0;d--){var u=s[d];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function N(c,s,d){return function(){this.name=c,this.bracketNo=0,this.style=s,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=N("importmodule","tag",["string","builtin"]),n.documentclass=N("documentclass","tag",["","atom"]),n.usepackage=N("usepackage","tag",["atom"]),n.begin=N("begin","tag",["atom"]),n.end=N("end","tag",["atom"]),n.label=N("label","tag",["atom"]),n.ref=N("ref","tag",["atom"]),n.eqref=N("eqref","tag",["atom"]),n.cite=N("cite","tag",["atom"]),n.bibitem=N("bibitem","tag",["atom"]),n.Bibitem=N("Bibitem","tag",["atom"]),n.RBibitem=N("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(c,s){c.f=s}function y(c,s){var d;if(c.match(/^\\[a-zA-Z@]+/)){var u=c.current().slice(1);return d=n.hasOwnProperty(u)?n[u]:n.DEFAULT,d=new d,z(s,d),D(s,m),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return D(s,function(o,a){return g(o,a,"\\]")}),"keyword";if(c.match("\\("))return D(s,function(o,a){return g(o,a,"\\)")}),"keyword";if(c.match("$$"))return D(s,function(o,a){return g(o,a,"$$")}),"keyword";if(c.match("$"))return D(s,function(o,a){return g(o,a,"$")}),"keyword";var l=c.next();if(l=="%")return c.skipToEnd(),"comment";if(l=="}"||l=="]"){if(d=I(s),d)d.closeBracket(l),D(s,m);else return"error";return"bracket"}else return l=="{"||l=="["?(d=n.DEFAULT,d=new d,z(s,d),"bracket"):/\d/.test(l)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=K(s),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function g(c,s,d){if(c.eatSpace())return null;if(d&&c.match(d))return D(s,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 u=c.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(c.skipToEnd(),"comment"):"error"}function m(c,s){var d=c.peek(),u;return d=="{"||d=="["?(u=I(s),u.openBracket(d),c.eat(d),D(s,y),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(D(s,y),k(s),y(c,s))}return{startState:function(){var c=P.inMathMode?function(s,d){return g(s,d)}:y;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,s){return s.f(c,s)},blankLine:function(c){c.f=y,c.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(xt,ve,G){},"/cxE":function(xt,ve,G){"use strict";G.d(ve,"f",function(){return P}),G.d(ve,"g",function(){return z}),G.d(ve,"h",function(){return I}),G.d(ve,"e",function(){return K}),G.d(ve,"b",function(){return N}),G.d(ve,"c",function(){return n}),G.d(ve,"d",function(){return D}),G.d(ve,"a",function(){return y});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
|
|
|
|
`+g.stack):g},0)}}emit(g){this.listeners.forEach(m=>{m(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const V=new Z;function P(g){K(g)||V.onUnexpectedError(g);return}function z(g){K(g)||V.onUnexpectedExternalError(g);return}function I(g){if(g instanceof Error){let{name:m,message:c}=g;const s=g.stacktrace||g.stack;return{$isError:!0,name:m,message:c,stack:s}}return g}const k="Canceled";function K(g){return g instanceof Error&&g.name===k&&g.message===k}function N(){const g=new Error(k);return g.name=g.message,g}function n(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function D(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class y extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"0Ru7":function(xt,ve,G){xt.exports={flex_box_center:"flex_box_center___2c1-o",flex_space_between:"flex_space_between___3UEAt",flex_box_vertical_center:"flex_box_vertical_center___2nDIB",flex_box_center_end:"flex_box_center_end___qHyDn",flex_box_column:"flex_box_column___3DlE6",listItem:"listItem___3_YnU",description:"description___34fLF",liked:"liked___9er6D",likedActive:"likedActive___1sBf0",reply:"reply___3pywq",replyList:"replyList___2xs49",comment:"comment___33KCb"}},"19Vz":function(xt,ve,G){(function(Z){Z(G("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(N,n,D){var y=D&&D!=Z.Init;if(n&&!y)N.on("blur",I),N.on("change",k),N.on("swapDoc",k),Z.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){z(N)}),k(N);else if(!n&&y){N.off("blur",I),N.off("change",k),N.off("swapDoc",k),Z.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),V(N);var g=N.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}n&&!N.hasFocus()&&I(N)});function V(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function P(N){V(N);var n=N.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=N.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=N.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),N.display.lineSpace.insertBefore(n,N.display.lineSpace.firstChild)}function z(N){setTimeout(function(){var n=!1,D=N.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:N.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?P(N):V(N)},20)}function I(N){K(N)&&P(N)}function k(N){var n=N.getWrapperElement(),D=K(N);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?P(N):V(N)}function K(N){return N.lineCount()===1&&N.getLine(0)===""}})},"1eCo":function(xt,ve,G){(function(Z){Z(G("VrN/"))})(function(Z){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(z,I){var k=z.indentUnit,K={},N=I.htmlMode?V:P;for(var n in N)K[n]=N[n];for(var n in I)K[n]=I[n];var D,y;function g(h,_){function E(B){return _.tokenize=B,B(h,_)}var x=h.next();if(x=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?E(s("atom","]]>")):null:h.match("--")?E(s("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),E(d(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),_.tokenize=s("meta","?>"),"meta"):(D=h.eat("/")?"closeTag":"openTag",_.tokenize=m,"tag bracket");if(x=="&"){var U;return h.eat("#")?h.eat("x")?U=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):U=h.eatWhile(/[\d]/)&&h.eat(";"):U=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),U?"atom":"error"}else return h.eatWhile(/[^&<]/),null}g.isInText=!0;function m(h,_){var E=h.next();if(E==">"||E=="/"&&h.eat(">"))return _.tokenize=g,D=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return D="equals",null;if(E=="<"){_.tokenize=g,_.state=a,_.tagName=_.tagStart=null;var x=_.tokenize(h,_);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(E)?(_.tokenize=c(E),_.stringStartCol=h.column(),_.tokenize(h,_)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(h){var _=function(E,x){for(;!E.eol();)if(E.next()==h){x.tokenize=m;break}return"string"};return _.isInAttribute=!0,_}function s(h,_){return function(E,x){for(;!E.eol();){if(E.match(_)){x.tokenize=g;break}E.next()}return h}}function d(h){return function(_,E){for(var x;(x=_.next())!=null;){if(x=="<")return E.tokenize=d(h+1),E.tokenize(_,E);if(x==">")if(h==1){E.tokenize=g;break}else return E.tokenize=d(h-1),E.tokenize(_,E)}return"meta"}}function u(h,_,E){this.prev=h.context,this.tagName=_,this.indent=h.indented,this.startOfLine=E,(K.doNotIndent.hasOwnProperty(_)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function l(h){h.context&&(h.context=h.context.prev)}function o(h,_){for(var E;;){if(!h.context)return;if(E=h.context.tagName,!K.contextGrabbers.hasOwnProperty(E)||!K.contextGrabbers[E].hasOwnProperty(_))return;l(h)}}function a(h,_,E){return h=="openTag"?(E.tagStart=_.column(),C):h=="closeTag"?w:a}function C(h,_,E){return h=="word"?(E.tagName=_.current(),y="tag",A):K.allowMissingTagName&&h=="endTag"?(y="tag bracket",A(h,_,E)):(y="error",C)}function w(h,_,E){if(h=="word"){var x=_.current();return E.context&&E.context.tagName!=x&&K.implicitlyClosed.hasOwnProperty(E.context.tagName)&&l(E),E.context&&E.context.tagName==x||K.matchClosing===!1?(y="tag",T):(y="tag error",R)}else return K.allowMissingTagName&&h=="endTag"?(y="tag bracket",T(h,_,E)):(y="error",R)}function T(h,_,E){return h!="endTag"?(y="error",T):(l(E),a)}function R(h,_,E){return y="error",T(h,_,E)}function A(h,_,E){if(h=="word")return y="attribute",v;if(h=="endTag"||h=="selfcloseTag"){var x=E.tagName,U=E.tagStart;return E.tagName=E.tagStart=null,h=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(x)?o(E,x):(o(E,x),E.context=new u(E,x,U==E.indented)),a}return y="error",A}function v(h,_,E){return h=="equals"?b:(K.allowMissing||(y="error"),A(h,_,E))}function b(h,_,E){return h=="string"?p:h=="word"&&K.allowUnquoted?(y="string",A):(y="error",A(h,_,E))}function p(h,_,E){return h=="string"?p:A(h,_,E)}return{startState:function(h){var _={tokenize:g,state:a,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(_.baseIndent=h),_},token:function(h,_){if(!_.tagName&&h.sol()&&(_.indented=h.indentation()),h.eatSpace())return null;D=null;var E=_.tokenize(h,_);return(E||D)&&E!="comment"&&(y=null,_.state=_.state(D||E,h,_),y&&(E=y=="error"?E+" error":y)),E},indent:function(h,_,E){var x=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+k;if(x&&x.noIndent)return Z.Pass;if(h.tokenize!=m&&h.tokenize!=g)return E?E.match(/^(\s*)/)[0].length:0;if(h.tagName)return K.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+k*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var U=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(U&&U[1])for(;x;)if(x.tagName==U[2]){x=x.prev;break}else if(K.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(U)for(;x;){var B=K.contextGrabbers[x.tagName];if(B&&B.hasOwnProperty(U[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+k: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=A)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var _=[],E=h.context;E;E=E.prev)E.tagName&&_.push(E.tagName);return _.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return V});class Z{constructor(P){this.element=P,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class V{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let P=this._first;for(;P!==Z.Undefined;){const z=P.next;P.prev=Z.Undefined,P.next=Z.Undefined,P=z}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,z){const I=new Z(P);if(this._first===Z.Undefined)this._first=I,this._last=I;else if(z){const K=this._last;this._last=I,I.prev=K,K.next=I}else{const K=this._first;this._first=I,I.next=K,K.prev=I}this._size+=1;let k=!1;return()=>{k||(k=!0,this._remove(I))}}shift(){if(this._first===Z.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===Z.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==Z.Undefined&&P.next!==Z.Undefined){const z=P.prev;z.next=P.next,P.next.prev=z}else P.prev===Z.Undefined&&P.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):P.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):P.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==Z.Undefined;)yield P.element,P=P.next}}},"2tmY":function(xt,ve,G){xt.exports={flex_box_center:"flex_box_center___3cCaq",flex_space_between:"flex_space_between___2qraC",flex_box_vertical_center:"flex_box_vertical_center___vX_NO",flex_box_center_end:"flex_box_center_end___32vQ4",flex_box_column:"flex_box_column___BRJOV",title:"title___22OaF",menuTabs:"menuTabs___WeHMl",rightMenu:"rightMenu___1epZf",shixunDetail:"shixunDetail___34j2C"}},"3/fG":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return V});function Z(P,z){let I;return z.length===0?I=P:I=P.replace(/\{(\d+)\}/g,function(k,K){const N=K[0];return typeof z[N]!="undefined"?z[N]:k}),I}function V(P,z,...I){return Z(z,I)}},"55Ip":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return o});var Z=G("Ty5D"),V=G("dI71"),P=G("q1tI"),z=G.n(P),I=G("YS25"),k=G("17x9"),K=G.n(k),N=G("wx14"),n=G("zLVn"),D=G("9R94"),y=function(b){Object(V.a)(p,b);function p(){for(var _,E=arguments.length,x=new Array(E),U=0;U<E;U++)x[U]=arguments[U];return _=b.call.apply(b,[this].concat(x))||this,_.history=Object(I.a)(_.props),_}var h=p.prototype;return h.render=function(){return z.a.createElement(Z.c,{history:this.history,children:this.props.children})},p}(z.a.Component),g=function(b){Object(V.a)(p,b);function p(){for(var _,E=arguments.length,x=new Array(E),U=0;U<E;U++)x[U]=arguments[U];return _=b.call.apply(b,[this].concat(x))||this,_.history=Object(I.b)(_.props),_}var h=p.prototype;return h.render=function(){return z.a.createElement(Z.c,{history:this.history,children:this.props.children})},p}(z.a.Component),m=function(p,h){return typeof p=="function"?p(h):p},c=function(p,h){return typeof p=="string"?Object(I.c)(p,null,null,h):p},s=function(p){return p},d=z.a.forwardRef;typeof d=="undefined"&&(d=s);function u(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var l=d(function(b,p){var h=b.innerRef,_=b.navigate,E=b.onClick,x=Object(n.a)(b,["innerRef","navigate","onClick"]),U=x.target,B=Object(N.a)({},x,{onClick:function(H){try{E&&E(H)}catch(j){throw H.preventDefault(),j}!H.defaultPrevented&&H.button===0&&(!U||U==="_self")&&!u(H)&&(H.preventDefault(),_())}});return s!==d?B.ref=p||h:B.ref=h,z.a.createElement("a",B)}),o=d(function(b,p){var h=b.component,_=h===void 0?l:h,E=b.replace,x=b.to,U=b.innerRef,B=Object(n.a)(b,["component","replace","to","innerRef"]);return z.a.createElement(Z.e.Consumer,null,function(L){L||Object(D.a)(!1);var H=L.history,j=c(m(x,L.location),L.location),S=j?H.createHref(j):"",J=Object(N.a)({},B,{href:S,navigate:function(){var se=m(x,L.location),fe=E?H.replace:H.push;fe(se)}});return s!==d?J.ref=p||U:J.innerRef=U,z.a.createElement(_,J)})});if(!1)var a,C;var w=function(p){return p},T=z.a.forwardRef;typeof T=="undefined"&&(T=w);function R(){for(var b=arguments.length,p=new Array(b),h=0;h<b;h++)p[h]=arguments[h];return p.filter(function(_){return _}).join(" ")}var A=T(function(b,p){var h=b["aria-current"],_=h===void 0?"page":h,E=b.activeClassName,x=E===void 0?"active":E,U=b.activeStyle,B=b.className,L=b.exact,H=b.isActive,j=b.location,S=b.sensitive,J=b.strict,te=b.style,se=b.to,fe=b.innerRef,Fe=Object(n.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return z.a.createElement(Z.e.Consumer,null,function(Le){Le||Object(D.a)(!1);var De=j||Le.location,He=c(m(se,De),De),We=He.pathname,ye=We&&We.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=ye?Object(Z.f)(De.pathname,{path:ye,exact:L,sensitive:S,strict:J}):null,Ye=!!(H?H(ue,De):ue),vt=Ye?R(B,x):B,ct=Ye?Object(N.a)({},te,{},U):te,it=Object(N.a)({"aria-current":Ye&&_||null,className:vt,style:ct,to:He},Fe);return w!==T?it.ref=p||fe:it.innerRef=fe,z.a.createElement(o,it)})});if(!1)var v},"5VLF":function(xt,ve,G){"use strict";var Z,V;function P(z,I,k){var K=function(N,n){return z.js_beautify(N,n)};return K.js=z.js_beautify,K.css=I.css_beautify,K.html=k.html_beautify,K.js_beautify=z.js_beautify,K.css_beautify=I.css_beautify,K.html_beautify=k.html_beautify,K}!(Z=[G("6UM0"),G("TXwP"),G("psGv")],V=function(z,I,k){return P(z,I,k)}.apply(ve,Z),V!==void 0&&(xt.exports=V))},"5Y4S":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return P});var Z=G("MNsG");const V=Z.b.performance&&typeof Z.b.performance.now=="function";class P{constructor(z){this._highResolution=V&&z,this._startTime=this._now(),this._stopTime=-1}static create(z=!0){return new P(z)}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(xt,ve,G){"use strict";G.d(ve,"a",function(){return T});var Z=G("wx14"),V=G("rePB"),P=G("VTBJ"),z=G("1OyB"),I=G("vuIU"),k=G("Ji7U"),K=G("LK+K"),N=G("q1tI"),n=G.n(N),D=G("TSYQ"),y=G.n(D),g=function(A){var v,b="".concat(A.rootPrefixCls,"-item"),p=y()(b,"".concat(b,"-").concat(A.page),(v={},Object(V.a)(v,"".concat(b,"-active"),A.active),Object(V.a)(v,A.className,!!A.className),Object(V.a)(v,"".concat(b,"-disabled"),!A.page),v)),h=function(){A.onClick(A.page)},_=function(x){A.onKeyPress(x,A.onClick,A.page)};return n.a.createElement("li",{title:A.showTitle?A.page:null,className:p,onClick:h,onKeyPress:_,tabIndex:"0"},A.itemRender(A.page,"page",n.a.createElement("a",{rel:"nofollow"},A.page)))},m=g,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(R){Object(k.a)(v,R);var A=Object(K.a)(v);function v(){var b;Object(z.a)(this,v);for(var p=arguments.length,h=new Array(p),_=0;_<p;_++)h[_]=arguments[_];return b=A.call.apply(A,[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 x=b.props,U=x.goButton,B=x.quickGo,L=x.rootPrefixCls,H=b.state.goInputText;if(U||H==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(L,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(L,"-next"))>=0))return;b.setState({goInputText:""}),B(b.getValidValue())},b.go=function(E){var x=b.state.goInputText;if(x==="")return;(E.keyCode===c.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(I.a)(v,[{key:"getValidValue",value:function(){var p=this.state,h=p.goInputText,_=p.current;return!h||isNaN(h)?_:Number(h)}},{key:"getPageSizeOptions",value:function(){var p=this.props,h=p.pageSize,_=p.pageSizeOptions;return _.some(function(E){return E.toString()===h.toString()})?_:_.concat([h.toString()]).sort(function(E,x){var U=isNaN(Number(E))?0:Number(E),B=isNaN(Number(x))?0:Number(x);return U-B})}},{key:"render",value:function(){var p=this,h=this.props,_=h.pageSize,E=h.locale,x=h.rootPrefixCls,U=h.changeSize,B=h.quickGo,L=h.goButton,H=h.selectComponentClass,j=h.buildOptionText,S=h.selectPrefixCls,J=h.disabled,te=this.state.goInputText,se="".concat(x,"-options"),fe=H,Fe=null,Le=null,De=null;if(!U&&!B)return null;var He=this.getPageSizeOptions();if(U&&fe){var We=He.map(function(ye,ue){return n.a.createElement(fe.Option,{key:ue,value:ye.toString()},(j||p.buildOptionText)(ye))});Fe=n.a.createElement(fe,{disabled:J,prefixCls:S,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||He[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},We)}return B&&(L&&(De=typeof L=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:J,className:"".concat(se,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},L)),Le=n.a.createElement("div",{className:"".concat(se,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:J,type:"text",value:te,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,De)),n.a.createElement("li",{className:"".concat(se)},Fe,Le)}}]),v}(n.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=s,u=G("N2Kk");function l(){}function o(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function a(R,A,v){return v}function C(R,A,v){var b=typeof R=="undefined"?A.pageSize:R;return Math.floor((v.total-1)/b)+1}var w=function(R){Object(k.a)(v,R);var A=Object(K.a)(v);function v(b){var p;Object(z.a)(this,v),p=A.call(this,b),p.getJumpPrevPage=function(){return Math.max(1,p.state.current-(p.props.showLessItems?3:5))},p.getJumpNextPage=function(){return Math.min(C(void 0,p.state,p.props),p.state.current+(p.props.showLessItems?3:5))},p.getItemIcon=function(U,B){var L=p.props.prefixCls,H=U||n.a.createElement("button",{type:"button","aria-label":B,className:"".concat(L,"-item-link")});return typeof U=="function"&&(H=n.a.createElement(U,Object(P.a)({},p.props))),H},p.savePaginationNode=function(U){p.paginationNode=U},p.isValid=function(U){return o(U)&&U!==p.state.current},p.shouldDisplayQuickJumper=function(){var U=p.props,B=U.showQuickJumper,L=U.pageSize,H=U.total;return H<=L?!1:B},p.handleKeyDown=function(U){(U.keyCode===c.ARROW_UP||U.keyCode===c.ARROW_DOWN)&&U.preventDefault()},p.handleKeyUp=function(U){var B=p.getValidValue(U),L=p.state.currentInputValue;B!==L&&p.setState({currentInputValue:B}),U.keyCode===c.ENTER?p.handleChange(B):U.keyCode===c.ARROW_UP?p.handleChange(B-1):U.keyCode===c.ARROW_DOWN&&p.handleChange(B+1)},p.changePageSize=function(U){var B=p.state.current,L=C(U,p.state,p.props);B=B>L?L:B,L===0&&(B=p.state.current),typeof U=="number"&&("pageSize"in p.props||p.setState({pageSize:U}),"current"in p.props||p.setState({current:B,currentInputValue:B})),p.props.onShowSizeChange(B,U),"onChange"in p.props&&p.props.onChange&&p.props.onChange(B,U)},p.handleChange=function(U){var B=p.props.disabled,L=U;if(p.isValid(L)&&!B){var H=C(void 0,p.state,p.props);L>H?L=H:L<1&&(L=1),"current"in p.props||p.setState({current:L,currentInputValue:L});var j=p.state.pageSize;return p.props.onChange(L,j),L}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<C(void 0,p.state,p.props)},p.runIfEnter=function(U,B){if(U.key==="Enter"||U.charCode===13){for(var L=arguments.length,H=new Array(L>2?L-2:0),j=2;j<L;j++)H[j-2]=arguments[j];B.apply(void 0,H)}},p.runIfEnterPrev=function(U){p.runIfEnter(U,p.prev)},p.runIfEnterNext=function(U){p.runIfEnter(U,p.next)},p.runIfEnterJumpPrev=function(U){p.runIfEnter(U,p.jumpPrev)},p.runIfEnterJumpNext=function(U){p.runIfEnter(U,p.jumpNext)},p.handleGoTO=function(U){(U.keyCode===c.ENTER||U.type==="click")&&p.handleChange(p.state.currentInputValue)};var h=b.onChange!==l,_="current"in b;_&&!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 x=b.defaultPageSize;return"pageSize"in b&&(x=b.pageSize),E=Math.min(E,C(x,void 0,b)),p.state={current:E,currentInputValue:E,pageSize:x},p}return Object(I.a)(v,[{key:"componentDidUpdate",value:function(p,h){var _=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(_,"-item-").concat(h.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(p){var h=p.target.value,_=C(void 0,this.state,this.props),E=this.state.currentInputValue,x;return h===""?x=h:isNaN(Number(h))?x=E:h>=_?x=_:x=Number(h),x}},{key:"getShowSizeChanger",value:function(){var p=this.props,h=p.showSizeChanger,_=p.total,E=p.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:_>E}},{key:"renderPrev",value:function(p){var h=this.props,_=h.prevIcon,E=h.itemRender,x=E(p,"prev",this.getItemIcon(_,"prev page")),U=!this.hasPrev();return Object(N.isValidElement)(x)?Object(N.cloneElement)(x,{disabled:U}):x}},{key:"renderNext",value:function(p){var h=this.props,_=h.nextIcon,E=h.itemRender,x=E(p,"next",this.getItemIcon(_,"next page")),U=!this.hasNext();return Object(N.isValidElement)(x)?Object(N.cloneElement)(x,{disabled:U}):x}},{key:"render",value:function(){var p=this,h=this.props,_=h.prefixCls,E=h.className,x=h.style,U=h.disabled,B=h.hideOnSinglePage,L=h.total,H=h.locale,j=h.showQuickJumper,S=h.showLessItems,J=h.showTitle,te=h.showTotal,se=h.simple,fe=h.itemRender,Fe=h.showPrevNextJumpers,Le=h.jumpPrevIcon,De=h.jumpNextIcon,He=h.selectComponentClass,We=h.selectPrefixCls,ye=h.pageSizeOptions,ue=this.state,Ye=ue.current,vt=ue.pageSize,ct=ue.currentInputValue;if(B===!0&&L<=vt)return null;var it=C(void 0,this.state,this.props),ft=[],Qe=null,qe=null,ht=null,de=null,Ie=null,Pe=j&&j.goButton,Ke=S?1:2,st=Ye-1>0?Ye-1:0,at=Ye+1<it?Ye+1:it,et=Object.keys(this.props).reduce(function(re,oe){return(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(re[oe]=p.props[oe]),re},{});if(se)return Pe&&(typeof Pe=="boolean"?Ie=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):Ie=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Pe),Ie=n.a.createElement("li",{title:J?"".concat(H.jump_to).concat(Ye,"/").concat(it):null,className:"".concat(_,"-simple-pager")},Ie)),n.a.createElement("ul",Object(Z.a)({className:y()(_,"".concat(_,"-simple"),Object(V.a)({},"".concat(_,"-disabled"),U),E),style:x,ref:this.savePaginationNode},et),n.a.createElement("li",{title:J?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:y()("".concat(_,"-prev"),Object(V.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(st)),n.a.createElement("li",{title:J?"".concat(Ye,"/").concat(it):null,className:"".concat(_,"-simple-pager")},n.a.createElement("input",{type:"text",value:ct,disabled:U,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(_,"-slash")},"/"),it),n.a.createElement("li",{title:J?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:y()("".concat(_,"-next"),Object(V.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(at)),Ie);if(it<=3+Ke*2){var tt={locale:H,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:J,itemRender:fe};it||ft.push(n.a.createElement(m,Object(Z.a)({},tt,{key:"noPager",page:it,className:"".concat(_,"-disabled")})));for(var dt=1;dt<=it;dt+=1){var yt=Ye===dt;ft.push(n.a.createElement(m,Object(Z.a)({},tt,{key:dt,page:dt,active:yt})))}}else{var Ae=S?H.prev_3:H.prev_5,Se=S?H.next_3:H.next_5;Fe&&(Qe=n.a.createElement("li",{title:J?Ae:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:y()("".concat(_,"-jump-prev"),Object(V.a)({},"".concat(_,"-jump-prev-custom-icon"),!!Le))},fe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Le,"prev page"))),qe=n.a.createElement("li",{title:J?Se:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:y()("".concat(_,"-jump-next"),Object(V.a)({},"".concat(_,"-jump-next-custom-icon"),!!De))},fe(this.getJumpNextPage(),"jump-next",this.getItemIcon(De,"next page")))),de=n.a.createElement(m,{locale:H,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:it,page:it,active:!1,showTitle:J,itemRender:fe}),ht=n.a.createElement(m,{locale:H,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:J,itemRender:fe});var Ve=Math.max(1,Ye-Ke),Je=Math.min(Ye+Ke,it);Ye-1<=Ke&&(Je=1+Ke*2),it-Ye<=Ke&&(Ve=it-Ke*2);for(var Ne=Ve;Ne<=Je;Ne+=1){var je=Ye===Ne;ft.push(n.a.createElement(m,{locale:H,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ne,page:Ne,active:je,showTitle:J,itemRender:fe}))}Ye-1>=Ke*2&&Ye!==1+2&&(ft[0]=Object(N.cloneElement)(ft[0],{className:"".concat(_,"-item-after-jump-prev")}),ft.unshift(Qe)),it-Ye>=Ke*2&&Ye!==it-2&&(ft[ft.length-1]=Object(N.cloneElement)(ft[ft.length-1],{className:"".concat(_,"-item-before-jump-next")}),ft.push(qe)),Ve!==1&&ft.unshift(ht),Je!==it&&ft.push(de)}var Ee=null;te&&(Ee=n.a.createElement("li",{className:"".concat(_,"-total-text")},te(L,[L===0?0:(Ye-1)*vt+1,Ye*vt>L?L:Ye*vt])));var he=!this.hasPrev()||!it,pe=!this.hasNext()||!it;return n.a.createElement("ul",Object(Z.a)({className:y()(_,E,Object(V.a)({},"".concat(_,"-disabled"),U)),style:x,unselectable:"unselectable",ref:this.savePaginationNode},et),Ee,n.a.createElement("li",{title:J?H.prev_page:null,onClick:this.prev,tabIndex:he?null:0,onKeyPress:this.runIfEnterPrev,className:y()("".concat(_,"-prev"),Object(V.a)({},"".concat(_,"-disabled"),he)),"aria-disabled":he},this.renderPrev(st)),ft,n.a.createElement("li",{title:J?H.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:y()("".concat(_,"-next"),Object(V.a)({},"".concat(_,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(at)),n.a.createElement(d,{disabled:U,locale:H,rootPrefixCls:_,selectComponentClass:He,selectPrefixCls:We,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ye,pageSize:vt,pageSizeOptions:ye,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Pe}))}}],[{key:"getDerivedStateFromProps",value:function(p,h){var _={};if("current"in p&&(_.current=p.current,p.current!==h.current&&(_.currentInputValue=_.current)),"pageSize"in p&&p.pageSize!==h.pageSize){var E=h.current,x=C(p.pageSize,h,p);E=E>x?x:E,"current"in p||(_.current=E,_.currentInputValue=E),_.pageSize=p.pageSize}return _}}]),v}(n.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:l,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:l,locale:u.a,style:{},itemRender:a,totalBoundaryShowSizeChanger:50};var T=w},"6RRn":function(xt,ve,G){"use strict";var Z=G("wCXF"),V=G("n6Qo");G.d(ve,"b",function(){return V.a});var P=G("IBYe"),z=G("6eGT"),I=G("hW8S");G.d(ve,"a",function(){return I.a}),ve.c=Z.b},"6UM0":function(xt,ve,G){var Z,V;(function(){var P;(function(){"use strict";var I=[function(n,D,y){var g=y(1).Beautifier,m=y(5).Options;function c(s,d){var u=new g(s,d);return u.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new m}},function(n,D,y){var g=y(2).Output,m=y(3).Token,c=y(4),s=y(5).Options,d=y(7).Tokenizer,u=y(7).line_starters,l=y(7).positionable_operators,o=y(7).TOKEN;function a(S,J){return J.indexOf(S)!==-1}function C(S){return S.replace(/^\s+/g,"")}function w(S){for(var J={},te=0;te<S.length;te++)J[S[te].replace(/-/g,"_")]=S[te];return J}function T(S,J){return S&&S.type===o.RESERVED&&S.text===J}function R(S,J){return S&&S.type===o.RESERVED&&a(S.text,J)}var A=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],b=w(v),p=[b.before_newline,b.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(S,J){if(J.multiline_frame||J.mode===h.ForInitializer||J.mode===h.Conditional)return;S.remove_indent(J.start_line_index)}function E(S){S=S.replace(c.allLineBreaks,`
|
|
`);for(var J=[],te=S.indexOf(`
|
|
`);te!==-1;)J.push(S.substring(0,te)),S=S.substring(te+1),te=S.indexOf(`
|
|
`);return S.length&&J.push(S),J}function x(S){return S===h.ArrayLiteral}function U(S){return a(S,[h.Expression,h.ForInitializer,h.Conditional])}function B(S,J){for(var te=0;te<S.length;te++){var se=S[te].trim();if(se.charAt(0)!==J)return!1}return!0}function L(S,J){for(var te=0,se=S.length,fe;te<se;te++)if(fe=S[te],fe&&fe.indexOf(J)!==0)return!1;return!0}function H(S,J){J=J||{},this._source_text=S||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(J)}H.prototype.create_flags=function(S,J){var te=0;S&&(te=S.indentation_level,!this._output.just_added_newline()&&S.line_indent_level>te&&(te=S.line_indent_level));var se={mode:J,parent:S,last_token:S?S.last_token:new m(o.START_BLOCK,""),last_word:S?S.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:te,alignment:0,line_indent_level:S?S.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},H.prototype._reset=function(S){var J=S.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,J),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var te=new d(S,this._options);return this._tokens=te.tokenize(),S},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S,J=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
|
|
`,J&&c.lineBreak.test(J||"")&&(te=J.match(c.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return S=this._output.get_code(te),S},H.prototype.handle_token=function(S,J){S.type===o.START_EXPR?this.handle_start_expr(S):S.type===o.END_EXPR?this.handle_end_expr(S):S.type===o.START_BLOCK?this.handle_start_block(S):S.type===o.END_BLOCK?this.handle_end_block(S):S.type===o.WORD?this.handle_word(S):S.type===o.RESERVED?this.handle_word(S):S.type===o.SEMICOLON?this.handle_semicolon(S):S.type===o.STRING?this.handle_string(S):S.type===o.EQUALS?this.handle_equals(S):S.type===o.OPERATOR?this.handle_operator(S):S.type===o.COMMA?this.handle_comma(S):S.type===o.BLOCK_COMMENT?this.handle_block_comment(S,J):S.type===o.COMMENT?this.handle_comment(S,J):S.type===o.DOT?this.handle_dot(S):S.type===o.EOF?this.handle_eof(S):S.type===o.UNKNOWN?this.handle_unknown(S,J):this.handle_unknown(S,J)},H.prototype.handle_whitespace_and_comments=function(S,J){var te=S.newlines,se=this._options.keep_array_indentation&&x(this._flags.mode);if(S.comments_before)for(var fe=S.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,J),this.handle_token(fe,J),fe=S.comments_before.next();if(se)for(var Fe=0;Fe<te;Fe+=1)this.print_newline(Fe>0,J);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,J);for(var Le=1;Le<te;Le+=1)this.print_newline(!0,J)}};var j=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(S,J){if(J=J===void 0?!1:J,this._output.just_added_newline())return;var te=this._options.preserve_newlines&&S.newlines||J,se=a(this._flags.last_token.text,l)||a(S.text,l);if(se){var fe=a(this._flags.last_token.text,l)&&a(this._options.operator_position,p)||a(S.text,l);te=te&&fe}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,j))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(S,J){if(!J&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var te=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&T(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(S)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(S){this._output.just_added_newline()&&(this._options.keep_array_indentation&&S.newlines&&(S.text==="["||x(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(S.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},H.prototype.print_token=function(S){if(this._output.raw){this._output.add_raw_token(S);return}if(this._options.comma_first&&S.previous&&S.previous.type===o.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var J=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(J),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(S),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(S),this._output.non_breaking_space=!0,this._output.add_token(S.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.set_mode=function(S){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,S),this._flags=this.create_flags(this._previous_flags,S),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(S){var J=!1;return J=J||R(this._flags.last_token,["var","let","const"])&&S.type===o.WORD,J=J||T(this._flags.last_token,"do"),J=J||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&R(this._flags.last_token,j)&&!S.newlines,J=J||T(this._flags.last_token,"else")&&!(T(S,"if")&&!S.comments_before),J=J||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),J=J||this._flags.last_token.type===o.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(S.text==="--"||S.text==="++")&&this._last_last_text!=="function"&&S.type!==o.WORD&&S.type!==o.RESERVED,J=J||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),J?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(S,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S,R(S,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S);var J=h.Expression;if(S.text==="["){if(this._flags.last_token.type===o.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,u)&&(this._output.space_before_token=!0),this.print_token(S),this.set_mode(J),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}J=h.ArrayLiteral,x(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())),a(this._flags.last_token.type,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,J=h.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,J=h.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&S.whitespace_before===""?this._output.space_before_token=!1:(a(this._flags.last_token.text,u)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var se=this._tokens.peek(-4);R(te,["async","function"])||te.text==="*"&&R(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(se.text==="{"||se.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(S);(this._flags.last_token.type===o.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&a(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===o.START_BLOCK?this.print_newline():(this._flags.last_token.type===o.END_EXPR||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===o.COMMA)&&this.allow_wrap_or_preserved_newline(S,S.newlines),this.print_token(S),this.set_mode(J),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(S){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(S),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(S,S.text==="]"&&x(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===o.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(S),this.restore_mode(),_(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)},H.prototype.handle_start_block=function(S){this.handle_whitespace_and_comments(S);var J=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):te&&(a(te.text,[":",","])&&a(J.type,[o.STRING,o.WORD,o.RESERVED])||a(J.text,["get","set","..."])&&a(te.type,[o.WORD,o.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(te.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===o.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):a(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!J.comments_before&&J.text==="}",fe=se&&this._flags.last_word==="function"&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var Fe=0,Le=null;this._flags.inline_frame=!0;do if(Fe+=1,Le=this._tokens.peek(Fe-1),Le.newlines){this._flags.inline_frame=!1;break}while(Le.type!==o.EOF&&!(Le.type===o.END_BLOCK&&Le.opened===S))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&S.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(fe||this._flags.last_token.type===o.EQUALS||R(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(x(this._previous_flags.mode)&&(this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.COMMA)&&((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(S),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(this._flags.last_token.type===o.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(S),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(S){for(this.handle_whitespace_and_comments(S);this._flags.mode===h.Statement;)this.restore_mode();var J=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!J?this._output.space_before_token=!0:this._options.brace_style==="expand"?J||this.print_newline():J||(x(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(S)},H.prototype.handle_word=function(S){if(S.type===o.RESERVED){if(a(S.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)S.type=o.WORD;else if(S.text==="import"&&a(this._tokens.peek().text,["(","."]))S.type=o.WORD;else if(a(S.text,["as","from"])&&!this._flags.import_block)S.type=o.WORD;else if(this._flags.mode===h.ObjectLiteral){var J=this._tokens.peek();J.text===":"&&(S.type=o.WORD)}}if(this.start_of_statement(S)?R(this._flags.last_token,["var","let","const"])&&S.type===o.WORD&&(this._flags.declaration_statement=!0):S.newlines&&!U(this._flags.mode)&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==o.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(S),this.print_newline()):this.handle_whitespace_and_comments(S),this._flags.do_block&&!this._flags.do_while)if(T(S,"while")){this._output.space_before_token=!0,this.print_token(S),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(S,"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&&R(S,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(S),this._flags.in_case=!0;return}if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S)),T(S,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===o.OPERATOR))&&(!this._output.just_added_blankline()&&!S.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,j)?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===o.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||x(this._flags.mode))||this.print_newline(),this.print_token(S),this._flags.last_word=S.text;return}var te="NONE";if(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":R(S,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&S.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===h.BlockStatement?te="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&U(this._flags.mode)?te="SPACE":this._flags.last_token.type===o.STRING?te="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&a(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===o.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),R(S,u)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),R(S,["else","catch","finally"]))if((!(this._flags.last_token.type===o.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&S.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?R(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(S,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?(this._flags.last_token.type!==o.START_EXPR||!R(S,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(S,"if")&&T(S.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(S,u)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&x(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);S.previous&&(S.previous.type===o.WORD||S.previous.type===o.RESERVED)&&(this._output.space_before_token=!0),this.print_token(S),this._flags.last_word=S.text,S.type===o.RESERVED&&(S.text==="do"?this._flags.do_block=!0:S.text==="if"?this._flags.if_block=!0:S.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(S,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(S){this.start_of_statement(S)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(S);for(var J=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&T(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(S)},H.prototype.handle_string=function(S){S.text.startsWith("`")&&S.newlines===0&&S.whitespace_before===""&&(S.previous.text===")"||this._flags.last_token.type===o.WORD)||(this.start_of_statement(S)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(S),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S):S.text.startsWith("`")&&this._flags.last_token.type===o.END_EXPR&&(S.previous.text==="]"||S.previous.text===")")&&S.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(S)},H.prototype.handle_equals=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(S),this._output.space_before_token=!0},H.prototype.handle_comma=function(S){this.handle_whitespace_and_comments(S,!0),this.print_token(S),this._output.space_before_token=!0,this._flags.declaration_statement?(U(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(S)):this._flags.mode===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(S)},H.prototype.handle_operator=function(S){var J=S.text==="*"&&(R(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),te=a(S.text,["-","+"])&&(a(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||a(this._flags.last_token.text,u)||this._flags.last_token.text===",");if(!this.start_of_statement(S)){var se=!J;this.handle_whitespace_and_comments(S,se)}if(S.text==="*"&&this._flags.last_token.type===o.DOT){this.print_token(S);return}if(S.text==="::"){this.print_token(S);return}if(this._flags.last_token.type===o.OPERATOR&&a(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(S),S.text===":"&&this._flags.in_case){this.print_token(S),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==o.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var fe=!0,Fe=!0,Le=!1;if(S.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,Le=!0):S.text==="?"&&(this._flags.ternary_depth+=1),!te&&!J&&this._options.preserve_newlines&&a(S.text,l)){var De=S.text===":",He=De&&Le,We=De&&!Le;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!We,this.print_token(S),(!De||He)&&this.allow_wrap_or_preserved_newline(S),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!De||He?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(S):this._output.space_before_token=!1,this.print_token(S),this._output.space_before_token=!0;return;case b.preserve_newline:We||this.allow_wrap_or_preserved_newline(S),fe=!(this._output.just_added_newline()||We),this._output.space_before_token=fe,this.print_token(S),this._output.space_before_token=!0;return}}if(J){this.allow_wrap_or_preserved_newline(S),fe=!1;var ye=this._tokens.peek();Fe=ye&&a(ye.type,[o.WORD,o.RESERVED])}else if(S.text==="...")this.allow_wrap_or_preserved_newline(S),fe=this._flags.last_token.type===o.START_BLOCK,Fe=!1;else if(a(S.text,["--","++","!","~"])||te){if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR)&&this.allow_wrap_or_preserved_newline(S),fe=!1,Fe=!1,S.newlines&&(S.text==="--"||S.text==="++"||S.text==="~")){var ue=R(this._flags.last_token,A)&&S.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(fe=!0),this._flags.last_token.type===o.RESERVED?fe=!0:this._flags.last_token.type===o.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(S.text==="--"||S.text==="++")):this._flags.last_token.type===o.OPERATOR&&(fe=a(S.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(S.text,["+","-"])&&a(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||fe,this.print_token(S),this._output.space_before_token=Fe},H.prototype.handle_block_comment=function(S,J){if(this._output.raw){this._output.add_raw_token(S),S.directives&&S.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(S.directives){this.print_newline(!1,J),this.print_token(S),S.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(S.text)&&!S.newlines){this._output.space_before_token=!0,this.print_token(S),this._output.space_before_token=!0;return}else this.print_block_commment(S,J)},H.prototype.print_block_commment=function(S,J){var te=E(S.text),se,fe=!1,Fe=!1,Le=S.whitespace_before,De=Le.length;if(this.print_newline(!1,J),this.print_token_line_indentation(S),this._output.add_token(te[0]),this.print_newline(!1,J),te.length>1){for(te=te.slice(1),fe=B(te,"*"),Fe=L(te,Le),fe&&(this._flags.alignment=1),se=0;se<te.length;se++)fe?(this.print_token_line_indentation(S),this._output.add_token(C(te[se]))):Fe&&te[se]?(this.print_token_line_indentation(S),this._output.add_token(te[se].substring(De))):(this._output.current_line.set_indent(-1),this._output.add_token(te[se])),this.print_newline(!1,J);this._flags.alignment=0}},H.prototype.handle_comment=function(S,J){S.newlines?this.print_newline(!1,J):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(S),this.print_newline(!1,J)},H.prototype.handle_dot=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,A)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(S,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(S)},H.prototype.handle_unknown=function(S,J){this.print_token(S),S.text[S.text.length-1]===`
|
|
`&&this.print_newline(!1,J)},H.prototype.handle_eof=function(S){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(S)},n.exports.Beautifier=H},function(n){function D(m){this.__parent=m,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 m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(m))return!0;return!1},D.prototype.set_indent=function(m,c){this.is_empty()&&(this.__indent_count=m||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__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(m){this.__items.push(m);var c=m.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=m.length-c:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function y(m,c){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),c=c||"",m.indent_level>0&&(c=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(m,c){var s=this.__base_string_length;return c=c||0,m<0&&(s=0),s+=m*this.__indent_size,s+=c,s},y.prototype.get_indent_string=function(m,c){var s=this.__base_string;return c=c||0,m<0&&(m=0,s=""),c+=m*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},y.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var m=this.__cache.length,c=0,s="";this.__indent_size&&m>=this.__indent_size&&(c=Math.floor(m/this.__indent_size),m-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),m&&(s+=new Array(m+1).join(" ")),this.__cache.push(s)};function g(m,c){this.__indent_cache=new y(m,c),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.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()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(m,c){return this.__indent_cache.get_indent_string(m,c)},g.prototype.get_indent_size=function(m,c){return this.__indent_cache.get_indent_size(m,c)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(m){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(s=s.replace(/[\n]/g,m)),s},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(m,c){return m=m||0,c=c||0,this.next_line.set_indent(m,c),this.__lines.length>1?(this.current_line.set_indent(m,c),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(m){for(var c=0;c<m.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(m){for(var c=this.__lines.length;m<c;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(m,c){for(var s=this.__lines.length-2;s>=0;){var d=this.__lines[s];if(d.is_empty())break;if(d.item(0).indexOf(m)!==0&&d.item(-1)!==c){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=g},function(n){function D(y,g,m,c){this.type=y,this.text=g,this.comments_before=null,this.newlines=m||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",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",c="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+y+m+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+c+"])*";D.identifier=new RegExp(s+d,"g"),D.identifierStart=new RegExp(s),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+m+c+"])+");var u=/[\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 g=y(6).Options,m=["before-newline","after-newline","preserve-newline"];function c(s){g.call(this,s,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var l=0;l<u.length;l++)u[l]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=u[l];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",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new g,n.exports.Options=c},function(n){function D(m,c){this.raw_options=y(m,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(m,c){var s=this.raw_options[m],d=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(d=s.concat()):typeof s=="string"&&(d=s.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(m,c){var s=this.raw_options[m],d=s===void 0?!!c:!!s;return d},D.prototype._get_characters=function(m,c){var s=this.raw_options[m],d=c||"";return typeof s=="string"&&(d=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(m,c){var s=this.raw_options[m];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(s,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(m,c,s){var d=this._get_selection_list(m,c,s);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return d[0]},D.prototype._get_selection_list=function(m,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var d=this._get_array(m,s);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return d},D.prototype._is_valid_selection=function(m,c){return m.length&&c.length&&!m.some(function(s){return c.indexOf(s)===-1})};function y(m,c){var s={};m=g(m);var d;for(d in m)d!==c&&(s[d]=m[d]);if(c&&m[c])for(d in m[c])s[d]=m[c][d];return s}function g(m){var c={},s;for(s in m){var d=s.replace(/-/g,"_");c[d]=m[s]}return c}n.exports.Options=D,n.exports.normalizeOpts=g,n.exports.mergeOpts=y},function(n,D,y){var g=y(8).InputScanner,m=y(9).Tokenizer,c=y(9).TOKEN,s=y(13).Directives,d=y(4),u=y(12).Pattern,l=y(14).TemplatablePattern;function o(B,L){return L.indexOf(B)!==-1}var a={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},C=new s(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,R=/[^\d\.]/,A=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var b=new RegExp(v),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"]),_=new RegExp("^(?:"+h.join("|")+")$"),E,x=function(B,L){m.call(this,B,L),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new u(this._input),j=new l(this._input).read_options(this._options);this.__patterns={template:j,identifier:j.starting_with(d.identifier).matching(d.identifierMatch),number:H.matching(w),punct:H.matching(b),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(d.lineBreak),shebang:H.starting_with(/#!/).until_after(d.lineBreak),xml:H.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:j.until(/['\\\n\r\u2028\u2029]/),double_quote:j.until(/["\\\n\r\u2028\u2029]/),template_text:j.until(/[`\\$]/),template_expression:j.until(/[`}\\]/)}};x.prototype=new m,x.prototype._is_comment=function(B){return B.type===a.COMMENT||B.type===a.BLOCK_COMMENT||B.type===a.UNKNOWN},x.prototype._is_opening=function(B){return B.type===a.START_BLOCK||B.type===a.START_EXPR},x.prototype._is_closing=function(B,L){return(B.type===a.END_BLOCK||B.type===a.END_EXPR)&&L&&(B.text==="]"&&L.text==="["||B.text===")"&&L.text==="("||B.text==="}"&&L.text==="{")},x.prototype._reset=function(){E=!1},x.prototype._get_next_token=function(B,L){var H=null;this._readWhitespace();var j=this._input.peek();return j===null?this._create_token(a.EOF,""):(H=H||this._read_non_javascript(j),H=H||this._read_string(j),H=H||this._read_word(B),H=H||this._read_singles(j),H=H||this._read_comment(j),H=H||this._read_regexp(j,B),H=H||this._read_xml(j,B),H=H||this._read_punctuation(),H=H||this._create_token(a.UNKNOWN,this._input.next()),H)},x.prototype._read_word=function(B){var L;if(L=this.__patterns.identifier.read(),L!=="")return L=L.replace(d.allLineBreaks,`
|
|
`),!(B.type===a.DOT||B.type===a.RESERVED&&(B.text==="set"||B.text==="get"))&&_.test(L)?(L==="in"||L==="of")&&(B.type===a.WORD||B.type===a.STRING)?this._create_token(a.OPERATOR,L):this._create_token(a.RESERVED,L):this._create_token(a.WORD,L);if(L=this.__patterns.number.read(),L!=="")return this._create_token(a.WORD,L)},x.prototype._read_singles=function(B){var L=null;return B==="("||B==="["?L=this._create_token(a.START_EXPR,B):B===")"||B==="]"?L=this._create_token(a.END_EXPR,B):B==="{"?L=this._create_token(a.START_BLOCK,B):B==="}"?L=this._create_token(a.END_BLOCK,B):B===";"?L=this._create_token(a.SEMICOLON,B):B==="."&&R.test(this._input.peek(1))?L=this._create_token(a.DOT,B):B===","&&(L=this._create_token(a.COMMA,B)),L&&this._input.next(),L},x.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(a.EQUALS,B):B==="?."?this._create_token(a.DOT,B):this._create_token(a.OPERATOR,B)},x.prototype._read_non_javascript=function(B){var L="";if(B==="#"){if(this._is_first_token()&&(L=this.__patterns.shebang.read(),L))return this._create_token(a.UNKNOWN,L.trim()+`
|
|
`);if(L=this.__patterns.include.read(),L)return this._create_token(a.UNKNOWN,L.trim()+`
|
|
`);B=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(T)){do B=this._input.next(),H+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,H)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(L=this.__patterns.html_comment_start.read(),L){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)L+=this._input.next();return E=!0,this._create_token(a.COMMENT,L)}}else if(E&&B==="-"&&(L=this.__patterns.html_comment_end.read(),L))return E=!1,this._create_token(a.COMMENT,L);return null},x.prototype._read_comment=function(B){var L=null;if(B==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var j=C.get_directives(H);j&&j.ignore==="start"&&(H+=C.readIgnored(this._input)),H=H.replace(d.allLineBreaks,`
|
|
`),L=this._create_token(a.BLOCK_COMMENT,H),L.directives=j}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),L=this._create_token(a.COMMENT,H))}return L},x.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var L=this._input.next();return this.has_char_escapes=!1,B==="`"?L+=this._read_string_recursive("`",!0,"${"):L+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(L=U(L)),this._input.peek()===B&&(L+=this._input.next()),L=L.replace(d.allLineBreaks,`
|
|
`),this._create_token(a.STRING,L)}return null},x.prototype._allow_regexp_or_xml=function(B){return B.type===a.RESERVED&&o(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===a.END_EXPR&&B.text===")"&&B.opened.previous.type===a.RESERVED&&o(B.opened.previous.text,["if","while","for"])||o(B.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},x.prototype._read_regexp=function(B,L){if(B==="/"&&this._allow_regexp_or_xml(L)){for(var H=this._input.next(),j=!1,S=!1;this._input.hasNext()&&(j||S||this._input.peek()!==B)&&!this._input.testChar(d.newline);)H+=this._input.peek(),j?j=!1:(j=this._input.peek()==="\\",this._input.peek()==="["?S=!0:this._input.peek()==="]"&&(S=!1)),this._input.next();return this._input.peek()===B&&(H+=this._input.next(),H+=this._input.read(d.identifier)),this._create_token(a.STRING,H)}return null},x.prototype._read_xml=function(B,L){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(L)){var H="",j=this.__patterns.xml.read_match();if(j){for(var S=j[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),J=S.indexOf("{")===0,te=0;j;){var se=!!j[1],fe=j[2],Fe=!!j[j.length-1]||fe.slice(0,8)==="![CDATA[";if(!Fe&&(fe===S||J&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--te:++te),H+=j[0],te<=0)break;j=this.__patterns.xml.read_match()}return j||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(d.allLineBreaks,`
|
|
`),this._create_token(a.STRING,H)}}return null};function U(B){for(var L="",H=0,j=new g(B),S=null;j.hasNext();)if(S=j.match(/([\s]|[^\\]|\\\\)+/g),S&&(L+=S[0]),j.peek()==="\\"){if(j.next(),j.peek()==="x")S=j.match(/x([0-9A-Fa-f]{2})/g);else if(j.peek()==="u")S=j.match(/u([0-9A-Fa-f]{4})/g);else{L+="\\",j.hasNext()&&(L+=j.next());continue}if(!S)return B;if(H=parseInt(S[1],16),H>126&&H<=255&&S[0].indexOf("x")===0)return B;if(H>=0&&H<32){L+="\\"+S[0];continue}else H===34||H===39||H===92?L+="\\"+String.fromCharCode(H):L+=String.fromCharCode(H)}return L}x.prototype._read_string_recursive=function(B,L,H){var j,S;B==="'"?S=this.__patterns.single_quote:B==='"'?S=this.__patterns.double_quote:B==="`"?S=this.__patterns.template_text:B==="}"&&(S=this.__patterns.template_expression);for(var J=S.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===B||!L&&d.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(j=this._input.peek(),j==="x"||j==="u"?this.has_char_escapes=!0:j==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),te+=this._input.next()):H&&(H==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),H===te&&(B==="`"?te+=this._read_string_recursive("}",L,"`"):te+=this._read_string_recursive("`",L,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=S.read(),J+=te}return J},n.exports.Tokenizer=x,n.exports.TOKEN=a,n.exports.positionable_operators=A.slice(),n.exports.line_starters=p.slice()},function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function y(g){this.__input=g||"",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 g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},y.prototype.peek=function(g){var m=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(m=this.__input.charAt(g)),m},y.prototype.__match=function(g,m){g.lastIndex=m;var c=g.exec(this.__input);return c&&!(D&&g.sticky)&&(c.index!==m&&(c=null)),c},y.prototype.test=function(g,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(g,m):!1},y.prototype.testChar=function(g,m){var c=this.peek(m);return g.lastIndex=0,c!==null&&g.test(c)},y.prototype.match=function(g){var m=this.__match(g,this.__position);return m?this.__position+=m[0].length:m=null,m},y.prototype.read=function(g,m,c){var s="",d;return g&&(d=this.match(g),d&&(s+=d[0])),m&&(d||!g)&&(s+=this.readUntil(m,c)),s},y.prototype.readUntil=function(g,m){var c="",s=this.__position;g.lastIndex=this.__position;var d=g.exec(this.__input);return d?(s=d.index,m&&(s+=d[0].length)):s=this.__input_length,c=this.__input.substring(this.__position,s),this.__position=s,c},y.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},y.prototype.get_regexp=function(g,m){var c=null,s="g";return m&&D&&(s="y"),typeof g=="string"&&g!==""?c=new RegExp(g,s):g&&(c=new RegExp(g.source,s)),c},y.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(g){var m=this.__position,c=this.readUntilAfter(g);return this.__position=m,c},y.prototype.lookBack=function(g){var m=this.__position-1;return m>=g.length&&this.__input.substring(m-g.length,m).toLowerCase()===g},n.exports.InputScanner=y},function(n,D,y){var g=y(8).InputScanner,m=y(3).Token,c=y(10).TokenStream,s=y(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(l,o){this._input=new g(l),this._options=o||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var l,o=new m(d.START,""),a=null,C=[],w=new c;o.type!==d.EOF;){for(l=this._get_next_token(o,a);this._is_comment(l);)w.add(l),l=this._get_next_token(o,a);w.isEmpty()||(l.comments_before=w,w=new c),l.parent=a,this._is_opening(l)?(C.push(a),a=l):a&&this._is_closing(l,a)&&(l.opened=a,a.closed=l,a=C.pop(),l.parent=a),l.previous=o,o.next=l,this.__tokens.add(l),o=l}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(l,o){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(d.RAW,a):this._create_token(d.EOF,"")},u.prototype._is_comment=function(l){return!1},u.prototype._is_opening=function(l){return!1},u.prototype._is_closing=function(l,o){return!1},u.prototype._create_token=function(l,o){var a=new m(l,o,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=u,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 g=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(g=this.__tokens[y]),g},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 g=y(12).Pattern;function m(c,s){g.call(this,c,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new g,m.prototype.__set_whitespace_patterns=function(c,s){c+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var s=this.__split(this._newline_regexp,c);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return c},m.prototype.matching=function(c,s){var d=this._create();return d.__set_whitespace_patterns(c,s),d._update(),d},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(c,s){c.lastIndex=0;for(var d=0,u=[],l=c.exec(s);l;)u.push(s.substring(d,l.index)),d=l.index+l[0].length,l=c.exec(s);return d<s.length?u.push(s.substring(d,s.length)):u.push(""),u},n.exports.WhitespacePattern=m},function(n){function D(y,g){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._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 g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(y),g._update(),g},D.prototype.until=function(y){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(y),g._update(),g},D.prototype.starting_with=function(y){var g=this._create();return g._starting_pattern=this._input.get_regexp(y,!0),g._update(),g},D.prototype.matching=function(y){var g=this._create();return g._match_pattern=this._input.get_regexp(y,!0),g._update(),g},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},n.exports.Pattern=D},function(n){function D(y,g){y=typeof y=="string"?y:y.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(y);m;)g[m[1]]=m[2],m=this.__directive_pattern.exec(y);return g},D.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},function(n,D,y){var g=y(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(s,d){g.call(this,s,d),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),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 u=new g(s);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new g,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(s){var d=this._create();return d._disabled[s]=!0,d._update(),d},c.prototype.read_options=function(s){var d=this._create();for(var u in m)d._disabled[u]=s.templating.indexOf(u)===-1;return d._update(),d},c.prototype.exclude=function(s){var d=this._create();return d._excluded[s]=!0,d._update(),d},c.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),s+=d,d=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},c.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},c.prototype._read_template=function(){var s="",d=this._input.peek();if(d==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(s=s||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},n.exports.TemplatablePattern=c}],k={};function K(n){var D=k[n];if(D!==void 0)return D.exports;var y=k[n]={exports:{}};return I[n](y,y.exports,K),y.exports}var N=K(0);P=N})();var z=P;!(Z=[],V=function(){return{js_beautify:z}}.apply(ve,Z),V!==void 0&&(xt.exports=V))})()},"6UeF":function(xt,ve,G){"use strict";G.r(ve);var Z=G("Znn+"),V=G("ZTPi"),P=G("sPJy"),z=G("bE4q"),I=G("k1fw"),k=G("tJVT"),K=G("q1tI"),N=G.n(K),n=G("Ty5D"),D=G("55Ip"),y=G("9kvl"),g=G("jhfD"),m=G("1vsH"),c=G("DjyN"),s=G("NUBc"),d=G("5Dmo"),u=G("3S7+"),l=G("14J3"),o=G("BMrR"),a=G("+L6B"),C=G("2/Rp"),w=G("miYZ"),T=G("tsqr"),R=G("9og8"),A=G("jCWc"),v=G("kPKH"),b=G("5NDa"),p=G("5rEg"),h=G("WmNS"),_=G.n(h),E=G("Ot1p"),x=G("m3rI"),U=G("9Bee"),B=G("2qtc"),L=G("kLXV"),H=function(et){var tt=et.shixunHomeworks,dt=et.dispatch,yt=Object(n.i)();return N.a.createElement(L.a,{centered:!0,title:"\u63D0\u793A",visible:tt.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(R.a)(_.a.mark(function Ae(){var Se;return _.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return Je.next=2,dt({type:"shixunHomeworks/deleteReply",payload:{object_id:tt.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Se=Je.sent,Se.status===0&&(T.b.success("\u5220\u9664\u6210\u529F"),dt({type:"shixunHomeworks/setActionTabs",payload:{}}),dt({type:"shixunHomeworks/getReplyList",payload:Object(I.a)({},tt.actionTabs.params)}));case 4:case"end":return Je.stop()}},Ae)})),onCancel:function(){dt({type:"shixunHomeworks/setActionTabs",payload:{}})}},N.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},j=Object(y.a)(function(at){var et=at.shixunHomeworks;return{shixunHomeworks:et}})(H),S=G("wd/R"),J=G.n(S),te=G("/MfK"),se=G("BtR2"),fe=G("0Ru7"),Fe=G.n(fe);J.a.lang("ZH-cn");var Le=function(et){var tt,dt=et.graduation,yt=et.classroomList,Ae=et.globalSetting,Se=et.loading,Ve=et.dispatch,Je=Object(K.useState)(Object(I.a)({},Object(n.i)())),Ne=Object(k.a)(Je,2),je=Ne[0],Ee=Ne[1],he=Object(K.useState)(!1),pe=Object(k.a)(he,2),re=pe[0],oe=pe[1],le=Object(K.useState)(-1),me=Object(k.a)(le,2),be=me[0],Be=me[1],$e=Object(K.useState)(""),ut=Object(k.a)($e,2),Et=ut[0],mt=ut[1],Bt=yt.detailLeftMenus,Ut=dt.graduationDetail,Tt=dt.replyList,kt=dt.detail,zt=dt.tasksDetail,$t={1:"\u8BBE\u8BA1",2:"\u8BBA\u6587",3:"\u521B\u4F5C"},vn={1:"\u751F\u4EA7/\u793E\u4F1A\u5B9E\u9645",2:"\u7ED3\u5408\u79D1\u7814",3:"\u5176\u5B83"},Ft={1:"\u771F\u9898",2:"\u6A21\u62DF\u9898"},an={1:"\u7EB5\u5411\u8BFE\u9898",2:"\u6A2A\u5411\u8BFE\u9898",3:"\u81EA\u9009"},nn={1:"\u65B0\u9898",2:"\u5F80\u5C4A\u9898\uFF0C\u6709\u65B0\u8981\u6C42",3:"\u5F80\u5C4A\u9898\uFF0C\u65E0\u65B0\u8981\u6C42"};return je.page_size=10,Object(K.useEffect)(function(){Ve({type:"graduation/getReplyList",payload:Object(I.a)({},je)}),Ve({type:"graduation/getTopisDetail",payload:Object(I.a)({},je)})},[je.categoryId]),N.a.createElement("section",{className:Fe.a.bg},N.a.createElement("section",{className:" edu-container"},N.a.createElement("aside",{className:[Fe.a.desc,"c-black","font14","bg-white"].join(" ")},N.a.createElement("h1",{className:Fe.a.description},kt.description),N.a.createElement("div",{className:"mt30"},N.a.createElement("ul",{className:Fe.a.listItem},N.a.createElement("li",null,N.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u7C7B\u578B\uFF1A"),N.a.createElement("span",null,$t[kt==null?void 0:kt.topic_type]||"--")),N.a.createElement("li",null,N.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6765\u6E90\uFF1A"),N.a.createElement("span",null,vn[kt==null?void 0:kt.topic_source]||"--")),N.a.createElement("li",null,N.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6027\u8D281\uFF1A"),N.a.createElement("span",null,Ft[kt==null?void 0:kt.topic_property_first]||"--")),N.a.createElement("li",null,N.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6027\u8D282\uFF1A"),N.a.createElement("span",null,an[kt==null?void 0:kt.topic_property_second]||"--")),N.a.createElement("li",null,N.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u91CD\u590D\u60C5\u51B5\uFF1A"),N.a.createElement("span",null,nn[kt==null?void 0:kt.topic_repeat]||"--")),N.a.createElement("li",null,N.a.createElement("span",{className:"c-light-black"},"\u8C03\u7814\u6216\u5B9E\u4E60\u5730\u70B9\uFF1A"),N.a.createElement("span",null,kt.city||"--")),N.a.createElement("li",{className:"fl with50"},N.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6765\u6E90\u5355\u4F4D\uFF1A"),N.a.createElement("span",null,kt.source_unit||"--")))),N.a.createElement("div",{className:"pl30"},zt==null||((tt=zt.attachments)===null||tt===void 0)?void 0:tt.map(function(ot,en){return N.a.createElement("div",null,N.a.createElement("a",{href:"".concat(x.a.API_SERVER).concat(ot.url)},N.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),N.a.createElement("span",{className:"ml10 c-black"},ot.title),N.a.createElement("span",{className:"c-light-black ml20 font12"},ot.filesize)))}))),N.a.createElement("aside",{className:[Fe.a.reply,"bg-white","mt20"].join(" ")},re&&N.a.createElement(E.a,{onChange:function(en){mt(en)},height:200,isFocus:!0,watch:!0}),N.a.createElement(o.a,{onClick:function(){oe(!0)}},N.a.createElement(v.a,{flex:"1"},!re&&N.a.createElement(p.a,{size:"large",className:"current",placeholder:"\u8BF4\u70B9\u4EC0\u4E48",disabled:!0})),N.a.createElement(v.a,null,N.a.createElement(C.a,{type:"primary",size:"large",onClick:Object(R.a)(_.a.mark(function ot(){var en;return _.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:if(!(Et==="")){Rt.next=4;break}T.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Rt.next=8;break;case 4:return Rt.next=6,Ve({type:"graduation/createReply",payload:{journals_for_message:{jour_id:je.categoryId,jour_type:"HomeworkCommon",reply_id:1,notes:Et}}});case 6:en=Rt.sent,en.status===0&&(T.b.success("\u53D1\u5E03\u6210\u529F"),Ve({type:"graduation/getReplyList",payload:Object(I.a)({},je)}),oe(!1));case 8:case"end":return Rt.stop()}},ot)}))},"\u53D1\u8868")))),(Tt==null?void 0:Tt.comments)&&Tt.comments!=""&&N.a.createElement("aside",{className:[Fe.a.replyList,"bg-white"].join(" ")},Tt==null?void 0:Tt.comments.map(function(ot,en){var It,Rt;return N.a.createElement(o.a,{gutter:[12,12],key:en},N.a.createElement(v.a,{flex:"40px"},N.a.createElement("img",{width:"40",src:"".concat(x.a.IMG_SERVER,"/images/").concat(ot==null||((It=ot.author)===null||It===void 0)?void 0:It.image_url)})),N.a.createElement(v.a,{flex:"1"},N.a.createElement(o.a,{align:"middle"},N.a.createElement(v.a,{span:24},N.a.createElement("span",{className:"c-light-black"},ot==null||((Rt=ot.author)===null||Rt===void 0)?void 0:Rt.name),N.a.createElement("span",{className:"c-light-black ml10"},J()(ot==null?void 0:ot.created_on).fromNow()," \u53D1\u5E03")),N.a.createElement(v.a,{span:24},N.a.createElement(U.a,{value:ot.content})),ot.children&&N.a.createElement("aside",{className:Fe.a.comment},ot.children.map(function(Mt,On){return N.a.createElement(o.a,{key:On},N.a.createElement(v.a,{span:24},N.a.createElement(o.a,null,N.a.createElement(v.a,{flex:"1"},Mt.author.name,N.a.createElement("span",{className:"c-light-black ml10"},J()(Mt==null?void 0:Mt.created_on).fromNow())),N.a.createElement(v.a,null,N.a.createElement(u.a,{title:"\u5220\u9664"},N.a.createElement(te.a,{className:"current",onClick:function(){Ve({type:"graduation/setActionTabs",payload:{key:"\u5220\u9664",params:je,selectArr:ot}})}}))))),N.a.createElement(v.a,null,N.a.createElement("strong",null,N.a.createElement(U.a,{value:Mt.content}))))})),N.a.createElement(v.a,{span:24,className:"mt5 c-light-black"},be===en&&N.a.createElement("aside",null,N.a.createElement(E.a,{onChange:function(On){mt(On)},height:150,isFocus:!0}),N.a.createElement(o.a,null,N.a.createElement(v.a,{span:24,className:"tr"},N.a.createElement(C.a,{type:"primary",size:"large",onClick:Object(R.a)(_.a.mark(function Mt(){return _.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:if(!(Et==="")){ln.next=4;break}T.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),ln.next=9;break;case 4:return ln.next=6,Ve({type:"graduation/createReply",payload:{journals_for_message:{jour_id:je.categoryId,jour_type:"HomeworkCommon",m_parent_id:ot.id,reply_id:1,notes:Et}}});case 6:Ve({type:"graduation/getReplyList",payload:Object(I.a)({},je)}),T.b.success("\u53D1\u5E03\u6210\u529F"),Be(-1);case 9:case"end":return ln.stop()}},Mt)}))},"\u53D1\u8868")))),be!==en&&N.a.createElement("div",{className:"tr"},N.a.createElement("span",{className:"iconfont icon-huifu1 mr5 ml30",onClick:function(){return Be(en)}}),ot.liked&&N.a.createElement("span",{className:"c-orange"},N.a.createElement(se.a,{className:"mr5 ml30",onClick:Object(R.a)(_.a.mark(function Mt(){return _.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Ve({type:"graduation/replyUnLike",payload:{object_id:ot.id,object_type:"message"}});case 2:Ve({type:"graduation/getReplyList",payload:Object(I.a)({},je)});case 3:case"end":return ln.stop()}},Mt)}))}),ot.praises_count),!ot.liked&&N.a.createElement("span",null,N.a.createElement(se.a,{className:"mr5 ml30",onClick:Object(R.a)(_.a.mark(function Mt(){return _.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Ve({type:"graduation/replyLike",payload:{object_id:ot.id,object_type:"message"}});case 2:Ve({type:"graduation/getReplyList",payload:Object(I.a)({},je)});case 3:case"end":return ln.stop()}},Mt)}))}),ot.praises_count))))))}))),N.a.createElement("aside",{className:"tc mt30 pb30"},N.a.createElement(s.a,{defaultCurrent:1,total:Tt==null?void 0:Tt.total_count,hideOnSinglePage:!0,current:je.page||1,onChange:function(en){je.page=en,Ve({type:"graduation/getReplyList",payload:Object(I.a)({},je)})}})),N.a.createElement(j,null))},De=Object(y.a)(function(at){var et=at.graduation,tt=at.classroomList,dt=at.loading,yt=at.globalSetting;return{graduation:et,globalSetting:yt,classroomList:tt,loading:dt.effects}})(Le),He=G("g9YV"),We=G("wCAj"),ye=G("y8nQ"),ue=G("Vl3Y"),Ye=G("PpiC"),vt=function(et){var tt=et.graduation,dt=et.dispatch,yt=Object(Ye.a)(et,["graduation","dispatch"]),Ae=Object(n.i)();return N.a.createElement(L.a,{centered:!0,title:"\u63D0\u793A",visible:tt.actionTabs.key==="\u62D2\u7EDD",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(R.a)(_.a.mark(function Se(){var Ve;return _.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return Ne.next=2,dt({type:"graduation/refuseTopic",payload:Object(I.a)({student_graduation_topic:tt.actionTabs.selectArrs.id},Ae)});case 2:Ve=Ne.sent,Ve.status===0&&(T.b.success("\u62D2\u7EDD\u6210\u529F"),dt({type:"graduation/setActionTabs",payload:{}}),dt({type:"graduation/getTopisDetailList",payload:Object(I.a)({},tt.actionTabs.params)}));case 4:case"end":return Ne.stop()}},Se)})),onCancel:function(){dt({type:"graduation/setActionTabs",payload:{}})}},N.a.createElement("p",null,"\u662F\u5426\u786E\u8BA4\u62D2\u7EDD\u5B66\u751F\u9009\u9898?"))},ct=Object(y.a)(function(at){var et=at.graduation;return{graduation:et}})(vt),it=G("OaEy"),ft=G("2fM7"),Qe=function(et){var tt,dt=et.graduation,yt=et.dispatch,Ae=Object(Ye.a)(et,["graduation","dispatch"]),Se=Object(n.i)(),Ve=dt.detailList,Je=ue.a.useForm(),Ne=Object(k.a)(Je,1),je=Ne[0];return N.a.createElement(L.a,{centered:!0,title:"\u540C\u610F\u9009\u9898",visible:dt.actionTabs.key==="\u540C\u610F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(R.a)(_.a.mark(function Ee(){var he,pe,re;return _.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,je.validateFields();case 2:return pe=je.getFieldsValue(),le.next=5,yt({type:"graduation/agreeTopic",payload:Object(I.a)({group_id:pe.group_id,course_group_name:Ve==null||((he=Ve.group_list)===null||he===void 0)?void 0:he.filter(function(me){return me.group_id==pe.group_id})[0].group_name,student_graduation_topic:dt.actionTabs.selectArrs.id},Se)});case 5:re=le.sent,re.status===0&&(T.b.success("\u540C\u610F\u6210\u529F"),yt({type:"graduation/setActionTabs",payload:{}}),yt({type:"graduation/getTopisDetailList",payload:Object(I.a)({},dt.actionTabs.params)}));case 7:case"end":return le.stop()}},Ee)})),onCancel:function(){yt({type:"graduation/setActionTabs",payload:{}})}},N.a.createElement("p",null,"\u786E\u8BA4\u540C\u610F\u5B66\u751F\u7684\u9009\u9898\uFF0C\u5C06\u5B66\u751F\u52A0\u5165\u6211\u7684\u5206\u73ED"),N.a.createElement(ue.a,{form:je},N.a.createElement(ue.a.Item,{name:"group_id",label:"\u9009\u62E9\uFF1A",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5206\u73ED"}]},N.a.createElement(ft.a,{placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED",size:"large"},Ve==null||((tt=Ve.group_list)===null||tt===void 0)?void 0:tt.map(function(Ee,he){return N.a.createElement(ft.a.Option,{value:Ee.group_id},Ee.group_name)})))))},qe=Object(y.a)(function(at){var et=at.graduation;return{graduation:et}})(Qe),ht=function(et){var tt=et.graduation,dt=et.loading,yt=et.dispatch,Ae=Object(K.useState)(Object(I.a)({},Object(n.i)())),Se=Object(k.a)(Ae,2),Ve=Se[0],Je=Se[1],Ne=Object(n.h)(),je=tt.detailList,Ee=Object(K.useState)({}),he=Object(k.a)(Ee,2),pe=he[0],re=he[1],oe=ue.a.useForm(),le=Object(k.a)(oe,1),me=le[0],be=function(ut,Et){Ve.page=ut,Ve.limit=20,yt({type:"graduation/getTopisDetailList",payload:Object(I.a)({},Ve)})},Be=[{title:"\u5E8F\u53F7",dataIndex:"name",width:200,align:"center",render:function(ut,Et,mt){return mt+1}},{title:"\u59D3\u540D",dataIndex:"student_name"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u5206\u73ED",dataIndex:"class_group_name"},{title:"\u9009\u9898\u65F6\u95F4",dataIndex:"selected_time"},{title:"\u786E\u8BA4\u7ED3\u679C",dataIndex:"result",render:function(ut){return ut==="\u5DF2\u62D2\u7EDD"?N.a.createElement("span",{className:"c-orange"},"\u5DF2\u62D2\u7EDD"):ut}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(ut,Et){return N.a.createElement("div",null,(Et.result==="\u5F85\u786E\u8BA4"||Et.result==="\u5DF2\u540C\u610F")&&N.a.createElement("span",{className:"current",onClick:function(){yt({type:"graduation/setActionTabs",payload:{key:"\u62D2\u7EDD",selectArrs:Et,params:Ve}})}},"\u62D2\u7EDD"),Et.result==="\u5F85\u786E\u8BA4"&&N.a.createElement("span",{className:"current ml20 c-blue",onClick:function(){yt({type:"graduation/setActionTabs",payload:{key:"\u540C\u610F",selectArrs:Et,params:Ve}})}},"\u540C\u610F"))}}];return N.a.createElement(N.a.Fragment,null,N.a.createElement("section",{className:"minH500 bg-white "},N.a.createElement(We.a,{loading:dt["graduation/getTopisDetailList"],pagination:!1,dataSource:je.users_list,columns:Be}),N.a.createElement(ct,null),N.a.createElement(qe,null)),N.a.createElement("aside",{className:"tc mb50 mt30"},N.a.createElement(s.a,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:be,defaultCurrent:Ve.page||1,current:Ve.page||1,defaultPageSize:15,total:tt.users_count})))},de=Object(y.a)(function(at){var et=at.graduation,tt=at.loading;return{graduation:et,loading:tt.effects}})(ht),Ie=G("2tmY"),Pe=G.n(Ie),Ke=function(et){var tt=et.graduation,dt=et.globalSetting,yt=et.loading,Ae=et.dispatch,Se=Object(n.i)(),Ve=Object(n.h)(),Je=Object(K.useState)([]),Ne=Object(k.a)(Je,2),je=Ne[0],Ee=Ne[1],he=Object(K.useState)(Ve.query.tabs||0),pe=Object(k.a)(he,2),re=pe[0],oe=pe[1],le=tt.detailTaskList,me=tt.tasksDetail,be;Se.category=Ve.query.category_id,Object(K.useEffect)(function(){Ae({type:"graduation/getTasksDetail",payload:Object(I.a)({},Se)}),Ae({type:"graduation/getTasksListDetail",payload:Object(I.a)({},Se)})},[Se.coursesId]);var Be=[{name:"\u4EFB\u52A1\u5217\u8868",id:0,compontent:N.a.createElement(de,null)},{name:"\u4EFB\u52A1\u63CF\u8FF0",id:1,compontent:N.a.createElement(De,null)}];return N.a.createElement("section",null,N.a.createElement("div",{className:"edu-container"},le.course_name&&N.a.createElement("section",{className:"animated fadeIn"},N.a.createElement("aside",{className:"mt10"},N.a.createElement(z.a,{separator:">"},N.a.createElement(z.a.Item,null,N.a.createElement(D.a,{to:"/classrooms/".concat(le.course_id,"/shixun_homework")},le.course_name)),N.a.createElement(z.a.Item,null,N.a.createElement(D.a,{to:"/classrooms/".concat(le.course_id,"/graduation_tasks")},"\u6BD5\u8BBE\u4EFB\u52A1")),N.a.createElement(z.a.Item,null,"\u4EFB\u52A1\u8BE6\u60C5"))),N.a.createElement("aside",{className:[Pe.a.title,"mt20"].join(" ")},N.a.createElement(D.a,{to:"/classrooms/".concat(le.course_id,"/graduation_tasks")},N.a.createElement(g.a,{className:"font16 c-black"})),N.a.createElement("strong",{className:"font20 ml5"},le.task_name),N.a.createElement(m.m,{status:[le.status_name]}))),N.a.createElement("aside",{className:"mt30 relative"},N.a.createElement("aside",{className:Pe.a.rightMenu},N.a.createElement(D.a,{className:Pe.a.shixunDetail,to:"/classrooms/".concat(Se.coursesId,"/graduation_tasks/").concat(Se.categoryId,"/edit")},N.a.createElement("span",{className:"iconfont icon-shixunxiangqing"}),"\u7F16\u8F91\u4EFB\u52A1")),N.a.createElement(V.a,{defaultActiveKey:re,className:Pe.a.menuTabs},Be.map(function($e,ut){return N.a.createElement(V.a.TabPane,{tab:$e.name,key:$e.id},$e.compontent)})))))},st=ve.default=Object(y.a)(function(at){var et=at.graduation,tt=at.loading,dt=at.globalSetting;return{graduation:et,globalSetting:dt,loading:tt.effects}})(Ke)},"6eGT":function(xt,ve,G){"use strict";function Z(V){return null}ve.a=Z},"746U":function(xt,ve,G){"use strict";G.d(ve,"f",function(){return Z}),G.d(ve,"l",function(){return V}),G.d(ve,"k",function(){return P}),G.d(ve,"j",function(){return z}),G.d(ve,"g",function(){return I}),G.d(ve,"m",function(){return k}),G.d(ve,"h",function(){return K}),G.d(ve,"n",function(){return N}),G.d(ve,"c",function(){return n}),G.d(ve,"a",function(){return D}),G.d(ve,"i",function(){return y}),G.d(ve,"o",function(){return g}),G.d(ve,"e",function(){return s}),G.d(ve,"d",function(){return d}),G.d(ve,"p",function(){return u}),G.d(ve,"b",function(){return l});function Z(o){return Array.isArray(o)}function V(o){return typeof o=="string"}function P(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function z(o){return typeof o=="number"&&!isNaN(o)}function I(o){return o===!0||o===!1}function k(o){return typeof o=="undefined"}function K(o){return!N(o)}function N(o){return k(o)||o===null}function n(o,a){if(!o)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function D(o){if(N(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function y(o){return typeof o=="function"}function g(o,a){const C=Math.min(o.length,a.length);for(let w=0;w<C;w++)m(o[w],a[w])}function m(o,a){if(V(a)){if(typeof o!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(y(a)){try{if(o instanceof a)return}catch(C){}if(!N(o)&&o.constructor===a)return;if(a.length===1&&a.call(void 0,o)===!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(o){let a=[],C=Object.getPrototypeOf(o);for(;Object.prototype!==C;)a=a.concat(Object.getOwnPropertyNames(C)),C=Object.getPrototypeOf(C);return a}function s(o){const a=[];for(const C of c(o))typeof o[C]=="function"&&a.push(C);return a}function d(o,a){const C=T=>function(){const R=Array.prototype.slice.call(arguments,0);return a(T,R)};let w={};for(const T of o)w[T]=C(T);return w}function u(o){return o===null?void 0:o}function l(o,a="Unreachable"){throw new Error(a)}},"7Cbv":function(xt,ve,G){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function P(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(V)}var z=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function I(m){return typeof m=="string"&&z.test(m)}for(var k=I,K=[],N=0;N<256;++N)K.push((N+256).toString(16).substr(1));function n(m){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(K[m[c+0]]+K[m[c+1]]+K[m[c+2]]+K[m[c+3]]+"-"+K[m[c+4]]+K[m[c+5]]+"-"+K[m[c+6]]+K[m[c+7]]+"-"+K[m[c+8]]+K[m[c+9]]+"-"+K[m[c+10]]+K[m[c+11]]+K[m[c+12]]+K[m[c+13]]+K[m[c+14]]+K[m[c+15]]).toLowerCase();if(!k(s))throw TypeError("Stringified UUID is invalid");return s}var D=n;function y(m,c,s){m=m||{};var d=m.random||(m.rng||P)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,c){s=s||0;for(var u=0;u<16;++u)c[s+u]=d[u];return c}return D(d)}var g=ve.a=y},"7ahc":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return C});var Z=G("k1fw"),V=G("0Owb"),P=G("+L6B"),z=G("2/Rp"),I=G("y8nQ"),k=G("Vl3Y"),K=G("tJVT"),N=G("OaEy"),n=G("2fM7"),D=G("q1tI"),y=G.n(D),g=G("VrN/"),m=G.n(g),c=G("p77/"),s=G.n(c),d=G("c5Ni"),u=G.n(d),l=n.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},a={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"]};ve.b=function(w){var T=w.callback,R=w.onCancel,A=Object(D.useState)("python"),v=Object(K.a)(A,2),b=v[0],p=v[1];function h(E){p(a[E][1])}function _(E){T(E)}return y.a.createElement(k.a,Object(V.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),y.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(n.a,{onChange:h},Object.keys(a).map(function(E){return y.a.createElement(l,{key:E,value:E},a[E][0])}))),y.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(C,{mode:b})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(z.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function C(w){var T=w.value,R=w.onChange,A=w.mode,v=w.options,b=v===void 0?{}:v,p=Object(D.useRef)(),h=Object(D.useState)(),_=Object(K.a)(h,2),E=_[0],x=_[1];return Object(D.useEffect)(function(){if(E){function U(B){var L=B.getValue();R&&R(L)}return E.on("change",U),function(){E.off("change",U)}}},[E,R]),Object(D.useEffect)(function(){E&&E.setOption("mode",A)},[E,A]),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 U=m.a.fromTextArea(p.current,Object(Z.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));x(U)}},[p.current,E]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:p}))}},"815F":function(xt,ve,G){"use strict";G.d(ve,"e",function(){return K}),G.d(ve,"c",function(){return n}),G.d(ve,"d",function(){return D}),G.d(ve,"a",function(){return g}),G.d(ve,"f",function(){return m}),G.d(ve,"b",function(){return c});var Z=G("KQm4"),V=G("VTBJ"),P=G("Ff2n"),z=G("Zm9Q"),I=G("Kwbf"),k=G("OZM5");function K(s,d){return s!=null?s:d}function N(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function u(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(l||[]).forEach(function(a){var C=a.key,w=a.children;Object(I.a)(C!=null,"Tree node must have a certain key: [".concat(o).concat(C,"]"));var T=String(C);Object(I.a)(!d.has(T)||C===null||C===void 0,"Same 'key' exist in the Tree: ".concat(T)),d.set(T,!0),u(w,"".concat(o).concat(T," > "))})}u(s)}function n(s){function d(u){var l=Object(z.a)(u);return l.map(function(o){if(!Object(k.i)(o))return Object(I.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var a=o.key,C=o.props,w=C.children,T=Object(P.a)(C,["children"]),R=Object(V.a)({key:a},T),A=d(w);return A.length&&(R.children=A),R}).filter(function(o){return o})}return d(s)}function D(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],u=new Set(d===!0?[]:d),l=[];function o(a){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.map(function(w,T){var R=Object(k.h)(C?C.pos:"0",T),A=K(w.key,R),v=Object(V.a)(Object(V.a)({},w),{},{parent:C,pos:R,children:null,data:w,isStart:[].concat(Object(Z.a)(C?C.isStart:[]),[T===0]),isEnd:[].concat(Object(Z.a)(C?C.isEnd:[]),[T===a.length-1])});return l.push(v),d===!0||u.has(A)?v.children=o(w.children||[],v):v.children=[],v})}return o(s),l}function y(s,d,u){var l;u?typeof u=="string"?l=function(C){return C[u]}:typeof u=="function"&&(l=function(C){return u(C)}):l=function(C,w){return K(C.key,w)};function o(a,C,w){var T=a?a.children:s,R=a?Object(k.h)(w.pos,C):"0";if(a){var A=l(a,R),v={node:a,index:C,pos:R,key:A,parentPos:w.node?w.pos:null,level:w.level+1};d(v)}T&&T.forEach(function(b,p){o(b,p,{node:a,pos:R,level:w?w.level+1:-1})})}o(null)}function g(s){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=d.initWrapper,l=d.processEntity,o=d.onProcessFinished,a=arguments.length>2?arguments[2]:void 0,C={},w={},T={posEntities:C,keyEntities:w};return u&&(T=u(T)||T),y(s,function(R){var A=R.node,v=R.index,b=R.pos,p=R.key,h=R.parentPos,_=R.level,E={node:A,index:v,key:p,pos:b,level:_},x=K(p,b);C[b]=E,w[x]=E,E.parent=C[h],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),l&&l(E,T)},a),o&&o(T),T}function m(s,d){var u=d.expandedKeys,l=d.selectedKeys,o=d.loadedKeys,a=d.loadingKeys,C=d.checkedKeys,w=d.halfCheckedKeys,T=d.dragOverNodeKey,R=d.dropPosition,A=d.keyEntities,v=A[s],b={eventKey:s,expanded:u.indexOf(s)!==-1,selected:l.indexOf(s)!==-1,loaded:o.indexOf(s)!==-1,loading:a.indexOf(s)!==-1,checked:C.indexOf(s)!==-1,halfChecked:w.indexOf(s)!==-1,pos:String(v?v.pos:""),dragOver:T===s&&R===0,dragOverGapTop:T===s&&R===-1,dragOverGapBottom:T===s&&R===1};return b}function c(s){var d=s.data,u=s.expanded,l=s.selected,o=s.checked,a=s.loaded,C=s.loading,w=s.halfChecked,T=s.dragOver,R=s.dragOverGapTop,A=s.dragOverGapBottom,v=s.pos,b=s.active,p=Object(V.a)(Object(V.a)({},d),{},{expanded:u,selected:l,checked:o,loaded:a,loading:C,halfChecked:w,dragOver:T,dragOverGapTop:R,dragOverGapBottom:A,pos:v,active:b});return"props"in p||Object.defineProperty(p,"props",{get:function(){return Object(I.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),p}},"8EBN":function(xt,ve,G){(function(Z){Z(G("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 V=0;V<Z.modeInfo.length;V++){var P=Z.modeInfo[V];P.mimes&&(P.mime=P.mimes[0])}Z.findModeByMIME=function(z){z=z.toLowerCase();for(var I=0;I<Z.modeInfo.length;I++){var k=Z.modeInfo[I];if(k.mime==z)return k;if(k.mimes){for(var K=0;K<k.mimes.length;K++)if(k.mimes[K]==z)return k}}if(/\+xml$/.test(z))return Z.findModeByMIME("application/xml");if(/\+json$/.test(z))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(z){z=z.toLowerCase();for(var I=0;I<Z.modeInfo.length;I++){var k=Z.modeInfo[I];if(k.ext){for(var K=0;K<k.ext.length;K++)if(k.ext[K]==z)return k}}},Z.findModeByFileName=function(z){for(var I=0;I<Z.modeInfo.length;I++){var k=Z.modeInfo[I];if(k.file&&k.file.test(z))return k}var K=z.lastIndexOf("."),N=K>-1&&z.substring(K+1,z.length);if(N)return Z.findModeByExtension(N)},Z.findModeByName=function(z){z=z.toLowerCase();for(var I=0;I<Z.modeInfo.length;I++){var k=Z.modeInfo[I];if(k.name.toLowerCase()==z)return k;if(k.alias){for(var K=0;K<k.alias.length;K++)if(k.alias[K].toLowerCase()==z)return k}}}})},"8HAY":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return I}),G.d(ve,"b",function(){return k}),G.d(ve,"d",function(){return K}),G.d(ve,"e",function(){return N}),G.d(ve,"c",function(){return n});var Z=G("MI8n"),V=G("pmY6"),P=G("3/fG"),z=function(D,y,g,m){function c(s){return s instanceof g?s:new g(function(d){d(s)})}return new(g||(g=Promise))(function(s,d){function u(a){try{o(m.next(a))}catch(C){d(C)}}function l(a){try{o(m.throw(a))}catch(C){d(C)}}function o(a){a.done?s(a.value):c(a.value).then(u,l)}o((m=m.apply(D,y||[])).next())})};class I extends V.a{constructor(D,y="",g="",m=!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=g,this._enabled=m,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 z(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class k extends V.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 z(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let g;try{yield this.runAction(D,y)}catch(m){g=m}this._onDidRun.fire({action:D,error:g})})}runAction(D,y){return z(this,void 0,void 0,function*(){yield D.run(y)})}}class K extends I{constructor(D){super(K.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class N{constructor(D,y,g,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=y,this.class=m,this._actions=g}get actions(){return this._actions}dispose(){}run(){return z(this,void 0,void 0,function*(){})}}class n extends I{constructor(){super(n.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(xt,ve,G){xt.exports={button:"button___1wy9m"}},"9Bee":function(xt,ve,G){"use strict";var Z=G("DYRE"),V=G("zeV3"),P=G("+L6B"),z=G("2/Rp"),I=G("k1fw"),k=G("9og8"),K=G("tJVT"),N=G("WmNS"),n=G.n(N),D=G("q1tI"),y=G.n(D),g=G("vg9a"),m=G("DlQD"),c=G.n(m),s=G("rUJ1");function d($,O){var M=$.match(/^(\s+)(?:```)/);if(M===null)return O;var W=M[1];return O.split(`
|
|
`).map(function(ee){var Y=ee.match(/^\s+/);if(Y===null)return ee;var Ce=Object(K.a)(Y,1),rt=Ce[0];return rt.length>=W.length?ee.slice(W.length):ee}).join(`
|
|
`)}var u=[],l=["<ul>"],o=new c.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){u.length=0,l=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T($,O,M,W){if(O>=$.length||$[O].level<=M)return O;var ee=$[O];W.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),O++;var Y=[];return O=T($,O,ee.level,Y),Y.length>0&&(W.push("<ul>"),Y.forEach(function(Ce){W.push(Ce)}),W.push("</ul>")),W.push("</li>"),O=T($,O,M,W),O}function R(){return T(u,0,0,l),l.push("</ul>"),l.join("")}var A={heading:function(O){var M=a.exec(O);if(M)return{type:"heading",raw:M[0],depth:M[1].length,text:M[2]}},fences:function(O){var M=this.rules.block.fences.exec(O);if(M){var W=M[0],ee=d(W,M[3]||""),Y=M[2]?M[2].trim():M[2];if(["latex","katex","math"].indexOf(Y)>=0){var Ce=p(),rt=ee;ee=Ce,h[Ce]={type:"block",expression:rt}}return{type:"code",raw:W,lang:Y,text:ee}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,p=function(){return"__special_katext_id_".concat(b++,"__")},h={};function _(){return h}function E(){b=0,h={}}function x($){return $=$.replace(v,function(O,M){var W=p();return h[W]={type:"inline",expression:M},W}),$}var U=o.listitem;o.listitem=function($){return U(x($))};var B=o.paragraph;o.paragraph=function($){return B(x($))};var L=o.tablecell;o.tablecell=function($,O){return L(x($),O)},o.code=function($,O,M){var W=(O||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"<p class='editormd-tex'>".concat($,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(O,'">').concat(M?$:Object(s.escape)($,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(M?$:Object(s.escape)($,!0))+"</code></pre>"},o.heading=function($,O,M){var W=this.options.headerPrefix+M.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:W,level:O,text:$}),"<h"+O+' id="'+W+'">'+$+"</h"+O+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:A,renderer:o});var H=c.a,j=G("SJMd"),S=G("ulZh"),J=G.n(S),te=G("m3rI"),se=G("Oy/b"),fe=G("p5ED"),Fe=G("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 Le=function($,O){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,W){M.__proto__=W}||function(M,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(M[ee]=W[ee])})($,O)};function De($,O){function M(){this.constructor=$}Le($,O),$.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function He($,O,M,W){return new(M||(M=Promise))(function(ee,Y){function Ce(Pt){try{wt(W.next(Pt))}catch(lt){Y(lt)}}function rt(Pt){try{wt(W.throw(Pt))}catch(lt){Y(lt)}}function wt(Pt){var lt;Pt.done?ee(Pt.value):(lt=Pt.value,lt instanceof M?lt:new M(function(Kt){Kt(lt)})).then(Ce,rt)}wt((W=W.apply($,O||[])).next())})}function We($,O){var M,W,ee,Y,Ce={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:rt(0),throw:rt(1),return:rt(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function rt(wt){return function(Pt){return function(lt){if(M)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(M=1,W&&(ee=2<[0]?W.return:lt[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,lt[1])).done)return ee;switch(W=0,ee&&(lt=[2<[0],ee.value]),lt[0]){case 0:case 1:ee=lt;break;case 4:return Ce.label++,{value:lt[1],done:!1};case 5:Ce.label++,W=lt[1],lt=[0];continue;case 7:lt=Ce.ops.pop(),Ce.trys.pop();continue;default:if(!(ee=Ce.trys,(ee=ee.length>0&&ee[ee.length-1])||lt[0]!==6&<[0]!==2)){Ce=0;continue}if(lt[0]===3&&(!ee||lt[1]>ee[0]&<[1]<ee[3])){Ce.label=lt[1];break}if(lt[0]===6&&Ce.label<ee[1]){Ce.label=ee[1],ee=lt;break}if(ee&&Ce.label<ee[2]){Ce.label=ee[2],Ce.ops.push(lt);break}ee[2]&&Ce.ops.pop(),Ce.trys.pop();continue}lt=O.call($,Ce)}catch(Kt){lt=[6,Kt],W=0}finally{M=ee=0}if(5<[0])throw lt[1];return{value:lt[0]?lt[1]:void 0,done:!0}}([wt,Pt])}}}function ye(){for(var $=0,O=0,M=arguments.length;O<M;O++)$+=arguments[O].length;var W=Array($),ee=0;for(O=0;O<M;O++)for(var Y=arguments[O],Ce=0,rt=Y.length;Ce<rt;Ce++,ee++)W[ee]=Y[Ce];return W}var ue=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(O,M){for(var W=0,ee=M;W<ee.length;W++){var Y=ee[W],Ce=Y[0],rt=Y[1];O.setAttribute(Ce,rt)}},$.createRect=function(O,M,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",O.toString()),ee.setAttribute("height",M.toString()),W&&$.setAttributes(ee,W),ee},$.createLine=function(O,M,W,ee,Y){var Ce=document.createElementNS("http://www.w3.org/2000/svg","line");return Ce.setAttribute("x1",O.toString()),Ce.setAttribute("y1",M.toString()),Ce.setAttribute("x2",W.toString()),Ce.setAttribute("y2",ee.toString()),Y&&$.setAttributes(Ce,Y),Ce},$.createPolygon=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",O),M&&$.setAttributes(W,M),W},$.createCircle=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(O/2).toString()),W.setAttribute("cy",(O/2).toString()),W.setAttribute("r",O.toString()),M&&$.setAttributes(W,M),W},$.createEllipse=function(O,M,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(O/2).toString()),ee.setAttribute("cy",(M/2).toString()),ee.setAttribute("rx",(O/2).toString()),ee.setAttribute("ry",(M/2).toString()),W&&$.setAttributes(ee,W),ee},$.createGroup=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return O&&$.setAttributes(M,O),M},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(O,M,W,ee,Y,Ce,rt){var wt=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(wt,[["id",O],["orient",M],["markerWidth",W.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ce.toString()]]),wt.appendChild(rt),wt},$.createText=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),O&&$.setAttributes(M,O),M},$.createTSpan=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=O,M&&$.setAttributes(W,M),W},$.createImage=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return O&&$.setAttributes(M,O),M},$.createPoint=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=O,W.y=M,W},$.createPath=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",O),M&&$.setAttributes(W,M),W},$}(),Ye=function(){function $(){}return $.addKey=function(O){$.key=O},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),vt=function(){function $(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return $.prototype.rasterize=function(O,M,W){var ee=this;return new Promise(function(Y){var Ce=W!==void 0?W:document.createElement("canvas");O===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var rt=document.createElementNS("http://www.w3.org/2000/svg","svg");rt.setAttribute("xmlns","http://www.w3.org/2000/svg"),rt.setAttribute("width",M.width.baseVal.valueAsString),rt.setAttribute("height",M.height.baseVal.valueAsString),rt.setAttribute("viewBox","0 0 "+M.viewBox.baseVal.width.toString()+" "+M.viewBox.baseVal.height.toString()),rt.innerHTML=M.innerHTML,ee.naturalSize===!0?(rt.width.baseVal.value=O.naturalWidth,rt.height.baseVal.value=O.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(rt.width.baseVal.value=ee.width,rt.height.baseVal.value=ee.height),Ce.width=rt.width.baseVal.value,Ce.height=rt.height.baseVal.value;var wt=rt.outerHTML,Pt=Ce.getContext("2d");ee.markersOnly!==!0&&Pt.drawImage(O,0,0,Ce.width,Ce.height);var lt=window.URL,Kt=new Image(Ce.width,Ce.height);Kt.setAttribute("crossOrigin","anonymous");var Jt=new Blob([wt],{type:"image/svg+xml"}),jn=lt.createObjectURL(Jt);Kt.onload=function(){Pt.drawImage(Kt,0,0),lt.revokeObjectURL(jn);var xr=Ce.toDataURL(ee.imageType,ee.imageQuality);Y(xr)},Kt.src=jn})},$}(),ct=function(){},it=function(){function $(O){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+O+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.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($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(O){return this.styleSheet===void 0&&this.addStyleSheet(),O.name=""+this.classNamePrefix+O.localName,this.classes.push(O),this.styleSheet.sheet.insertRule("."+O.name+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length),O},$.prototype.addRule=function(O){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(O),this.styleSheet.sheet.insertRule(O.selector+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var O;this.styleSheet=document.createElement("style"),((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).appendChild(this.styleSheet),this.addRule(new ft("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ft("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ft("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Qe("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Qe("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},$.prototype.removeStyleSheet=function(){var O;this.styleSheet&&(((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),ft=function($,O){this.selector=$,this.style=O},Qe=function($,O){this.localName=$,this.style=O},qe=function(){function $(O,M,W,ee,Y){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=O,this.displayMode=M,this.markerItems=W,this.uiStyleSettings=ee,this.styles=Y,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return $.prototype.show=function(O){var M=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Y){var Ce=document.createElement("div");Ce.className=""+M.toolbarButtonStyleClass.name,Ce.setAttribute("data-type-name",Y.typeName),Ce.innerHTML=Y.icon,Ce.addEventListener("click",function(){M.markerToolbarButtonClicked(Ce,Y)}),M.buttons.push(Ce),M.markerButtons.push(Ce)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},$.prototype.addButtonClickListener=function(O){this.buttonClickListeners.push(O)},$.prototype.removeButtonClickListener=function(O){this.buttonClickListeners.indexOf(O)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(O),1)},$.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},$.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var O=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var M=0;M<this.markerButtons.length;M++)M<O||M===O&&this.markerButtons.length-1===O?this.markerButtonBlock.appendChild(this.markerButtons[M]):(M===O&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[M]))}},$.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")},$.prototype.resetButtonStyles=function(){var O=this;this.buttons.forEach(function(M){M.className=M.className.replace(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name,"").trim(),M.className=M.className.replace(O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:O.toolbarActiveButtonStyleColorsClass.name,"").trim(),M.className+=" "+(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name)})},$.prototype.addActionButton=function(O,M,W){var ee=this,Y=document.createElement("div");switch(Y.className=""+this.toolbarButtonStyleClass.name,Y.innerHTML=M,Y.setAttribute("data-action",W),Y.addEventListener("click",function(){ee.actionToolbarButtonClicked(Y,W)}),W){case"select":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Y.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Y.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Y.style.fill=this.uiStyleSettings.closeButtonColor}O.appendChild(Y),this.buttons.push(Y)},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Qe("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 Qe("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Qe("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Qe("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 Qe("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var O=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Qe("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
|
|
padding: `+O+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Qe("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Qe("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ft("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ft("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},$.prototype.markerToolbarButtonClicked=function(O,M){this.setActiveButton(O),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",M)}),this.markerButtonOverflowBlock.style.display="none"},$.prototype.actionToolbarButtonClicked=function(O,M){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",M)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},$.prototype.setActiveButton=function(O){this.resetButtonStyles(),O.className=O.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),O.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},$.prototype.setActiveMarkerButton=function(O){var M=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===O});M&&this.setActiveButton(M)},$.prototype.setCurrentMarker=function(O){var M=this;this.currentMarker=O,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){M.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},$}(),ht=function(){function $(O,M,W,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=O,this.displayMode=M,this.uiStyleSettings=W,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return $.prototype.addStyles=function(){var O;this.toolboxStyleClass=this.styles.addClass(new Qe("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 Qe("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var M=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Qe("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Qe("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Qe("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 Qe("toolbox-panel-row_colors",`
|
|
background-color: `+((O=this.uiStyleSettings.toolboxBackgroundColor)!==null&&O!==void 0?O:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Qe("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
|
|
padding: `+M+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Qe("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Qe("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new ft("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ft("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},$.prototype.show=function(O){var M;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolboxStyleClass.name+" "+((M=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},$.prototype.setPanelButtons=function(O){var M,W,ee=this;this.panels=O,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Y){var Ce;Y.uiStyleSettings=ee.uiStyleSettings;var rt=document.createElement("div");rt.className=ee.toolboxButtonStyleClass.name+" "+((Ce=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ce!==void 0?Ce:ee.toolboxButtonStyleColorsClass.name),rt.innerHTML=Y.icon,rt.title=Y.title,rt.addEventListener("click",function(){ee.panelButtonClick(Y)}),ee.panelButtons.push(rt),ee.buttonRow.appendChild(rt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},$.prototype.panelButtonClick=function(O){var M=this,W=-1;if(O!==this.activePanel){W=this.panels.indexOf(O),this.panelRow.innerHTML="";var ee=O.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=O}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){M.displayMode==="inline"?M.panelRow.style.display="none":M.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Y,Ce){var rt,wt;Y.className=M.toolboxButtonStyleClass.name+" "+(Ce===W?""+((rt=M.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&rt!==void 0?rt:M.toolboxActiveButtonStyleColorsClass.name):""+((wt=M.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&wt!==void 0?wt:M.toolboxButtonStyleColorsClass.name))})},$}(),de=function($,O){this.title=$,this.icon=O},Ie=function($){function O(M,W,ee,Y){var Ce=$.call(this,M,Y||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Ce.colors=[],Ce.addTransparent=!1,Ce.colorBoxes=[],Ce.colors=W,Ce.currentColor=ee,Ce.setCurrentColor=Ce.setCurrentColor.bind(Ce),Ce.getColorBox=Ce.getColorBox.bind(Ce),Ce}return De(O,$),O.prototype.getUi=function(){var M=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var Y=M.getColorBox(ee);W.appendChild(Y),M.colorBoxes.push(Y)}),W},O.prototype.getColorBox=function(M){var W=this,ee=this.uiStyleSettings.toolbarHeight/4,Y=this.uiStyleSettings.toolbarHeight-ee,Ce=document.createElement("div");Ce.style.display="inline-block",Ce.style.boxSizing="content-box",Ce.style.width=Y-2+"px",Ce.style.height=Y-2+"px",Ce.style.padding="1px",Ce.style.marginRight="2px",Ce.style.marginBottom="2px",Ce.style.borderWidth="2px",Ce.style.borderStyle="solid",Ce.style.borderRadius=(Y+2)/2+"px",Ce.style.borderColor=M===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ce.addEventListener("click",function(){W.setCurrentColor(M,Ce)});var rt=document.createElement("div");return rt.style.display="inline-block",rt.style.width=Y-2+"px",rt.style.height=Y-2+"px",rt.style.backgroundColor=M,rt.style.borderRadius=Y/2+"px",M==="transparent"&&(rt.style.fill=this.uiStyleSettings.toolboxAccentColor,rt.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>`),Ce.appendChild(rt),Ce},O.prototype.setCurrentColor=function(M,W){var ee=this;this.currentColor=M,this.colorBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(M)},O}(de),Pe=function(){function $(O,M,W){this._state="new",this._isSelected=!1,this._container=O,this._overlayContainer=M,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty($.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),$.prototype.ownsTarget=function(O){return!1},Object.defineProperty($.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),$.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},$.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},$.prototype.pointerDown=function(O,M){},$.prototype.dblClick=function(O,M){},$.prototype.manipulate=function(O){},$.prototype.pointerUp=function(O){this.stateChanged()},$.prototype.dispose=function(){},$.prototype.addMarkerVisualToContainer=function(O){this.container.childNodes.length>0?this.container.insertBefore(O,this.container.childNodes[0]):this.container.appendChild(O)},$.prototype.getState=function(){return{typeName:$.typeName,state:this.state,notes:this.notes}},$.prototype.restoreState=function(O){this._state=O.state,this.notes=O.notes},$.prototype.scale=function(O,M){},$.prototype.colorChanged=function(O){this.onColorChanged&&this.onColorChanged(O),this.stateChanged()},$.prototype.fillColorChanged=function(O){this.onFillColorChanged&&this.onFillColorChanged(O),this.stateChanged()},$.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var O=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),O.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(O)&&this.onStateChanged(this)}},$.typeName="MarkerBase",$}(),Ke=function(){function $(){this.findGripByVisual=this.findGripByVisual.bind(this)}return $.prototype.findGripByVisual=function(O){return this.topLeft.ownsTarget(O)?this.topLeft:this.topCenter.ownsTarget(O)?this.topCenter:this.topRight.ownsTarget(O)?this.topRight:this.centerLeft.ownsTarget(O)?this.centerLeft:this.centerRight.ownsTarget(O)?this.centerRight:this.bottomLeft.ownsTarget(O)?this.bottomLeft:this.bottomCenter.ownsTarget(O)?this.bottomCenter:this.bottomRight.ownsTarget(O)?this.bottomRight:void 0},$}(),st=function(){function $(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},$}(),at=function(){function $(){}return $.toITransformMatrix=function(O){return{a:O.a,b:O.b,c:O.c,d:O.d,e:O.e,f:O.f}},$.toSVGMatrix=function(O,M){return O.a=M.a,O.b=M.b,O.c=M.c,O.d=M.d,O.e=M.e,O.f=M.f,O},$}(),et=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.left=0,Y.top=0,Y.width=0,Y.height=0,Y.defaultSize={x:50,y:20},Y.offsetX=0,Y.offsetY=0,Y.rotationAngle=0,Y.CB_DISTANCE=10,Y._suppressMarkerCreateEvent=!1,Y.container.transform.baseVal.appendItem(ue.createTransform()),Y.setupControlBox(),Y}return De(O,$),Object.defineProperty(O.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"visual",{get:function(){return this._visual},set:function(M){this._visual=M;var W=ue.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!!$.prototype.ownsTarget.call(this,M)||!!(this.controlGrips.findGripByVisual(M)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M))},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.state==="new"&&(this.left=M.x,this.top=M.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(M);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var Y=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Y.x-this.width/2,this.top=Y.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ce=this.container.transform.baseVal.getItem(0);Ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},O.prototype.pointerUp=function(M){var W=this.state;$.prototype.pointerUp.call(this,M),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(M),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},O.prototype.moveVisual=function(M){this.visual.style.transform="translate("+M.x+"px, "+M.y+"px)"},O.prototype.manipulate=function(M){var W=this.unrotatePoint(M);this.state==="creating"?this.resize(M):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(M)},O.prototype.resize=function(M){var W=this.manipulationStartLeft,ee=this.manipulationStartWidth,Y=this.manipulationStartTop,Ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+M.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+M.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Y=this.manipulationStartTop+M.y-this.manipulationStartY,Ce=this.manipulationStartHeight+this.manipulationStartTop-Y;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ce=this.manipulationStartHeight+M.y-this.manipulationStartY}ee>=0?(this.left=W,this.width=ee):(this.left=W+ee,this.width=-ee),Ce>=0?(this.top=Y,this.height=Ce):(this.top=Y+Ce,this.height=-Ce),this.setSize()},O.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},O.prototype.rotate=function(M){if(Math.abs(M.x-this.centerX)>.1){var W=Math.sign(M.x-this.centerX);this.rotationAngle=180*Math.atan((M.y-this.centerY)/(M.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},O.prototype.applyRotation=function(){var M=this.container.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(M,0)},O.prototype.rotatePoint=function(M){if(this.rotationAngle===0)return M;var W=this.container.getCTM(),ee=ue.createPoint(M.x,M.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},O.prototype.unrotatePoint=function(M){if(this.rotationAngle===0)return M;var W=this.container.getCTM();W=W.inverse();var ee=ue.createPoint(M.x,M.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},O.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var M=ue.createTransform();M.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(M),this.container.appendChild(this.controlBox),this.controlRect=ue.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ue.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ke,this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){var M=this.controlBox.transform.baseVal.getItem(0);M.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(M,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()},O.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()},O.prototype.createGrip=function(){var M=new st;return M.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.controlGrips.topLeft.GRIP_SIZE,W=-M/2,ee=W,Y=(this.width+this.CB_DISTANCE)/2-M/2,Ce=(this.height+this.CB_DISTANCE)/2-M/2,rt=this.height+this.CB_DISTANCE-M/2,wt=this.width+this.CB_DISTANCE-M/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ee),this.positionGrip(this.controlGrips.topCenter.visual,Y,ee),this.positionGrip(this.controlGrips.topRight.visual,wt,ee),this.positionGrip(this.controlGrips.centerLeft.visual,W,Ce),this.positionGrip(this.controlGrips.centerRight.visual,wt,Ce),this.positionGrip(this.controlGrips.bottomLeft.visual,W,rt),this.positionGrip(this.controlGrips.bottomCenter.visual,Y,rt),this.positionGrip(this.controlGrips.bottomRight.visual,wt,rt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Y,ee-3*this.CB_DISTANCE)},O.prototype.positionGrip=function(M,W,ee){var Y=M.transform.baseVal.getItem(0);Y.setTranslate(W,ee),M.transform.baseVal.replaceItem(Y,0)},O.prototype.hideControlBox=function(){this.controlBox.style.display="none"},O.prototype.showControlBox=function(){this.controlBox.style.display=""},O.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:at.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:at.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},$.prototype.getState.call(this))},O.prototype.restoreState=function(M){$.prototype.restoreState.call(this,M);var W=M;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},O.prototype.scale=function(M,W){$.prototype.scale.call(this,M,W);var ee=this.rotatePoint({x:this.left,y:this.top}),Y=this.unrotatePoint({x:ee.x*M,y:ee.y*W});this.left=Y.x,this.top=Y.y,this.width=this.width*M,this.height=this.height*W,this.adjustControlBox()},O}(Pe),tt=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y}return De(O,$),O.prototype.ownsTarget=function(M){return!(!$.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=ue.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){$.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){$.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){$.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){$.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this))},O.prototype.restoreState=function(M){var W=M;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),$.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,W){$.prototype.scale.call(this,M,W),this.setSize()},O.title="Rectangle marker",O}(et),dt=function($){function O(M,W,ee,Y){var Ce=$.call(this,M,Y||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ce.widths=[],Ce.widthBoxes=[],Ce.widths=W,Ce.currentWidth=ee,Ce.setCurrentWidth=Ce.setCurrentWidth.bind(Ce),Ce}return De(O,$),O.prototype.getUi=function(){var M=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.flexGrow="2",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===M.currentWidth?M.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){M.setCurrentWidth(ee,Y)}),W.appendChild(Y);var Ce=document.createElement("div");Ce.innerText=ee.toString(),Ce.style.marginRight="5px",Y.appendChild(Ce);var rt=document.createElement("div");rt.style.minHeight="20px",rt.style.flexGrow="2",rt.style.display="flex",rt.style.alignItems="center";var wt=document.createElement("hr");wt.style.minWidth="20px",wt.style.border="0px",wt.style.borderTop=ee+"px solid "+M.uiStyleSettings.toolboxColor,wt.style.flexGrow="2",rt.appendChild(wt),Y.appendChild(rt),M.widthBoxes.push(Y)}),W},O.prototype.setCurrentWidth=function(M,W){var ee=this;this.currentWidth=M,this.widthBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},O}(de),yt=function($){function O(M,W,ee,Y){var Ce=$.call(this,M,Y||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Ce.styles=[],Ce.styleBoxes=[],Ce.styles=W,Ce.currentStyle=ee,Ce.setCurrentStyle=Ce.setCurrentStyle.bind(Ce),Ce}return De(O,$),O.prototype.getUi=function(){var M=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/M.styles.length-5+"%",Y.style.borderColor=ee===M.currentStyle?M.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){M.setCurrentStyle(ee,Y)}),W.appendChild(Y);var Ce=document.createElement("div");Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.overflow="hidden";var rt=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+M.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
|
|
</svg>`;Ce.innerHTML=rt,Y.appendChild(Ce),M.styleBoxes.push(Y)}),W},O.prototype.setCurrentStyle=function(M,W){var ee=this;this.currentStyle=M,this.styleBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},O}(de),Ae=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Ie("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new dt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new yt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return De(O,$),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=$.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="FrameMarker",O.title="Frame marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',O}(tt),Se=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ve=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.x1=0,Y.y1=0,Y.x2=0,Y.y2=0,Y.defaultLength=50,Y.manipulationStartX=0,Y.manipulationStartY=0,Y.manipulationStartX1=0,Y.manipulationStartY1=0,Y.manipulationStartX2=0,Y.manipulationStartY2=0,Y.setupControlBox(),Y}return De(O,$),O.prototype.ownsTarget=function(M){return!!$.prototype.ownsTarget.call(this,M)||!(!this.grip1.ownsTarget(M)&&!this.grip2.ownsTarget(M))},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.manipulationStartX=M.x,this.manipulationStartY=M.y,this.state==="new"&&(this.x1=M.x,this.y1=M.y,this.x2=M.x,this.y2=M.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(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},O.prototype.pointerUp=function(M){var W=this.state;$.prototype.pointerUp.call(this,M),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(M),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},O.prototype.adjustVisual=function(){},O.prototype.manipulate=function(M){this.state==="creating"?this.resize(M):this.state==="move"?(this.x1=this.manipulationStartX1+M.x-this.manipulationStartX,this.y1=this.manipulationStartY1+M.y-this.manipulationStartY,this.x2=this.manipulationStartX2+M.x-this.manipulationStartX,this.y2=this.manipulationStartY2+M.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(M)},O.prototype.resize=function(M){switch(this.activeGrip){case this.grip1:this.x1=M.x,this.y1=M.y;break;case this.grip2:case void 0:this.x2=M.x,this.y2=M.y}this.adjustVisual(),this.adjustControlBox()},O.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){this.positionGrips()},O.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},O.prototype.createGrip=function(){var M=new st;return M.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-M/2,this.y1-M/2),this.positionGrip(this.grip2.visual,this.x2-M/2,this.y2-M/2)},O.prototype.positionGrip=function(M,W,ee){var Y=M.transform.baseVal.getItem(0);Y.setTranslate(W,ee),M.transform.baseVal.replaceItem(Y,0)},O.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},$.prototype.getState.call(this))},O.prototype.restoreState=function(M){$.prototype.restoreState.call(this,M);var W=M;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},O.prototype.scale=function(M,W){$.prototype.scale.call(this,M,W),this.x1=this.x1*M,this.y1=this.y1*W,this.x2=this.x2*M,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},O}(Pe),Je=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Ie("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new dt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new yt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return De(O,$),O.prototype.ownsTarget=function(M){return!(!$.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorLine&&M!==this.visibleLine)},O.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},O.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},$.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){$.prototype.restoreState.call(this,M);var W=M;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},O.typeName="LineMarker",O.title="Line marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',O}(Ve),Ne=function($){function O(M,W,ee,Y){var Ce=$.call(this,M,Y||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Ce.fonts=[],Ce.fontBoxes=[],Ce.fonts=W,Ce.currentFont=ee,Ce.setCurrentFont=Ce.setCurrentFont.bind(Ce),Ce}return De(O,$),O.prototype.getUi=function(){var M=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ee){var Y=document.createElement("div");Y.style.display="inline-block",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/M.fonts.length-5+"%",Y.style.borderColor=ee===M.currentFont?M.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){M.setCurrentFont(ee,Y)}),W.appendChild(Y);var Ce=document.createElement("div");Ce.style.display="flex",Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.fontFamily=ee,Ce.style.overflow="hidden";var rt=document.createElement("div");rt.style.whiteSpace="nowrap",rt.style.overflow="hidden",rt.style.textOverflow="ellipsis",rt.innerHTML="The quick brown fox jumps over the lazy dog",Ce.appendChild(rt),Y.appendChild(Ce),M.fontBoxes.push(Y)}),W},O.prototype.setCurrentFont=function(M,W){var ee=this;this.currentFont=M,this.fontBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},O}(de),je=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.color="transparent",Y.padding=5,Y.DEFAULT_TEXT="your text here",Y.text=Y.DEFAULT_TEXT,Y.isMoved=!1,Y.color=ee.defaultColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setColor=Y.setColor.bind(Y),Y.setFont=Y.setFont.bind(Y),Y.renderText=Y.renderText.bind(Y),Y.sizeText=Y.sizeText.bind(Y),Y.textEditDivClicked=Y.textEditDivClicked.bind(Y),Y.showTextEditor=Y.showTextEditor.bind(Y),Y.setSize=Y.setSize.bind(Y),Y.positionTextEditor=Y.positionTextEditor.bind(Y),Y.colorPanel=new Ie("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.fontFamilyPanel=new Ne("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y}return De(O,$),O.prototype.ownsTarget=function(M){if($.prototype.ownsTarget.call(this,M)||M===this.visual||M===this.textElement||M===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ee){ee===M&&(W=!0)}),W},O.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.isMoved=!1,this.pointerDownPoint=M,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.renderText=function(){var M=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(W){M.textElement.appendChild(ue.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},O.prototype.getTextScale=function(){var M=this.textElement.getBBox(),W=1;if(M.width>0&&M.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/M.width,Y=(1*this.height-this.height*this.padding*2/100)/M.height;W=Math.min(ee,Y)}return W},O.prototype.getTextPosition=function(M){var W=this.textElement.getBBox(),ee=0,Y=0;return W.width>0&&W.height>0&&(ee=(this.width-W.width*M)/2,Y=this.height/2-W.height*M/2),{x:ee,y:Y}},O.prototype.sizeText=function(){var M=this.textElement.getBBox(),W=this.getTextScale(),ee=this.getTextPosition(W);ee.y-=M.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},O.prototype.manipulate=function(M){$.prototype.manipulate.call(this,M),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(M.x-this.pointerDownPoint.x)>5||Math.abs(M.y-this.pointerDownPoint.y)>5)},O.prototype.resize=function(M){$.prototype.resize.call(this,M),this.isMoved=!0,this.setSize(),this.sizeText()},O.prototype.setSize=function(){$.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},O.prototype.pointerUp=function(M){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),$.prototype.pointerUp.call(this,M),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},O.prototype.showTextEditor=function(){var M=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(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(M.textEditor.style.fontSize);M.textEditor.clientWidth>=Number.parseInt(M.textEditor.style.maxWidth)&&W>.9;)W-=.1,M.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ee=W.clipboardData.getData("text"),Y=window.getSelection();if(!Y.rangeCount)return!1;Y.deleteFromDocument(),Y.getRangeAt(0).insertNode(document.createTextNode(ee)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){M.textEditDivClicked(M.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},O.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var M=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),Y={x:ee.width*M,y:ee.height*M};W.x-=Y.x/2,W.y-=Y.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*M,12)+"px",this.textElement.style.display="none"}},O.prototype.textEditDivClicked=function(M){this.text=M.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},O.prototype.select=function(){$.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},O.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),$.prototype.deselect.call(this)},O.prototype.dblClick=function(M,W){$.prototype.dblClick.call(this,M,W),this.showTextEditor()},O.prototype.setColor=function(M){this.textElement&&ue.setAttributes(this.textElement,[["fill",M]]),this.color=M,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(M)},O.prototype.setFont=function(M){this.textElement&&ue.setAttributes(this.textElement,[["font-family",M]]),this.fontFamily=M,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},O.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},O.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},$.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var W=M;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),$.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,W){$.prototype.scale.call(this,M,W),this.setSize(),this.sizeText(),this.positionTextEditor()},O.typeName="TextMarker",O.title="Text marker",O.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>',O}(et),Ee=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.color="transparent",Y.lineWidth=3,Y.drawing=!1,Y.pixelRatio=1,Y.color=ee.defaultColor,Y.lineWidth=ee.defaultStrokeWidth,Y.pixelRatio=ee.freehandPixelRatio,Y.setColor=Y.setColor.bind(Y),Y.addCanvas=Y.addCanvas.bind(Y),Y.finishCreation=Y.finishCreation.bind(Y),Y.setLineWidth=Y.setLineWidth.bind(Y),Y.colorPanel=new Ie("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.lineWidthPanel=new dt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.lineWidthPanel.onWidthChanged=Y.setLineWidth,Y}return De(O,$),O.prototype.ownsTarget=function(M){return!(!$.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.drawingImage)},O.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var M=ue.createTransform();this.visual.transform.baseVal.appendItem(M),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,W){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(M.x,M.y),this.drawing=!0):$.prototype.pointerDown.call(this,M,W)},O.prototype.manipulate=function(M){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(M.x,M.y),this.canvasContext.stroke()):$.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){$.prototype.resize.call(this,M),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):$.prototype.pointerUp.call(this,M)},O.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)},O.prototype.select=function(){this.state==="creating"&&this.finishCreation(),$.prototype.select.call(this)},O.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),$.prototype.deselect.call(this)},O.prototype.finishCreation=function(){for(var M=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=W[0],Y=W[1],Ce=W[2],rt=W[3],wt=!1,Pt=0;Pt<this.canvasElement.height;Pt++)for(var lt=0;lt<this.canvasElement.width;lt++)M.data[Pt*this.canvasElement.width*4+4*lt+3]>0&&(wt=!0,Pt<Y&&(Y=Pt),lt<ee&&(ee=lt),Pt>rt&&(rt=Pt),lt>Ce&&(Ce=lt));if(wt){this.left=ee/this.pixelRatio,this.top=Y/this.pixelRatio,this.width=(Ce-ee)/this.pixelRatio,this.height=(rt-Y)/this.pixelRatio;var Kt=document.createElement("canvas");Kt.width=Ce-ee,Kt.height=rt-Y,Kt.getContext("2d").putImageData(this.canvasContext.getImageData(ee,Y,Ce-ee,rt-Y),0,0),this.drawingImgUrl=Kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},O.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},O.prototype.setColor=function(M){this.color=M,this.colorChanged(M)},O.prototype.setLineWidth=function(M){this.lineWidth=M},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({drawingImgUrl:this.drawingImgUrl},$.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){this.createVisual(),$.prototype.restoreState.call(this,M),this.drawingImgUrl=M.drawingImgUrl,this.setDrawingImage()},O.prototype.scale=function(M,W){$.prototype.scale.call(this,M,W),this.setDrawingImage()},O.typeName="FreehandMarker",O.title="Freehand marker",O.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>',O}(et),he=function($){function O(M,W,ee){var Y=$.call(this,M,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Y.typeBoxes=[],Y.currentType=W,Y.setCurrentType=Y.setCurrentType.bind(Y),Y}return De(O,$),O.prototype.getUi=function(){var M=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ee=function(rt){var wt="both";switch(rt){case 0:wt="both";break;case 1:wt="start";break;case 2:wt="end";break;case 3:wt="none"}var Pt=document.createElement("div");if(Pt.style.display="flex",Pt.style.flexGrow="2",Pt.style.alignItems="center",Pt.style.justifyContent="space-between",Pt.style.padding="5px",Pt.style.borderWidth="2px",Pt.style.borderStyle="solid",Pt.style.borderColor=wt===Y.currentType?Y.uiStyleSettings.toolboxAccentColor:"transparent",Pt.addEventListener("click",function(){M.setCurrentType(wt,Pt)}),W.appendChild(Pt),wt==="both"||wt==="start"){var lt=document.createElement("div");lt.style.display="flex",lt.style.alignItems="center",lt.style.minHeight="20px",lt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,lt.style.marginLeft="5px",Pt.appendChild(lt)}var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.style.flexGrow="2";var Jt=document.createElement("hr");if(Jt.style.minWidth="20px",Jt.style.border="0px",Jt.style.borderTop="3px solid "+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee"),Jt.style.flexGrow="2",Kt.appendChild(Jt),Pt.appendChild(Kt),wt==="both"||wt==="end"){var jn=document.createElement("div");jn.style.display="flex",jn.style.alignItems="center",jn.style.minHeight="20px",jn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,jn.style.marginRight="5px",Pt.appendChild(jn)}Y.typeBoxes.push(Pt)},Y=this,Ce=0;Ce<4;Ce++)ee(Ce);return W},O.prototype.setCurrentType=function(M,W){var ee=this;this.currentType=M,this.typeBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},O}(de),pe=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.arrowType="end",Y.arrowBaseHeight=10,Y.arrowBaseWidth=10,Y.getArrowPoints=Y.getArrowPoints.bind(Y),Y.setArrowType=Y.setArrowType.bind(Y),Y.arrowTypePanel=new he("Arrow type","end"),Y.arrowTypePanel.onArrowTypeChanged=Y.setArrowType,Y}return De(O,$),O.prototype.ownsTarget=function(M){return!(!$.prototype.ownsTarget.call(this,M)&&M!==this.arrow1&&M!==this.arrow2)},O.prototype.getArrowPoints=function(M,W){var ee=this.arrowBaseWidth+2*this.strokeWidth,Y=this.arrowBaseHeight+2*this.strokeWidth;return M-ee/2+","+(W+Y/2)+" "+M+","+(W-Y/2)+" "+(M+ee/2)+","+(W+Y/2)},O.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(M,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(M+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},O.prototype.setArrowType=function(M){this.arrowType=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({arrowType:this.arrowType},$.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){$.prototype.restoreState.call(this,M);var W=M;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},O.typeName="ArrowMarker",O.title="Arrow marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',O}(Je),re=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.fillColor=ee.defaultFillColor,Y.strokeWidth=0,Y.fillPanel=new Ie("Color",ee.defaultColorSet,ee.defaultFillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y}return De(O,$),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=$.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="CoverMarker",O.title="Cover marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',O}(tt),oe=function($){function O(M,W,ee,Y){var Ce=$.call(this,M,Y||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Ce.opacities=[],Ce.opacityBoxes=[],Ce.opacities=W,Ce.currentOpacity=ee,Ce.setCurrentOpacity=Ce.setCurrentOpacity.bind(Ce),Ce}return De(O,$),O.prototype.getUi=function(){var M=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===M.currentOpacity?M.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){M.setCurrentOpacity(ee,Y)}),W.appendChild(Y);var Ce=document.createElement("div");Ce.innerText=100*ee+"%",Y.appendChild(Ce),M.opacityBoxes.push(Y)}),W},O.prototype.setCurrentOpacity=function(M,W){var ee=this;this.currentOpacity=M,this.opacityBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},O}(de),le=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.setOpacity=Y.setOpacity.bind(Y),Y.fillColor=ee.defaultHighlightColor,Y.strokeWidth=0,Y.opacity=ee.defaultHighlightOpacity,Y.fillPanel=new Ie("Color",ee.defaultColorSet,Y.fillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y.opacityPanel=new oe("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return De(O,$),O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=$.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="HighlightMarker",O.title="Highlight marker",O.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>',O}(re),me='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',be=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.bgColor="transparent",Y.tipPosition={x:0,y:0},Y.tipBase1Position={x:0,y:0},Y.tipBase2Position={x:0,y:0},Y.tipMoving=!1,Y.color=ee.defaultStrokeColor,Y.bgColor=ee.defaultFillColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setBgColor=Y.setBgColor.bind(Y),Y.getTipPoints=Y.getTipPoints.bind(Y),Y.positionTip=Y.positionTip.bind(Y),Y.setTipPoints=Y.setTipPoints.bind(Y),Y.colorPanel=new Ie("Text color",ee.defaultColorSet,Y.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),Y.colorPanel.onColorChanged=Y.setColor,Y.bgColorPanel=new Ie("Fill color",ee.defaultColorSet,Y.bgColor,me),Y.bgColorPanel.onColorChanged=Y.setBgColor,Y.fontFamilyPanel=new Ne("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y.tipGrip=new st,Y.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),Y.controlBox.appendChild(Y.tipGrip.visual),Y}return De(O,$),O.prototype.ownsTarget=function(M){return $.prototype.ownsTarget.call(this,M)||this.tipGrip.ownsTarget(M)||this.tip===M},O.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},O.prototype.pointerDown=function(M,W){this.state==="new"&&$.prototype.pointerDown.call(this,M,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):$.prototype.pointerDown.call(this,M,W)},O.prototype.pointerUp=function(M){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,$.prototype.pointerUp.call(this,M);else{var W=this.state==="creating";$.prototype.pointerUp.call(this,M),this.setTipPoints(W),this.positionTip()}},O.prototype.manipulate=function(M){if(this.tipMoving){var W=this.unrotatePoint(M);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else $.prototype.manipulate.call(this,M)},O.prototype.setBgColor=function(M){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",M]]),ue.setAttributes(this.tip,[["fill",M]])),this.bgColor=M,this.fillColorChanged(M)},O.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},O.prototype.setTipPoints=function(M){M===void 0&&(M=!1);var W=Math.min(this.height/2,15),ee=this.height/5;M&&(this.tipPosition={x:W+ee/2,y:this.height+20});var Y=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+ee,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ee,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Y<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ee,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-ee},this.tipBase2Position={x:this.width,y:this.height-W}):Y<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-ee})},O.prototype.resize=function(M){$.prototype.resize.call(this,M),this.positionTip()},O.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var M=this.tipGrip.visual.transform.baseVal.getItem(0);M.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(M,0)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.select=function(){this.positionTip(),$.prototype.select.call(this)},O.prototype.getState=function(){var M=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},$.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var W=M;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,$.prototype.restoreState.call(this,M),this.createTip(),this.setTipPoints()},O.prototype.scale=function(M,W){$.prototype.scale.call(this,M,W),this.tipPosition={x:this.tipPosition.x*M,y:this.tipPosition.y*W},this.positionTip()},O.typeName="CalloutMarker",O.title="Callout marker",O.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>',O}(je),Be=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.fillColor=ee.defaultFillColor,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.setOpacity=Y.setOpacity.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y.strokePanel=new Ie("Line color",ye(ee.defaultColorSet,["transparent"]),ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.fillPanel=new Ie("Fill color",ye(ee.defaultColorSet,["transparent"]),Y.fillColor,me),Y.fillPanel.onColorChanged=Y.setFillColor,Y.strokeWidthPanel=new dt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new yt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y.opacityPanel=new oe("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return De(O,$),O.prototype.ownsTarget=function(M){return!(!$.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=ue.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){$.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){$.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){$.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},O.prototype.pointerUp=function(M){$.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(M),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var W=M;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),$.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,W){$.prototype.scale.call(this,M,W),this.setSize()},O.typeName="EllipseMarker",O.title="Ellipse marker",O.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>',O}(et),$e=function($){function O(M,W,ee){return $.call(this,M,W,ee)||this}return De(O,$),Object.defineProperty(O.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!(!$.prototype.ownsTarget.call(this,M)&&M!==this.tip1&&M!==this.tip2)},O.prototype.createTips=function(){this.tip1=ue.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip2)},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(M,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(M+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=$.prototype.getState.call(this);return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){$.prototype.restoreState.call(this,M),this.createTips(),this.adjustVisual()},O.typeName="MeasurementMarker",O.title="Measurement marker",O.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>',O}(Je),ut=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.strokePanel.colors=ee.defaultColorSet,Y.fillColor="transparent",Y}return De(O,$),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=$.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="EllipseFrameMarker",O.title="Ellipse frame marker",O.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>',O}(Be),Et=function(){function $(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),$.prototype.addUndoStep=function(O){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(O)||(this.undoStack.push(O),JSON.stringify(this.lastRedoStep)!==JSON.stringify(O)&&this.redoStack.splice(0,this.redoStack.length))},$.prototype.replaceLastUndoStep=function(O){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=O)},$.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},$.prototype.undo=function(){if(this.undoStack.length>1){var O=this.undoStack.pop();return O!==void 0&&this.redoStack.push(O),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},$.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},$}(),mt=function($){function O(M,W,ee){var Y=$.call(this,M,W,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.curveX=0,Y.curveY=0,Y.manipulationStartCurveX=0,Y.manipulationStartCurveY=0,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.positionGrips=Y.positionGrips.bind(Y),Y.addControlGrips=Y.addControlGrips.bind(Y),Y.adjustVisual=Y.adjustVisual.bind(Y),Y.setupControlBox=Y.setupControlBox.bind(Y),Y.resize=Y.resize.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Ie("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new dt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new yt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return De(O,$),O.prototype.ownsTarget=function(M){return!(!$.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorCurve&&M!==this.visibleCurve&&!this.curveGrip.ownsTarget(M))},O.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},O.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,W){$.prototype.pointerDown.call(this,M,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=M.x,this.curveY=M.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},O.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setupControlBox=function(){$.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},O.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,$.prototype.addControlGrips.call(this)},O.prototype.positionGrips=function(){$.prototype.positionGrips.call(this);var M=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-M/2,this.curveY-M/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()))},O.prototype.manipulate=function(M){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+M.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+M.y-this.manipulationStartY),$.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){this.activeGrip===this.curveGrip&&(this.curveX=M.x,this.curveY=M.y),$.prototype.resize.call(this,M),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual()},O.prototype.scale=function(M,W){this.curveX=this.curveX*M,this.curveY=this.curveY*W,$.prototype.scale.call(this,M,W)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},$.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){$.prototype.restoreState.call(this,M);var W=M;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},O.typeName="CurveMarker",O.title="Curve marker",O.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>',O}(Ve),Bt=function(){function $(O,M){M===void 0&&(M=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=O,this.cancelable=M}return Object.defineProperty($.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),$.prototype.preventDefault=function(){this._defaultPrevented=!0},$}(),Ut=function($){function O(M,W,ee){var Y=$.call(this,M,!1)||this;return Y.dataUrl=W,Y.state=ee,Y}return De(O,$),O}(Bt),Tt=function($){function O(M,W,ee){ee===void 0&&(ee=!1);var Y=$.call(this,M,ee)||this;return Y.marker=W,Y}return De(O,$),O}(Bt),kt=function(){function $(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return $.prototype.addEventListener=function(O,M){this[O].push(M)},$.prototype.removeEventListener=function(O,M){var W=this[O].indexOf(M);W>-1&&this[O].splice(W,1)},$}(),zt=function(){function $(O){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Se,this._isOpen=!1,this.undoRedoManager=new Et,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 kt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=$.instanceCounter++,this.styles=new it(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=O,this.targetRoot=document.body,this.width=O.clientWidth,this.height=O.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty($.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ae,Ee,pe,je,ut,Be,le,be,$e,re,Je,mt]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ae,Ee,pe,je,Be,le,be]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ae,Ee,pe,je,le]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(O){var M=this;this._availableMarkerTypes.splice(0),O.forEach(function(W){if(typeof W=="string"){var ee=M.ALL_MARKER_TYPES.find(function(Y){return Y.typeName===W});ee!==void 0&&M._availableMarkerTypes.push(ee)}else M._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(O){this._zoomLevel=O,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ye.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},$.prototype.show=function(){var O=this;this.styles.styleSheetRoot===void 0&&ct.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ct.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(M){return M(new Bt(O))})},$.prototype.render=function(){return He(this,void 0,void 0,function(){var O;return We(this,function(M){switch(M.label){case 0:return this.setCurrentMarker(),(O=new vt).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.markersOnly=this.renderMarkersOnly,O.width=this.renderWidth,O.height=this.renderHeight,[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return M.sent(),[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,M.sent()]}})})},$.prototype.close=function(O){var M=this;if(O===void 0&&(O=!1),this.isOpen){var W=!1;O||this.eventListeners.beforeclose.forEach(function(ee){var Y=new Bt(M,!0);ee(Y),Y.defaultPrevented&&(W=!0)}),W||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new Bt(M))}),this.detachEvents(),this._isOpen=!1)}},$.prototype.addMarkersToToolbar=function(){for(var O,M=[],W=0;W<arguments.length;W++)M[W]=arguments[W];(O=this._availableMarkerTypes).push.apply(O,M)},$.prototype.addRenderEventListener=function(O){this.addEventListener("render",function(M){O(M.dataUrl,M.state)})},$.prototype.removeRenderEventListener=function(O){},$.prototype.addCloseEventListener=function(O){this.addEventListener("close",function(){O()})},$.prototype.removeCloseEventListener=function(O){},$.prototype.setupResizeObserver=function(){var O=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return O.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupTargetResize=function(){var O=1*this.target.clientWidth/this.target.clientHeight,M=this.editorCanvas.clientWidth/O>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*O:this.editorCanvas.clientWidth,W=M<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/O;this.resize(M,W)},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.resize=function(O,M){this._isResizing=!0;var W=O/this.imageWidth,ee=M/this.imageHeight;this.imageWidth=Math.round(O),this.imageHeight=Math.round(M),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(W,ee),this._isResizing=!1},$.prototype.scaleMarkers=function(O,M){var W,ee=this;this._currentMarker&&this._currentMarker instanceof je?this._currentMarker.scale(O,M):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Y){Y!==ee._currentMarker&&Y.scale(O,M)}),W!==void 0&&this.setCurrentMarker(W)},$.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"},$.prototype.setTopLeft=function(){var O=this.editingTarget.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=O.left-M.left,this.top=O.top-M.top},$.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)},$.prototype.addDefs=function(){for(var O,M=[],W=0;W<arguments.length;W++)M[W]=arguments[W];this.defs=ue.createDefs(),this.addDefsToImage(),(O=this.defs).append.apply(O,M)},$.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},$.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)},$.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},$.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},$.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)},$.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},$.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)},$.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 O=document.createElement("a");O.href="https://markerjs.com/",O.target="_blank",O.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>',O.title="Powered by marker.js",O.style.display="grid",O.style.alignItems="center",O.style.justifyItems="center",O.style.padding="3px",O.style.width="20px",O.style.height="20px",this.logoUI.appendChild(O),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},$.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},$.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"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 qe(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 ht(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},$.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.removeMarker=function(O){this.markerImage.removeChild(O.container),this.markers.indexOf(O)>-1&&this.markers.splice(this.markers.indexOf(O),1),O.dispose()},$.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},$.prototype.toolbarButtonClicked=function(O,M){if(O==="marker"&&M!==void 0)this.createNewMarker(M);else if(O==="action")switch(M){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},$.prototype.deleteSelectedMarker=function(){var O=this;if(this._currentMarker!==void 0){var M=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var Y=new Tt(O,O._currentMarker,!0);ee(Y),Y.defaultPrevented&&(M=!0)}),!M){var W=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new Tt(O,W))})}}},$.prototype.clear=function(){var O=this,M=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ce){var rt=new Tt(O,void 0,!0);Ce(rt),rt.defaultPrevented&&(M=!0)}),!M)){this.setCurrentMarker();for(var W=function(Ce){var rt=ee.markers[Ce];ee.setCurrentMarker(ee.markers[Ce]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(wt){return wt(new Tt(O,rt))})},ee=this,Y=this.markers.length-1;Y>=0;Y--)W(Y);this.addUndoStep()}},Object.defineProperty($.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),$.prototype.showNotesEditor=function(){var O;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=(O=this._currentMarker.notes)!==null&&O!==void 0?O:"",this.overlayContainer.appendChild(this.notesArea))},$.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},$.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},$.prototype.addUndoStep=function(){var O=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var M=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===M.width&&W.height===M.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(M),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Y){return Y(new Bt(O))})}else this.undoRedoManager.replaceLastUndoStep(M),this.eventListeners.statechange.forEach(function(Y){return Y(new Bt(O))})}},$.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},$.prototype.undoStep=function(){var O=this,M=this.undoRedoManager.undo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Bt(O))}))},$.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},$.prototype.redoStep=function(){var O=this,M=this.undoRedoManager.redo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Bt(O))}))},$.prototype.stepZoom=function(){var O=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=O<this.zoomSteps.length-1?this.zoomSteps[O+1]:this.zoomSteps[0]},$.prototype.panTo=function(O){this.contentDiv.scrollBy({left:this.prevPanPoint.x-O.x,top:this.prevPanPoint.y-O.y}),this.prevPanPoint=O},$.prototype.startRenderAndClose=function(){return He(this,void 0,void 0,function(){var O,M,W=this;return We(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return O=ee.sent(),M=this.getState(),this.eventListeners.render.forEach(function(Y){return Y(new Ut(W,O,M))}),this.close(!0),[2]}})})},$.prototype.getState=function(O){O===!0&&this.setCurrentMarker();var M={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return M.markers.push(W.getState())}),M},$.prototype.restoreState=function(O){var M=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);O.markers.forEach(function(W){var ee=M._availableMarkerTypes.find(function(Ce){return Ce.typeName===W.typeName});if(ee!==void 0){var Y=M.addNewMarker(ee);Y.restoreState(W),M.markers.push(Y)}}),O.width&&O.height&&(O.width!==this.imageWidth||O.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/O.width,this.imageHeight/O.height),this.eventListeners.restorestate.forEach(function(W){return W(new Bt(M))})},$.prototype.addNewMarker=function(O){var M=ue.createGroup();return this.markerImage.appendChild(M),new O(M,this.overlayContainer,this.settings)},$.prototype.createNewMarker=function(O){var M,W=this;(M=typeof O=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===O}):O)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(M),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(M.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new Tt(W,W._currentMarker))}))},$.prototype.markerCreated=function(O){var M=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(O),this.setCurrentMarker(O),O instanceof Ee&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ee):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new Tt(M,M._currentMarker))})},$.prototype.colorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=O,this.settings.defaultStrokeColor=O)},$.prototype.fillColorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=O)},$.prototype.markerStateChanged=function(O){var M=this;this.eventListeners.markerchange.forEach(function(W){return W(new Tt(M,O))})},$.prototype.setCurrentMarker=function(O){var M=this;this._currentMarker!==O&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new Tt(M,M._currentMarker))})),this._currentMarker=O,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(W){return W(new Tt(M,M._currentMarker))}))},$.prototype.onPointerDown=function(O){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||O.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var M=this.markers.find(function(W){return W.ownsTarget(O.target)});M!==void 0?(this.setCurrentMarker(M),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:O.clientX,y:O.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY))},$.prototype.onDblClick=function(O){if(this._isFocused||this.focus(),this.mode==="select"){var M=this.markers.find(function(W){return W.ownsTarget(O.target)});M!==void 0&&M!==this._currentMarker&&this.setCurrentMarker(M),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target):this.setCurrentMarker()}},$.prototype.onPointerMove=function(O){this.touchPoints!==1&&O.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||O.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(O.clientX,O.clientY)):this.zoomLevel>1&&this.panTo({x:O.clientX,y:O.clientY}))},$.prototype.onPointerUp=function(O){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(O.clientX,O.clientY)),this.isDragging=!1,this.addUndoStep()},$.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},$.prototype.onKeyUp=function(O){this._currentMarker===void 0||this.notesArea!==void 0||O.key!=="Delete"&&O.key!=="Backspace"||this.deleteSelectedMarker()},$.prototype.clientToLocalCoordinates=function(O,M){var W=this.markerImage.getBoundingClientRect();return{x:(O-W.left)/this.zoomLevel,y:(M-W.top)/this.zoomLevel}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},$.prototype.addLicenseKey=function(O){Ye.addKey(O)},$.prototype.addEventListener=function(O,M){this.eventListeners.addEventListener(O,M)},$.prototype.removeEventListener=function(O,M){this.eventListeners.removeEventListener(O,M)},$.prototype.renderState=function(O){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(O),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty($.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),$.prototype.focus=function(){var O=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(M){return M(new Bt(O))}))},$.prototype.blur=function(){var O=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(M){return M(new Bt(O))}))},$.instanceCounter=0,$}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var $t=function($,O){return($t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,W){M.__proto__=W}||function(M,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(M[ee]=W[ee])})($,O)};function vn($,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");function M(){this.constructor=$}$t($,O),$.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function Ft($,O,M,W){return new(M||(M=Promise))(function(ee,Y){function Ce(Pt){try{wt(W.next(Pt))}catch(lt){Y(lt)}}function rt(Pt){try{wt(W.throw(Pt))}catch(lt){Y(lt)}}function wt(Pt){var lt;Pt.done?ee(Pt.value):(lt=Pt.value,lt instanceof M?lt:new M(function(Kt){Kt(lt)})).then(Ce,rt)}wt((W=W.apply($,O||[])).next())})}function an($,O){var M,W,ee,Y,Ce={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:rt(0),throw:rt(1),return:rt(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function rt(wt){return function(Pt){return function(lt){if(M)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(M=1,W&&(ee=2<[0]?W.return:lt[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,lt[1])).done)return ee;switch(W=0,ee&&(lt=[2<[0],ee.value]),lt[0]){case 0:case 1:ee=lt;break;case 4:return Ce.label++,{value:lt[1],done:!1};case 5:Ce.label++,W=lt[1],lt=[0];continue;case 7:lt=Ce.ops.pop(),Ce.trys.pop();continue;default:if(!(ee=Ce.trys,(ee=ee.length>0&&ee[ee.length-1])||lt[0]!==6&<[0]!==2)){Ce=0;continue}if(lt[0]===3&&(!ee||lt[1]>ee[0]&<[1]<ee[3])){Ce.label=lt[1];break}if(lt[0]===6&&Ce.label<ee[1]){Ce.label=ee[1],ee=lt;break}if(ee&&Ce.label<ee[2]){Ce.label=ee[2],Ce.ops.push(lt);break}ee[2]&&Ce.ops.pop(),Ce.trys.pop();continue}lt=O.call($,Ce)}catch(Kt){lt=[6,Kt],W=0}finally{M=ee=0}if(5<[0])throw lt[1];return{value:lt[0]?lt[1]:void 0,done:!0}}([wt,Pt])}}}var nn=function(){function $(){}return $.addKey=function(O){$.key=O},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),ot=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(O,M){for(var W=0,ee=M;W<ee.length;W++){var Y=ee[W],Ce=Y[0],rt=Y[1];O.setAttribute(Ce,rt)}},$.createRect=function(O,M,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",O.toString()),ee.setAttribute("height",M.toString()),W&&$.setAttributes(ee,W),ee},$.createLine=function(O,M,W,ee,Y){var Ce=document.createElementNS("http://www.w3.org/2000/svg","line");return Ce.setAttribute("x1",O.toString()),Ce.setAttribute("y1",M.toString()),Ce.setAttribute("x2",W.toString()),Ce.setAttribute("y2",ee.toString()),Y&&$.setAttributes(Ce,Y),Ce},$.createPolygon=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",O),M&&$.setAttributes(W,M),W},$.createCircle=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(O/2).toString()),W.setAttribute("cy",(O/2).toString()),W.setAttribute("r",O.toString()),M&&$.setAttributes(W,M),W},$.createEllipse=function(O,M,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(O/2).toString()),ee.setAttribute("cy",(M/2).toString()),ee.setAttribute("rx",(O/2).toString()),ee.setAttribute("ry",(M/2).toString()),W&&$.setAttributes(ee,W),ee},$.createGroup=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return O&&$.setAttributes(M,O),M},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(O,M,W,ee,Y,Ce,rt){var wt=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(wt,[["id",O],["orient",M],["markerWidth",W.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ce.toString()]]),wt.appendChild(rt),wt},$.createText=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),O&&$.setAttributes(M,O),M},$.createTSpan=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=O,M&&$.setAttributes(W,M),W},$.createImage=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return O&&$.setAttributes(M,O),M},$.createPoint=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=O,W.y=M,W},$.createPath=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",O),M&&$.setAttributes(W,M),W},$.createElement=function(O,M){var W=document.createElementNS("http://www.w3.org/2000/svg",O);return M&&$.setAttributes(W,M),W},$.getHollowRectanglePath=function(O,M,W,ee,Y,Ce,rt,wt){return"M"+O+","+M+"V"+(M+ee)+"H"+(O+W)+"V"+M+"H"+Y+"V"+Ce+"H"+(Y+rt)+"V"+(Ce+wt)+"H"+Y+"V"+M+"Z"},$}(),en=function(){function $(O){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+O+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.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($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(O){return this.styleSheet===void 0&&this.addStyleSheet(),O.name=""+this.classNamePrefix+O.localName,this.classes.push(O),this.styleSheet.sheet.insertRule("."+O.name+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length),O},$.prototype.addRule=function(O){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(O),this.styleSheet.sheet.insertRule(O.selector+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var O;this.styleSheet=document.createElement("style"),((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).appendChild(this.styleSheet),this.addRule(new It("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new It("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new It("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Rt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Rt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},$.prototype.removeStyleSheet=function(){var O;this.styleSheet&&(((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),It=function($,O){this.selector=$,this.style=O},Rt=function($,O){this.localName=$,this.style=O},Mt=function(){function $(){this.blocks=[],this.display=""}return $.prototype.addButtonBlock=function(O){O.className=this.blockClassName,O.buttonClassName=this.buttonClassName,O.buttonColorsClassName=this.buttonColorsClassName,O.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(O)},$.prototype.addElementBlock=function(O){O.className===void 0&&(O.className=this.blockClassName),this.blocks.push(O)},$.prototype.getUI=function(){var O=document.createElement("div");return O.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,O.style.display=this.display,this.blocks.forEach(function(M){return O.appendChild(M.getUI())}),O},$}(),On=function(){function $(){}return $.prototype.getUI=function(){var O=document.createElement("div");if(O.className=this.className,this.minWidth!==void 0&&(O.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":O.style.justifyContent="flex-start";break;case"center":O.style.justifyContent="center";break;case"end":O.style.justifyContent="flex-end"}return O.style.whiteSpace="nowrap",O},$}(),ln=function($){function O(){var M=$!==null&&$.apply(this,arguments)||this;return M.buttons=[],M}return vn(O,$),O.prototype.addButton=function(M){M.className=this.buttonClassName,M.colorsClassName=this.buttonColorsClassName,M.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(M)},O.prototype.getUI=function(){var M=$.prototype.getUI.call(this);return this.buttons.forEach(function(W){return M.appendChild(W.getUI())}),M},O}(On),un=function(){function $(O,M){this._isActive=!1,this._isHidden=!1,this._icon=O,this.title=M,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty($.prototype,"icon",{get:function(){return this._icon},set:function(O){this._icon=O,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isActive",{get:function(){return this._isActive},set:function(O){this._isActive=O,this.adjustClassName()},enumerable:!1,configurable:!0}),$.prototype.getUI=function(){var O=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 O.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},$.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,"")))},$.prototype.hide=function(){this._isHidden=!0},$}(),Lt=function($){function O(){var M=$!==null&&$.apply(this,arguments)||this;return M.elements=[],M}return vn(O,$),O.prototype.addElement=function(M){this.elements.push(M)},O.prototype.getUI=function(){var M=$.prototype.getUI.call(this);return this.elements.forEach(function(W){return M.appendChild(W)}),M},O}(On),ar=function(){function $(O,M){this.horizontal=O,this.vertical=M}return Object.defineProperty($.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),$.prototype.getVerticalLength=function(O){return O/this.ratio},$.prototype.getHorizontalLength=function(O){return O*this.ratio},$}(),In=function(){function $(){}return $.getIcon=function(O,M){if(O>0&&M>0){var W=new ar(O,M),ee=W.ratio>=1?20:W.getHorizontalLength(20),Y=W.ratio<1?20:W.getVerticalLength(20),Ce=document.createElementNS("http://www.w3.org/2000/svg","svg");Ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ce);var rt=ot.createDefs();Ce.appendChild(rt);var wt=ot.createElement("clipPath",[["id","text-bg-clip"]]);rt.appendChild(wt);var Pt=ot.createPath(ot.getHollowRectanglePath((24-ee)/2,(24-Y)/2,ee,Y,(24-ee)/2+2,(24-Y)/2+2,ee-4,Y-4));Ce.appendChild(Pt);var lt=ot.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);lt.appendChild(ot.createTSpan(O+":"+M)),Ce.appendChild(lt);var Kt=lt.getBBox();ot.setAttributes(lt,[["x",((24-Kt.width)/2).toString()],["y",((24-Kt.height)/2-Kt.y).toString()]]);var Jt=ot.createPath(ot.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Kt.width))/2,(24-Math.ceil(Kt.height))/2,Math.ceil(Kt.width),Math.ceil(Kt.height)));return wt.appendChild(Jt),ot.setAttributes(Pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ce),Ce.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>'},$}(),Nn=function($){function O(M,W,ee){var Y=$.call(this,M,W)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=ee,Y}return vn(O,$),O.prototype.setupDropdown=function(){var M=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=M.className,W.colorsClassName=M.colorsClassName,M.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},O.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},O.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},O.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},O.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},O.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},O}(un),tn=function(){function $(O,M){this.GRIP_SIZE=10,this.color=O,this.fillColor=M,this.visual=ot.createGroup(),this.visual.appendChild(ot.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ot.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},$.prototype.setCenter=function(O,M){this.visual.childNodes.forEach(function(W){return ot.setAttributes(W,[["cx",O.toString()],["cy",M.toString()]])})},$}(),Fn=function(){function $(O,M,W,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=O,this.canvasHeight=M,this.margin=W,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty($.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(O){this._aspectRatio=O,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.gridContainer&&ot.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(O){this._zoomFactor=O,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),$.prototype.open=function(){var O=this;this.cropShadeElement=ot.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ot.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var M=0;M<this.numberOfGridLines;M++)this.horizontalGridLines.push(ot.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ot.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(W){return O.gridContainer.appendChild(W)}),this.verticalGridLines.forEach(function(W){return O.gridContainer.appendChild(W)}),this.cropRectElement=ot.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new tn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new tn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new tn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new tn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},$.prototype.setCropRectangle=function(O){this.cropRect=O;var M=Object.assign({},this.cropRect);this.zoomFactor!==1&&(M.width=this.cropRect.width*this.zoomFactor,M.height=this.cropRect.height*this.zoomFactor,M.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-M.width/2,M.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-M.height/2),ot.setAttributes(this.cropRectElement,[["x",M.x.toString()],["y",M.y.toString()],["width",M.width.toString()],["height",M.height.toString()]]);var W=M.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Ce){var rt=M.y+W*(Ce+1);ot.setAttributes(Y,[["x1",""+M.x],["y1",""+rt],["x2",""+(M.x+M.width)],["y2",""+rt]])});var ee=M.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Ce){var rt=M.x+ee*(Ce+1);ot.setAttributes(Y,[["x1",""+rt],["y1",""+M.y],["x2",""+rt],["y2",""+(M.y+M.height)]])}),ot.setAttributes(this.cropShadeElement,[["d",ot.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,M.x,M.y,M.width,M.height)]]),this.topLeftGrip.setCenter(M.x,M.y),this.topRightGrip.setCenter(M.x+M.width,M.y),this.bottomLeftGrip.setCenter(M.x,M.y+M.height),this.bottomRightGrip.setCenter(M.x+M.width,M.y+M.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},$.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},$.prototype.clientToLocalCoordinates=function(O,M){var W=this.container.getBoundingClientRect();return{x:O-W.left+this.margin,y:M-W.top+this.margin}},$.prototype.onPointerDown=function(O){this.container.setPointerCapture(O.pointerId),this.previousPoint=this.clientToLocalCoordinates(O.clientX,O.clientY),this.cropRectElement===O.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(O.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(O.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(O.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(O.target)&&(this.activeGrip=this.bottomRightGrip)},$.prototype.onPointerMove=function(O){if(this.isMoving)this.move(this.clientToLocalCoordinates(O.clientX,O.clientY));else if(this.activeGrip){var M=this.clientToLocalCoordinates(O.clientX,O.clientY);this.resize(M)}O.preventDefault()},$.prototype.onPointerUp=function(O){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(O.pointerId)},$.prototype.move=function(O){var M=O.x-this.previousPoint.x,W=O.y-this.previousPoint.y;this.zoomFactor!==1&&(M=-M/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+M),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=O},$.prototype.resize=function(O){var M=Object.assign({},this.cropRect),W=O.x-this.previousPoint.x,ee=O.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:M.x+W<this.margin&&(W=this.margin-M.x),M.x+=W,M.width=this.cropRect.x+this.cropRect.width-M.x;break;case this.bottomRightGrip:case this.topRightGrip:M.width+W>this.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-M.width),M.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(M.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),M.height=this.aspectRatio.getVerticalLength(M.width)):(M.y+=ee,M.height=this.cropRect.y+this.cropRect.height-M.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?M.height=this.aspectRatio.getVerticalLength(M.width):M.height+=ee}M.width<10&&(M.x=this.cropRect.x,M.width=10),M.height<10&&(M.y=this.cropRect.y,M.height=10),this.previousPoint=O,M.x>=this.margin&&M.y>=this.margin&&M.x-this.margin+M.width<=this.canvasWidth&&M.y-this.margin+M.height<=this.canvasHeight&&(this.cropRect=M,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},$.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var O=this.cropRect.x+this.cropRect.width/2,M=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=W:this.cropRect.height=ee,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=O-this.cropRect.width/2,this.cropRect.y=M-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},$.prototype.getRescaledRect=function(O,M,W,ee,Y,Ce){var rt=W/O,wt=ee/M;return{x:(Y.x-Ce)*rt+Ce,y:(Y.y-Ce)*wt+Ce,width:Y.width*rt,height:Y.height*wt}},$.prototype.scaleCanvas=function(O,M){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,O,M,this.cropRect,this.margin);this.canvasWidth=O,this.canvasHeight=M,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},$}(),dr=function(){function $(O){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=O,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty($.prototype,"angle",{get:function(){return this._angle},set:function(O){this._angle=O,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),$.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},$.prototype.onPointerDown=function(O){this.controlContainer.setPointerCapture(O.pointerId),this.isDragging=!0,this.previousPoint={x:O.clientX,y:O.clientY}},$.prototype.onPointerMove=function(O){this.isDragging&&(this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.previousPoint.x=O.clientX)},$.prototype.onPointerUp=function(O){this.isDragging&&this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(O.pointerId)},$.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var O=this.angleLabelText.getBBox();ot.setAttributes(this.angleLabelElement,[["x",((this.width-O.width)/2).toString()],["y",(this.height/2).toString()]])}},$.prototype.positionScaleShape=function(){if(this.scaleShape){var O=this.scaleShape.transform.baseVal.getItem(0);O.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(O,0)}},$.prototype.getVisual=function(){var O=document.createElementNS("http://www.w3.org/2000/svg","svg");O.setAttribute("xmlns","http://www.w3.org/2000/svg"),O.setAttribute("width",this.width+"px"),O.setAttribute("height",this.height+"px"),O.setAttribute("viewBox","0 0 "+this.width+" "+this.height),O.style.flexShrink="0",document.body.appendChild(O);for(var M="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ee=W%5==0?this.height/3:this.height/6;M+="h4v"+-ee+"h1v"+ee}M+="v1H0Z",this.scaleShape=ot.createPath(M);var Y=ot.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),O.appendChild(this.scaleShape),this.angleLabelElement=ot.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ot.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ce=ot.createTSpan("");return Ce.innerHTML="°",this.angleLabelElement.appendChild(Ce),O.appendChild(this.angleLabelElement),document.body.removeChild(O),O},$}(),gr=function(){function $(){this.naturalSize=!1,this.imageType="image/png"}return $.prototype.rasterize=function(O,M,W,ee,Y,Ce,rt){var wt=this;return new Promise(function(Pt){var lt=document.createElement("canvas");lt.width=O.width.baseVal.value-2*ee,lt.height=O.height.baseVal.value-2*ee;var Kt=1,Jt=1;wt.naturalSize===!0?(Kt=M.naturalWidth/(O.width.baseVal.value-2*ee)/Ce,Jt=M.naturalHeight/(O.height.baseVal.value-2*ee)/rt,lt.width=M.naturalWidth/Ce,lt.height=M.naturalHeight/rt):wt.width!==void 0&&wt.height!==void 0&&(Kt=wt.width/W.width,Jt=wt.height/W.height,lt.width*=Kt,lt.height*=Jt);var jn=lt.getContext("2d");jn.translate(lt.width/2,lt.height/2),jn.rotate(Y*Math.PI/180),jn.scale(Ce,rt),jn.translate(-lt.width/2,-lt.height/2),jn.drawImage(M,0,0,lt.width,lt.height);var xr=document.createElement("canvas");xr.width=W.width*Kt,xr.height=W.height*Jt,xr.getContext("2d").putImageData(jn.getImageData((W.x-ee)*Kt,(W.y-ee)*Jt,W.width*Kt,W.height*Jt),0,0),Pt(xr.toDataURL(wt.imageType,wt.imageQuality))})},$}(),pt=function(){function $(O){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=$.instanceCounter++,this.styles=new en(this.instanceNo),this.target=O,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(O){this._zoomToCropEnabled=O,O?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"gridLines",{get:function(){return this._gridLines},set:function(O){this._gridLines=O,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(O){this._rotationAngle=O,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"aspectRatio",{get:function(){var O;return(O=this._aspectRatio)!==null&&O!==void 0?O:this.aspectRatios[0]},set:function(O){this._aspectRatio=O},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},$.prototype.show=function(){this.showUI(),this.open()},$.prototype.close=function(O){O===void 0&&(O=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),O||this.closeEventListeners.forEach(function(M){return M()}),this._isOpen=!1)},$.prototype.addRenderEventListener=function(O){this.renderEventListeners.push(O)},$.prototype.removeRenderEventListener=function(O){this.renderEventListeners.indexOf(O)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(O),1)},$.prototype.addCloseEventListener=function(O){this.closeEventListeners.push(O)},$.prototype.removeCloseEventListener=function(O){this.closeEventListeners.indexOf(O)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(O),1)},$.prototype.setupResizeObserver=function(){var O=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var O=1*this.target.clientWidth/this.target.clientHeight,M=this.contentDiv.clientWidth/O>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*O:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=M+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/O;this.resize(M,W)}},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.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",ot.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},$.prototype.resize=function(O,M){this.imageWidth=Math.round(O),this.imageHeight=Math.round(M),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()},$.prototype.setEditingTarget=function(){var O=document.createElement("canvas");O.width=this.target.naturalWidth,O.height=this.target.naturalHeight,O.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var M=O.toDataURL();ot.setAttributes(this.editingTarget,[["href",M]]),this.setEditingTargetSize()},$.prototype.setTopLeft=function(){var O=this.target.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=O.left-M.left-this.CANVAS_MARGIN,this.top=O.top-M.top-this.CANVAS_MARGIN},$.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=ot.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ot.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ot.createGroup(),this.editingTargetRotationScaleContainer=ot.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var O=ot.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(O);var M=ot.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(M),this.editingTargetContainer=ot.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)},$.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},$.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ot.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Fn(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()},$.prototype.zoomToCrop=function(){if(this.cropRect){var O=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,M=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=O+"px "+M+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-O+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-M+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},$.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)},$.prototype.cropRectChanged=function(O){this.cropRect=O,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},$.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},$.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.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 O=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,M=this.target.offsetTop>O+this.CANVAS_MARGIN?this.target.offsetTop-(O+this.CANVAS_MARGIN):0;this.coverDiv.style.top=M+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},$.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},$.prototype.addTopToolbar=function(){var O=this;this.topToolbar=new Mt,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 M=new ln;M.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(M);var W=[];this.aspectRatios.forEach(function(Jt){var jn=new un(In.getIcon(Jt.horizontal,Jt.vertical),Jt.horizontal===0&&Jt.vertical===0?"FREE":Jt.horizontal+":"+Jt.vertical);jn.onClick=function(){return O.ratioButtonClicked(Jt)},W.push(jn)}),this.aspectRatioButton=new Nn(In.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,M.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new un('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){O.isGridVisible=!O.isGridVisible,ee.isActive=O.isGridVisible},M.addButton(ee);var Y=new un('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){O.zoomToCropEnabled=!O.zoomToCropEnabled,Y.isActive=O.zoomToCropEnabled},M.addButton(Y),!nn.isLicensed){var Ce=new Lt;this.topToolbar.addElementBlock(Ce);var rt=document.createElement("div");rt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var wt=document.createElement("a");wt.style.color="currentColor",wt.href="https://markerjs.com/products/cropro",wt.target="_blank",wt.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>',rt.appendChild(wt),Ce.addElement(rt)}var Pt=new ln;Pt.minWidth=3*this.toolbarHeight+"px",Pt.contentAlign="end",this.topToolbar.addButtonBlock(Pt);var lt=new un('<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");lt.onClick=this.startRenderAndClose,Pt.addButton(lt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(lt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Kt=new un('<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");Kt.onClick=this.close,Pt.addButton(Kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},$.prototype.addBottomToolbar=function(){var O=this;this.bottomToolbar=new Mt,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 M=new ln;M.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(M);var W=new un('<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");W.onClick=this.rotateLeftButtonClicked,M.addButton(W);var ee=new un('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ee.onClick=this.rotateRightButtonClicked,M.addButton(ee);var Y=new Lt;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new dr("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(Pt){O.rotateBy(Pt),O.straightener.angle=O.rotationAngle},Y.addElement(this.straightener.getUI());var Ce=new ln;Ce.minWidth=2*this.toolbarHeight+"px",Ce.contentAlign="end",this.bottomToolbar.addButtonBlock(Ce);var rt=new un('<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");rt.onClick=this.flipHorizontallyButtonClicked,Ce.addButton(rt);var wt=new un('<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");wt.onClick=this.flipVerticallyButtonClicked,Ce.addButton(wt)},$.prototype.ratioButtonClicked=function(O){this.aspectRatio=O,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},$.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=In.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},$.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ar(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},$.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},$.prototype.restoreState=function(O){if(O){var M=this.cropLayer.getRescaledRect(O.width,O.height,this.imageWidth,this.imageHeight,O.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(M),this.cropRectChanged(M),this.flippedHorizontally=O.flippedHorizontally,this.flippedVertically=O.flippedVertically,this.applyFlip(),this.rotationAngle=O.rotationAngle,this.applyRotation()}},$.prototype.clientToLocalCoordinates=function(O,M){var W=this.cropImage.getBoundingClientRect();return{x:O-W.left,y:M-W.top}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var O=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},$.prototype.rotateLeftButtonClicked=function(){var O=this.rotationAngle-90;this.rotationAngle%90!=0&&(O+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(O)},$.prototype.rotateRightButtonClicked=function(){var O=this.rotationAngle+90;this.rotationAngle%90!=0&&(O-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(O)},$.prototype.rotateTo=function(O){O=(O=O>180?O-360:O)<=-180?O+360:O,this.rotationAngle=O,this.applyRotation()},$.prototype.rotateBy=function(O){this.rotateTo((this.rotationAngle+O)%360)},$.prototype.applyRotation=function(){var O=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var M=this.editingTargetRotationContainer.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(M,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=O},$.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},$.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},$.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},$.prototype.startRenderAndClose=function(){return Ft(this,void 0,void 0,function(){var O,M;return an(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return O=W.sent(),M=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(O,M)}),this.close(!0),[2]}})})},$.prototype.render=function(){return Ft(this,void 0,void 0,function(){var O;return an(this,function(M){switch(M.label){case 0:return(O=new gr).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.width=this.renderWidth,O.height=this.renderHeight,this.unzoomFromCrop(),ot.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,O.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 M.sent(),[4,O.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,M.sent()]}})})},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Rt("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 Rt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Rt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var O=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Rt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*O)+`px;
|
|
height: `+(this.toolbarHeight-2*O)+`px;
|
|
padding: `+O+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Rt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Rt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new It("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new It("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Rt("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 Rt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Rt("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 Rt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*O)+`px;
|
|
padding: `+O+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Rt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},$.instanceCounter=0,$}(),Gt=G("8hTe"),kr=G.n(Gt),Hr=/<pre[^>]*>/g;function ri($){var O=document.createElement("div");return O.innerHTML=$,O.childNodes.length===0?"":O.childNodes[0].nodeValue}var Wr=ve.a=function($){var O=$.value,M=O===void 0?"":O,W=$.edit,ee=W===void 0?!1:W,Y=$.className,Ce=$.showTextOnly,rt=$.showLines,wt=$.replaces,Pt=$.zoomImg,lt=$.hasMask,Kt=$.style,Jt=Kt===void 0?{}:Kt,jn=$.stylesPrev,xr=jn===void 0?{}:jn,vr=String(M),Jn=Object(D.useRef)(),ii=Object(D.useRef)(),wi=Object(D.useState)(""),or=Object(K.a)(wi,2),Kr=or[0],yi=or[1],ai=Object(D.useState)("office"),Tr=Object(K.a)(ai,2),Ai=Tr[0],Si=Tr[1],Ri=function(){var on=new pt(ii.current);on.displayMode="popup",on.addRenderEventListener(function(){var Vn=Object(k.a)(n.a.mark(function cn(Qn){var An;return n.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return Jn.current.style.display="none",fr.next=3,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn}});case 3:An=fr.sent,An!=null&&An.id&&wt(ii.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(An==null?void 0:An.id,"?type=").concat(An.content_type));case 5:case"end":return fr.stop()}},cn)}));return function(cn){return Vn.apply(this,arguments)}}()),on.show()},Ni=function(){var on=new zt(ii.current);on.settings.displayMode="popup",on.addEventListener("render",function(){var Vn=Object(k.a)(n.a.mark(function cn(Qn){var An;return n.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(Jn.current.style.display="none",!ii.current){fr.next=6;break}return fr.next=4,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn.dataUrl}});case 4:An=fr.sent,An!=null&&An.id&&wt(ii.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(An==null?void 0:An.id,"?type=").concat(An.content_type));case 6:case"end":return fr.stop()}},cn)}));return function(cn){return Vn.apply(this,arguments)}}()),on.show(),window.markerArea=on},oi=Object(D.useMemo)(function(){Jn.current&&(Jn.current.style.zIndex=-1);try{var Mn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,on=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Vn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;vr=vr.replace(Mn,"("+te.a.API_SERVER+"/api/attachments/").replace(on,'"'+te.a.API_SERVER+"/api/attachments/").replace(Vn,'"'+te.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(si){}var cn=H(vr),Qn=_();if(vr.match(/\[TOC\]/)&&(cn=cn.replace("<p>[TOC]</p>",R()),C()),cn=cn.replace(/(__special_katext_id_\d+__)/g,function(si,fr){var wr=Qn[fr],Ci=wr.type,li=wr.expression;return Object(se.renderToString)(ri(li)||"",{displayMode:Ci==="block",throwOnError:!1,output:"html"})}),cn=cn.replace(/▁/g,"\u2581\u2581\u2581"),E(),Ce){var An=document.createElement("div");return An.innerHTML=cn,An.innerText}return setTimeout(function(){return Ui()},500),cn},[vr]),hr=Object(D.useRef)();w.WebkitLineClamp=rt,rt&&(Jt=Object(I.a)(Object(I.a)({},Jt),w));function pi(Mn){var on=Mn.target;if(on.tagName.toUpperCase()==="IMG"){if(Pt){var Vn=on.getAttribute("src");yi(Vn),Si("image")}}else if(on.tagName.toUpperCase()==="A"){var cn=on.getAttribute("href");if(cn.indexOf("office")>-1)Mn.preventDefault(),yi(cn),Si("office");else if(cn.indexOf("application/pdf")>-1)Mn.preventDefault(),yi(cn),Si("pdf");else if(cn.indexOf("text/html")>-1)Mn.preventDefault(),yi(cn),Si("html");else if(cn.startsWith("#")){Mn.preventDefault();var Qn=document.getElementById(cn.replace("#",""));Qn&&Qn.scrollIntoView(!0)}}}var Ui=function(){var on,Vn=(on=hr.current)===null||on===void 0?void 0:on.querySelectorAll("video");Vn==null||Vn.forEach(function(cn){if(cn.oncontextmenu=function(){return!1},cn.src.indexOf(".m3u8")>-1&&!cn.canPlayType("application/vnd.apple.mpegurl")){if(J.a.isSupported()){var Qn=new J.a;Qn.loadSource(cn.src),Qn.attachMedia(cn)}}})};Object(D.useEffect)(function(){if(hr.current&&oi&&(oi.match(Hr)&&window.PR.prettyPrint()),hr.current)return hr.current.addEventListener("click",pi),function(){hr.current.removeEventListener("click",pi),E(),C()}},[oi,hr.current,pi]);var mi=function(on){if(!ee)return;on.target.nodeName==="IMG"?(Jn.current.style.zIndex=1,Jn.current.style.display="flex",Jn.current.style.width=on.target.clientWidth+"px",Jn.current.style.height=on.target.clientHeight+"px",Jn.current.style.top=on.target.offsetTop+"px",Jn.current.style.left=on.target.offsetLeft+"px",ii.current.src=on.target.getAttribute("src")):Jn.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:hr,style:Object(I.a)({},Jt),className:"".concat(Y||""," markdown-body ").concat(kr.a.mdBody),onMouseOver:mi,dangerouslySetInnerHTML:{__html:oi}}),y.a.createElement("div",{ref:Jn,className:kr.a.button},y.a.createElement(V.a,null,y.a.createElement(z.a,{onClick:function(){return Ri()}},"\u88C1\u526A"),y.a.createElement(z.a,{onClick:function(){return Ni()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:ii,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(fe.a,{close:!0,data:Kr,type:Kr!=null&&Kr.length?Ai:"",style:Object(I.a)({},xr),onClose:function(){return yi("")}}))}},"9VGf":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return P});var Z=G("q1tI"),V=G.n(Z);function P(z,I){var k=Object(Z.useRef)();Object(Z.useEffect)(function(){k.current=z}),Object(Z.useEffect)(function(){function K(){k.current()}if(I!==null){var N=setInterval(K,I);return function(){return clearInterval(N)}}},[I])}},BU3w:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return k});var Z=G("MNnm"),V="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var N=document.querySelector("head");return N||document.body}function z(K){var N,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var D=document.createElement("style");if((N=n.csp)===null||N===void 0?void 0:N.nonce){var y;D.nonce=(y=n.csp)===null||y===void 0?void 0:y.nonce}D.innerHTML=K;var g=P(n),m=g.firstChild;return n.prepend&&g.prepend?g.prepend(D):n.prepend&&m?g.insertBefore(D,m):g.appendChild(D),D}var I=new Map;function k(K,N){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=P(n);if(!I.has(D)){var y=z("",n),g=y.parentNode;I.set(D,g),g.removeChild(y)}var m=Array.from(I.get(D).children).find(function(l){return l.tagName==="STYLE"&&l[V]===N});if(m){var c,s;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&m.nonce!==((s=n.csp)===null||s===void 0?void 0:s.nonce)){var d;m.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return m.innerHTML!==K&&(m.innerHTML=K),m}var u=z(K,n);return u[V]=N,u}},Bd2K:function(xt,ve,G){(function(Z){Z(G("VrN/"),G("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(n,D,y){if(y!=Z.Init&&y&&n.removeKeyMap("autoCloseTags"),!D)return;var g={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(g["'/'"]=function(m){return k(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(g["'>'"]=function(m){return z(m)}),n.addKeyMap(g)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function z(n){if(n.getOption("disableInput"))return Z.Pass;for(var D=n.listSelections(),y=[],g=n.getOption("autoCloseTags"),m=0;m<D.length;m++){if(!D[m].empty())return Z.Pass;var c=D[m].head,s=n.getTokenAt(c),d=Z.innerMode(n.getMode(),s.state),u=d.state,l=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(u),o=l&&l.name;if(!o)return Z.Pass;var a=d.mode.configuration=="html",C=typeof g=="object"&&g.dontCloseTags||a&&V,w=typeof g=="object"&&g.indentTags||a&&P;s.end>c.ch&&(o=o.slice(0,o.length-s.end+c.ch));var T=o.toLowerCase();if(!o||s.type=="string"&&(s.end!=c.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&l.close||s.string.indexOf("/")==c.ch-s.start-1||C&&K(C,T)>-1||N(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(u)||[],o,c,!0))return Z.Pass;var R=typeof g=="object"&&g.emptyTags;if(R&&K(R,o)>-1){y[m]={text:"/>",newPos:Z.Pos(c.line,c.ch+2)};continue}var A=w&&K(w,T)>-1;y[m]={indent:A,text:">"+(A?`
|
|
|
|
`:"")+"</"+o+">",newPos:A?Z.Pos(c.line+1,0):Z.Pos(c.line,c.ch+1)}}for(var v=typeof g=="object"&&g.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var b=y[m];n.replaceRange(b.text,D[m].head,D[m].anchor,"+insert");var p=n.listSelections().slice(0);p[m]={head:b.newPos,anchor:b.newPos},n.setSelections(p),!v&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function I(n,D){for(var y=n.listSelections(),g=[],m=D?"/":"</",c=n.getOption("autoCloseTags"),s=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<y.length;d++){if(!y[d].empty())return Z.Pass;var u=y[d].head,l=n.getTokenAt(u),o=Z.innerMode(n.getMode(),l.state),a=o.state;if(D&&(l.type=="string"||l.string.charAt(0)!="<"||l.start!=u.ch-1))return Z.Pass;var C,w=o.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(w&&o.mode.name=="javascript")C=m+"script";else if(w&&o.mode.name=="css")C=m+"style";else{var T=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(a);if(!T||T.length&&N(n,T,T[T.length-1],u))return Z.Pass;C=m+T[T.length-1]}n.getLine(u.line).charAt(l.end)!=">"&&(C+=">"),g[d]=C}if(n.replaceSelections(g),y=n.listSelections(),!s)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 k(n){return n.getOption("disableInput")?Z.Pass:I(n,!0)}Z.commands.closeTag=function(n){return I(n)};function K(n,D){if(n.indexOf)return n.indexOf(D);for(var y=0,g=n.length;y<g;++y)if(n[y]==D)return y;return-1}function N(n,D,y,g,m){if(!Z.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,g.line+500),s=Z.scanForClosingTag(n,g,null,c);if(!s||s.tag!=y)return!1;for(var d=m?1:0,u=D.length-1;u>=0&&D[u]==y;u--)++d;g=s.to;for(var u=1;u<d;u++){var l=Z.scanForClosingTag(n,g,null,c);if(!l||l.tag!=y)return!1;g=l.to}return!0}})},BjJ7:function(xt,ve,G){"use strict";G.d(ve,"d",function(){return V}),G.d(ve,"c",function(){return P}),G.d(ve,"e",function(){return z}),G.d(ve,"b",function(){return I}),G.d(ve,"a",function(){return K});var Z=G("m3rI");function V(N){var n=!0;if(N.length>0){for(var D=0;D<N.length;D++)if(N[D].compile_success==0||!N[D].compile_success){n=!1;break}}else n=!1;return n}function P(N){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],y=0;y<N.length;y++){var g=N[y],m=n?"".concat(n,"/").concat(g.name):"".concat(g.name);D.push({title:g.name,isLeaf:!(g.type==="tree"),key:m})}return D}function z(N,n,D){for(var y=0;y<N.length;y++){var g=N[y];if(g.key===n){g.children=D;break}g.children&&z(g.children,n,D)}return N}function I(N,n,D){var y;return function(){var g=this,m=arguments,c=function(){y=null,D||N.apply(g,m)},s=D&&!y;clearTimeout(y),y=setTimeout(c,n),s&&N.apply(g,m)}}var k=!0,K=Z.a.API_SERVER},"C+DQ":function(xt,ve,G){},"C/vA":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return Z});function Z(V){const P=this;let z=!1,I;return function(){return z||(z=!0,I=V.apply(P,arguments)),I}}},"Cg/j":function(xt,ve,G){"use strict";G.d(ve,"b",function(){return Z}),G.d(ve,"a",function(){return V}),G.d(ve,"c",function(){return z}),G.d(ve,"d",function(){return I});var Z;(function(k){k.serviceIds=new Map,k.DI_TARGET="$di$target",k.DI_DEPENDENCIES="$di$dependencies";function K(N){return N[k.DI_DEPENDENCIES]||[]}k.getServiceDependencies=K})(Z||(Z={}));const V=z("instantiationService");function P(k,K,N,n){K[Z.DI_TARGET]===K?K[Z.DI_DEPENDENCIES].push({id:k,index:N,optional:n}):(K[Z.DI_DEPENDENCIES]=[{id:k,index:N,optional:n}],K[Z.DI_TARGET]=K)}function z(k){if(Z.serviceIds.has(k))return Z.serviceIds.get(k);const K=function(N,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(K,N,D,!1)};return K.toString=()=>k,Z.serviceIds.set(k,K),K}function I(k){return function(K,N,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(k,K,n,!0)}}},DlQD:function(xt,ve,G){(function(Z,V){xt.exports=V()})(this,function(){"use strict";function Z(Ee,he){for(var pe=0;pe<he.length;pe++){var re=he[pe];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Ee,re.key,re)}}function V(Ee,he,pe){return he&&Z(Ee.prototype,he),pe&&Z(Ee,pe),Ee}function P(Ee,he){if(!Ee)return;if(typeof Ee=="string")return z(Ee,he);var pe=Object.prototype.toString.call(Ee).slice(8,-1);if(pe==="Object"&&Ee.constructor&&(pe=Ee.constructor.name),pe==="Map"||pe==="Set")return Array.from(Ee);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return z(Ee,he)}function z(Ee,he){(he==null||he>Ee.length)&&(he=Ee.length);for(var pe=0,re=new Array(he);pe<he;pe++)re[pe]=Ee[pe];return re}function I(Ee,he){var pe;if(typeof Symbol=="undefined"||Ee[Symbol.iterator]==null){if(Array.isArray(Ee)||(pe=P(Ee))||he&&Ee&&typeof Ee.length=="number"){pe&&(Ee=pe);var re=0;return function(){return re>=Ee.length?{done:!0}:{done:!1,value:Ee[re++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return pe=Ee[Symbol.iterator](),pe.next.bind(pe)}function k(Ee,he){return he={exports:{}},Ee(he,he.exports),he.exports}var K=k(function(Ee){function he(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function pe(re){Ee.exports.defaults=re}Ee.exports={defaults:he(),getDefaults:he,changeDefaults:pe}}),N=K.defaults,n=K.getDefaults,D=K.changeDefaults,y=/[&<>"']/,g=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(he){return s[he]};function u(Ee,he){if(he){if(y.test(Ee))return Ee.replace(g,d)}else if(m.test(Ee))return Ee.replace(c,d);return Ee}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(Ee){return Ee.replace(l,function(he,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var a=/(^|[^\[])\^/g;function C(Ee,he){Ee=Ee.source||Ee,he=he||"";var pe={replace:function(oe,le){return le=le.source||le,le=le.replace(a,"$1"),Ee=Ee.replace(oe,le),pe},getRegex:function(){return new RegExp(Ee,he)}};return pe}var w=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ee,he,pe){if(Ee){var re;try{re=decodeURIComponent(o(pe)).replace(w,"").toLowerCase()}catch(oe){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}he&&!T.test(pe)&&(pe=h(he,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(oe){return null}return pe}var A={},v=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,p=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(Ee,he){A[" "+Ee]||(v.test(Ee)?A[" "+Ee]=Ee+"/":A[" "+Ee]=U(Ee,"/",!0)),Ee=A[" "+Ee];var pe=Ee.indexOf(":")===-1;return he.substring(0,2)==="//"?pe?he:Ee.replace(b,"$1")+he:he.charAt(0)==="/"?pe?he:Ee.replace(p,"$1")+he:Ee+he}var _={exec:function(){}};function E(Ee){for(var he=1,pe,re;he<arguments.length;he++){pe=arguments[he];for(re in pe)Object.prototype.hasOwnProperty.call(pe,re)&&(Ee[re]=pe[re])}return Ee}function x(Ee,he){var pe=Ee.replace(/\|/g,function(le,me,be){for(var Be=!1,$e=me;--$e>=0&&be[$e]==="\\";)Be=!Be;return Be?"|":" |"}),re=pe.split(/ \|/),oe=0;if(re.length>he)re.splice(he);else for(;re.length<he;)re.push("");for(;oe<re.length;oe++)re[oe]=re[oe].trim().replace(/\\\|/g,"|");return re}function U(Ee,he,pe){var re=Ee.length;if(re===0)return"";for(var oe=0;oe<re;){var le=Ee.charAt(re-oe-1);if(le===he&&!pe)oe++;else if(le!==he&&pe)oe++;else break}return Ee.substr(0,re-oe)}function B(Ee,he){if(Ee.indexOf(he[1])===-1)return-1;for(var pe=Ee.length,re=0,oe=0;oe<pe;oe++)if(Ee[oe]==="\\")oe++;else if(Ee[oe]===he[0])re++;else if(Ee[oe]===he[1]&&(re--,re<0))return oe;return-1}function L(Ee){Ee&&Ee.sanitize&&!Ee.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var H={escape:u,unescape:o,edit:C,cleanUrl:R,resolveUrl:h,noopTest:_,merge:E,splitCells:x,rtrim:U,findClosingBracket:B,checkSanitizeDeprecation:L},j=K.defaults,S=H.rtrim,J=H.splitCells,te=H.escape,se=H.findClosingBracket;function fe(Ee,he,pe){var re=he.href,oe=he.title?te(he.title):null,le=Ee[1].replace(/\\([\[\]])/g,"$1");return Ee[0].charAt(0)!=="!"?{type:"link",raw:pe,href:re,title:oe,text:le}:{type:"image",raw:pe,href:re,title:oe,text:te(le)}}function Fe(Ee,he){var pe=Ee.match(/^(\s+)(?:```)/);if(pe===null)return he;var re=pe[1];return he.split(`
|
|
`).map(function(oe){var le=oe.match(/^\s+/);if(le===null)return oe;var me=le[0];return me.length>=re.length?oe.slice(re.length):oe}).join(`
|
|
`)}var Le=function(){function Ee(pe){this.options=pe||j}var he=Ee.prototype;return he.space=function(re){var oe=this.rules.block.newline.exec(re);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
|
|
`}},he.code=function(re,oe){var le=this.rules.block.code.exec(re);if(le){var me=oe[oe.length-1];if(me&&me.type==="paragraph")return{raw:le[0],text:le[0].trimRight()};var be=le[0].replace(/^ {4}/gm,"");return{type:"code",raw:le[0],codeBlockStyle:"indented",text:this.options.pedantic?be:S(be,`
|
|
`)}}},he.fences=function(re){var oe=this.rules.block.fences.exec(re);if(oe){var le=oe[0],me=Fe(le,oe[3]||"");return{type:"code",raw:le,lang:oe[2]?oe[2].trim():oe[2],text:me}}},he.heading=function(re){var oe=this.rules.block.heading.exec(re);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},he.nptable=function(re){var oe=this.rules.block.nptable.exec(re);if(oe){var le={type:"table",header:J(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
|
|
`):[],raw:oe[0]};if(le.header.length===le.align.length){var me=le.align.length,be;for(be=0;be<me;be++)/^ *-+: *$/.test(le.align[be])?le.align[be]="right":/^ *:-+: *$/.test(le.align[be])?le.align[be]="center":/^ *:-+ *$/.test(le.align[be])?le.align[be]="left":le.align[be]=null;for(me=le.cells.length,be=0;be<me;be++)le.cells[be]=J(le.cells[be],le.header.length);return le}}},he.hr=function(re){var oe=this.rules.block.hr.exec(re);if(oe)return{type:"hr",raw:oe[0]}},he.blockquote=function(re){var oe=this.rules.block.blockquote.exec(re);if(oe){var le=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:le}}},he.list=function(re){var oe=this.rules.block.list.exec(re);if(oe){for(var le=oe[0],me=oe[2],be=me.length>1,Be=me[me.length-1]===")",$e={type:"list",raw:le,ordered:be,start:be?+me.slice(0,-1):"",loose:!1,items:[]},ut=oe[0].match(this.rules.block.item),Et=!1,mt,Bt,Ut,Tt,kt,zt,$t,vn=ut.length,Ft=0;Ft<vn;Ft++)mt=ut[Ft],le=mt,Bt=mt.length,mt=mt.replace(/^ *([*+-]|\d+[.)]) */,""),~mt.indexOf(`
|
|
`)&&(Bt-=mt.length,mt=this.options.pedantic?mt.replace(/^ {1,4}/gm,""):mt.replace(new RegExp("^ {1,"+Bt+"}","gm"),"")),Ft!==vn-1&&(Ut=this.rules.block.bullet.exec(ut[Ft+1])[0],(be?Ut.length===1||!Be&&Ut[Ut.length-1]===")":Ut.length>1||this.options.smartLists&&Ut!==me)&&(Tt=ut.slice(Ft+1).join(`
|
|
`),$e.raw=$e.raw.substring(0,$e.raw.length-Tt.length),Ft=vn-1)),kt=Et||/\n\n(?!\s*$)/.test(mt),Ft!==vn-1&&(Et=mt.charAt(mt.length-1)===`
|
|
`,kt||(kt=Et)),kt&&($e.loose=!0),zt=/^\[[ xX]\] /.test(mt),$t=void 0,zt&&($t=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),$e.items.push({type:"list_item",raw:le,task:zt,checked:$t,loose:kt,text:mt});return $e}},he.html=function(re){var oe=this.rules.block.html.exec(re);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):te(oe[0]):oe[0]}},he.def=function(re){var oe=this.rules.block.def.exec(re);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var le=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:le,raw:oe[0],href:oe[2],title:oe[3]}}},he.table=function(re){var oe=this.rules.block.table.exec(re);if(oe){var le={type:"table",header:J(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
|
|
`):[]};if(le.header.length===le.align.length){le.raw=oe[0];var me=le.align.length,be;for(be=0;be<me;be++)/^ *-+: *$/.test(le.align[be])?le.align[be]="right":/^ *:-+: *$/.test(le.align[be])?le.align[be]="center":/^ *:-+ *$/.test(le.align[be])?le.align[be]="left":le.align[be]=null;for(me=le.cells.length,be=0;be<me;be++)le.cells[be]=J(le.cells[be].replace(/^ *\| *| *\| *$/g,""),le.header.length);return le}}},he.lheading=function(re){var oe=this.rules.block.lheading.exec(re);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},he.paragraph=function(re){var oe=this.rules.block.paragraph.exec(re);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
|
|
`?oe[1].slice(0,-1):oe[1]}},he.text=function(re,oe){var le=this.rules.block.text.exec(re);if(le){var me=oe[oe.length-1];return me&&me.type==="text"?{raw:le[0],text:le[0]}:{type:"text",raw:le[0],text:le[0]}}},he.escape=function(re){var oe=this.rules.inline.escape.exec(re);if(oe)return{type:"escape",raw:oe[0],text:te(oe[1])}},he.tag=function(re,oe,le){var me=this.rules.inline.tag.exec(re);if(me)return!oe&&/^<a /i.test(me[0])?oe=!0:oe&&/^<\/a>/i.test(me[0])&&(oe=!1),!le&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?le=!0:le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(le=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:oe,inRawBlock:le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]}},he.link=function(re){var oe=this.rules.inline.link.exec(re);if(oe){var le=se(oe[2],"()");if(le>-1){var me=oe[0].indexOf("!")===0?5:4,be=me+oe[1].length+le;oe[2]=oe[2].substring(0,le),oe[0]=oe[0].substring(0,be).trim(),oe[3]=""}var Be=oe[2],$e="";if(this.options.pedantic){var ut=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Be);ut?(Be=ut[1],$e=ut[3]):$e=""}else $e=oe[3]?oe[3].slice(1,-1):"";Be=Be.trim().replace(/^<([\s\S]*)>$/,"$1");var Et=fe(oe,{href:Be&&Be.replace(this.rules.inline._escapes,"$1"),title:$e&&$e.replace(this.rules.inline._escapes,"$1")},oe[0]);return Et}},he.reflink=function(re,oe){var le;if((le=this.rules.inline.reflink.exec(re))||(le=this.rules.inline.nolink.exec(re))){var me=(le[2]||le[1]).replace(/\s+/g," ");if(me=oe[me.toLowerCase()],!me||!me.href){var be=le[0].charAt(0);return{type:"text",raw:be,text:be}}var Be=fe(le,me,le[0]);return Be}},he.strong=function(re,oe,le){le===void 0&&(le="");var me=this.rules.inline.strong.start.exec(re);if(me&&(!me[1]||me[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){oe=oe.slice(-1*re.length);var be=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var Be;(me=be.exec(oe))!=null;)if(Be=this.rules.inline.strong.middle.exec(oe.slice(0,me.index+3)),Be)return{type:"strong",raw:re.slice(0,Be[0].length),text:re.slice(2,Be[0].length-2)}}},he.em=function(re,oe,le){le===void 0&&(le="");var me=this.rules.inline.em.start.exec(re);if(me&&(!me[1]||me[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){oe=oe.slice(-1*re.length);var be=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var Be;(me=be.exec(oe))!=null;)if(Be=this.rules.inline.em.middle.exec(oe.slice(0,me.index+2)),Be)return{type:"em",raw:re.slice(0,Be[0].length),text:re.slice(1,Be[0].length-1)}}},he.codespan=function(re){var oe=this.rules.inline.code.exec(re);if(oe){var le=oe[2].replace(/\n/g," "),me=/[^ ]/.test(le),be=le.startsWith(" ")&&le.endsWith(" ");return me&&be&&(le=le.substring(1,le.length-1)),le=te(le,!0),{type:"codespan",raw:oe[0],text:le}}},he.br=function(re){var oe=this.rules.inline.br.exec(re);if(oe)return{type:"br",raw:oe[0]}},he.del=function(re){var oe=this.rules.inline.del.exec(re);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},he.autolink=function(re,oe){var le=this.rules.inline.autolink.exec(re);if(le){var me,be;return le[2]==="@"?(me=te(this.options.mangle?oe(le[1]):le[1]),be="mailto:"+me):(me=te(le[1]),be=me),{type:"link",raw:le[0],text:me,href:be,tokens:[{type:"text",raw:me,text:me}]}}},he.url=function(re,oe){var le;if(le=this.rules.inline.url.exec(re)){var me,be;if(le[2]==="@")me=te(this.options.mangle?oe(le[0]):le[0]),be="mailto:"+me;else{var Be;do Be=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(Be!==le[0]);me=te(le[0]),le[1]==="www."?be="http://"+me:be=me}return{type:"link",raw:le[0],text:me,href:be,tokens:[{type:"text",raw:me,text:me}]}}},he.inlineText=function(re,oe,le){var me=this.rules.inline.text.exec(re);if(me){var be;return oe?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]:be=te(this.options.smartypants?le(me[0]):me[0]),{type:"text",raw:me[0],text:be}}},Ee}(),De=H.noopTest,He=H.edit,We=H.merge,ye={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:De,table:De,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=He(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=He(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=He(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._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",ye._comment=/<!--(?!-?>)[\s\S]*?-->/,ye.html=He(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=He(ye._paragraph).replace("hr",ye.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",ye._tag).getRegex(),ye.blockquote=He(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=We({},ye),ye.gfm=We({},ye.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*|$)"}),ye.gfm.nptable=He(ye.gfm.nptable).replace("hr",ye.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",ye._tag).getRegex(),ye.gfm.table=He(ye.gfm.table).replace("hr",ye.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",ye._tag).getRegex(),ye.pedantic=We({},ye.normal,{html:He(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._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:De,paragraph:He(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:De,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:De,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=He(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=He(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=He(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=He(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=He(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=He(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=He(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=He(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=He(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=He(ue._blockSkip,"g").getRegex(),ue.overlapSkip=He(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ue.autolink=He(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=He(ue.tag).replace("comment",ye._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=He(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=He(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=He(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=We({},ue),ue.pedantic=We({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:He(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:He(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=We({},ue.normal,{escape:He(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=He(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=We({},ue.gfm,{br:He(ue.br).replace("{2,}","*").getRegex(),text:He(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ye={block:ye,inline:ue},vt=K.defaults,ct=Ye.block,it=Ye.inline;function ft(Ee){return Ee.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 Qe(Ee){var he="",pe,re,oe=Ee.length;for(pe=0;pe<oe;pe++)re=Ee.charCodeAt(pe),Math.random()>.5&&(re="x"+re.toString(16)),he+="&#"+re+";";return he}var qe=function(){function Ee(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||vt,this.options.tokenizer=this.options.tokenizer||new Le,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:ct.normal,inline:it.normal};this.options.pedantic?(re.block=ct.pedantic,re.inline=it.pedantic):this.options.gfm&&(re.block=ct.gfm,this.options.breaks?re.inline=it.breaks:re.inline=it.gfm),this.tokenizer.rules=re}Ee.lex=function(re,oe){var le=new Ee(oe);return le.lex(re)};var he=Ee.prototype;return he.lex=function(re){return re=re.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},he.blockTokens=function(re,oe,le){oe===void 0&&(oe=[]),le===void 0&&(le=!0),re=re.replace(/^ +$/gm,"");for(var me,be,Be,$e;re;){if(me=this.tokenizer.space(re)){re=re.substring(me.raw.length),me.type&&oe.push(me);continue}if(me=this.tokenizer.code(re,oe)){re=re.substring(me.raw.length),me.type?oe.push(me):($e=oe[oe.length-1],$e.raw+=`
|
|
`+me.raw,$e.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(re)){re=re.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.heading(re)){re=re.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.nptable(re)){re=re.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.hr(re)){re=re.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.blockquote(re)){re=re.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],le),oe.push(me);continue}if(me=this.tokenizer.list(re)){for(re=re.substring(me.raw.length),Be=me.items.length,be=0;be<Be;be++)me.items[be].tokens=this.blockTokens(me.items[be].text,[],!1);oe.push(me);continue}if(me=this.tokenizer.html(re)){re=re.substring(me.raw.length),oe.push(me);continue}if(le&&(me=this.tokenizer.def(re))){re=re.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(re)){re=re.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.lheading(re)){re=re.substring(me.raw.length),oe.push(me);continue}if(le&&(me=this.tokenizer.paragraph(re))){re=re.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.text(re,oe)){re=re.substring(me.raw.length),me.type?oe.push(me):($e=oe[oe.length-1],$e.raw+=`
|
|
`+me.raw,$e.text+=`
|
|
`+me.text);continue}if(re){var ut="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ut);break}else throw new Error(ut)}}return oe},he.inline=function(re){var oe,le,me,be,Be,$e,ut=re.length;for(oe=0;oe<ut;oe++){$e=re[oe];switch($e.type){case"paragraph":case"text":case"heading":{$e.tokens=[],this.inlineTokens($e.text,$e.tokens);break}case"table":{for($e.tokens={header:[],cells:[]},be=$e.header.length,le=0;le<be;le++)$e.tokens.header[le]=[],this.inlineTokens($e.header[le],$e.tokens.header[le]);for(be=$e.cells.length,le=0;le<be;le++)for(Be=$e.cells[le],$e.tokens.cells[le]=[],me=0;me<Be.length;me++)$e.tokens.cells[le][me]=[],this.inlineTokens(Be[me],$e.tokens.cells[le][me]);break}case"blockquote":{this.inline($e.tokens);break}case"list":{for(be=$e.items.length,le=0;le<be;le++)this.inline($e.items[le].tokens);break}}}return re},he.inlineTokens=function(re,oe,le,me,be){oe===void 0&&(oe=[]),le===void 0&&(le=!1),me===void 0&&(me=!1),be===void 0&&(be="");var Be,$e=re,ut;if(this.tokens.links){var Et=Object.keys(this.tokens.links);if(Et.length>0)for(;(ut=this.tokenizer.rules.inline.reflinkSearch.exec($e))!=null;)Et.includes(ut[0].slice(ut[0].lastIndexOf("[")+1,-1))&&($e=$e.slice(0,ut.index)+"["+"a".repeat(ut[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ut=this.tokenizer.rules.inline.blockSkip.exec($e))!=null;)$e=$e.slice(0,ut.index)+"["+"a".repeat(ut[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Be=this.tokenizer.escape(re)){re=re.substring(Be.raw.length),oe.push(Be);continue}if(Be=this.tokenizer.tag(re,le,me)){re=re.substring(Be.raw.length),le=Be.inLink,me=Be.inRawBlock,oe.push(Be);continue}if(Be=this.tokenizer.link(re)){re=re.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,me)),oe.push(Be);continue}if(Be=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,me)),oe.push(Be);continue}if(Be=this.tokenizer.strong(re,$e,be)){re=re.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],le,me),oe.push(Be);continue}if(Be=this.tokenizer.em(re,$e,be)){re=re.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],le,me),oe.push(Be);continue}if(Be=this.tokenizer.codespan(re)){re=re.substring(Be.raw.length),oe.push(Be);continue}if(Be=this.tokenizer.br(re)){re=re.substring(Be.raw.length),oe.push(Be);continue}if(Be=this.tokenizer.del(re)){re=re.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],le,me),oe.push(Be);continue}if(Be=this.tokenizer.autolink(re,Qe)){re=re.substring(Be.raw.length),oe.push(Be);continue}if(!le&&(Be=this.tokenizer.url(re,Qe))){re=re.substring(Be.raw.length),oe.push(Be);continue}if(Be=this.tokenizer.inlineText(re,me,ft)){re=re.substring(Be.raw.length),be=Be.raw.slice(-1),oe.push(Be);continue}if(re){var mt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return oe},V(Ee,null,[{key:"rules",get:function(){return{block:ct,inline:it}}}]),Ee}(),ht=K.defaults,de=H.cleanUrl,Ie=H.escape,Pe=function(){function Ee(pe){this.options=pe||ht}var he=Ee.prototype;return he.code=function(re,oe,le){var me=(oe||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(re,me);be!=null&&be!==re&&(le=!0,re=be)}return me?'<pre><code class="'+this.options.langPrefix+Ie(me,!0)+'">'+(le?re:Ie(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(le?re:Ie(re,!0))+`</code></pre>
|
|
`},he.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},he.html=function(re){return re},he.heading=function(re,oe,le,me){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+me.slug(le)+'">'+re+"</h"+oe+`>
|
|
`:"<h"+oe+">"+re+"</h"+oe+`>
|
|
`},he.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},he.list=function(re,oe,le){var me=oe?"ol":"ul",be=oe&&le!==1?' start="'+le+'"':"";return"<"+me+be+`>
|
|
`+re+"</"+me+`>
|
|
`},he.listitem=function(re){return"<li>"+re+`</li>
|
|
`},he.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},he.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},he.table=function(re,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+oe+`</table>
|
|
`},he.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},he.tablecell=function(re,oe){var le=oe.header?"th":"td",me=oe.align?"<"+le+' align="'+oe.align+'">':"<"+le+">";return me+re+"</"+le+`>
|
|
`},he.strong=function(re){return"<strong>"+re+"</strong>"},he.em=function(re){return"<em>"+re+"</em>"},he.codespan=function(re){return"<code>"+re+"</code>"},he.br=function(){return this.options.xhtml?"<br/>":"<br>"},he.del=function(re){return"<del>"+re+"</del>"},he.link=function(re,oe,le){if(re=de(this.options.sanitize,this.options.baseUrl,re),re===null)return le;var me='<a href="'+Ie(re)+'"';return oe&&(me+=' title="'+oe+'"'),me+=">"+le+"</a>",me},he.image=function(re,oe,le){if(re=de(this.options.sanitize,this.options.baseUrl,re),re===null)return le;var me='<img src="'+re+'" alt="'+le+'"';return oe&&(me+=' title="'+oe+'"'),me+=this.options.xhtml?"/>":">",me},he.text=function(re){return re},Ee}(),Ke=function(){function Ee(){}var he=Ee.prototype;return he.strong=function(re){return re},he.em=function(re){return re},he.codespan=function(re){return re},he.del=function(re){return re},he.html=function(re){return re},he.text=function(re){return re},he.link=function(re,oe,le){return""+le},he.image=function(re,oe,le){return""+le},he.br=function(){return""},Ee}(),st=function(){function Ee(){this.seen={}}var he=Ee.prototype;return he.slug=function(re){var oe=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var le=oe;do this.seen[le]++,oe=le+"-"+this.seen[le];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Ee}(),at=K.defaults,et=H.unescape,tt=function(){function Ee(pe){this.options=pe||at,this.options.renderer=this.options.renderer||new Pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new st}Ee.parse=function(re,oe){var le=new Ee(oe);return le.parse(re)};var he=Ee.prototype;return he.parse=function(re,oe){oe===void 0&&(oe=!0);var le="",me,be,Be,$e,ut,Et,mt,Bt,Ut,Tt,kt,zt,$t,vn,Ft,an,nn,ot,en=re.length;for(me=0;me<en;me++){Tt=re[me];switch(Tt.type){case"space":continue;case"hr":{le+=this.renderer.hr();continue}case"heading":{le+=this.renderer.heading(this.parseInline(Tt.tokens),Tt.depth,et(this.parseInline(Tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{le+=this.renderer.code(Tt.text,Tt.lang,Tt.escaped);continue}case"table":{for(Bt="",mt="",$e=Tt.header.length,be=0;be<$e;be++)mt+=this.renderer.tablecell(this.parseInline(Tt.tokens.header[be]),{header:!0,align:Tt.align[be]});for(Bt+=this.renderer.tablerow(mt),Ut="",$e=Tt.cells.length,be=0;be<$e;be++){for(Et=Tt.tokens.cells[be],mt="",ut=Et.length,Be=0;Be<ut;Be++)mt+=this.renderer.tablecell(this.parseInline(Et[Be]),{header:!1,align:Tt.align[Be]});Ut+=this.renderer.tablerow(mt)}le+=this.renderer.table(Bt,Ut);continue}case"blockquote":{Ut=this.parse(Tt.tokens),le+=this.renderer.blockquote(Ut);continue}case"list":{for(kt=Tt.ordered,zt=Tt.start,$t=Tt.loose,$e=Tt.items.length,Ut="",be=0;be<$e;be++)Ft=Tt.items[be],an=Ft.checked,nn=Ft.task,vn="",Ft.task&&(ot=this.renderer.checkbox(an),$t?Ft.tokens.length>0&&Ft.tokens[0].type==="text"?(Ft.tokens[0].text=ot+" "+Ft.tokens[0].text,Ft.tokens[0].tokens&&Ft.tokens[0].tokens.length>0&&Ft.tokens[0].tokens[0].type==="text"&&(Ft.tokens[0].tokens[0].text=ot+" "+Ft.tokens[0].tokens[0].text)):Ft.tokens.unshift({type:"text",text:ot}):vn+=ot),vn+=this.parse(Ft.tokens,$t),Ut+=this.renderer.listitem(vn,nn,an);le+=this.renderer.list(Ut,kt,zt);continue}case"html":{le+=this.renderer.html(Tt.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(Tt.tokens));continue}case"text":{for(Ut=Tt.tokens?this.parseInline(Tt.tokens):Tt.text;me+1<en&&re[me+1].type==="text";)Tt=re[++me],Ut+=`
|
|
`+(Tt.tokens?this.parseInline(Tt.tokens):Tt.text);le+=oe?this.renderer.paragraph(Ut):Ut;continue}default:{var It='Token with "'+Tt.type+'" type was not found.';if(this.options.silent){console.error(It);return}else throw new Error(It)}}}return le},he.parseInline=function(re,oe){oe=oe||this.renderer;var le="",me,be,Be=re.length;for(me=0;me<Be;me++){be=re[me];switch(be.type){case"escape":{le+=oe.text(be.text);break}case"html":{le+=oe.html(be.text);break}case"link":{le+=oe.link(be.href,be.title,this.parseInline(be.tokens,oe));break}case"image":{le+=oe.image(be.href,be.title,be.text);break}case"strong":{le+=oe.strong(this.parseInline(be.tokens,oe));break}case"em":{le+=oe.em(this.parseInline(be.tokens,oe));break}case"codespan":{le+=oe.codespan(be.text);break}case"br":{le+=oe.br();break}case"del":{le+=oe.del(this.parseInline(be.tokens,oe));break}case"text":{le+=oe.text(be.text);break}default:{var $e='Token with "'+be.type+'" type was not found.';if(this.options.silent){console.error($e);return}else throw new Error($e)}}}return le},Ee}(),dt=H.merge,yt=H.checkSanitizeDeprecation,Ae=H.escape,Se=K.getDefaults,Ve=K.changeDefaults,Je=K.defaults;function Ne(Ee,he,pe){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");if(typeof he=="function"&&(pe=he,he=null),he=dt({},Ne.defaults,he||{}),yt(he),pe){var re=he.highlight,oe;try{oe=qe.lex(Ee,he)}catch(Be){return pe(Be)}var le=function($e){var ut;if(!$e)try{ut=tt.parse(oe,he)}catch(Et){$e=Et}return he.highlight=re,$e?pe($e):pe(null,ut)};if(!re||re.length<3)return le();if(delete he.highlight,!oe.length)return le();var me=0;Ne.walkTokens(oe,function(Be){Be.type==="code"&&(me++,setTimeout(function(){re(Be.text,Be.lang,function($e,ut){if($e)return le($e);ut!=null&&ut!==Be.text&&(Be.text=ut,Be.escaped=!0),me--,me===0&&le()})},0))}),me===0&&le();return}try{var be=qe.lex(Ee,he);return he.walkTokens&&Ne.walkTokens(be,he.walkTokens),tt.parse(be,he)}catch(Be){if(Be.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,he.silent)return"<p>An error occurred:</p><pre>"+Ae(Be.message+"",!0)+"</pre>";throw Be}}Ne.options=Ne.setOptions=function(Ee){return dt(Ne.defaults,Ee),Ve(Ne.defaults),Ne},Ne.getDefaults=Se,Ne.defaults=Je,Ne.use=function(Ee){var he=dt({},Ee);if(Ee.renderer&&function(){var re=Ne.defaults.renderer||new Pe,oe=function(be){var Be=re[be];re[be]=function(){for(var $e=arguments.length,ut=new Array($e),Et=0;Et<$e;Et++)ut[Et]=arguments[Et];var mt=Ee.renderer[be].apply(re,ut);return mt===!1&&(mt=Be.apply(re,ut)),mt}};for(var le in Ee.renderer)oe(le);he.renderer=re}(),Ee.tokenizer&&function(){var re=Ne.defaults.tokenizer||new Le,oe=function(be){var Be=re[be];re[be]=function(){for(var $e=arguments.length,ut=new Array($e),Et=0;Et<$e;Et++)ut[Et]=arguments[Et];var mt=Ee.tokenizer[be].apply(re,ut);return mt===!1&&(mt=Be.apply(re,ut)),mt}};for(var le in Ee.tokenizer)oe(le);he.tokenizer=re}(),Ee.walkTokens){var pe=Ne.defaults.walkTokens;he.walkTokens=function(re){Ee.walkTokens(re),pe&&pe(re)}}Ne.setOptions(he)},Ne.walkTokens=function(Ee,he){for(var pe=I(Ee),re;!(re=pe()).done;){var oe=re.value;he(oe);switch(oe.type){case"table":{for(var le=I(oe.tokens.header),me;!(me=le()).done;){var be=me.value;Ne.walkTokens(be,he)}for(var Be=I(oe.tokens.cells),$e;!($e=Be()).done;)for(var ut=$e.value,Et=I(ut),mt;!(mt=Et()).done;){var Bt=mt.value;Ne.walkTokens(Bt,he)}break}case"list":{Ne.walkTokens(oe.items,he);break}default:oe.tokens&&Ne.walkTokens(oe.tokens,he)}}},Ne.Parser=tt,Ne.parser=tt.parse,Ne.Renderer=Pe,Ne.TextRenderer=Ke,Ne.Lexer=qe,Ne.lexer=qe.lex,Ne.Tokenizer=Le,Ne.Slugger=st,Ne.parse=Ne;var je=Ne;return je})},ELLl:function(xt,ve,G){(function(Z){Z(G("VrN/"))})(function(Z){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(s,d,u){u&&u!=Z.Init&&(s.removeKeyMap(I),s.state.closeBrackets=null),d&&(k(z(d,"pairs")),s.state.closeBrackets=d,s.addKeyMap(I))});function z(s,d){return d=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[d]!=null?s[d]:V[d]}var I={Backspace:n,Enter:D};function k(s){for(var d=0;d<s.length;d++){var u=s.charAt(d),l="'"+u+"'";I[l]||(I[l]=K(u))}}k(V.pairs+"`");function K(s){return function(d){return g(d,s)}}function N(s){var d=s.state.closeBrackets;if(!d||d.override)return d;var u=s.getModeAt(s.getCursor());return u.closeBrackets||d}function n(s){var d=N(s);if(!d||s.getOption("disableInput"))return Z.Pass;for(var u=z(d,"pairs"),l=s.listSelections(),o=0;o<l.length;o++){if(!l[o].empty())return Z.Pass;var a=m(s,l[o].head);if(!a||u.indexOf(a)%2!=0)return Z.Pass}for(var o=l.length-1;o>=0;o--){var C=l[o].head;s.replaceRange("",P(C.line,C.ch-1),P(C.line,C.ch+1),"+delete")}}function D(s){var d=N(s),u=d&&z(d,"explode");if(!u||s.getOption("disableInput"))return Z.Pass;for(var l=s.listSelections(),o=0;o<l.length;o++){if(!l[o].empty())return Z.Pass;var a=m(s,l[o].head);if(!a||u.indexOf(a)%2!=0)return Z.Pass}s.operation(function(){var C=s.lineSeparator()||`
|
|
`;s.replaceSelection(C+C,null),s.execCommand("goCharLeft"),l=s.listSelections();for(var w=0;w<l.length;w++){var T=l[w].head.line;s.indentLine(T,null,!0),s.indentLine(T+1,null,!0)}})}function y(s){var d=Z.cmpPos(s.anchor,s.head)>0;return{anchor:new P(s.anchor.line,s.anchor.ch+(d?-1:1)),head:new P(s.head.line,s.head.ch+(d?1:-1))}}function g(s,d){var u=N(s);if(!u||s.getOption("disableInput"))return Z.Pass;var l=z(u,"pairs"),o=l.indexOf(d);if(o==-1)return Z.Pass;for(var a=z(u,"closeBefore"),C=z(u,"triples"),w=l.charAt(o+1)==d,T=s.listSelections(),R=o%2==0,A,v=0;v<T.length;v++){var b=T[v],p=b.head,h,_=s.getRange(p,P(p.line,p.ch+1));if(R&&!b.empty())h="surround";else if((w||!R)&&_==d)w&&c(s,p)?h="both":C.indexOf(d)>=0&&s.getRange(p,P(p.line,p.ch+3))==d+d+d?h="skipThree":h="skip";else if(w&&p.ch>1&&C.indexOf(d)>=0&&s.getRange(P(p.line,p.ch-2),p)==d+d){if(p.ch>2&&/\bstring/.test(s.getTokenTypeAt(P(p.line,p.ch-2))))return Z.Pass;h="addFour"}else if(w){var E=p.ch==0?" ":s.getRange(P(p.line,p.ch-1),p);if(!Z.isWordChar(_)&&E!=d&&!Z.isWordChar(E))h="both";else return Z.Pass}else if(R&&(_.length===0||/\s/.test(_)||a.indexOf(_)>-1))h="both";else return Z.Pass;if(!A)A=h;else if(A!=h)return Z.Pass}var x=o%2?l.charAt(o-1):d,U=o%2?d:l.charAt(o+1);s.operation(function(){if(A=="skip")s.execCommand("goCharRight");else if(A=="skipThree")for(var B=0;B<3;B++)s.execCommand("goCharRight");else if(A=="surround"){for(var L=s.getSelections(),B=0;B<L.length;B++)L[B]=x+L[B]+U;s.replaceSelections(L,"around"),L=s.listSelections().slice();for(var B=0;B<L.length;B++)L[B]=y(L[B]);s.setSelections(L)}else A=="both"?(s.replaceSelection(x+U,null),s.triggerElectric(x+U),s.execCommand("goCharLeft")):A=="addFour"&&(s.replaceSelection(x+x+x+x,"before"),s.execCommand("goCharRight"))})}function m(s,d){var u=s.getRange(P(d.line,d.ch-1),P(d.line,d.ch+1));return u.length==2?u:null}function c(s,d){var u=s.getTokenAt(P(d.line,d.ch+1));return/\bstring/.test(u.type)&&u.start==d.ch&&(d.ch==0||!/\bstring/.test(s.getTokenTypeAt(d)))}})},FWmy:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return Z});function Z(V,P){if(!V)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},HmJG:function(xt,ve,G){},IBYe:function(xt,ve,G){"use strict";function Z(V){return null}ve.a=Z},JYp7:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return Z});var Z;(function(V){function P(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}V.is=P;const z=Object.freeze([]);function I(){return z}V.empty=I;function*k(a){yield a}V.single=k;function K(a){return a||z}V.from=K;function N(a){return!a||a[Symbol.iterator]().next().done===!0}V.isEmpty=N;function n(a){return a[Symbol.iterator]().next().value}V.first=n;function D(a,C){for(const w of a)if(C(w))return!0;return!1}V.some=D;function y(a,C){for(const w of a)if(C(w))return w;return}V.find=y;function*g(a,C){for(const w of a)C(w)&&(yield w)}V.filter=g;function*m(a,C){let w=0;for(const T of a)yield C(T,w++)}V.map=m;function*c(...a){for(const C of a)for(const w of C)yield w}V.concat=c;function*s(a){for(const C of a)for(const w of C)yield w}V.concatNested=s;function d(a,C,w){let T=w;for(const R of a)T=C(T,R);return T}V.reduce=d;function*u(a,C,w=a.length){for(C<0&&(C+=a.length),w<0?w+=a.length:w>a.length&&(w=a.length);C<w;C++)yield a[C]}V.slice=u;function l(a,C=Number.POSITIVE_INFINITY){const w=[];if(C===0)return[w,a];const T=a[Symbol.iterator]();for(let R=0;R<C;R++){const A=T.next();if(A.done)return[w,V.empty()];w.push(A.value)}return[w,{[Symbol.iterator](){return T}}]}V.consume=l;function o(a,C,w=(T,R)=>T===R){const T=a[Symbol.iterator](),R=C[Symbol.iterator]();for(;;){const A=T.next(),v=R.next();if(A.done!==v.done)return!1;if(A.done)return!0;if(!w(A.value,v.value))return!1}}V.equals=o})(Z||(Z={}))},LdHM:function(xt,ve,G){"use strict";G.d(ve,"b",function(){return a}),G.d(ve,"a",function(){return w});var Z=G("1OyB"),V=G("vuIU"),P=G("Ji7U"),z=G("LK+K"),I=G("q1tI"),k=G("rePB"),K=G("Ff2n"),N=G("ODXe"),n=G("4IlW"),D=G("bX4T"),y=G("YrtM"),g=G("TSYQ"),m=G.n(g),c=G("+nKL"),s=G("8OUc"),d=function(J,te){var se=J.prefixCls,fe=J.id,Fe=J.flattenOptions,Le=J.childrenAsData,De=J.values,He=J.searchValue,We=J.multiple,ye=J.defaultActiveFirstOption,ue=J.height,Ye=J.itemHeight,vt=J.notFoundContent,ct=J.open,it=J.menuItemSelectedIcon,ft=J.virtual,Qe=J.onSelect,qe=J.onToggleOpen,ht=J.onActiveValue,de=J.onScroll,Ie=J.onMouseEnter,Pe="".concat(se,"-item"),Ke=Object(y.a)(function(){return Fe},[ct,Fe],function(je,Ee){return Ee[0]&&je[1]!==Ee[1]}),st=I.useRef(null),at=function(Ee){Ee.preventDefault()},et=function(Ee){st.current&&st.current.scrollTo({index:Ee})},tt=function(Ee){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=Ke.length,re=0;re<pe;re+=1){var oe=(Ee+re*he+pe)%pe,le=Ke[oe],me=le.group,be=le.data;if(!me&&!be.disabled)return oe}return-1},dt=I.useState(function(){return tt(0)}),yt=Object(N.a)(dt,2),Ae=yt[0],Se=yt[1],Ve=function(Ee){Se(Ee);var he=Ke[Ee];if(!he){ht(null,-1);return}ht(he.data.value,Ee)};I.useEffect(function(){Ve(ye!==!1?tt(0):-1)},[Ke.length,He]),I.useEffect(function(){var je=setTimeout(function(){if(!We&&ct&&De.size===1){var Ee=Array.from(De)[0],he=Ke.findIndex(function(pe){var re=pe.data;return re.value===Ee});Ve(he),et(he)}});return function(){return clearTimeout(je)}},[ct]);var Je=function(Ee){Ee!==void 0&&Qe(Ee,{selected:!De.has(Ee)}),We||qe(!1)};if(I.useImperativeHandle(te,function(){return{onKeyDown:function(Ee){var he=Ee.which;switch(he){case n.a.UP:case n.a.DOWN:{var pe=0;if(he===n.a.UP?pe=-1:he===n.a.DOWN&&(pe=1),pe!==0){var re=tt(Ae+pe,pe);et(re),Ve(re)}break}case n.a.ENTER:{var oe=Ke[Ae];oe&&!oe.data.disabled?Je(oe.data.value):Je(void 0),ct&&Ee.preventDefault();break}case n.a.ESC:qe(!1)}},onKeyUp:function(){},scrollTo:function(Ee){et(Ee)}}}),Ke.length===0)return I.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(Pe,"-empty"),onMouseDown:at},vt);function Ne(je){var Ee=Ke[je];if(!Ee)return null;var he=Ee.data||{},pe=he.value,re=he.label,oe=he.children,le=Object(D.a)(he,!0),me=Le?oe:re;return Ee?I.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},le,{key:je,role:"option",id:"".concat(fe,"_list_").concat(je),"aria-selected":De.has(pe)}),pe):null}return I.createElement(I.Fragment,null,I.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ne(Ae-1),Ne(Ae),Ne(Ae+1)),I.createElement(c.a,{itemKey:"key",ref:st,data:Ke,height:ue,itemHeight:Ye,fullHeight:!1,onMouseDown:at,onScroll:de,virtual:ft,onMouseEnter:Ie},function(je,Ee){var he,pe=je.group,re=je.groupOption,oe=je.data,le=oe.label,me=oe.key;if(pe)return I.createElement("div",{className:m()(Pe,"".concat(Pe,"-group"))},le!==void 0?le:me);var be=oe.disabled,Be=oe.value,$e=oe.title,ut=oe.children,Et=oe.style,mt=oe.className,Bt=Object(K.a)(oe,["disabled","value","title","children","style","className"]),Ut=De.has(Be),Tt="".concat(Pe,"-option"),kt=m()(Pe,Tt,mt,(he={},Object(k.a)(he,"".concat(Tt,"-grouped"),re),Object(k.a)(he,"".concat(Tt,"-active"),Ae===Ee&&!be),Object(k.a)(he,"".concat(Tt,"-disabled"),be),Object(k.a)(he,"".concat(Tt,"-selected"),Ut),he)),zt=Le?ut:le,$t=!it||typeof it=="function"||Ut;return I.createElement("div",Object.assign({},Bt,{"aria-selected":Ut,className:kt,title:$e,onMouseMove:function(){if(Ae===Ee||be)return;Ve(Ee)},onClick:function(){be||Je(Be)},style:Et}),I.createElement("div",{className:"".concat(Tt,"-content")},zt||Be),I.isValidElement(it)||Ut,$t&&I.createElement(s.a,{className:"".concat(Pe,"-option-state"),customizeIcon:it,customizeIconProps:{isSelected:Ut}},Ut?"\u2713":null))}))},u=I.forwardRef(d);u.displayName="OptionList";var l=u,o=function(){return null};o.isSelectOption=!0;var a=o,C=function(){return null};C.isSelectOptGroup=!0;var w=C,T=G("VTBJ"),R=G("Zm9Q");function A(S){var J=S.key,te=S.props,se=te.children,fe=te.value,Fe=Object(K.a)(te,["children","value"]);return Object(T.a)({key:J,value:fe!==void 0?fe:J,children:se},Fe)}function v(S){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(S).map(function(te,se){if(!I.isValidElement(te)||!te.type)return null;var fe=te.type.isSelectOptGroup,Fe=te.key,Le=te.props,De=Le.children,He=Object(K.a)(Le,["children"]);return J||!fe?A(te):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Fe===null?se:Fe,"__"),label:Fe},He),{},{options:v(De)})}).filter(function(te){return te})}var b=G("2Qr1"),p=G("qNPg"),h=G("U8pU"),_=G("Kwbf"),E=G("WKfj");function x(S){var J=S.mode,te=S.options,se=S.children,fe=S.backfill,Fe=S.allowClear,Le=S.placeholder,De=S.getInputElement,He=S.showSearch,We=S.onSearch,ye=S.defaultOpen,ue=S.autoFocus,Ye=S.labelInValue,vt=S.value,ct=S.inputValue,it=S.optionLabelProp,ft=J==="multiple"||J==="tags",Qe=He!==void 0?He:ft||J==="combobox",qe=te||v(se);if(Object(_.a)(J!=="tags"||qe.every(function(Pe){return!Pe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),J==="tags"||J==="combobox"){var ht=qe.some(function(Pe){return Pe.options?Pe.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in Pe?Pe.value:Pe.key)=="number"});Object(_.a)(!ht,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(J!=="combobox"||!it,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(J==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(_.a)(J==="combobox"||!De,"`getInputElement` only work with `combobox` mode."),Object(_.b)(J!=="combobox"||!De||!Fe||!Le,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),We&&!Qe&&J!=="combobox"&&J!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ye||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),vt!=null){var de=Object(E.d)(vt);Object(_.a)(!Ye||de.every(function(Pe){return Object(h.a)(Pe)==="object"&&("key"in Pe||"value"in Pe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!ft||Array.isArray(vt),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var Ie=null;Object(R.a)(se).some(function(Pe){if(!I.isValidElement(Pe)||!Pe.type)return!1;var Ke=Pe.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var st=Object(R.a)(Pe.props.children).every(function(at){return!I.isValidElement(at)||!Pe.type||at.type.isSelectOption?!0:(Ie=at.type,!1)});return!st}return Ie=Ke,!0}),Ie&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ie.displayName||Ie.name||Ie,"`.")),Object(_.a)(ct===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=x,B=Object(p.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:v,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:U,fillOptionsWithMissingValue:b.a}),L=function(S){Object(P.a)(te,S);var J=Object(z.a)(te);function te(){var se;return Object(Z.a)(this,te),se=J.apply(this,arguments),se.selectRef=I.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(V.a)(te,[{key:"render",value:function(){return I.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),te}(I.Component);L.Option=a,L.OptGroup=w;var H=L,j=ve.c=H},M8RZ:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return n});var Z=G("fWQN"),V=G("mtLc"),P=G("yKVA"),z=G("879j"),I=G("q1tI"),k=G.n(I),K=G("i8i4"),N=G.n(K),n=function(D){Object(P.a)(g,D);var y=Object(z.a)(g);function g(m){var c;Object(Z.a)(this,g),c=y.call(this,m);var s=window.document;return c.node=s.createElement("div"),s.body.appendChild(c.node),c}return Object(V.a)(g,[{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)}}]),g}(k.a.Component)},MI8n:function(xt,ve,G){"use strict";G.d(ve,"c",function(){return I}),G.d(ve,"b",function(){return n}),G.d(ve,"e",function(){return D}),G.d(ve,"a",function(){return y}),G.d(ve,"d",function(){return g}),G.d(ve,"f",function(){return m});var Z=G("/cxE"),V=G("pmY6"),P=G("24hK"),z=G("5Y4S"),I;(function(c){c.None=()=>V.a.None;function s(x){return(U,B=null,L)=>{let H=!1,j;return j=x(S=>H?void 0:(j?j.dispose():H=!0,U.call(B,S)),null,L),H&&j.dispose(),j}}c.once=s;function d(x,U){return w((B,L=null,H)=>x(j=>B.call(L,U(j)),null,H))}c.map=d;function u(x,U){return w((B,L=null,H)=>x(j=>{U(j),B.call(L,j)},null,H))}c.forEach=u;function l(x,U){return w((B,L=null,H)=>x(j=>U(j)&&B.call(L,j),null,H))}c.filter=l;function o(x){return x}c.signal=o;function a(...x){return(U,B=null,L)=>Object(V.e)(...x.map(H=>H(j=>U.call(B,j),null,L)))}c.any=a;function C(x,U,B){let L=B;return d(x,H=>(L=U(L,H),L))}c.reduce=C;function w(x){let U;const B=new n({onFirstListenerAdd(){U=x(B.fire,B)},onLastListenerRemove(){U.dispose()}});return B.event}function T(x,U,B=100,L=!1,H){let j,S,J,te=0;const se=new n({leakWarningThreshold:H,onFirstListenerAdd(){j=x(fe=>{te++,S=U(S,fe),L&&!J&&(se.fire(S),S=void 0),clearTimeout(J),J=setTimeout(()=>{const Fe=S;S=void 0,J=void 0,(!L||te>1)&&se.fire(Fe),te=0},B)})},onLastListenerRemove(){j.dispose()}});return se.event}c.debounce=T;function R(x,U=(B,L)=>B===L){let B=!0,L;return l(x,H=>{const j=B||!U(H,L);return B=!1,L=H,j})}c.latch=R;function A(x,U){return[c.filter(x,U),c.filter(x,B=>!U(B))]}c.split=A;function v(x,U=!1,B=[]){let L=B.slice(),H=x(J=>{L?L.push(J):S.fire(J)});const j=()=>{L&&L.forEach(J=>S.fire(J)),L=null},S=new n({onFirstListenerAdd(){H||(H=x(J=>S.fire(J)))},onFirstListenerDidAdd(){L&&(U?setTimeout(j):j())},onLastListenerRemove(){H&&H.dispose(),H=null}});return S.event}c.buffer=v;class b{constructor(x){this.event=x}map(x){return new b(d(this.event,x))}forEach(x){return new b(u(this.event,x))}filter(x){return new b(l(this.event,x))}reduce(x,U){return new b(C(this.event,x,U))}latch(){return new b(R(this.event))}debounce(x,U=100,B=!1,L){return new b(T(this.event,x,U,B,L))}on(x,U,B){return this.event(x,U,B)}once(x,U,B){return s(this.event)(x,U,B)}}function p(x){return new b(x)}c.chain=p;function h(x,U,B=L=>L){const L=(...J)=>S.fire(B(...J)),H=()=>x.on(U,L),j=()=>x.removeListener(U,L),S=new n({onFirstListenerAdd:H,onLastListenerRemove:j});return S.event}c.fromNodeEventEmitter=h;function _(x,U,B=L=>L){const L=(...J)=>S.fire(B(...J)),H=()=>x.addEventListener(U,L),j=()=>x.removeEventListener(U,L),S=new n({onFirstListenerAdd:H,onLastListenerRemove:j});return S.event}c.fromDOMEventEmitter=_;function E(x){return new Promise(U=>s(x)(U))}c.toPromise=E})(I||(I={}));class k{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${k._idPool++}`}start(c){this._stopWatch=new z.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}}}k._idPool=0;let K=-1;class N{constructor(c,s=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=s,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let s=K;if(typeof this.customThreshold=="number"&&(s=this.customThreshold),s<=0||c<s)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),u=this._stacks.get(d)||0;if(this._stacks.set(d,u+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let l,o=0;for(const[a,C]of this._stacks)(!l||o<C)&&(l=a,o=C);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${o}):`),console.warn(l)}return()=>{const l=this._stacks.get(d)||0;this._stacks.set(d,l-1)}}}class n{constructor(c){var s;this._disposed=!1,this._options=c,this._leakageMon=K>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((s=this._options)===null||s===void 0?void 0:s._profName)?new k(this._options._profName):void 0}get event(){return this._event||(this._event=(c,s,d)=>{var u;this._listeners||(this._listeners=new P.a);const l=this._listeners.isEmpty();l&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(s?[c,s]:c);l&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,s);const a=(u=this._leakageMon)===null||u===void 0?void 0:u.check(this._listeners.size),C=Object(V.i)(()=>{if(a&&a(),!this._disposed&&(o(),this._options&&this._options.onLastListenerRemove)){const w=this._listeners&&!this._listeners.isEmpty();w||this._options.onLastListenerRemove(this)}});return d instanceof V.b?d.add(C):Array.isArray(d)&&d.push(C),C}),this._event}fire(c){var s,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let u of this._listeners)this._deliveryQueue.push([u,c]);for((s=this._perfMon)===null||s===void 0||s.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[u,l]=this._deliveryQueue.shift();try{typeof u=="function"?u.call(void 0,l):u[0].call(u[1],l)}catch(o){Object(Z.f)(o)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,s,d,u,l;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(s=this._deliveryQueue)===null||s===void 0||s.clear(),(u=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||u===void 0||u.call(d),(l=this._leakageMon)===null||l===void 0||l.dispose())}}class D extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=c==null?void 0:c.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const c=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(c))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(c){this._listeners&&(this._isPaused!==0?this._eventQueue.push(c):super.fire(c))}}class y extends D{constructor(c){var s;super(c);this._delay=(s=c.delay)!==null&&s!==void 0?s:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class g{constructor(){this.buffers=[]}wrapEvent(c){return(s,d,u)=>c(l=>{const o=this.buffers[this.buffers.length-1];o?o.push(()=>s.call(d,l)):s.call(d,l)},void 0,u)}bufferEvents(c){const s=[];this.buffers.push(s);const d=c();return this.buffers.pop(),s.forEach(u=>u()),d}}class m{constructor(){this.listening=!1,this.inputEvent=I.None,this.inputEventListener=V.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(xt,ve,G){"use strict";(function(Z,V){G.d(ve,"b",function(){return d}),G.d(ve,"i",function(){return a}),G.d(ve,"f",function(){return C}),G.d(ve,"d",function(){return w}),G.d(ve,"g",function(){return T}),G.d(ve,"h",function(){return R}),G.d(ve,"c",function(){return A}),G.d(ve,"k",function(){return v}),G.d(ve,"j",function(){return b}),G.d(ve,"a",function(){return p}),G.d(ve,"e",function(){return E});var P;const z="en";let I=!1,k=!1,K=!1,N=!1,n=!1,D=!1,y=!1,g,m=z,c,s;const d=typeof self=="object"?self:typeof Z=="object"?Z:{};let u;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?u=d.vscode.process:typeof V!="undefined"&&(u=V);const l=typeof((P=u==null?void 0:u.versions)===null||P===void 0?void 0:P.electron)=="string"&&u.type==="renderer";if(typeof navigator=="object"&&!l)s=navigator.userAgent,I=s.indexOf("Windows")>=0,k=s.indexOf("Macintosh")>=0,y=(s.indexOf("Macintosh")>=0||s.indexOf("iPad")>=0||s.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=s.indexOf("Linux")>=0,D=!0,g=navigator.language,m=g;else if(typeof u=="object"){I=u.platform==="win32",k=u.platform==="darwin",K=u.platform==="linux",N=K&&!!u.env.SNAP&&!!u.env.SNAP_REVISION,g=z,m=z;const x=u.env.VSCODE_NLS_CONFIG;if(x)try{const U=JSON.parse(x),B=U.availableLanguages["*"];g=U.locale,m=B||z,c=U._translationsConfigFile}catch(U){}n=!0}else console.error("Unable to resolve platform.");let o=0;k?o=1:I?o=3:K&&(o=2);const a=I,C=k,w=K,T=n,R=D,A=y,v=s,b=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let B=[];d.addEventListener("message",H=>{if(H.data&&H.data.vscodeSetImmediateId)for(let j=0,S=B.length;j<S;j++){const J=B[j];if(J.id===H.data.vscodeSetImmediateId){B.splice(j,1),J.callback();return}}});let L=0;return H=>{const j=++L;B.push({id:j,callback:H}),d.postMessage({vscodeSetImmediateId:j},"*")}}if(typeof(u==null?void 0:u.nextTick)=="function")return u.nextTick.bind(u);const U=Promise.resolve();return B=>U.then(B)}(),p=k||y?2:I?1:3;let h=!0,_=!1;function E(){if(!_){_=!0;const x=new Uint8Array(2);x[0]=1,x[1]=2;const U=new Uint16Array(x.buffer);h=U[0]===(2<<8)+1}return h}}).call(this,G("IyRk"),G("Q2Ig"))},N0LK:function(xt,ve,G){"use strict";G.d(ve,"C",function(){return Z}),G.d(ve,"v",function(){return P}),G.d(ve,"s",function(){return z}),G.d(ve,"t",function(){return I}),G.d(ve,"U",function(){return k}),G.d(ve,"J",function(){return K}),G.d(ve,"O",function(){return N}),G.d(ve,"p",function(){return n}),G.d(ve,"T",function(){return D}),G.d(ve,"q",function(){return y}),G.d(ve,"N",function(){return g}),G.d(ve,"M",function(){return m}),G.d(ve,"Q",function(){return c}),G.d(ve,"u",function(){return s}),G.d(ve,"x",function(){return d}),G.d(ve,"I",function(){return u}),G.d(ve,"f",function(){return l}),G.d(ve,"h",function(){return o}),G.d(ve,"g",function(){return a}),G.d(ve,"i",function(){return C}),G.d(ve,"G",function(){return w}),G.d(ve,"H",function(){return T}),G.d(ve,"r",function(){return R}),G.d(ve,"R",function(){return A}),G.d(ve,"d",function(){return v}),G.d(ve,"e",function(){return b}),G.d(ve,"E",function(){return p}),G.d(ve,"F",function(){return h}),G.d(ve,"j",function(){return _}),G.d(ve,"z",function(){return E}),G.d(ve,"K",function(){return U}),G.d(ve,"L",function(){return B}),G.d(ve,"m",function(){return H}),G.d(ve,"k",function(){return S}),G.d(ve,"A",function(){return te}),G.d(ve,"a",function(){return se}),G.d(ve,"n",function(){return fe}),G.d(ve,"l",function(){return Fe}),G.d(ve,"D",function(){return Le}),G.d(ve,"B",function(){return De}),G.d(ve,"b",function(){return He}),G.d(ve,"S",function(){return We}),G.d(ve,"o",function(){return ye}),G.d(ve,"P",function(){return ue}),G.d(ve,"w",function(){return Ye}),G.d(ve,"c",function(){return vt}),G.d(ve,"y",function(){return ft});function Z(de){return!de||typeof de!="string"?!0:de.trim().length===0}const V=/{(\d+)}/g;function P(de,...Ie){return Ie.length===0?de:de.replace(V,function(Pe,Ke){const st=parseInt(Ke,10);return isNaN(st)||st<0||st>=Ie.length?Pe:Ie[st]})}function z(de){return de.replace(/[<>&]/g,function(Ie){switch(Ie){case"<":return"<";case">":return">";case"&":return"&";default:return Ie}})}function I(de){return de.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k(de,Ie=" "){const Pe=K(de,Ie);return N(Pe,Ie)}function K(de,Ie){if(!de||!Ie)return de;const Pe=Ie.length;if(Pe===0||de.length===0)return de;let Ke=0;for(;de.indexOf(Ie,Ke)===Ke;)Ke=Ke+Pe;return de.substring(Ke)}function N(de,Ie){if(!de||!Ie)return de;const Pe=Ie.length,Ke=de.length;if(Pe===0||Ke===0)return de;let st=Ke,at=-1;for(;!(at=de.lastIndexOf(Ie,st-1),at===-1||at+Pe!==st);){if(at===0)return"";st=at}return de.substring(0,st)}function n(de){return de.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(de){return de.replace(/\*/g,"")}function y(de,Ie,Pe={}){if(!de)throw new Error("Cannot create regex from empty string");Ie||(de=I(de)),Pe.wholeWord&&(/\B/.test(de.charAt(0))||(de="\\b"+de),/\B/.test(de.charAt(de.length-1))||(de=de+"\\b"));let Ke="";return Pe.global&&(Ke+="g"),Pe.matchCase||(Ke+="i"),Pe.multiline&&(Ke+="m"),Pe.unicode&&(Ke+="u"),new RegExp(de,Ke)}function g(de){if(de.source==="^"||de.source==="^$"||de.source==="$"||de.source==="^\\s*$")return!1;const Ie=de.exec("");return!!(Ie&&de.lastIndex===0)}function m(de){return(de.global?"g":"")+(de.ignoreCase?"i":"")+(de.multiline?"m":"")+(de.unicode?"u":"")}function c(de){return de.split(/\r\n|\r|\n/)}function s(de){for(let Ie=0,Pe=de.length;Ie<Pe;Ie++){const Ke=de.charCodeAt(Ie);if(Ke!==32&&Ke!==9)return Ie}return-1}function d(de,Ie=0,Pe=de.length){for(let Ke=Ie;Ke<Pe;Ke++){const st=de.charCodeAt(Ke);if(st!==32&&st!==9)return de.substring(Ie,Ke)}return de.substring(Ie,Pe)}function u(de,Ie=de.length-1){for(let Pe=Ie;Pe>=0;Pe--){const Ke=de.charCodeAt(Pe);if(Ke!==32&&Ke!==9)return Pe}return-1}function l(de,Ie){return de<Ie?-1:de>Ie?1:0}function o(de,Ie,Pe=0,Ke=de.length,st=0,at=Ie.length){for(;Pe<Ke&&st<at;Pe++,st++){let dt=de.charCodeAt(Pe),yt=Ie.charCodeAt(st);if(dt<yt)return-1;if(dt>yt)return 1}const et=Ke-Pe,tt=at-st;return et<tt?-1:et>tt?1:0}function a(de,Ie){return C(de,Ie,0,de.length,0,Ie.length)}function C(de,Ie,Pe=0,Ke=de.length,st=0,at=Ie.length){for(;Pe<Ke&&st<at;Pe++,st++){let dt=de.charCodeAt(Pe),yt=Ie.charCodeAt(st);if(dt===yt)continue;if(dt>=128||yt>=128)return o(de.toLowerCase(),Ie.toLowerCase(),Pe,Ke,st,at);w(dt)&&(dt-=32),w(yt)&&(yt-=32);const Ae=dt-yt;if(Ae===0)continue;return Ae}const et=Ke-Pe,tt=at-st;return et<tt?-1:et>tt?1:0}function w(de){return de>=97&&de<=122}function T(de){return de>=65&&de<=90}function R(de,Ie){return de.length===Ie.length&&C(de,Ie)===0}function A(de,Ie){const Pe=Ie.length;return Ie.length>de.length?!1:C(de,Ie,0,Pe)===0}function v(de,Ie){let Pe,Ke=Math.min(de.length,Ie.length);for(Pe=0;Pe<Ke;Pe++)if(de.charCodeAt(Pe)!==Ie.charCodeAt(Pe))return Pe;return Ke}function b(de,Ie){let Pe,Ke=Math.min(de.length,Ie.length);const st=de.length-1,at=Ie.length-1;for(Pe=0;Pe<Ke;Pe++)if(de.charCodeAt(st-Pe)!==Ie.charCodeAt(at-Pe))return Pe;return Ke}function p(de){return 55296<=de&&de<=56319}function h(de){return 56320<=de&&de<=57343}function _(de,Ie){return(de-55296<<10)+(Ie-56320)+65536}function E(de,Ie,Pe){const Ke=de.charCodeAt(Pe);if(p(Ke)&&Pe+1<Ie){const st=de.charCodeAt(Pe+1);if(h(st))return _(Ke,st)}return Ke}function x(de,Ie){const Pe=de.charCodeAt(Ie-1);if(h(Pe)&&Ie>1){const Ke=de.charCodeAt(Ie-2);if(p(Ke))return _(Ke,Pe)}return Pe}function U(de,Ie){const Pe=ct.getInstance(),Ke=Ie,st=de.length,at=E(de,st,Ie);Ie+=at>=65536?2:1;let et=Pe.getGraphemeBreakType(at);for(;Ie<st;){const tt=E(de,st,Ie),dt=Pe.getGraphemeBreakType(tt);if(vt(et,dt))break;Ie+=tt>=65536?2:1,et=dt}return Ie-Ke}function B(de,Ie){const Pe=ct.getInstance(),Ke=Ie,st=x(de,Ie);Ie-=st>=65536?2:1;let at=Pe.getGraphemeBreakType(st);for(;Ie>0;){const et=x(de,Ie),tt=Pe.getGraphemeBreakType(et);if(vt(tt,at))break;Ie-=et>=65536?2:1,at=tt}return Ke-Ie}const L=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function H(de){return L.test(de)}const j=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function S(de){return j.test(de)}const J=/^[\t\n\r\x20-\x7E]*$/;function te(de){return J.test(de)}const se=/[\u2028\u2029]/;function fe(de){return se.test(de)}function Fe(de){for(let Ie=0,Pe=de.length;Ie<Pe;Ie++)if(Le(de.charCodeAt(Ie)))return!0;return!1}function Le(de){return de=+de,de>=11904&&de<=55215||de>=63744&&de<=64255||de>=65281&&de<=65374}function De(de){return de>=127462&&de<=127487||de===8986||de===8987||de===9200||de===9203||de>=9728&&de<=10175||de===11088||de===11093||de>=127744&&de<=128591||de>=128640&&de<=128764||de>=128992&&de<=129003||de>=129280&&de<=129535||de>=129648&&de<=129750}const He=String.fromCharCode(65279);function We(de){return!!(de&&de.length>0&&de.charCodeAt(0)===65279)}function ye(de,Ie=!1){return de?(Ie&&(de=de.replace(/\\./g,"")),de.toLowerCase()!==de):!1}function ue(de){const Ie=90-65+1;return de=de%(2*Ie),de<Ie?String.fromCharCode(97+de):String.fromCharCode(65+de-Ie)}function Ye(de){const Ie=ct.getInstance();return Ie.getGraphemeBreakType(de)}function vt(de,Ie){return de===0?Ie!==5&&Ie!==7:de===2&&Ie===3?!1:de===4||de===2||de===3||(Ie===4||Ie===2||Ie===3)?!0:de===8&&(Ie===8||Ie===9||Ie===11||Ie===12)||((de===11||de===9)&&(Ie===9||Ie===10)||((de===12||de===10)&&Ie===10||(Ie===5||Ie===13||(Ie===7||(de===1||de===13&&Ie===14)))))?!1:!(de===6&&Ie===6)}class ct{constructor(){this._data=it()}static getInstance(){return ct._INSTANCE||(ct._INSTANCE=new ct),ct._INSTANCE}getGraphemeBreakType(de){if(de<32)return de===10?3:de===13?2:4;if(de<127)return 0;const Ie=this._data,Pe=Ie.length/3;let Ke=1;for(;Ke<=Pe;)if(de<Ie[3*Ke])Ke=2*Ke;else if(de>Ie[3*Ke+1])Ke=2*Ke+1;else return Ie[3*Ke+2];return 0}}ct._INSTANCE=null;function it(){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 ft(de,Ie){if(de===0)return 0;const Pe=Qe(de,Ie);if(Pe!==void 0)return Pe;const Ke=x(Ie,de);return de-=qe(Ke),de}function Qe(de,Ie){let Pe=x(Ie,de);for(de-=qe(Pe);ht(Pe)||Pe===65039||Pe===8419;){if(de===0)return;Pe=x(Ie,de),de-=qe(Pe)}if(!De(Pe))return;if(de>=0){const Ke=x(Ie,de);Ke===8205&&(de-=qe(Ke))}return de}function qe(de){return de>=65536?2:1}function ht(de){return 127995<=de&&de<=127999}},NvD2:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return k});var Z=G("Kwbf");function V(K,N){var n=new Set;return K.forEach(function(D){N.has(D)||n.add(D)}),n}function P(K){var N=K||{},n=N.disabled,D=N.disableCheckbox,y=N.checkable;return!!(n||D)||y===!1}function z(K,N,n,D){for(var y=new Set(K),g=new Set,m=0;m<=n;m+=1){var c=N.get(m)||new Set;c.forEach(function(l){var o=l.key,a=l.node,C=l.children,w=C===void 0?[]:C;y.has(o)&&!D(a)&&w.filter(function(T){return!D(T.node)}).forEach(function(T){y.add(T.key)})})}for(var s=new Set,d=n;d>=0;d-=1){var u=N.get(d)||new Set;u.forEach(function(l){var o=l.parent,a=l.node;if(D(a)||!l.parent||s.has(l.parent.key))return;if(D(l.parent.node)){s.add(o.key);return}var C=!0,w=!1;(o.children||[]).filter(function(T){return!D(T.node)}).forEach(function(T){var R=T.key,A=y.has(R);C&&!A&&(C=!1),!w&&(A||g.has(R))&&(w=!0)}),C&&y.add(o.key),w&&g.add(o.key),s.add(o.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(V(g,y))}}function I(K,N,n,D,y){for(var g=new Set(K),m=new Set(N),c=0;c<=D;c+=1){var s=n.get(c)||new Set;s.forEach(function(o){var a=o.key,C=o.node,w=o.children,T=w===void 0?[]:w;!g.has(a)&&!m.has(a)&&!y(C)&&T.filter(function(R){return!y(R.node)}).forEach(function(R){g.delete(R.key)})})}m=new Set;for(var d=new Set,u=D;u>=0;u-=1){var l=n.get(u)||new Set;l.forEach(function(o){var a=o.parent,C=o.node;if(y(C)||!o.parent||d.has(o.parent.key))return;if(y(o.parent.node)){d.add(a.key);return}var w=!0,T=!1;(a.children||[]).filter(function(R){return!y(R.node)}).forEach(function(R){var A=R.key,v=g.has(A);w&&!v&&(w=!1),!T&&(v||m.has(A))&&(T=!0)}),w||g.delete(a.key),T&&m.add(a.key),d.add(a.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(V(m,g))}}function k(K,N,n,D){var y=[],g;D?g=D:g=P;var m=new Set(K.filter(function(u){var l=!!n[u];return l||y.push(u),l})),c=new Map,s=0;Object.keys(n).forEach(function(u){var l=n[u],o=l.level,a=c.get(o);a||(a=new Set,c.set(o,a)),a.add(l),s=Math.max(s,o)}),Object(Z.a)(!y.length,"Tree missing follow keys: ".concat(y.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var d;return N===!0?d=z(m,c,s,g):d=I(m,N.halfCheckedKeys,c,s,g),d}},OZM5:function(xt,ve,G){"use strict";G.d(ve,"b",function(){return D}),G.d(ve,"a",function(){return y}),G.d(ve,"k",function(){return g}),G.d(ve,"h",function(){return m}),G.d(ve,"i",function(){return c}),G.d(ve,"g",function(){return s}),G.d(ve,"c",function(){return d}),G.d(ve,"d",function(){return u}),G.d(ve,"j",function(){return a}),G.d(ve,"e",function(){return C}),G.d(ve,"f",function(){return w});var Z=G("KQm4"),V=G("U8pU"),P=G("Ff2n"),z=G("q1tI"),I=G.n(z),k=G("Kwbf"),K=G("WaYH"),N=.25,n=2;function D(T,R){var A=T.slice(),v=A.indexOf(R);return v>=0&&A.splice(v,1),A}function y(T,R){var A=T.slice();return A.indexOf(R)===-1&&A.push(R),A}function g(T){return T.split("-")}function m(T,R){return"".concat(T,"-").concat(R)}function c(T){return T&&T.type&&T.type.isTreeNode}function s(T,R){var A=[T],v=R[T];function b(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];p.forEach(function(h){var _=h.key,E=h.children;A.push(_),b(E)})}return b(v.children),A}function d(T,R){var A=T.clientY,v=R.selectHandle.getBoundingClientRect(),b=v.top,p=v.bottom,h=v.height,_=Math.max(h*N,n);return A<=b+_?-1:A>=p-_?1:0}function u(T,R){if(!T)return;var A=R.multiple;return A?T.slice():T.length?[T[0]]:T}var l=function(R){return R};function o(T,R){if(!T)return[];var A=R||{},v=A.processProps,b=v===void 0?l:v,p=Array.isArray(T)?T:[T];return p.map(function(h){var _=h.children,E=Object(P.a)(h,["children"]),x=o(_,R);return I.a.createElement(K.a,Object.assign({},b(E)),x)})}function a(T){if(!T)return null;var R;if(Array.isArray(T))R={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(V.a)(T)==="object")R={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(k.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function C(T,R){var A=new Set;function v(b){if(A.has(b))return;var p=R[b];if(!p)return;A.add(b);var h=p.parent,_=p.node;if(_.disabled)return;h&&v(h.key)}return(T||[]).forEach(function(b){v(b)}),Object(Z.a)(A)}function w(T){var R={};return Object.keys(T).forEach(function(A){(A.startsWith("data-")||A.startsWith("aria-"))&&(R[A]=T[A])}),R}},Ot1p:function(xt,ve,G){"use strict";var Z=G("2qtc"),V=G("kLXV"),P=G("rAM+"),z=G("miYZ"),I=G("tsqr"),k=G("9og8"),K=G("tJVT"),N=G("jrin"),n=G("WmNS"),D=G.n(n),y=G("q1tI"),g=G.n(y),m=G("VrN/"),c=G.n(m),s=G("bdgK"),d=G("p77/"),u=G("Bd2K"),l=G("ELLl"),o=G("19Vz"),a=G("lZu9"),C=G("+NIl"),w=G("kSUc"),T=G("9Bee"),R=function(be){var Be=be.value,$e=Be===void 0?"":Be,ut=be.className,Et=be.showTextOnly,mt=be.showLines,Bt=be.style,Ut=Bt===void 0?{}:Bt,Tt=Object(y.useMemo)(function(){return""},[$e]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:Tt}}))},A=G("0Owb"),v=G("dejd"),b=G("C+DQ"),p=G("1vsH"),h=G("m3rI"),_=[{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(be){var Be=be.onActionCallback,$e=be.title,ut=be.icon,Et=be.actionName,mt=be.className,Bt=mt===void 0?"":mt,Ut=be.children;function Tt(){Be(Et)}return g.a.createElement("a",{title:$e,className:Bt,onClick:Tt},g.a.createElement("i",{className:"md-iconfont ".concat(ut)}),Ut)}var x=function(be){var Be=be.watch,$e=be.showNullButton,ut=be.onActionCallback,Et=be.fullScreen,mt=be.insertTemp,Bt=be.hidetoolBar,Ut=be.uuid,Tt=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(p.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(p.F)("_educoder_session"),"&key=").concat(Ut,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var kt=[].concat(_,[{title:"".concat(Be?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Be?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!Bt&&kt.map(function(zt,$t){return g.a.createElement("li",{key:$t},zt.actionName?g.a.createElement(E,Object(A.a)({},zt,{onActionCallback:ut})):g.a.createElement("span",{className:"v-line"}))}),$e?g.a.createElement("li",null,g.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ut},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,mt&&g.a.createElement("li",null,g.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(mt),onActionCallback:ut},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(E,{icon:"".concat(Et?"icon-shrink":"icon-enlarge"),title:Et?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ut})))},U=G("M8RZ"),B=G("+L6B"),L=G("2/Rp"),H=G("y8nQ"),j=G("Vl3Y"),S=G("5NDa"),J=G("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},se=function(be){var Be=be.callback,$e=be.onCancel;function ut(Et){Be(Et)}return g.a.createElement(j.a,Object(A.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ut}),g.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(J.a,null)),g.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(J.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(L.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))},fe=G("7ahc"),Fe=G("HmJG"),Le=G("BjJ7"),De=j.a.useForm,He={width:280,marginRight:10},We={labelCol:{span:5},wrapperCol:{span:19}},ye=function(be){var Be=be.callback,$e=be.onCancel,ut=De(),Et=Object(K.a)(ut,1),mt=Et[0];function Bt(kt){Be(kt)}function Ut(kt,zt){if(kt.status===-1){I.b.error(kt.message);return}mt.setFieldsValue({src:"/api/attachments/".concat(kt.id),type:zt.type})}function Tt(kt){var zt=kt.target.files[0];Ye(zt,Ut)}return g.a.createElement(j.a,Object(A.a)({form:mt},We,{className:"upload-image-panel",onFinish:Bt}),g.a.createElement(j.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(j.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},g.a.createElement(J.a,{style:He})),g.a.createElement(ue,{onFileChange:Tt}))),g.a.createElement(j.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(J.a,{style:{width:264}})),g.a.createElement(j.a.Item,{style:{textAlign:"right"}},g.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(L.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))};function ue(be){var Be=be.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:Be}))}function Ye(be,Be){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var $e=new FormData;$e.append("editormd-image-file",be),$e.append("file_param_name","editormd-image-file"),$e.append("byxhr","true");var ut=new window.XMLHttpRequest;ut.withCredentials=!0,ut.addEventListener("load",function(Et){Be(JSON.parse(Et.target.responseText),be)},!1),ut.addEventListener("error",function(Et){console.error(Et)},!1),ut.open("POST","".concat(Le.a,"/api/attachments.json")),ut.send($e)}var vt=G("giR+"),ct=G("fyUT"),it=G("7Kak"),ft=G("9yH6"),Qe=ft.a.Group,qe={margin:"0 8px"},ht=function(be){var Be=be.callback,$e=be.onCancel;function ut(Et){Be(Et)}return g.a.createElement(j.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ut},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:qe},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:qe},"\u884C\u6570"),g.a.createElement(j.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(ct.a,null)),g.a.createElement("span",{style:qe},"\u5217\u6570"),g.a.createElement(j.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(ct.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:qe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(j.a.Item,{name:"align"},g.a.createElement(Qe,null,g.a.createElement(ft.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(ft.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(ft.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(ft.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(L.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))},de=G("ErOA"),Ie=G("7Cbv"),Pe="link",Ke="upload-image",st="code-block",at="add-table",et="------------",tt={default:et,left:":".concat(et),center:":".concat(et,":"),right:"".concat(et,":")},dt=G("9VGf"),yt,Ae;function Se(){}var Ve=0,Je=1e4,Ne="\u2581",je=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ee(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var he=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=he?"Cmd":"Ctrl",re=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],oe=(yt={},Object(N.a)(yt,pe+"-B","bold"),Object(N.a)(yt,pe+"-I","italic"),yt),le=(Ae={},Object(N.a)(Ae,Pe,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(Ae,st,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(Ae,Ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(N.a)(Ae,at,"\u6DFB\u52A0\u8868\u683C"),Ae),me=ve.a=function(be){var Be=be.defaultValue,$e=Be===void 0?"":Be,ut=be.onChange,Et=be.width,mt=Et===void 0?"100%":Et,Bt=be.height,Ut=Bt===void 0?400:Bt,Tt=be.miniToolbar,kt=Tt===void 0?!1:Tt,zt=be.isFocus,$t=zt===void 0?!1:zt,vn=be.watch,Ft=be.insertTemp,an=be.mode,nn=an===void 0?"markdown":an,ot=be.id,en=ot===void 0?"markdown-editor-id":ot,It=be.showResizeBar,Rt=It===void 0?!1:It,Mt=be.noStorage,On=Mt===void 0?!1:Mt,ln=be.showNullButton,un=ln===void 0?!1:ln,Lt=be.hidetoolBar,ar=Lt===void 0?!1:Lt,In=be.fullScreen,Nn=In===void 0?!1:In,tn=be.onBlur,Fn=be.onCMBeforeChange,dr=be.onFullScreen,gr=be.className,pt=gr===void 0?"":gr,Gt=be.disablePaste,kr=Gt===void 0?!1:Gt,Hr=be.placeholder,ri=Hr===void 0?"":Hr,Wr=be.values,$=Wr===void 0?"":Wr,O=Object(y.useState)(null),M=Object(K.a)(O,2),W=M[0],ee=M[1],Y=Object(y.useState)($e),Ce=Object(K.a)(Y,2),rt=Ce[0],wt=Ce[1],Pt=Object(y.useState)(vn),lt=Object(K.a)(Pt,2),Kt=lt[0],Jt=lt[1],jn=Object(y.useState)(Nn),xr=Object(K.a)(jn,2),vr=xr[0],Jn=xr[1],ii=Object(y.useState)(""),wi=Object(K.a)(ii,2),or=wi[0],Kr=wi[1],yi=Object(y.useState)(0),ai=Object(K.a)(yi,2),Tr=ai[0],Ai=ai[1],Si=Object(y.useState)(Ut),Ri=Object(K.a)(Si,2),Ni=Ri[0],oi=Ri[1],hr=Object(y.useState)(!1),pi=Object(K.a)(hr,2),Ui=pi[0],mi=pi[1],Mn=Object(y.useRef)(Object(Ie.a)()),on=Object(y.useRef)(!1),Vn=Object(y.useRef)(),cn=Object(y.useRef)(),Qn=Object(y.useRef)(),An=Object(y.useRef)(),si=Object(y.useRef)(),fr=function(){var jt=Object(k.a)(D.a.mark(function Qt(){var Wt,sn;return D.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(de.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Mn.current}});case 2:sn=Bn.sent,sn!=null&&(Wt=sn.attachments)!==null&&Wt!==void 0&&Wt.length&&(console.log("cm:",W,cn),sn.attachments.map(function(En){En.content_type.indexOf("image")>-1?W.replaceSelection(".concat(En.content_type,")")):En.content_type.indexOf("video")>-1?W.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):En.content_type.indexOf("pdf")>-1?W.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,'&disposition=inline" target="_blank">').concat(En.name,"</a>")):W.replaceSelection("[".concat(En.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,")"))}));case 4:case"end":return Bn.stop()}},Qt)}));return function(){return jt.apply(this,arguments)}}();Object(y.useEffect)(function(){wt($),W==null||W.setValue($)},[$]),Object(y.useEffect)(function(){dr==null||dr(vr)},[vr]),Object(y.useEffect)(function(){if(cn.current){var jt=c.a.fromTextArea(cn.current,{mode:nn,lineNumbers:!kt,lineWrapping:!0,value:$e,autoCloseTags:!0,autoCloseBrackets:!0});$t&&jt.focus();function Qt(Wt,sn){if(kr){sn.preventDefault();return}var bn=sn.clipboardData;if(bn){var Bn=bn.types.toString(),En=bn.items;if(Bn==="Files"||bn.types.indexOf("Files")>-1){if(sn.preventDefault(),nn=="stex")return;try{var tr,Pr=En[1];((tr=En[0])===null||tr===void 0?void 0:tr.kind)==="file"&&(Pr=En[0]);var fn=Pr.getAsFile(),ui=fn.name.split(".").pop();Ye(fn,function(kn){if(kn.id){var yr,Sr,Qr;(fn==null||((yr=fn.type)===null||yr===void 0)?void 0:yr.indexOf("image"))>-1?jt.replaceSelection(".concat(kn.content_type,")")):(fn==null||((Sr=fn.type)===null||Sr===void 0)?void 0:Sr.indexOf("video"))>-1?jt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,'"></video>')):(fn==null||((Qr=fn.type)===null||Qr===void 0)?void 0:Qr.indexOf("pdf"))>-1?jt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):re.includes(ui)?jt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):jt.replaceSelection("[".concat(fn.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(kn.content_type,")"))}else(kn==null?void 0:kn.status)===401&&(document.location.href="/user/login")})}catch(kn){I.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return jt.on("paste",Qt),jt.on("dragleave",function(Wt,sn){Qn.current.classList.remove("mouse-hover-md")}),jt.on("dragover",function(Wt,sn){Qn.current.classList.add("mouse-hover-md")}),jt.on("drop",function(Wt,sn){Qn.current.classList.add("mouse-hover-md");var bn;if(bn=sn.dataTransfer.files,bn.length>0){sn.preventDefault(),sn.stopPropagation();for(var Bn=function(Pr){var fn=bn[Pr],ui=fn.name.split(".").pop();Ye(fn,function(kn){if(kn.id){var yr,Sr,Qr;(fn==null||((yr=fn.type)===null||yr===void 0)?void 0:yr.indexOf("image"))>-1?jt.replaceSelection(".concat(kn.content_type,")")):(fn==null||((Sr=fn.type)===null||Sr===void 0)?void 0:Sr.indexOf("video"))>-1?jt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,'"></video>')):(fn==null||((Qr=fn.type)===null||Qr===void 0)?void 0:Qr.indexOf("pdf"))>-1?jt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):re.includes(ui)?jt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):jt.replaceSelection("[".concat(fn.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(kn.content_type,")"))}else(kn==null?void 0:kn.status)===401&&(document.location.href="/user/login")})},En=0;En<bn.length;En++)Bn(En)}}),ee(jt),function(){jt.off("paste",Qt)}}},[]);var wr=Object(y.useCallback)(function(){if(Qn.current)try{}catch(jt){console.log(jt,"---- to set md editor body height")}},[Ni,Qn,vr]);Object(y.useEffect)(function(){function jt(){var Wt=new s.default(function(sn){var bn=Object(P.a)(sn),Bn;try{for(bn.s();!(Bn=bn.n()).done;){var En=Bn.value;(En.target.offsetHeight>0||En.target.offsetWidth>0)&&(wr(),W.setSize("100%","100%"),W.refresh())}}catch(tr){bn.e(tr)}finally{bn.f()}});return Wt.observe(cn.current.parentElement),Wt}if(W){var Qt=jt();return function(){Qt.unobserve(cn.current.parentElement)}}},[W,wr]),Object(y.useEffect)(function(){if(W){for(var jt=[],Qt=function(){var En=sn[Wt];bn=Object(K.a)(En,2);var tr=bn[0],Pr=bn[1],fn=Object(N.a)({},tr,function(){Ci(Pr)});jt.push(fn),W.addKeyMap(fn)},Wt=0,sn=Object.entries(oe);Wt<sn.length;Wt++){var bn;Qt()}return Vn.current=setInterval(function(){on.current&&fr()},4e3),function(){clearInterval(Vn.current);var Bn=Object(P.a)(jt),En;try{for(Bn.s();!(En=Bn.n()).done;){var tr=En.value;W.removeKeyMap(tr)}}catch(Pr){Bn.e(Pr)}finally{Bn.f()}}}},[W]),Object(y.useEffect)(function(){Nn!==vr&&Jn(Nn)},[Nn]),Object(dt.a)(function(){if(!On&&Tr>0){var jt=new Date().getTime(),Qt=window.sessionStorage.getItem(en);jt>=Tr+Je&&(!Qt||Qt!==rt)&&(window.sessionStorage.setItem(en,rt),mi(!0))}},Je),Object(y.useEffect)(function(){Jt(vn)},[W,vn]),Object(y.useEffect)(function(){W&&($t&&W.focus())},[W,$t]),Object(y.useEffect)(function(){if(Kt&&W){var jt=W.getScrollerElement();function Qt(Wt){var sn=Wt.target;if(si.current){var bn=sn.scrollTop/sn.scrollHeight;si.current.scrollTop=si.current.scrollHeight*bn}}return jt.addEventListener("scroll",Qt),function(){jt.removeEventListener("scroll",Qt)}}},[W,Kt]),Object(y.useEffect)(function(){if(W&&Fn){function jt(Qt,Wt){Fn(Qt,Wt)}return W.on("beforeChange",jt),function(){W.off("beforeChange",jt)}}},[W,Fn]),Object(y.useEffect)(function(){if(W&&tn){function jt(){tn(W.getValue())}return W.on("blur",jt),function(){W.off("blur",jt)}}},[W,tn]),Object(y.useEffect)(function(){if(W){function jt(Qt){var Wt=Qt.getValue();wt(Wt),Ai(new Date().getTime()),Qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ut&&ut(Wt)}return W.on("change",jt),function(){W.off("change",jt)}}},[W,ut]),Object(y.useEffect)(function(){W&&($e==null?(W.setValue(""),wt("")):$e!==W.getValue()&&(W.setValue($e),wt($e),W.setCursor(W.lineCount(),0)))},[W,$e]);var Ci=Object(y.useCallback)(function(jt){var Qt=W.getCursor(),Wt=W.getSelection(),sn=Wt.split(`
|
|
`);switch(jt){case"bold":return W.replaceSelection("**"+Wt+"**"),Wt===""&&W.setCursor(Qt.line,Qt.ch+2),W.focus();case"italic":return W.replaceSelection("*"+Wt+"*"),Wt===""&&W.setCursor(Qt.line,Qt.ch+1),W.focus();case"code":return W.replaceSelection("`"+Wt+"`"),Wt===""&&W.setCursor(Qt.line,Qt.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+Wt+"$$`"),Wt===""&&W.setCursor(Qt.line,Qt.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+Wt+"\n```"),W.setCursor(Qt.line+1,Wt.length+1),W.focus();case"line-break":return W.replaceSelection(`<br/>
|
|
`),W.focus();case"list-ul":return Wt===""?W.replaceSelection("- "+Wt):W.replaceSelection(sn.map(function(bn){return bn===""?"":"- ".concat(bn)}).join(`
|
|
`)),W.focus();case"list-ol":return Wt===""?W.replaceSelection("1. "+Wt):W.replaceSelection(sn.map(function(bn,Bn){return bn===""?"":"".concat(Bn+1,". ").concat(bn)}).join(`
|
|
`)),W.focus();case"add-null-ch":return Wt===""&&W.setCursor(Qt.line,Qt.ch+1),W.replaceSelection(Ne),W.focus();case"inster-template-1":return Wt===""&&W.setCursor(Qt.line,Qt.ch),W.replaceSelection(je),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return Jt(!Kt),W.focus();case"trigger-full-screen":return Jn(!vr),W.focus();case Pe:Kr(Pe);return;case st:Kr(st);return;case Ke:Kr(Ke);return;case at:Kr(at);return;default:throw new Error}},[W,Kt,vr]),li=Object(y.useCallback)(function(jt){Kr("");switch(or){case Pe:var Qt=jt.title,Wt=jt.link;return W.replaceSelection("[".concat(Qt,"](").concat(Wt,")")),W.focus();case st:var sn=jt.language,bn=jt.content;return W.replaceSelection(["```"+sn,bn,"```"].join(`
|
|
`)),W.focus();case Ke:var Bn=jt.src,En=jt.alt;return En?W.replaceSelection(".concat(Bn,' "').concat(En,'" )')):W.replaceSelection("")),W.focus();case at:for(var tr=jt.row,Pr=jt.col,fn=jt.align,ui=`
|
|
`,kn=0;kn<tr;kn++){for(var yr=[],Sr=[],Qr=0;Qr<Pr;Qr++)kn===1&&Sr.push(tt[fn]),yr.push(" ");kn===1&&(ui+="| ".concat(Sr.join(" | "),` |
|
|
`)),ui+="| ".concat(yr.join(Pr===1?"":" | "),` |
|
|
`)}return W.replaceSelection(ui+`
|
|
`),W.focus();default:throw new Error}},[W,or]),gi=Object(y.useMemo)(function(){switch(or){case Pe:return g.a.createElement(se,{callback:li,onCancel:Fr});case st:return g.a.createElement(fe.b,{callback:li,onCancel:Fr});case Ke:return g.a.createElement(ye,{callback:li,onCancel:Fr});case at:return g.a.createElement(ht,{callback:li,onCancel:Fr});default:return null}},[or]);function Fr(){Kr("")}Object(y.useEffect)(function(){if(An.current){var jt=An.current,Qt=!1,Wt=0;function sn(En){Qt=!0,Wt=En.pageY}function bn(){Qt=!1}function Bn(En){if(Qt){var tr=En.pageY-Wt;tr<0&&(tr=0),tr>300&&(tr=300);var Pr=Ut+tr+"px";oi(Pr)}}return jt.addEventListener("mousedown",sn),document.addEventListener("mousemove",Bn),document.addEventListener("mouseup",bn),function(){jt.removeEventListener("mousedown",sn),document.removeEventListener("mousemove",Bn),document.removeEventListener("mouseup",bn)}}},[W,An]),Object(y.useEffect)(function(){oi(Ut)},[Ut]);var Gr=Ee(mt),Fi=Ee(Ni),$r={width:Gr,height:Fi},ji=Object(y.useMemo)(function(){if(Tr){var jt=new Date(Tr),Qt=jt.getHours(),Wt=jt.getMinutes(),sn=jt.getSeconds();return Qt=Qt<10?"0"+Qt:Qt,Wt=Wt<10?"0"+Wt:Wt,sn=sn<10?"0"+sn:sn,"".concat(Qt,":").concat(Wt,":").concat(sn)}return 0},[Tr]);function Li(){window.sessionStorage.removeItem(en),mi(!1),Ai(0)}function Jr(){mi(!1),Ai(0),W.setValue(window.sessionStorage.getItem(en))}function Ji(jt,Qt){var Wt=W.getValue();Wt=Wt.replace(jt,Qt),wt(Wt),W==null||W.setValue(Wt)}return g.a.createElement(y.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:Qn},g.a.createElement("div",{className:"markdown-editor-container ".concat(pt," ").concat(Kt?"on-preview":""," ").concat(kt?"mini":""," ").concat(vr?"full-screen":""),style:$r},g.a.createElement(x,{insertTemp:Ft,watch:Kt,fullScreen:vr,showNullButton:un,onActionCallback:Ci,hidetoolBar:ar,uuid:Mn.current,setOpenPhones:function(){on.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:cn,placeholder:ri})),Kt?g.a.createElement("div",{ref:si,className:"preview-container"},nn==="stex"&&g.a.createElement(R,{value:rt}),nn!=="stex"&&g.a.createElement(T.a,{edit:!0,value:rt,replaces:Ji})):null))),Rt?g.a.createElement("a",{ref:An,className:"editor-resize"}):null,g.a.createElement(U.a,null,le[or]?g.a.createElement(V.a,{centered:!0,title:le[or],visible:!0,onCancel:Fr,footer:null,className:"markdown-popup-form"},gi):null))}},"SA+Z":function(xt,ve,G){var Z=G("wTVA"),V=G("EbDI"),P=G("ZhPi"),z=G("wkBT");function I(k){return Z(k)||V(k)||P(k)||z()}xt.exports=I,xt.exports.__esModule=!0,xt.exports.default=xt.exports},SJMd:function(xt,ve){/**
|
|
* @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 G,Z,V,P=!1,z,I;window.PR_SHOULD_USE_CONTINUATION=!0;var k,K;(function(){var N=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"],g=[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"],m=[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"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",d=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="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",l=[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"],o=[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"],a=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[g,c,m,d,u,l,o,a],w=/^(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",R="kwd",A="com",v="typ",b="lit",p="pun",h="pln",_="tag",E="dec",x="src",U="atn",B="atv",L="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(Qe){for(var qe=0,ht=!1,de=!1,Ie=0,Pe=Qe.length;Ie<Pe;++Ie){var Ke=Qe[Ie];if(Ke.ignoreCase)de=!0;else if(/[a-z]/i.test(Ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ht=!0,de=!1;break}}var st={b:8,t:9,n:10,v:11,f:12,r:13};function at(Ae){var Se=Ae.charCodeAt(0);if(Se!==92)return Se;var Ve=Ae.charAt(1);return Se=st[Ve],Se||("0"<=Ve&&Ve<="7"?parseInt(Ae.substring(1),8):Ve==="u"||Ve==="x"?parseInt(Ae.substring(2),16):Ae.charCodeAt(1))}function et(Ae){if(Ae<32)return(Ae<16?"\\x0":"\\x")+Ae.toString(16);var Se=String.fromCharCode(Ae);return Se==="\\"||Se==="-"||Se==="]"||Se==="^"?"\\"+Se:Se}function tt(Ae){var Se=Ae.substring(1,Ae.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ve=[],Je=Se[0]==="^",Ne=["["];Je&&Ne.push("^");for(var je=Je?1:0,Ee=Se.length;je<Ee;++je){var he=Se[je];if(/\\[bdsw]/i.test(he))Ne.push(he);else{var pe=at(he),re;je+2<Ee&&Se[je+1]==="-"?(re=at(Se[je+2]),je+=2):re=pe,Ve.push([pe,re]),re<65||pe>122||(re<65||pe>90||Ve.push([Math.max(65,pe)|32,Math.min(re,90)|32]),re<97||pe>122||Ve.push([Math.max(97,pe)&~32,Math.min(re,122)&~32]))}}Ve.sort(function(be,Be){return be[0]-Be[0]||Be[1]-be[1]});for(var oe=[],le=[],je=0;je<Ve.length;++je){var me=Ve[je];me[0]<=le[1]+1?le[1]=Math.max(le[1],me[1]):oe.push(le=me)}for(var je=0;je<oe.length;++je){var me=oe[je];Ne.push(et(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&Ne.push("-"),Ne.push(et(me[1])))}return Ne.push("]"),Ne.join("")}function dt(Ae){for(var Se=Ae.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ve=Se.length,Je=[],Ne=0,je=0;Ne<Ve;++Ne){var Ee=Se[Ne];if(Ee==="(")++je;else if(Ee.charAt(0)==="\\"){var he=+Ee.substring(1);he&&(he<=je?Je[he]=-1:Se[Ne]=et(he))}}for(var Ne=1;Ne<Je.length;++Ne)Je[Ne]===-1&&(Je[Ne]=++qe);for(var Ne=0,je=0;Ne<Ve;++Ne){var Ee=Se[Ne];if(Ee==="(")++je,Je[je]||(Se[Ne]="(?:");else if(Ee.charAt(0)==="\\"){var he=+Ee.substring(1);he&&he<=je&&(Se[Ne]="\\"+Je[he])}}for(var Ne=0;Ne<Ve;++Ne)Se[Ne]==="^"&&Se[Ne+1]!=="^"&&(Se[Ne]="");if(Ae.ignoreCase&&ht)for(var Ne=0;Ne<Ve;++Ne){var Ee=Se[Ne],pe=Ee.charAt(0);Ee.length>=2&&pe==="["?Se[Ne]=tt(Ee):pe!=="\\"&&(Se[Ne]=Ee.replace(/[a-zA-Z]/g,function(le){var me=le.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Se.join("")}for(var yt=[],Ie=0,Pe=Qe.length;Ie<Pe;++Ie){var Ke=Qe[Ie];if(Ke.global||Ke.multiline)throw new Error(""+Ke);yt.push("(?:"+dt(Ke)+")")}return new RegExp(yt.join("|"),de?"gi":"g")}function S(Qe,qe){var ht=/(?:^|\s)nocode(?:\s|$)/,de=[],Ie=0,Pe=[],Ke=0;function st(at){var et=at.nodeType;if(et==1){if(ht.test(at.className))return;for(var tt=at.firstChild;tt;tt=tt.nextSibling)st(tt);var dt=at.nodeName.toLowerCase();(dt==="br"||dt==="li")&&(de[Ke]=`
|
|
`,Pe[Ke<<1]=Ie++,Pe[Ke++<<1|1]=at)}else if(et==3||et==4){var yt=at.nodeValue;yt.length&&(qe?yt=yt.replace(/\r\n?/g,`
|
|
`):yt=yt.replace(/[ \t\r\n]+/g," "),de[Ke]=yt,Pe[Ke<<1]=Ie,Ie+=yt.length,Pe[Ke++<<1|1]=at)}}return st(Qe),{sourceCode:de.join("").replace(/\n$/,""),spans:Pe}}function J(Qe,qe,ht,de,Ie){if(!ht)return;var Pe={sourceNode:Qe,pre:1,langExtension:null,numberLines:null,sourceCode:ht,spans:null,basePos:qe,decorations:null};de(Pe),Ie.push.apply(Ie,Pe.decorations)}var te=/\S/;function se(Qe){for(var qe=void 0,ht=Qe.firstChild;ht;ht=ht.nextSibling){var de=ht.nodeType;qe=de===1?qe?Qe:ht:de===3&&te.test(ht.nodeValue)?Qe:qe}return qe===Qe?void 0:qe}function fe(Qe,qe){var ht={},de;(function(){for(var Ke=Qe.concat(qe),st=[],at={},et=0,tt=Ke.length;et<tt;++et){var dt=Ke[et],yt=dt[3];if(yt)for(var Ae=yt.length;--Ae>=0;)ht[yt.charAt(Ae)]=dt;var Se=dt[1],Ve=""+Se;at.hasOwnProperty(Ve)||(st.push(Se),at[Ve]=null)}st.push(/[\0-\uffff]/),de=j(st)})();var Ie=qe.length,Pe=function(Ke){for(var st=Ke.sourceCode,at=Ke.basePos,et=Ke.sourceNode,tt=[at,h],dt=0,yt=st.match(de)||[],Ae={},Se=0,Ve=yt.length;Se<Ve;++Se){var Je=yt[Se],Ne=Ae[Je],je=void 0,Ee;if(typeof Ne=="string")Ee=!1;else{var he=ht[Je.charAt(0)];if(he)je=Je.match(he[1]),Ne=he[0];else{for(var pe=0;pe<Ie;++pe)if(he=qe[pe],je=Je.match(he[1]),je){Ne=he[0];break}je||(Ne=h)}Ee=Ne.length>=5&&Ne.substring(0,5)==="lang-",Ee&&!(je&&typeof je[1]=="string")&&(Ee=!1,Ne=x),Ee||(Ae[Je]=Ne)}var re=dt;if(dt+=Je.length,!Ee)tt.push(at+re,Ne);else{var oe=je[1],le=Je.indexOf(oe),me=le+oe.length;je[2]&&(me=Je.length-je[2].length,le=me-oe.length);var be=Ne.substring(5);J(et,at+re,Je.substring(0,le),Pe,tt),J(et,at+re+le,oe,ue(be,oe),tt),J(et,at+re+me,Je.substring(me),Pe,tt)}}Ke.decorations=tt};return Pe}function Fe(Qe){var qe=[],ht=[];Qe.tripleQuotedStrings?qe.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Qe.multiLineStrings?qe.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):qe.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Qe.verbatimStrings&&ht.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var de=Qe.hashComments;de&&(Qe.cStyleComments?(de>1?qe.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):qe.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ht.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):qe.push([A,/^#[^\r\n]*/,null,"#"])),Qe.cStyleComments&&(ht.push([A,/^\/\/[^\r\n]*/,null]),ht.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=Qe.regexLiterals;if(Ie){var Pe=Ie>1?"":`
|
|
\r`,Ke=Pe?".":"[\\S\\s]",st="/(?=[^/*"+Pe+"])(?:[^/\\x5B\\x5C"+Pe+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+Pe+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";ht.push(["lang-regex",RegExp("^"+H+"("+st+")")])}var at=Qe.types;at&&ht.push([v,at]);var et=(""+Qe.keywords).replace(/^ | $/g,"");et.length&&ht.push([R,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),qe.push([h,/^\s+/,null,` \r
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return Qe.regexLiterals&&(tt+="(?!s*/)"),ht.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[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(tt),null]),fe(qe,ht)}var Le=Fe({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function De(Qe,qe,ht){for(var de=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,Pe=Qe.ownerDocument,Ke=Pe.createElement("li");Qe.firstChild;)Ke.appendChild(Qe.firstChild);var st=[Ke];function at(Se){var Ve=Se.nodeType;if(Ve==1&&!de.test(Se.className))if(Se.nodeName==="br")et(Se),Se.parentNode&&Se.parentNode.removeChild(Se);else for(var Je=Se.firstChild;Je;Je=Je.nextSibling)at(Je);else if((Ve==3||Ve==4)&&ht){var Ne=Se.nodeValue,je=Ne.match(Ie);if(je){var Ee=Ne.substring(0,je.index);Se.nodeValue=Ee;var he=Ne.substring(je.index+je[0].length);if(he){var pe=Se.parentNode;pe.insertBefore(Pe.createTextNode(he),Se.nextSibling)}et(Se),Ee||Se.parentNode.removeChild(Se)}}}function et(Se){for(;!Se.nextSibling;)if(Se=Se.parentNode,!Se)return;function Ve(je,Ee){var he=Ee?je.cloneNode(!1):je,pe=je.parentNode;if(pe){var re=Ve(pe,1),oe=je.nextSibling;re.appendChild(he);for(var le=oe;le;le=oe)oe=le.nextSibling,re.appendChild(le)}return he}for(var Je=Ve(Se.nextSibling,0),Ne;(Ne=Je.parentNode)&&Ne.nodeType===1;)Je=Ne;st.push(Je)}for(var tt=0;tt<st.length;++tt)at(st[tt]);qe===(qe|0)&&st[0].setAttribute("value",qe);var dt=Pe.createElement("ol");dt.className="linenums";for(var yt=Math.max(0,qe-1|0)||0,tt=0,Ae=st.length;tt<Ae;++tt)Ke=st[tt],Ke.className="L"+(tt+yt)%10,Ke.firstChild||Ke.appendChild(Pe.createTextNode("\xA0")),dt.appendChild(Ke);Qe.appendChild(dt)}function He(Qe){var qe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);qe=qe&&+qe[1]<=8;var ht=/\n/g,de=Qe.sourceCode,Ie=de.length,Pe=0,Ke=Qe.spans,st=Ke.length,at=0,et=Qe.decorations,tt=et.length,dt=0;et[tt]=Ie;var yt,Ae;for(Ae=yt=0;Ae<tt;)et[Ae]!==et[Ae+2]?(et[yt++]=et[Ae++],et[yt++]=et[Ae++]):Ae+=2;for(tt=yt,Ae=yt=0;Ae<tt;){for(var Se=et[Ae],Ve=et[Ae+1],Je=Ae+2;Je+2<=tt&&et[Je+1]===Ve;)Je+=2;et[yt++]=Se,et[yt++]=Ve,Ae=Je}tt=et.length=yt;var Ne=Qe.sourceNode,je="";Ne&&(je=Ne.style.display,Ne.style.display="none");try{for(var Ee=null;at<st;){var he=Ke[at],pe=Ke[at+2]||Ie,re=et[dt+2]||Ie,Je=Math.min(pe,re),oe=Ke[at+1],le;if(oe.nodeType!==1&&(le=de.substring(Pe,Je))){qe&&(le=le.replace(ht,"\r")),oe.nodeValue=le;var me=oe.ownerDocument,be=me.createElement("span");be.className=et[dt+1];var Be=oe.parentNode;Be.replaceChild(be,oe),be.appendChild(oe),Pe<pe&&(Ke[at+1]=oe=me.createTextNode(de.substring(Je,pe)),Be.insertBefore(oe,be.nextSibling))}Pe=Je,Pe>=pe&&(at+=2),Pe>=re&&(dt+=2)}}finally{Ne&&(Ne.style.display=je)}}var We={};function ye(Qe,qe){for(var ht=qe.length;--ht>=0;){var de=qe[ht];We.hasOwnProperty(de)?N.console&&console.warn("cannot override language handler %s",de):We[de]=Qe}}function ue(Qe,qe){return Qe&&We.hasOwnProperty(Qe)||(Qe=/^\s*</.test(qe)?"default-markup":"default-code"),We[Qe]}ye(Le,["default-code"]),ye(fe([],[[h,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\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"]),ye(fe([[h,/^[\s]+/,null,` \r
|
|
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!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"]),ye(fe([],[[B,/^[\s\S]+/]]),["uq.val"]),ye(Fe({keywords:g,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),ye(Fe({keywords:"null,true,false"}),["json"]),ye(Fe({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),ye(Fe({keywords:m,cStyleComments:!0}),["java"]),ye(Fe({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(Fe({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(Fe({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(Fe({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(Fe({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(Fe({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(fe([],[[T,/^[\s\S]+/]]),["regex"]);function Ye(Qe){var qe=Qe.langExtension;try{var ht=S(Qe.sourceNode,Qe.pre),de=ht.sourceCode;Qe.sourceCode=de,Qe.spans=ht.spans,Qe.basePos=0,ue(qe,de)(Qe),He(Qe)}catch(Ie){N.console&&console.log(Ie&&Ie.stack||Ie)}}function vt(Qe,qe,ht){var de=ht||!1,Ie=qe||null,Pe=document.createElement("div");Pe.innerHTML="<pre>"+Qe+"</pre>",Pe=Pe.firstChild,de&&De(Pe,de,!0);var Ke={langExtension:Ie,numberLines:de,sourceNode:Pe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ye(Ke),Pe.innerHTML}function ct(Qe,qe){var ht=qe||document.body,de=ht.ownerDocument||document;function Ie(he){return ht.getElementsByTagName(he)}for(var Pe=[Ie("pre"),Ie("code"),Ie("xmp")],Ke=[],st=0;st<Pe.length;++st)for(var at=0,et=Pe[st].length;at<et;++at)Ke.push(Pe[st][at]);Pe=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var dt=0,yt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ae=/\bprettyprint\b/,Se=/\bprettyprinted\b/,Ve=/pre|xmp/i,Je=/^code$/i,Ne=/^(?:pre|code|xmp)$/i,je={};function Ee(){for(var he=N.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;dt<Ke.length&&tt.now()<he;dt++){for(var pe=Ke[dt],re=je,oe=pe;oe=oe.previousSibling;){var le=oe.nodeType,me=(le===7||le===8)&&oe.nodeValue;if(me?!/^\??prettify\b/.test(me):le!==3||/\S/.test(oe.nodeValue))break;if(me){re={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vn,Ft,an){re[Ft]=an});break}}var be=pe.className;if((re!==je||Ae.test(be))&&!Se.test(be)){for(var Be=!1,$e=pe.parentNode;$e;$e=$e.parentNode){var ut=$e.tagName;if(Ne.test(ut)&&$e.className&&Ae.test($e.className)){Be=!0;break}}if(!Be){pe.className+=" prettyprinted";var Et=re.lang;if(!Et){Et=be.match(yt);var mt;!Et&&(mt=se(pe))&&Je.test(mt.tagName)&&(Et=mt.className.match(yt)),Et&&(Et=Et[1])}var Bt;if(Ve.test(pe.tagName))Bt=1;else{var Ut=pe.currentStyle,Tt=de.defaultView,kt=Ut?Ut.whiteSpace:Tt&&Tt.getComputedStyle?Tt.getComputedStyle(pe,null).getPropertyValue("white-space"):0;Bt=kt&&kt.substring(0,3)==="pre"}var zt=re.linenums;(zt=zt==="true"||+zt)||(zt=be.match(/\blinenums\b(?::(\d+))?/),zt=zt?zt[1]&&zt[1].length?+zt[1]:!0:!1),zt&&De(pe,zt,Bt);var $t={langExtension:Et,sourceNode:pe,numberLines:zt,pre:Bt,sourceCode:null,basePos:null,spans:null,decorations:null};Ye($t)}}}dt<Ke.length?N.setTimeout(Ee,250):typeof Qe=="function"&&Qe()}Ee()}var it=N.PR={createSimpleLexer:fe,registerLangHandler:ye,sourceDecorator:Fe,PR_ATTRIB_NAME:U,PR_ATTRIB_VALUE:B,PR_COMMENT:A,PR_DECLARATION:E,PR_KEYWORD:R,PR_LITERAL:b,PR_NOCODE:L,PR_PLAIN:h,PR_PUNCTUATION:p,PR_SOURCE:x,PR_STRING:T,PR_TAG:_,PR_TYPE:v,prettyPrintOne:P?N.prettyPrintOne=vt:k=vt,prettyPrint:K=P?N.prettyPrint=ct:K=ct},ft=N.define;typeof ft=="function"&&ft.amd&&ft("google-code-prettify",[],function(){return it})})()},T8No:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return K}),G.d(ve,"e",function(){return N}),G.d(ve,"c",function(){return p}),G.d(ve,"b",function(){return h}),G.d(ve,"d",function(){return _}),G.d(ve,"f",function(){return U});var Z=G("MNsG"),V=G("N0LK"),P=G("Cg/j");let z=Z.k||"";const I=new Map;I.set("false",!1),I.set("true",!0),I.set("isMac",Z.f),I.set("isLinux",Z.d),I.set("isWindows",Z.i),I.set("isWeb",Z.h),I.set("isMacNative",Z.f&&!Z.h),I.set("isEdge",z.indexOf("Edg/")>=0),I.set("isFirefox",z.indexOf("Firefox")>=0),I.set("isChrome",z.indexOf("Chrome")>=0),I.set("isSafari",z.indexOf("Safari")>=0);const k=Object.prototype.hasOwnProperty;class K{static has(L){return g.create(L)}static equals(L,H){return m.create(L,H)}static regex(L,H){return T.create(L,H)}static not(L){return u.create(L)}static and(...L){return v.create(L,null)}static or(...L){return b.create(L,null,!0)}static deserialize(L,H=!1){return L?this._deserializeOrExpression(L,H):void 0}static _deserializeOrExpression(L,H){let j=L.split("||");return b.create(j.map(S=>this._deserializeAndExpression(S,H)),null,!0)}static _deserializeAndExpression(L,H){let j=L.split("&&");return v.create(j.map(S=>this._deserializeOne(S,H)),null)}static _deserializeOne(L,H){if(L=L.trim(),L.indexOf("!=")>=0){let j=L.split("!=");return d.create(j[0].trim(),this._deserializeValue(j[1],H))}if(L.indexOf("==")>=0){let j=L.split("==");return m.create(j[0].trim(),this._deserializeValue(j[1],H))}if(L.indexOf("=~")>=0){let j=L.split("=~");return T.create(j[0].trim(),this._deserializeRegexValue(j[1],H))}if(L.indexOf(" in ")>=0){let j=L.split(" in ");return c.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(L)){const j=L.split(">=");return a.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(L)){const j=L.split(">");return o.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(L)){const j=L.split("<=");return w.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(L)){const j=L.split("<");return C.create(j[0].trim(),j[1].trim())}return/^\!\s*/.test(L)?u.create(L.substr(1).trim()):g.create(L)}static _deserializeValue(L,H){if(L=L.trim(),L==="true")return!0;if(L==="false")return!1;let j=/^'([^']*)'$/.exec(L);return j?j[1].trim():L}static _deserializeRegexValue(L,H){if(Object(V.C)(L)){if(H)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let j=L.indexOf("/"),S=L.lastIndexOf("/");if(j===S||j<0){if(H)throw new Error(`bad regexp-value '${L}', missing /-enclosure`);return console.warn(`bad regexp-value '${L}', missing /-enclosure`),null}let J=L.slice(j+1,S),te=L[S+1]==="i"?"i":"";try{return new RegExp(J,te)}catch(se){if(H)throw new Error(`bad regexp-value '${L}', parse error: ${se}`);return console.warn(`bad regexp-value '${L}', parse error: ${se}`),null}}}function N(L,H){const j=L?L.substituteConstants():void 0,S=H?H.substituteConstants():void 0;return!j&&!S?!0:!j||!S?!1:j.equals(S)}function n(L,H){return L.cmp(H)}class D{constructor(){this.type=0}cmp(L){return this.type-L.type}equals(L){return L.type===this.type}substituteConstants(){return this}evaluate(L){return!1}serialize(){return"false"}keys(){return[]}negate(){return y.INSTANCE}}D.INSTANCE=new D;class y{constructor(){this.type=1}cmp(L){return this.type-L.type}equals(L){return L.type===this.type}substituteConstants(){return this}evaluate(L){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}y.INSTANCE=new y;class g{constructor(L,H){this.key=L,this.negated=H,this.type=2}static create(L,H=null){const j=I.get(L);return typeof j=="boolean"?j?y.INSTANCE:D.INSTANCE:new g(L,H)}cmp(L){return L.type!==this.type?this.type-L.type:E(this.key,L.key)}equals(L){return L.type===this.type?this.key===L.key:!1}substituteConstants(){const L=I.get(this.key);return typeof L=="boolean"?L?y.INSTANCE:D.INSTANCE:this}evaluate(L){return!!L.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this)),this.negated}}class m{constructor(L,H,j){this.key=L,this.value=H,this.negated=j,this.type=4}static create(L,H,j=null){if(typeof H=="boolean")return H?g.create(L,j):u.create(L,j);const S=I.get(L);if(typeof S=="boolean"){const J=S?"true":"false";return H===J?y.INSTANCE:D.INSTANCE}return new m(L,H,j)}cmp(L){return L.type!==this.type?this.type-L.type:x(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){const L=I.get(this.key);if(typeof L=="boolean"){const H=L?"true":"false";return this.value===H?y.INSTANCE:D.INSTANCE}return this}evaluate(L){return L.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(L,H){this.key=L,this.valueKey=H,this.type=10,this.negated=null}static create(L,H){return new c(L,H)}cmp(L){return L.type!==this.type?this.type-L.type:x(this.key,this.valueKey,L.key,L.valueKey)}equals(L){return L.type===this.type?this.key===L.key&&this.valueKey===L.valueKey:!1}substituteConstants(){return this}evaluate(L){const H=L.getValue(this.valueKey),j=L.getValue(this.key);return Array.isArray(H)?H.indexOf(j)>=0:typeof j=="string"&&typeof H=="object"&&H!==null?k.call(H,j):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=s.create(this)),this.negated}}class s{constructor(L){this._actual=L,this.type=11}static create(L){return new s(L)}cmp(L){return L.type!==this.type?this.type-L.type:this._actual.cmp(L._actual)}equals(L){return L.type===this.type?this._actual.equals(L._actual):!1}substituteConstants(){return this}evaluate(L){return!this._actual.evaluate(L)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(L,H,j){this.key=L,this.value=H,this.negated=j,this.type=5}static create(L,H,j=null){if(typeof H=="boolean")return H?u.create(L,j):g.create(L,j);const S=I.get(L);if(typeof S=="boolean"){const J=S?"true":"false";return H===J?D.INSTANCE:y.INSTANCE}return new d(L,H,j)}cmp(L){return L.type!==this.type?this.type-L.type:x(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){const L=I.get(this.key);if(typeof L=="boolean"){const H=L?"true":"false";return this.value===H?D.INSTANCE:y.INSTANCE}return this}evaluate(L){return L.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class u{constructor(L,H){this.key=L,this.negated=H,this.type=3}static create(L,H=null){const j=I.get(L);return typeof j=="boolean"?j?D.INSTANCE:y.INSTANCE:new u(L,H)}cmp(L){return L.type!==this.type?this.type-L.type:E(this.key,L.key)}equals(L){return L.type===this.type?this.key===L.key:!1}substituteConstants(){const L=I.get(this.key);return typeof L=="boolean"?L?D.INSTANCE:y.INSTANCE:this}evaluate(L){return!L.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}function l(L,H){if(typeof L=="string"){const j=parseFloat(L);isNaN(j)||(L=j)}return typeof L=="string"||typeof L=="number"?H(L):D.INSTANCE}class o{constructor(L,H,j){this.key=L,this.value=H,this.negated=j,this.type=12}static create(L,H,j=null){return l(H,S=>new o(L,S,j))}cmp(L){return L.type!==this.type?this.type-L.type:x(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class a{constructor(L,H,j){this.key=L,this.value=H,this.negated=j,this.type=13}static create(L,H,j=null){return l(H,S=>new a(L,S,j))}cmp(L){return L.type!==this.type?this.type-L.type:x(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class C{constructor(L,H,j){this.key=L,this.value=H,this.negated=j,this.type=14}static create(L,H,j=null){return l(H,S=>new C(L,S,j))}cmp(L){return L.type!==this.type?this.type-L.type:x(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.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 w{constructor(L,H,j){this.key=L,this.value=H,this.negated=j,this.type=15}static create(L,H,j=null){return l(H,S=>new w(L,S,j))}cmp(L){return L.type!==this.type?this.type-L.type:x(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class T{constructor(L,H){this.key=L,this.regexp=H,this.type=7,this.negated=null}static create(L,H){return new T(L,H)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.key<L.key)return-1;if(this.key>L.key)return 1;const H=this.regexp?this.regexp.source:"",j=L.regexp?L.regexp.source:"";return H<j?-1:H>j?1:0}equals(L){if(L.type===this.type){const H=this.regexp?this.regexp.source:"",j=L.regexp?L.regexp.source:"";return this.key===L.key&&H===j}return!1}substituteConstants(){return this}evaluate(L){let H=L.getValue(this.key);return this.regexp?this.regexp.test(H):!1}serialize(){const L=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${L}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(L){this._actual=L,this.type=8}static create(L){return new R(L)}cmp(L){return L.type!==this.type?this.type-L.type:this._actual.cmp(L._actual)}equals(L){return L.type===this.type?this._actual.equals(L._actual):!1}substituteConstants(){return this}evaluate(L){return!this._actual.evaluate(L)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function A(L){let H=null;for(let j=0,S=L.length;j<S;j++){const J=L[j].substituteConstants();if(L[j]!==J&&H===null){H=[];for(let te=0;te<j;te++)H[te]=L[te]}H!==null&&(H[j]=J)}return H===null?L:H}class v{constructor(L,H){this.expr=L,this.negated=H,this.type=6}static create(L,H){return v._normalizeArr(L,H)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.expr.length<L.expr.length)return-1;if(this.expr.length>L.expr.length)return 1;for(let H=0,j=this.expr.length;H<j;H++){const S=n(this.expr[H],L.expr[H]);if(S!==0)return S}return 0}equals(L){if(L.type===this.type){if(this.expr.length!==L.expr.length)return!1;for(let H=0,j=this.expr.length;H<j;H++)if(!this.expr[H].equals(L.expr[H]))return!1;return!0}return!1}substituteConstants(){const L=A(this.expr);return L===this.expr?this:v.create(L,this.negated)}evaluate(L){for(let H=0,j=this.expr.length;H<j;H++)if(!this.expr[H].evaluate(L))return!1;return!0}static _normalizeArr(L,H){const j=[];let S=!1;for(const J of L){if(!J)continue;if(J.type===1){S=!0;continue}if(J.type===0)return D.INSTANCE;if(J.type===6){j.push(...J.expr);continue}j.push(J)}if(j.length===0&&S)return y.INSTANCE;if(j.length===0)return;if(j.length===1)return j[0];j.sort(n);for(let J=1;J<j.length;J++)j[J-1].equals(j[J])&&(j.splice(J,1),J--);if(j.length===1)return j[0];for(;j.length>1;){const J=j[j.length-1];if(J.type!==9)break;j.pop();const te=j.pop(),se=j.length===0,fe=b.create(J.expr.map(Fe=>v.create([Fe,te],null)),null,se);fe&&(j.push(fe),j.sort(n))}return j.length===1?j[0]:new v(j,H)}serialize(){return this.expr.map(L=>L.serialize()).join(" && ")}keys(){const L=[];for(let H of this.expr)L.push(...H.keys());return L}negate(){if(!this.negated){const L=[];for(let H of this.expr)L.push(H.negate());this.negated=b.create(L,this,!0)}return this.negated}}class b{constructor(L,H){this.expr=L,this.negated=H,this.type=9}static create(L,H,j){return b._normalizeArr(L,H,j)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.expr.length<L.expr.length)return-1;if(this.expr.length>L.expr.length)return 1;for(let H=0,j=this.expr.length;H<j;H++){const S=n(this.expr[H],L.expr[H]);if(S!==0)return S}return 0}equals(L){if(L.type===this.type){if(this.expr.length!==L.expr.length)return!1;for(let H=0,j=this.expr.length;H<j;H++)if(!this.expr[H].equals(L.expr[H]))return!1;return!0}return!1}substituteConstants(){const L=A(this.expr);return L===this.expr?this:b.create(L,this.negated,!1)}evaluate(L){for(let H=0,j=this.expr.length;H<j;H++)if(this.expr[H].evaluate(L))return!0;return!1}static _normalizeArr(L,H,j){let S=[],J=!1;if(L){for(let te=0,se=L.length;te<se;te++){const fe=L[te];if(!fe)continue;if(fe.type===0){J=!0;continue}if(fe.type===1)return y.INSTANCE;if(fe.type===9){S=S.concat(fe.expr);continue}S.push(fe)}if(S.length===0&&J)return D.INSTANCE;S.sort(n)}if(S.length===0)return;if(S.length===1)return S[0];for(let te=1;te<S.length;te++)S[te-1].equals(S[te])&&(S.splice(te,1),te--);if(S.length===1)return S[0];if(j){for(let te=0;te<S.length;te++)for(let se=te+1;se<S.length;se++)U(S[te],S[se])&&(S.splice(se,1),se--);if(S.length===1)return S[0]}return new b(S,H)}serialize(){return this.expr.map(L=>L.serialize()).join(" || ")}keys(){const L=[];for(let H of this.expr)L.push(...H.keys());return L}negate(){if(!this.negated){let L=[];for(let H of this.expr)L.push(H.negate());for(;L.length>1;){const H=L.shift(),j=L.shift(),S=[];for(const te of B(H))for(const se of B(j))S.push(v.create([te,se],null));const J=L.length===0;L.unshift(b.create(S,null,J))}this.negated=L[0]}return this.negated}}class p extends g{constructor(L,H,j){super(L,null);this._defaultValue=H,typeof j=="object"?p._info.push(Object.assign(Object.assign({},j),{key:L})):j!==!0&&p._info.push({key:L,description:j,type:H!=null?typeof H:void 0})}static all(){return p._info.values()}bindTo(L){return L.createKey(this.key,this._defaultValue)}getValue(L){return L.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(L){return m.create(this.key,L)}}p._info=[];const h=Object(P.c)("contextKeyService"),_="setContext";function E(L,H){return L<H?-1:L>H?1:0}function x(L,H,j,S){return L<j?-1:L>j?1:H<S?-1:H>S?1:0}function U(L,H){if(H.type===6&&L.type!==9&&L.type!==6){for(const J of H.expr)if(L.equals(J))return!0}const j=L.negate(),S=B(j).concat(B(H));S.sort(n);for(let J=0;J<S.length;J++){const te=S[J],se=te.negate();for(let fe=J+1;fe<S.length;fe++){const Fe=S[fe];if(se.equals(Fe))return!0}}return!1}function B(L){return L.type===9?L.expr:[L]}},TXwP:function(xt,ve,G){var Z,V;(function(){var P;(function(){"use strict";var I=[,,function(n){function D(m){this.__parent=m,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 m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(m))return!0;return!1},D.prototype.set_indent=function(m,c){this.is_empty()&&(this.__indent_count=m||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__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(m){this.__items.push(m);var c=m.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=m.length-c:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function y(m,c){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),c=c||"",m.indent_level>0&&(c=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(m,c){var s=this.__base_string_length;return c=c||0,m<0&&(s=0),s+=m*this.__indent_size,s+=c,s},y.prototype.get_indent_string=function(m,c){var s=this.__base_string;return c=c||0,m<0&&(m=0,s=""),c+=m*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},y.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var m=this.__cache.length,c=0,s="";this.__indent_size&&m>=this.__indent_size&&(c=Math.floor(m/this.__indent_size),m-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),m&&(s+=new Array(m+1).join(" ")),this.__cache.push(s)};function g(m,c){this.__indent_cache=new y(m,c),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.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()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(m,c){return this.__indent_cache.get_indent_string(m,c)},g.prototype.get_indent_size=function(m,c){return this.__indent_cache.get_indent_size(m,c)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(m){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(s=s.replace(/[\n]/g,m)),s},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(m,c){return m=m||0,c=c||0,this.next_line.set_indent(m,c),this.__lines.length>1?(this.current_line.set_indent(m,c),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(m){for(var c=0;c<m.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(m){for(var c=this.__lines.length;m<c;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(m,c){for(var s=this.__lines.length-2;s>=0;){var d=this.__lines[s];if(d.is_empty())break;if(d.item(0).indexOf(m)!==0&&d.item(-1)!==c){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=g},,,,function(n){function D(m,c){this.raw_options=y(m,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(m,c){var s=this.raw_options[m],d=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(d=s.concat()):typeof s=="string"&&(d=s.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(m,c){var s=this.raw_options[m],d=s===void 0?!!c:!!s;return d},D.prototype._get_characters=function(m,c){var s=this.raw_options[m],d=c||"";return typeof s=="string"&&(d=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(m,c){var s=this.raw_options[m];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(s,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(m,c,s){var d=this._get_selection_list(m,c,s);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return d[0]},D.prototype._get_selection_list=function(m,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var d=this._get_array(m,s);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[m]+"'");return d},D.prototype._is_valid_selection=function(m,c){return m.length&&c.length&&!m.some(function(s){return c.indexOf(s)===-1})};function y(m,c){var s={};m=g(m);var d;for(d in m)d!==c&&(s[d]=m[d]);if(c&&m[c])for(d in m[c])s[d]=m[c][d];return s}function g(m){var c={},s;for(s in m){var d=s.replace(/-/g,"_");c[d]=m[s]}return c}n.exports.Options=D,n.exports.normalizeOpts=g,n.exports.mergeOpts=y},,function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function y(g){this.__input=g||"",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 g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},y.prototype.peek=function(g){var m=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(m=this.__input.charAt(g)),m},y.prototype.__match=function(g,m){g.lastIndex=m;var c=g.exec(this.__input);return c&&!(D&&g.sticky)&&(c.index!==m&&(c=null)),c},y.prototype.test=function(g,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(g,m):!1},y.prototype.testChar=function(g,m){var c=this.peek(m);return g.lastIndex=0,c!==null&&g.test(c)},y.prototype.match=function(g){var m=this.__match(g,this.__position);return m?this.__position+=m[0].length:m=null,m},y.prototype.read=function(g,m,c){var s="",d;return g&&(d=this.match(g),d&&(s+=d[0])),m&&(d||!g)&&(s+=this.readUntil(m,c)),s},y.prototype.readUntil=function(g,m){var c="",s=this.__position;g.lastIndex=this.__position;var d=g.exec(this.__input);return d?(s=d.index,m&&(s+=d[0].length)):s=this.__input_length,c=this.__input.substring(this.__position,s),this.__position=s,c},y.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},y.prototype.get_regexp=function(g,m){var c=null,s="g";return m&&D&&(s="y"),typeof g=="string"&&g!==""?c=new RegExp(g,s):g&&(c=new RegExp(g.source,s)),c},y.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(g){var m=this.__position,c=this.readUntilAfter(g);return this.__position=m,c},y.prototype.lookBack=function(g){var m=this.__position-1;return m>=g.length&&this.__input.substring(m-g.length,m).toLowerCase()===g},n.exports.InputScanner=y},,,,,function(n){function D(y,g){y=typeof y=="string"?y:y.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(y);m;)g[m[1]]=m[2],m=this.__directive_pattern.exec(y);return g},D.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},,function(n,D,y){var g=y(16).Beautifier,m=y(17).Options;function c(s,d){var u=new g(s,d);return u.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new m}},function(n,D,y){var g=y(17).Options,m=y(2).Output,c=y(8).InputScanner,s=y(13).Directives,d=new s(/\/\*/,/\*\//),u=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,o=/\s/,a=/(?:\s|\n)+/g,C=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(R,A){this._source_text=R||"",this._options=new g(A),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(R){var A="";for(this._ch=this._input.next();this._ch;){if(A+=this._ch,this._ch==="\\")A+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return A},T.prototype.eatWhitespace=function(R){for(var A=o.test(this._input.peek()),v=0;o.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
|
|
`&&((v===0||v<this._options.max_preserve_newlines)&&(v++,this._output.add_new_line(!0)));return A},T.prototype.foundNestedPseudoClass=function(){for(var R=0,A=1,v=this._input.peek(A);v;){if(v==="{")return!0;if(v==="(")R+=1;else if(v===")"){if(R===0)return!1;R-=1}else if(v===";"||v==="}")return!1;A++,v=this._input.peek(A)}return!1},T.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},T.prototype.preserveSingleSpace=function(R){R&&(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 R=this._source_text,A=this._options.eol;A==="auto"&&(A=`
|
|
`,R&&u.test(R||"")&&(A=R.match(u)[0])),R=R.replace(l,`
|
|
`);var v=R.match(/^[\t ]*/)[0];this._output=new m(this._options,v),this._input=new c(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,p=!1,h=!1,_=!1,E=!1,x=!1,U=!1,B=this._ch,L=!1,H,j,S;H=this._input.read(a),j=H!=="",S=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var J=this._input.read(C),te=d.get_directives(J);te&&te.ignore==="start"&&(J+=d.readIgnored(this._input)),this.print_string(J),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(j),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?E=!0:se==="import"&&(x=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!p&&b===0&&se.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(j),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),_?(_=!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)):(S==="("?this._output.space_before_token=!1:S!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),S==="{"&&this._output.trim(!0),x=!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 fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){L=!0;break}(p||_)&&!(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=S==='"'||S==="'";this.preserveSingleSpace(Fe||j),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")L=!1,b===0?(h&&(this.outdent(),h=!1),E=!1,x=!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 Le=!1;this._input.lookBack("with")&&(Le=!0),this.preserveSingleSpace(j||Le),this.print_string(this._ch),h&&S==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),U=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),U&&this._input.peek()===";"&&this._options.selector_separator_newline&&(U=!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||U)&&b===0&&!x&&!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&&o.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(j),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),o.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 De=S==='"'||S==="'";this.preserveSingleSpace(De||j),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&L&&this._output.add_new_line()}var He=this._output.get_code(A);return He},n.exports.Beautifier=T},function(n,D,y){var g=y(6).Options;function m(c){g.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var u=0;u<d.length;u++)d[u]!=="expand"?this.brace_style="collapse":this.brace_style=d[u]}m.prototype=new g,n.exports.Options=m}],k={};function K(n){var D=k[n];if(D!==void 0)return D.exports;var y=k[n]={exports:{}};return I[n](y,y.exports,K),y.exports}var N=K(15);P=N})();var z=P;!(Z=[],V=function(){return{css_beautify:z}}.apply(ve,Z),V!==void 0&&(xt.exports=V))})()},Vhoy:function(xt,ve,G){"use strict";G.d(ve,"d",function(){return z}),G.d(ve,"e",function(){return I}),G.d(ve,"c",function(){return k}),G.d(ve,"b",function(){return K}),G.d(ve,"a",function(){return N});var Z=G("MI8n");class V{constructor(){this._icons=new Map,this._onDidRegister=new Z.b}add(n){const D=this._icons.get(n.id);D?n.description?D.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new V,z=P;function I(n,D){return new K(n,D)}function k(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,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var N;(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 s=D.exec(c.id);if(!s)return y(K.error);let[,d,u]=s;const l=["codicon","codicon-"+d];return u&&l.push("codicon-modifier-"+u.substr(1)),l}n.asClassNameArray=y;function g(c){return y(c).join(" ")}n.asClassName=g;function m(c){return"."+y(c).join(".")}n.asCSSSelector=m})(N||(N={})),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(xt,ve,G){(function(Z,V){xt.exports=V()})(this,function(){"use strict";var Z=navigator.userAgent,V=navigator.platform,P=/gecko\/\d/i.test(Z),z=/MSIE \d/.test(Z),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),k=/Edge\/(\d+)/.exec(Z),K=z||I||k,N=K&&(z?document.documentMode||6:+(k||I)[1]),n=!k&&/WebKit\//.test(Z),D=n&&/Qt\/\d+\.\d+/.test(Z),y=!k&&/Chrome\//.test(Z),g=/Opera\//.test(Z),m=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),s=/PhantomJS/.test(Z),d=!k&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),u=/Android/.test(Z),l=d||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),o=d||/Mac/.test(V),a=/\bCrOS\b/.test(Z),C=/win/i.test(V),w=g&&Z.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(g=!1,n=!0);var T=o&&(D||g&&(w==null||w<12.11)),R=P||K&&N>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var i=e.className,r=A(t).exec(i);if(r){var f=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(f?r[1]+f:"")}};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,i,r){var f=document.createElement(e);if(i&&(f.className=i),r&&(f.style.cssText=r),typeof t=="string")f.appendChild(document.createTextNode(t));else if(t)for(var F=0;F<t.length;++F)f.appendChild(t[F]);return f}function _(e,t,i,r){var f=h(e,t,i,r);return f.setAttribute("role","presentation"),f}var E;document.createRange?E=function(e,t,i,r){var f=document.createRange();return f.setEnd(r||e,i),f.setStart(e,t),f}:E=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(f){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function x(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 U(){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 B(e,t){var i=e.className;A(t).test(i)||(e.className+=(i?" ":"")+t)}function L(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!A(i[r]).test(t)&&(t+=" "+i[r]);return t}var H=function(e){e.select()};d?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(H=function(e){try{e.select()}catch(t){}});function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function S(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function J(e,t,i,r,f){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var F=r||0,X=f||0;;){var Q=e.indexOf(" ",F);if(Q<0||Q>=t)return X+(t-F);X+=Q-F,X+=i-X%i,F=Q+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function se(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var fe=50,Fe={toString:function(){return"CodeMirror.Pass"}},Le={scroll:!1},De={origin:"*mouse"},He={origin:"+move"};function We(e,t,i){for(var r=0,f=0;;){var F=e.indexOf(" ",r);F==-1&&(F=e.length);var X=F-r;if(F==e.length||f+X>=t)return r+Math.min(X,t-f);if(f+=F-r,f+=i-f%i,r=F+1,f>=t)return r}}var ye=[""];function ue(e){for(;ye.length<=e;)ye.push(Ye(ye)+" ");return ye[e]}function Ye(e){return e[e.length-1]}function vt(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function ct(e,t,i){for(var r=0,f=i(t);r<e.length&&i(e[r])<=f;)r++;e.splice(r,0,t)}function it(){}function ft(e,t){var i;return Object.create?i=Object.create(e):(it.prototype=e,i=new it),t&&S(t,i),i}var Qe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function qe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Qe.test(e))}function ht(e,t){return t?t.source.indexOf("\\w")>-1&&qe(e)?!0:t.test(e):qe(e)}function de(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ie=/[\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 Pe(e){return e.charCodeAt(0)>=768&&Ie.test(e)}function Ke(e,t,i){for(;(i<0?t>0:t<e.length)&&Pe(e.charAt(t));)t+=i;return t}function st(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var f=(t+i)/2,F=r<0?Math.ceil(f):Math.floor(f);if(F==t)return e(F)?t:i;e(F)?i=F:t=F+r}}function at(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var f=!1,F=0;F<e.length;++F){var X=e[F];(X.from<i&&X.to>t||t==i&&X.to==t)&&(r(Math.max(X.from,t),Math.min(X.to,i),X.level==1?"rtl":"ltr",F),f=!0)}f||r(t,i,"ltr")}var et=null;function tt(e,t,i){var r;et=null;for(var f=0;f<e.length;++f){var F=e[f];if(F.from<t&&F.to>t)return f;F.to==t&&(F.from!=F.to&&i=="before"?r=f:et=f),F.from==t&&(F.from!=F.to&&i!="before"?r=f:et=f)}return r!=null?r:et}var dt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,F=/[LRr]/,X=/[Lb1n]/,Q=/[1n]/;function q(ie,xe,Oe){this.level=ie,this.from=xe,this.to=Oe}return function(ie,xe){var Oe=xe=="ltr"?"L":"R";if(ie.length==0||xe=="ltr"&&!r.test(ie))return!1;for(var Xe=ie.length,Ge=[],nt=0;nt<Xe;++nt)Ge.push(i(ie.charCodeAt(nt)));for(var gt=0,St=Oe;gt<Xe;++gt){var Ot=Ge[gt];Ot=="m"?Ge[gt]=St:St=Ot}for(var Dt=0,At=Oe;Dt<Xe;++Dt){var Nt=Ge[Dt];Nt=="1"&&At=="r"?Ge[Dt]="n":F.test(Nt)&&(At=Nt,Nt=="r"&&(Ge[Dt]="R"))}for(var qt=1,Xt=Ge[0];qt<Xe-1;++qt){var yn=Ge[qt];yn=="+"&&Xt=="1"&&Ge[qt+1]=="1"?Ge[qt]="1":yn==","&&Xt==Ge[qt+1]&&(Xt=="1"||Xt=="n")&&(Ge[qt]=Xt),Xt=yn}for(var er=0;er<Xe;++er){var Nr=Ge[er];if(Nr==",")Ge[er]="N";else if(Nr=="%"){var cr=void 0;for(cr=er+1;cr<Xe&&Ge[cr]=="%";++cr);for(var vi=er&&Ge[er-1]=="!"||cr<Xe&&Ge[cr]=="1"?"1":"N",di=er;di<cr;++di)Ge[di]=vi;er=cr-1}}for(var Cr=0,hi=Oe;Cr<Xe;++Cr){var Br=Ge[Cr];hi=="L"&&Br=="1"?Ge[Cr]="L":F.test(Br)&&(hi=Br)}for(var Mr=0;Mr<Xe;++Mr)if(f.test(Ge[Mr])){var Or=void 0;for(Or=Mr+1;Or<Xe&&f.test(Ge[Or]);++Or);for(var mr=(Mr?Ge[Mr-1]:Oe)=="L",fi=(Or<Xe?Ge[Or]:Oe)=="L",Ga=mr==fi?mr?"L":"R":Oe,pa=Mr;pa<Or;++pa)Ge[pa]=Ga;Mr=Or-1}for(var Yr=[],$i,Ur=0;Ur<Xe;)if(X.test(Ge[Ur])){var ps=Ur;for(++Ur;Ur<Xe&&X.test(Ge[Ur]);++Ur);Yr.push(new q(0,ps,Ur))}else{var ra=Ur,Ta=Yr.length,wa=xe=="rtl"?1:0;for(++Ur;Ur<Xe&&Ge[Ur]!="L";++Ur);for(var ni=ra;ni<Ur;)if(Q.test(Ge[ni])){ra<ni&&(Yr.splice(Ta,0,new q(1,ra,ni)),Ta+=wa);var za=ni;for(++ni;ni<Ur&&Q.test(Ge[ni]);++ni);Yr.splice(Ta,0,new q(2,za,ni)),Ta+=wa,ra=ni}else++ni;ra<Ur&&Yr.splice(Ta,0,new q(1,ra,Ur))}return xe=="ltr"&&(Yr[0].level==1&&($i=ie.match(/^\s+/))&&(Yr[0].from=$i[0].length,Yr.unshift(new q(0,0,$i[0].length))),Ye(Yr).level==1&&($i=ie.match(/\s+$/))&&(Ye(Yr).to-=$i[0].length,Yr.push(new q(0,Xe-$i[0].length,Xe)))),xe=="rtl"?Yr.reverse():Yr}}();function yt(e,t){var i=e.order;return i==null&&(i=e.order=dt(e.text,t)),i}var Ae=[],Se=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ae).concat(i)}};function Ve(e,t){return e._handlers&&e._handlers[t]||Ae}function Je(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,f=r&&r[t];if(f){var F=se(f,i);F>-1&&(r[t]=f.slice(0,F).concat(f.slice(F+1)))}}}function Ne(e,t){var i=Ve(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),f=0;f<i.length;++f)i[f].apply(null,r)}function je(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ne(e,i||t.type,e,t),le(t)||t.codemirrorIgnore}function Ee(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)se(i,t[r])==-1&&i.push(t[r])}function he(e,t){return Ve(e,t).length>0}function pe(e){e.prototype.on=function(t,i){Se(this,t,i)},e.prototype.off=function(t,i){Je(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){re(e),oe(e)}function be(e){return e.target||e.srcElement}function Be(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var $e=function(){if(K&&N<9)return!1;var e=h("div");return"draggable"in e||"dragDrop"in e}(),ut;function Et(e){if(ut==null){var t=h("span","\u200B");p(e,h("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ut=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&N<8))}var i=ut?h("span","\u200B"):h("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var mt;function Bt(e){if(mt!=null)return mt;var t=p(e,document.createTextNode("A\u062EA")),i=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return b(e),!i||i.left==i.right?!1:mt=r.right-i.right<3}var Ut=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var f=e.indexOf(`
|
|
`,t);f==-1&&(f=e.length);var F=e.slice(t,e.charAt(f-1)=="\r"?f-1:f),X=F.indexOf("\r");X!=-1?(i.push(F.slice(0,X)),t+=X+1):(i.push(F),t=f+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Tt=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},kt=function(){var e=h("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),zt=null;function $t(e){if(zt!=null)return zt;var t=p(e,h("span","x")),i=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return zt=Math.abs(i.left-r.left)>1}var vn={},Ft={};function an(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),vn[e]=t}function nn(e,t){Ft[e]=t}function ot(e){if(typeof e=="string"&&Ft.hasOwnProperty(e))e=Ft[e];else if(e&&typeof e.name=="string"&&Ft.hasOwnProperty(e.name)){var t=Ft[e.name];typeof t=="string"&&(t={name:t}),e=ft(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ot("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ot("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function en(e,t){t=ot(t);var i=vn[t.name];if(!i)return en(e,"text/plain");var r=i(e,t);if(It.hasOwnProperty(t.name)){var f=It[t.name];for(var F in f){if(!f.hasOwnProperty(F))continue;r.hasOwnProperty(F)&&(r["_"+F]=r[F]),r[F]=f[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 It={};function Rt(e,t){var i=It.hasOwnProperty(e)?It[e]:It[e]={};S(t,i)}function Mt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var f=t[r];f instanceof Array&&(f=f.concat([])),i[r]=f}return i}function On(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function ln(e,t,i){return e.startState?e.startState(t,i):!0}var un=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};un.prototype.eol=function(){return this.pos>=this.string.length},un.prototype.sol=function(){return this.pos==this.lineStart},un.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},un.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},un.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},un.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},un.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},un.prototype.skipToEnd=function(){this.pos=this.string.length},un.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},un.prototype.backUp=function(e){this.pos-=e},un.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=J(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},un.prototype.indentation=function(){return J(this.string,null,this.tabSize)-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},un.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(X){return i?X.toLowerCase():X},f=this.string.substr(this.pos,e.length);if(r(f)==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)}},un.prototype.current=function(){return this.string.slice(this.start,this.pos)},un.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},un.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},un.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Lt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var f=i.children[r],F=f.chunkSize();if(t<F){i=f;break}t-=F}return i.lines[t]}function ar(e,t,i){var r=[],f=t.line;return e.iter(t.line,i.line+1,function(F){var X=F.text;f==i.line&&(X=X.slice(0,i.ch)),f==t.line&&(X=X.slice(t.ch)),r.push(X),++f}),r}function In(e,t,i){var r=[];return e.iter(t,i,function(f){r.push(f.text)}),r}function Nn(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function tn(e){if(e.parent==null)return null;for(var t=e.parent,i=se(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var f=0;!(r.children[f]==t);++f)i+=r.children[f].chunkSize();return i+t.first}function Fn(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var f=e.children[r],F=f.height;if(t<F){e=f;continue e}t-=F,i+=f.chunkSize()}return i}while(!e.lines);for(var X=0;X<e.lines.length;++X){var Q=e.lines[X],q=Q.height;if(t<q)break;t-=q}return i+X}function dr(e,t){return t>=e.first&&t<e.first+e.size}function gr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function pt(e,t,i){if(i===void 0&&(i=null),!(this instanceof pt))return new pt(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Gt(e,t){return e.line-t.line||e.ch-t.ch}function kr(e,t){return e.sticky==t.sticky&&Gt(e,t)==0}function Hr(e){return pt(e.line,e.ch)}function ri(e,t){return Gt(e,t)<0?t:e}function Wr(e,t){return Gt(e,t)<0?e:t}function $(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function O(e,t){if(t.line<e.first)return pt(e.first,0);var i=e.first+e.size-1;return t.line>i?pt(i,Lt(e,i).text.length):M(t,Lt(e,t.line).text.length)}function M(e,t){var i=e.ch;return i==null||i>t?pt(e.line,t):i<0?pt(e.line,0):e}function W(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=O(e,t[r]);return i}var ee=function(e,t){this.state=e,this.lookAhead=t},Y=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Y.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Y.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Y.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Y.fromSaved=function(e,t,i){return t instanceof ee?new Y(e,Mt(e.mode,t.state),i,t.lookAhead):new Y(e,Mt(e.mode,t),i)},Y.prototype.save=function(e){var t=e!==!1?Mt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Ce(e,t,i,r){var f=[e.state.modeGen],F={};vr(e,t.text,e.doc.mode,i,function(ie,xe){return f.push(ie,xe)},F,r);for(var X=i.state,Q=function(ie){i.baseTokens=f;var xe=e.state.overlays[ie],Oe=1,Xe=0;i.state=!0,vr(e,t.text,xe.mode,i,function(Ge,nt){for(var gt=Oe;Xe<Ge;){var St=f[Oe];St>Ge&&f.splice(Oe,1,Ge,f[Oe+1],St),Oe+=2,Xe=Math.min(Ge,St)}if(!nt)return;if(xe.opaque)f.splice(gt,Oe-gt,Ge,"overlay "+nt),Oe=gt+2;else for(;gt<Oe;gt+=2){var Ot=f[gt+1];f[gt+1]=(Ot?Ot+" ":"")+"overlay "+nt}},F),i.state=X,i.baseTokens=null,i.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Q(q);return{styles:f,classes:F.bgClass||F.textClass?F:null}}function rt(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=wt(e,tn(t)),f=t.text.length>e.options.maxHighlightLength&&Mt(e.doc.mode,r.state),F=Ce(e,t,r);f&&(r.state=f),t.stateAfter=r.save(!f),t.styles=F.styles,F.classes?t.styleClasses=F.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function wt(e,t,i){var r=e.doc,f=e.display;if(!r.mode.startState)return new Y(r,!0,t);var F=Jn(e,t,i),X=F>r.first&&Lt(r,F-1).stateAfter,Q=X?Y.fromSaved(r,X,F):new Y(r,ln(r.mode),F);return r.iter(F,t,function(q){Pt(e,q.text,Q);var ie=Q.line;q.stateAfter=ie==t-1||ie%5==0||ie>=f.viewFrom&&ie<f.viewTo?Q.save():null,Q.nextLine()}),i&&(r.modeFrontier=Q.line),Q}function Pt(e,t,i,r){var f=e.doc.mode,F=new un(t,e.options.tabSize,i);for(F.start=F.pos=r||0,t==""&<(f,i.state);!F.eol();)Kt(f,F,i.state),F.start=F.pos}function lt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=On(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Kt(e,t,i,r){for(var f=0;f<10;f++){r&&(r[0]=On(e,i).mode);var F=e.token(t,i);if(t.pos>t.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var Jt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function jn(e,t,i,r){var f=e.doc,F=f.mode,X;t=O(f,t);var Q=Lt(f,t.line),q=wt(e,t.line,i),ie=new un(Q.text,e.options.tabSize,q),xe;for(r&&(xe=[]);(r||ie.pos<t.ch)&&!ie.eol();)ie.start=ie.pos,X=Kt(F,ie,q.state),r&&xe.push(new Jt(ie,X,Mt(f.mode,q.state)));return r?xe:new Jt(ie,X,q.state)}function xr(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function vr(e,t,i,r,f,F,X){var Q=i.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var q=0,ie=null,xe=new un(t,e.options.tabSize,r),Oe,Xe=e.options.addModeClass&&[null];for(t==""&&xr(lt(i,r.state),F);!xe.eol();){if(xe.pos>e.options.maxHighlightLength?(Q=!1,X&&Pt(e,t,r,xe.pos),xe.pos=t.length,Oe=null):Oe=xr(Kt(i,xe,r.state,Xe),F),Xe){var Ge=Xe[0].name;Ge&&(Oe="m-"+(Oe?Ge+" "+Oe:Ge))}if(!Q||ie!=Oe){for(;q<xe.start;)q=Math.min(xe.start,q+5e3),f(q,ie);ie=Oe}xe.start=xe.pos}for(;q<xe.pos;){var nt=Math.min(xe.pos,q+5e3);f(nt,ie),q=nt}}function Jn(e,t,i){for(var r,f,F=e.doc,X=i?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>X;--Q){if(Q<=F.first)return F.first;var q=Lt(F,Q-1),ie=q.stateAfter;if(ie&&(!i||Q+(ie instanceof ee?ie.lookAhead:0)<=F.modeFrontier))return Q;var xe=J(q.text,null,e.options.tabSize);(f==null||r>xe)&&(f=Q-1,r=xe)}return f}function ii(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,r=t-1;r>i;r--){var f=Lt(e,r).stateAfter;if(f&&(!(f instanceof ee)||r+f.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var wi=!1,or=!1;function Kr(){wi=!0}function yi(){or=!0}function ai(e,t,i){this.marker=e,this.from=t,this.to=i}function Tr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Ai(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function Si(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ri(e,t,i){var r;if(e)for(var f=0;f<e.length;++f){var F=e[f],X=F.marker,Q=F.from==null||(X.inclusiveLeft?F.from<=t:F.from<t);if(Q||F.from==t&&X.type=="bookmark"&&(!i||!F.marker.insertLeft)){var q=F.to==null||(X.inclusiveRight?F.to>=t:F.to>t);(r||(r=[])).push(new ai(X,F.from,q?null:F.to))}}return r}function Ni(e,t,i){var r;if(e)for(var f=0;f<e.length;++f){var F=e[f],X=F.marker,Q=F.to==null||(X.inclusiveRight?F.to>=t:F.to>t);if(Q||F.from==t&&X.type=="bookmark"&&(!i||F.marker.insertLeft)){var q=F.from==null||(X.inclusiveLeft?F.from<=t:F.from<t);(r||(r=[])).push(new ai(X,q?null:F.from-t,F.to==null?null:F.to-t))}}return r}function oi(e,t){if(t.full)return null;var i=dr(e,t.from.line)&&Lt(e,t.from.line).markedSpans,r=dr(e,t.to.line)&&Lt(e,t.to.line).markedSpans;if(!i&&!r)return null;var f=t.from.ch,F=t.to.ch,X=Gt(t.from,t.to)==0,Q=Ri(i,f,X),q=Ni(r,F,X),ie=t.text.length==1,xe=Ye(t.text).length+(ie?f:0);if(Q)for(var Oe=0;Oe<Q.length;++Oe){var Xe=Q[Oe];if(Xe.to==null){var Ge=Tr(q,Xe.marker);Ge?ie&&(Xe.to=Ge.to==null?null:Ge.to+xe):Xe.to=f}}if(q)for(var nt=0;nt<q.length;++nt){var gt=q[nt];if(gt.to!=null&&(gt.to+=xe),gt.from==null){var St=Tr(Q,gt.marker);St||(gt.from=xe,ie&&(Q||(Q=[])).push(gt))}else gt.from+=xe,ie&&(Q||(Q=[])).push(gt)}Q&&(Q=hr(Q)),q&&q!=Q&&(q=hr(q));var Ot=[Q];if(!ie){var Dt=t.text.length-2,At;if(Dt>0&&Q)for(var Nt=0;Nt<Q.length;++Nt)Q[Nt].to==null&&(At||(At=[])).push(new ai(Q[Nt].marker,null,null));for(var qt=0;qt<Dt;++qt)Ot.push(At);Ot.push(q)}return Ot}function hr(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function pi(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(Ge){if(Ge.markedSpans)for(var nt=0;nt<Ge.markedSpans.length;++nt){var gt=Ge.markedSpans[nt].marker;gt.readOnly&&(!r||se(r,gt)==-1)&&(r||(r=[])).push(gt)}}),!r)return null;for(var f=[{from:t,to:i}],F=0;F<r.length;++F)for(var X=r[F],Q=X.find(0),q=0;q<f.length;++q){var ie=f[q];if(Gt(ie.to,Q.from)<0||Gt(ie.from,Q.to)>0)continue;var xe=[q,1],Oe=Gt(ie.from,Q.from),Xe=Gt(ie.to,Q.to);(Oe<0||!X.inclusiveLeft&&!Oe)&&xe.push({from:ie.from,to:Q.from}),(Xe>0||!X.inclusiveRight&&!Xe)&&xe.push({from:Q.to,to:ie.to}),f.splice.apply(f,xe),q+=xe.length-3}return f}function Ui(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function mi(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Mn(e){return e.inclusiveLeft?-1:0}function on(e){return e.inclusiveRight?1:0}function Vn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),f=t.find(),F=Gt(r.from,f.from)||Mn(e)-Mn(t);if(F)return-F;var X=Gt(r.to,f.to)||on(e)-on(t);return X||t.id-e.id}function cn(e,t){var i=or&&e.markedSpans,r;if(i)for(var f=void 0,F=0;F<i.length;++F)f=i[F],f.marker.collapsed&&(t?f.from:f.to)==null&&(!r||Vn(r,f.marker)<0)&&(r=f.marker);return r}function Qn(e){return cn(e,!0)}function An(e){return cn(e,!1)}function si(e,t){var i=or&&e.markedSpans,r;if(i)for(var f=0;f<i.length;++f){var F=i[f];F.marker.collapsed&&(F.from==null||F.from<t)&&(F.to==null||F.to>t)&&(!r||Vn(r,F.marker)<0)&&(r=F.marker)}return r}function fr(e,t,i,r,f){var F=Lt(e,t),X=or&&F.markedSpans;if(X)for(var Q=0;Q<X.length;++Q){var q=X[Q];if(!q.marker.collapsed)continue;var ie=q.marker.find(0),xe=Gt(ie.from,i)||Mn(q.marker)-Mn(f),Oe=Gt(ie.to,r)||on(q.marker)-on(f);if(xe>=0&&Oe<=0||xe<=0&&Oe>=0)continue;if(xe<=0&&(q.marker.inclusiveRight&&f.inclusiveLeft?Gt(ie.to,i)>=0:Gt(ie.to,i)>0)||xe>=0&&(q.marker.inclusiveRight&&f.inclusiveLeft?Gt(ie.from,r)<=0:Gt(ie.from,r)<0))return!0}}function wr(e){for(var t;t=Qn(e);)e=t.find(-1,!0).line;return e}function Ci(e){for(var t;t=An(e);)e=t.find(1,!0).line;return e}function li(e){for(var t,i;t=An(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function gi(e,t){var i=Lt(e,t),r=wr(i);return i==r?t:tn(r)}function Fr(e,t){if(t>e.lastLine())return t;var i=Lt(e,t),r;if(!Gr(e,i))return t;for(;r=An(i);)i=r.find(1,!0).line;return tn(i)+1}function Gr(e,t){var i=or&&t.markedSpans;if(i)for(var r=void 0,f=0;f<i.length;++f){if(r=i[f],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&Fi(e,t,r))return!0}}function Fi(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return Fi(e,r.line,Tr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var f=void 0,F=0;F<t.markedSpans.length;++F)if(f=t.markedSpans[F],f.marker.collapsed&&!f.marker.widgetNode&&f.from==i.to&&(f.to==null||f.to!=i.from)&&(f.marker.inclusiveLeft||i.marker.inclusiveRight)&&Fi(e,t,f))return!0}function $r(e){e=wr(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var f=i.lines[r];if(f==e)break;t+=f.height}for(var F=i.parent;F;i=F,F=i.parent)for(var X=0;X<F.children.length;++X){var Q=F.children[X];if(Q==i)break;t+=Q.height}return t}function ji(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=Qn(r);){var f=i.find(0,!0);r=f.from.line,t+=f.from.ch-f.to.ch}for(r=e;i=An(r);){var F=i.find(0,!0);t-=r.text.length-F.from.ch,r=F.to.line,t+=r.text.length-F.to.ch}return t}function Li(e){var t=e.display,i=e.doc;t.maxLine=Lt(i,i.first),t.maxLineLength=ji(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var f=ji(r);f>t.maxLineLength&&(t.maxLineLength=f,t.maxLine=r)})}var Jr=function(e,t,i){this.text=e,mi(this,t),this.height=i?i(this):1};Jr.prototype.lineNo=function(){return tn(this)},pe(Jr);function Ji(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ui(e),mi(e,i);var f=r?r(e):1;f!=e.height&&Nn(e,f)}function jt(e){e.parent=null,Ui(e)}var Qt={},Wt={};function sn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Wt:Qt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function bn(e,t){var i=_("span",null,null,n?"padding-right: .1px":null),r={pre:_("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var f=0;f<=(t.rest?t.rest.length:0);f++){var F=f?t.rest[f-1]:t.line,X=void 0;r.pos=0,r.addToken=En,Bt(e.display.measure)&&(X=yt(F,e.doc.direction))&&(r.addToken=Pr(r.addToken,X)),r.map=[];var Q=t!=e.display.externalMeasured&&tn(F);ui(F,r,rt(e,F,Q)),F.styleClasses&&(F.styleClasses.bgClass&&(r.bgClass=L(F.styleClasses.bgClass,r.bgClass||"")),F.styleClasses.textClass&&(r.textClass=L(F.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Et(e.display.measure))),f==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 q=r.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=L(r.pre.className,r.textClass||"")),r}function Bn(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 En(e,t,i,r,f,F,X){if(!t)return;var Q=e.splitSpaces?tr(t,e.trailingSpace):t,q=e.cm.state.specialChars,ie=!1,xe;if(!q.test(t))e.col+=t.length,xe=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,xe),K&&N<9&&(ie=!0),e.pos+=t.length;else{xe=document.createDocumentFragment();for(var Oe=0;;){q.lastIndex=Oe;var Xe=q.exec(t),Ge=Xe?Xe.index-Oe:t.length-Oe;if(Ge){var nt=document.createTextNode(Q.slice(Oe,Oe+Ge));K&&N<9?xe.appendChild(h("span",[nt])):xe.appendChild(nt),e.map.push(e.pos,e.pos+Ge,nt),e.col+=Ge,e.pos+=Ge}if(!Xe)break;Oe+=Ge+1;var gt=void 0;if(Xe[0]==" "){var St=e.cm.options.tabSize,Ot=St-e.col%St;gt=xe.appendChild(h("span",ue(Ot),"cm-tab")),gt.setAttribute("role","presentation"),gt.setAttribute("cm-text"," "),e.col+=Ot}else Xe[0]=="\r"||Xe[0]==`
|
|
`?(gt=xe.appendChild(h("span",Xe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),gt.setAttribute("cm-text",Xe[0]),e.col+=1):(gt=e.cm.options.specialCharPlaceholder(Xe[0]),gt.setAttribute("cm-text",Xe[0]),K&&N<9?xe.appendChild(h("span",[gt])):xe.appendChild(gt),e.col+=1);e.map.push(e.pos,e.pos+1,gt),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,i||r||f||ie||F||X){var Dt=i||"";r&&(Dt+=r),f&&(Dt+=f);var At=h("span",[xe],Dt,F);if(X)for(var Nt in X)X.hasOwnProperty(Nt)&&Nt!="style"&&Nt!="class"&&At.setAttribute(Nt,X[Nt]);return e.content.appendChild(At)}e.content.appendChild(xe)}function tr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",f=0;f<e.length;f++){var F=e.charAt(f);F==" "&&i&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(F="\xA0"),r+=F,i=F==" "}return r}function Pr(e,t){return function(i,r,f,F,X,Q,q){f=f?f+" cm-force-border":"cm-force-border";for(var ie=i.pos,xe=ie+r.length;;){for(var Oe=void 0,Xe=0;Xe<t.length&&!(Oe=t[Xe],Oe.to>ie&&Oe.from<=ie);Xe++);if(Oe.to>=xe)return e(i,r,f,F,X,Q,q);e(i,r.slice(0,Oe.to-ie),f,F,null,Q,q),F=null,r=r.slice(Oe.to-ie),ie=Oe.to}}}function fn(e,t,i,r){var f=!r&&i.widgetNode;f&&e.map.push(e.pos,e.pos+t,f),!r&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",i.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=t,e.trailingSpace=!1}function ui(e,t,i){var r=e.markedSpans,f=e.text,F=0;if(!r){for(var X=1;X<i.length;X+=2)t.addToken(t,f.slice(F,F=i[X]),sn(i[X+1],t.cm.options));return}for(var Q=f.length,q=0,ie=1,xe="",Oe,Xe,Ge=0,nt,gt,St,Ot,Dt;;){if(Ge==q){nt=gt=St=Xe="",Dt=null,Ot=null,Ge=Infinity;for(var At=[],Nt=void 0,qt=0;qt<r.length;++qt){var Xt=r[qt],yn=Xt.marker;if(yn.type=="bookmark"&&Xt.from==q&&yn.widgetNode)At.push(yn);else if(Xt.from<=q&&(Xt.to==null||Xt.to>q||yn.collapsed&&Xt.to==q&&Xt.from==q)){if(Xt.to!=null&&Xt.to!=q&&Ge>Xt.to&&(Ge=Xt.to,gt=""),yn.className&&(nt+=" "+yn.className),yn.css&&(Xe=(Xe?Xe+";":"")+yn.css),yn.startStyle&&Xt.from==q&&(St+=" "+yn.startStyle),yn.endStyle&&Xt.to==Ge&&(Nt||(Nt=[])).push(yn.endStyle,Xt.to),yn.title&&((Dt||(Dt={})).title=yn.title),yn.attributes)for(var er in yn.attributes)(Dt||(Dt={}))[er]=yn.attributes[er];yn.collapsed&&(!Ot||Vn(Ot.marker,yn)<0)&&(Ot=Xt)}else Xt.from>q&&Ge>Xt.from&&(Ge=Xt.from)}if(Nt)for(var Nr=0;Nr<Nt.length;Nr+=2)Nt[Nr+1]==Ge&&(gt+=" "+Nt[Nr]);if(!Ot||Ot.from==q)for(var cr=0;cr<At.length;++cr)fn(t,0,At[cr]);if(Ot&&(Ot.from||0)==q){if(fn(t,(Ot.to==null?Q+1:Ot.to)-q,Ot.marker,Ot.from==null),Ot.to==null)return;Ot.to==q&&(Ot=!1)}}if(q>=Q)break;for(var vi=Math.min(Q,Ge);;){if(xe){var di=q+xe.length;if(!Ot){var Cr=di>vi?xe.slice(0,vi-q):xe;t.addToken(t,Cr,Oe?Oe+nt:nt,St,q+Cr.length==Ge?gt:"",Xe,Dt)}if(di>=vi){xe=xe.slice(vi-q),q=vi;break}q=di,St=""}xe=f.slice(F,F=i[ie++]),Oe=sn(i[ie++],t.cm.options)}}}function kn(e,t,i){this.line=t,this.rest=li(t),this.size=this.rest?tn(Ye(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Gr(e,t)}function yr(e,t,i){for(var r=[],f,F=t;F<i;F=f){var X=new kn(e.doc,Lt(e.doc,F),F);f=F+X.size,r.push(X)}return r}var Sr=null;function Qr(e){Sr?Sr.ops.push(e):e.ownsGroup=Sr={ops:[e],delayedCallbacks:[]}}function ma(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var f=e.ops[r];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(i<t.length)}function Pn(e,t){var i=e.ownsGroup;if(!i)return;try{ma(i)}finally{Sr=null,t(i)}}var wn=null;function _n(e,t){var i=Ve(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),f;Sr?f=Sr.delayedCallbacks:wn?f=wn:(f=wn=[],setTimeout(zr,0));for(var F=function(Q){f.push(function(){return i[Q].apply(null,r)})},X=0;X<i.length;++X)F(X)}function zr(){var e=wn;wn=null;for(var t=0;t<e.length;++t)e[t]()}function Bi(e,t,i,r){for(var f=0;f<t.changes.length;f++){var F=t.changes[f];F=="text"?Sa(e,t):F=="gutter"?Xa(e,t,i,r):F=="class"?Va(e,t):F=="widget"&&zo(e,t,r)}t.changes=null}function Hi(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&&N<8&&(e.node.style.zIndex=2)),e.node}function ga(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=Hi(t);t.background=r.insertBefore(h("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function va(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):bn(e,t)}function Sa(e,t){var i=t.text.className,r=va(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,Va(e,t)):i&&(t.text.className=i)}function Va(e,t){ga(e,t),t.line.wrapClass?Hi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Xa(e,t,i,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 f=Hi(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),f.insertBefore(t.gutterBackground,t.text)}var F=t.line.gutterMarkers;if(e.options.lineNumbers||F){var X=Hi(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",gr(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),F)for(var q=0;q<e.display.gutterSpecs.length;++q){var ie=e.display.gutterSpecs[q].className,xe=F.hasOwnProperty(ie)&&F[ie];xe&&Q.appendChild(h("div",[xe],"CodeMirror-gutter-elt","left: "+r.gutterLeft[ie]+"px; width: "+r.gutterWidth[ie]+"px"))}}}function zo(e,t,i){t.alignable&&(t.alignable=null);for(var r=A("CodeMirror-linewidget"),f=t.node.firstChild,F=void 0;f;f=F)F=f.nextSibling,r.test(f.className)&&t.node.removeChild(f);Ya(e,t,i)}function _o(e,t,i,r){var f=va(e,t);return t.text=t.node=f.pre,f.bgClass&&(t.bgClass=f.bgClass),f.textClass&&(t.textClass=f.textClass),Va(e,t),Xa(e,t,i,r),Ya(e,t,r),t.node}function Ya(e,t,i){if(xo(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)xo(e,t.rest[r],t,i,!1)}function xo(e,t,i,r,f){if(!t.widgets)return;for(var F=Hi(i),X=0,Q=t.widgets;X<Q.length;++X){var q=Q[X],ie=h("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||ie.setAttribute("cm-ignore-events","true"),Vo(q,ie,i,r),e.display.input.setUneditable(ie),f&&q.above?F.insertBefore(ie,i.gutter||i.text):F.appendChild(ie),_n(q,"redraw")}}function Vo(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var f=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(f-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=f+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ia(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),p(t.display.measure,h("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Ii(e,t){for(var i=be(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function $a(e){return e.lineSpace.offsetTop}function ge(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Re(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=p(e.measure,h("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function ke(e){return fe-e.display.nativeBarWidth}function _e(e){return e.display.scroller.clientWidth-ke(e)-e.display.barWidth}function ne(e){return e.display.scroller.clientHeight-ke(e)-e.display.barHeight}function ce(e,t,i){var r=e.options.lineWrapping,f=r&&_e(e);if(!t.measure.heights||r&&t.measure.width!=f){var F=t.measure.heights=[];if(r){t.measure.width=f;for(var X=t.text.firstChild.getClientRects(),Q=0;Q<X.length-1;Q++){var q=X[Q],ie=X[Q+1];Math.abs(q.bottom-ie.bottom)>2&&F.push((q.bottom+ie.top)/2-i.top)}}F.push(i.bottom-i.top)}}function ae(e,t,i){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 f=0;f<e.rest.length;f++)if(tn(e.rest[f])>i)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}function Te(e,t){t=wr(t);var i=tn(t),r=e.display.externalMeasured=new kn(e.doc,t,i);r.lineN=i;var f=r.built=bn(e,r);return r.text=f.pre,p(e.display.lineMeasure,f.pre),r}function we(e,t,i,r){return ze(e,Me(e,t),i,r)}function Ue(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[qn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Me(e,t){var i=tn(t),r=Ue(e,i);r&&!r.text?r=null:r&&r.changes&&(Bi(e,r,i,sr(e)),e.curOp.forceUpdate=!0),r||(r=Te(e,t));var f=ae(r,t,i);return{line:t,view:r,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function ze(e,t,i,r,f){t.before&&(i=-1);var F=i+(r||""),X;return t.cache.hasOwnProperty(F)?X=t.cache[F]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ce(e,t.view,t.rect),t.hasHeights=!0),X=Ct(e,t,i,r),X.bogus||(t.cache[F]=X)),{left:X.left,right:X.right,top:f?X.rtop:X.top,bottom:f?X.rbottom:X.bottom}}var Ze={left:0,right:0,top:0,bottom:0};function _t(e,t,i){for(var r,f,F,X,Q,q,ie=0;ie<e.length;ie+=3)if(Q=e[ie],q=e[ie+1],t<Q?(f=0,F=1,X="left"):t<q?(f=t-Q,F=f+1):(ie==e.length-3||t==q&&e[ie+3]>t)&&(F=q-Q,f=F-1,t>=q&&(X="right")),f!=null){if(r=e[ie+2],Q==q&&i==(r.insertLeft?"left":"right")&&(X=i),i=="left"&&f==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)r=e[(ie-=3)+2],X="left";if(i=="right"&&f==q-Q)for(;ie<e.length-3&&e[ie+3]==e[ie+4]&&!e[ie+5].insertLeft;)r=e[(ie+=3)+2],X="right";break}return{node:r,start:f,end:F,collapse:X,coverStart:Q,coverEnd:q}}function bt(e,t){var i=Ze;if(t=="left")for(var r=0;r<e.length&&!((i=e[r]).left!=i.right);r++);else for(var f=e.length-1;f>=0&&!((i=e[f]).left!=i.right);f--);return i}function Ct(e,t,i,r){var f=_t(t.map,i,r),F=f.node,X=f.start,Q=f.end,q=f.collapse,ie;if(F.nodeType==3){for(var xe=0;xe<4;xe++){for(;X&&Pe(t.line.text.charAt(f.coverStart+X));)--X;for(;f.coverStart+Q<f.coverEnd&&Pe(t.line.text.charAt(f.coverStart+Q));)++Q;if(K&&N<9&&X==0&&Q==f.coverEnd-f.coverStart?ie=F.parentNode.getBoundingClientRect():ie=bt(E(F,X,Q).getClientRects(),r),ie.left||ie.right||X==0)break;Q=X,X=X-1,q="right"}K&&N<11&&(ie=Zt(e.display.measure,ie))}else{X>0&&(q=r="right");var Oe;e.options.lineWrapping&&(Oe=F.getClientRects()).length>1?ie=Oe[r=="right"?Oe.length-1:0]:ie=F.getBoundingClientRect()}if(K&&N<9&&!X&&(!ie||!ie.left&&!ie.right)){var Xe=F.parentNode.getClientRects()[0];Xe?ie={left:Xe.left,right:Xe.left+Ar(e.display),top:Xe.top,bottom:Xe.bottom}:ie=Ze}for(var Ge=ie.top-t.rect.top,nt=ie.bottom-t.rect.top,gt=(Ge+nt)/2,St=t.view.measure.heights,Ot=0;Ot<St.length-1&&!(gt<St[Ot]);Ot++);var Dt=Ot?St[Ot-1]:0,At=St[Ot],Nt={left:(q=="right"?ie.right:ie.left)-t.rect.left,right:(q=="left"?ie.left:ie.right)-t.rect.left,top:Dt,bottom:At};return!ie.left&&!ie.right&&(Nt.bogus=!0),e.options.singleCursorHeightPerLine||(Nt.rtop=Ge,Nt.rbottom=nt),Nt}function Zt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!$t(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function mn(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 rn(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)mn(e.display.view[t])}function dn(e){rn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function gn(){return y&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pn(){return y&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function hn(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ia(e.widgets[i]));return t}function Rn(e,t,i,r,f){if(!f){var F=hn(t);i.top+=F,i.bottom+=F}if(r=="line")return i;r||(r="local");var X=$r(t);if(r=="local"?X+=$a(e.display):X-=e.display.viewOffset,r=="page"||r=="window"){var Q=e.display.lineSpace.getBoundingClientRect();X+=Q.top+(r=="window"?0:pn());var q=Q.left+(r=="window"?0:gn());i.left+=q,i.right+=q}return i.top+=X,i.bottom+=X,i}function xn(e,t,i){if(i=="div")return t;var r=t.left,f=t.top;if(i=="page")r-=gn(),f-=pn();else if(i=="local"||!i){var F=e.display.sizer.getBoundingClientRect();r+=F.left,f+=F.top}var X=e.display.lineSpace.getBoundingClientRect();return{left:r-X.left,top:f-X.top}}function nr(e,t,i,r,f){return r||(r=Lt(e.doc,t.line)),Rn(e,r,we(e,r,t.ch,f),i)}function Tn(e,t,i,r,f,F){r=r||Lt(e.doc,t.line),f||(f=Me(e,r));function X(nt,gt){var St=ze(e,f,nt,gt?"right":"left",F);return gt?St.left=St.right:St.right=St.left,Rn(e,r,St,i)}var Q=yt(r,e.doc.direction),q=t.ch,ie=t.sticky;if(q>=r.text.length?(q=r.text.length,ie="before"):q<=0&&(q=0,ie="after"),!Q)return X(ie=="before"?q-1:q,ie=="before");function xe(nt,gt,St){var Ot=Q[gt],Dt=Ot.level==1;return X(St?nt-1:nt,Dt!=St)}var Oe=tt(Q,q,ie),Xe=et,Ge=xe(q,Oe,ie=="before");return Xe!=null&&(Ge.other=xe(q,Xe,ie!="before")),Ge}function Yt(e,t){var i=0;t=O(e.doc,t),e.options.lineWrapping||(i=Ar(e.display)*t.ch);var r=Lt(e.doc,t.line),f=$r(r)+$a(e.display);return{left:i,right:i,top:f,bottom:f+r.height}}function Vt(e,t,i,r,f){var F=pt(e,t,i);return F.xRel=f,r&&(F.outside=r),F}function Sn(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Vt(r.first,0,null,-1,-1);var f=Fn(r,i),F=r.first+r.size-1;if(f>F)return Vt(r.first+r.size-1,Lt(r,F).text.length,null,1,1);t<0&&(t=0);for(var X=Lt(r,f);;){var Q=rr(e,X,f,t,i),q=si(X,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var ie=q.find(1);if(ie.line==f)return ie;X=Lt(r,f=ie.line)}}function Ln(e,t,i,r){r-=hn(t);var f=t.text.length,F=st(function(X){return ze(e,i,X-1).bottom<=r},f,0);return f=st(function(X){return ze(e,i,X).top>r},F,f),{begin:F,end:f}}function Ht(e,t,i,r){i||(i=Me(e,t));var f=Rn(e,t,ze(e,i,r),"line").top;return Ln(e,t,i,f)}function Dn(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function rr(e,t,i,r,f){f-=$r(t);var F=Me(e,t),X=hn(t),Q=0,q=t.text.length,ie=!0,xe=yt(t,e.doc.direction);if(xe){var Oe=(e.options.lineWrapping?Xn:Un)(e,t,i,F,xe,r,f);ie=Oe.level!=1,Q=ie?Oe.from:Oe.to-1,q=ie?Oe.to:Oe.from-1}var Xe=null,Ge=null,nt=st(function(qt){var Xt=ze(e,F,qt);return Xt.top+=X,Xt.bottom+=X,Dn(Xt,r,f,!1)?(Xt.top<=f&&Xt.left<=r&&(Xe=qt,Ge=Xt),!0):!1},Q,q),gt,St,Ot=!1;if(Ge){var Dt=r-Ge.left<Ge.right-r,At=Dt==ie;nt=Xe+(At?0:1),St=At?"after":"before",gt=Dt?Ge.left:Ge.right}else{!ie&&(nt==q||nt==Q)&&nt++,St=nt==0?"after":nt==t.text.length?"before":ze(e,F,nt-(ie?1:0)).bottom+X<=f==ie?"after":"before";var Nt=Tn(e,pt(i,nt,St),"line",t,F);gt=Nt.left,Ot=f<Nt.top?-1:f>=Nt.bottom?1:0}return nt=Ke(t.text,nt,1),Vt(i,nt,St,Ot,r-gt)}function Un(e,t,i,r,f,F,X){var Q=st(function(Oe){var Xe=f[Oe],Ge=Xe.level!=1;return Dn(Tn(e,pt(i,Ge?Xe.to:Xe.from,Ge?"before":"after"),"line",t,r),F,X,!0)},0,f.length-1),q=f[Q];if(Q>0){var ie=q.level!=1,xe=Tn(e,pt(i,ie?q.from:q.to,ie?"after":"before"),"line",t,r);Dn(xe,F,X,!0)&&xe.top>X&&(q=f[Q-1])}return q}function Xn(e,t,i,r,f,F,X){var Q=Ln(e,t,r,X),q=Q.begin,ie=Q.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var xe=null,Oe=null,Xe=0;Xe<f.length;Xe++){var Ge=f[Xe];if(Ge.from>=ie||Ge.to<=q)continue;var nt=Ge.level!=1,gt=ze(e,r,nt?Math.min(ie,Ge.to)-1:Math.max(q,Ge.from)).right,St=gt<F?F-gt+1e9:gt-F;(!xe||Oe>St)&&(xe=Ge,Oe=St)}return xe||(xe=f[f.length-1]),xe.from<q&&(xe={from:q,to:xe.to,level:xe.level}),xe.to>ie&&(xe={from:xe.from,to:ie,level:xe.level}),xe}var Gn;function pr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Gn==null){Gn=h("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Gn.appendChild(document.createTextNode("x")),Gn.appendChild(h("br"));Gn.appendChild(document.createTextNode("x"))}p(e.measure,Gn);var i=Gn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),b(e.measure),i||1}function Ar(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=h("span","xxxxxxxxxx"),i=h("pre",[t],"CodeMirror-line-like");p(e.measure,i);var r=t.getBoundingClientRect(),f=(r.right-r.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function sr(e){for(var t=e.display,i={},r={},f=t.gutters.clientLeft,F=t.gutters.firstChild,X=0;F;F=F.nextSibling,++X){var Q=e.display.gutterSpecs[X].className;i[Q]=F.offsetLeft+F.clientLeft+f,r[Q]=F.clientWidth}return{fixedPos:Vr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Vr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function bi(e){var t=pr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Ar(e.display)-3);return function(f){if(Gr(e.doc,f))return 0;var F=0;if(f.widgets)for(var X=0;X<f.widgets.length;X++)f.widgets[X].height&&(F+=f.widgets[X].height);return i?F+(Math.ceil(f.text.length/r)||1)*t:F+t}}function Zr(e){var t=e.doc,i=bi(e);t.iter(function(r){var f=i(r);f!=r.height&&Nn(r,f)})}function Rr(e,t,i,r){var f=e.display;if(!i&&be(t).getAttribute("cm-not-content")=="true")return null;var F,X,Q=f.lineSpace.getBoundingClientRect();try{F=t.clientX-Q.left,X=t.clientY-Q.top}catch(Oe){return null}var q=Sn(e,F,X),ie;if(r&&q.xRel>0&&(ie=Lt(e.doc,q.line).text).length==q.ch){var xe=J(ie,ie.length,e.options.tabSize)-ie.length;q=pt(q.line,Math.max(0,Math.round((F-Re(e.display).left)/Ar(e.display))-xe))}return q}function qn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function Yn(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var f=e.display;if(r&&i<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>t)&&(f.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=f.viewTo)or&&gi(e.doc,t)<f.viewTo&&ir(e);else if(i<=f.viewFrom)or&&Fr(e.doc,i+r)>f.viewFrom?ir(e):(f.viewFrom+=r,f.viewTo+=r);else if(t<=f.viewFrom&&i>=f.viewTo)ir(e);else if(t<=f.viewFrom){var F=Ei(e,i,i+r,1);F?(f.view=f.view.slice(F.index),f.viewFrom=F.lineN,f.viewTo+=r):ir(e)}else if(i>=f.viewTo){var X=Ei(e,t,t,-1);X?(f.view=f.view.slice(0,X.index),f.viewTo=X.lineN):ir(e)}else{var Q=Ei(e,t,t,-1),q=Ei(e,i,i+r,1);Q&&q?(f.view=f.view.slice(0,Q.index).concat(yr(e,Q.lineN,q.lineN)).concat(f.view.slice(q.index)),f.viewTo+=r):ir(e)}var ie=f.externalMeasured;ie&&(i<ie.lineN?ie.lineN+=r:t<ie.lineN+ie.size&&(f.externalMeasured=null))}function lr(e,t,i){e.curOp.viewChanged=!0;var r=e.display,f=e.display.externalMeasured;if(f&&t>=f.lineN&&t<f.lineN+f.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var F=r.view[qn(e,t)];if(F.node==null)return;var X=F.changes||(F.changes=[]);se(X,i)==-1&&X.push(i)}function ir(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ei(e,t,i,r){var f=qn(e,t),F,X=e.display.view;if(!or||i==e.doc.first+e.doc.size)return{index:f,lineN:i};for(var Q=e.display.viewFrom,q=0;q<f;q++)Q+=X[q].size;if(Q!=t){if(r>0){if(f==X.length-1)return null;F=Q+X[f].size-t,f++}else F=Q-t;t+=F,i+=F}for(;gi(e.doc,i)!=i;){if(f==(r<0?0:X.length-1))return null;i+=r*X[f-(r<0?1:0)].size,f+=r}return{index:f,lineN:i}}function Wi(e,t,i){var r=e.display,f=r.view;f.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=yr(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=yr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(qn(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(yr(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,qn(e,i)))),r.viewTo=i}function Ki(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var f=t[r];!f.hidden&&(!f.node||f.changes)&&++i}return i}function zn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Oi(e,t){t===void 0&&(t=!0);for(var i=e.doc,r={},f=r.cursors=document.createDocumentFragment(),F=r.selection=document.createDocumentFragment(),X=0;X<i.sel.ranges.length;X++){if(!t&&X==i.sel.primIndex)continue;var Q=i.sel.ranges[X];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var q=Q.empty();(q||e.options.showCursorWhenSelecting)&&Gi(e,Q.head,f),q||Kn(e,Q,F)}return r}function Gi(e,t,i){var r=Tn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),f=i.appendChild(h("div","\xA0","CodeMirror-cursor"));if(f.style.left=r.left+"px",f.style.top=r.top+"px",f.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var F=i.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 Zn(e,t){return e.top-t.top||e.left-t.left}function Kn(e,t,i){var r=e.display,f=e.doc,F=document.createDocumentFragment(),X=Re(e.display),Q=X.left,q=Math.max(r.sizerWidth,_e(e)-r.sizer.offsetLeft)-X.right,ie=f.direction=="ltr";function xe(At,Nt,qt,Xt){Nt<0&&(Nt=0),Nt=Math.round(Nt),Xt=Math.round(Xt),F.appendChild(h("div",null,"CodeMirror-selected","position: absolute; left: "+At+`px;
|
|
top: `+Nt+"px; width: "+(qt==null?q-At:qt)+`px;
|
|
height: `+(Xt-Nt)+"px"))}function Oe(At,Nt,qt){var Xt=Lt(f,At),yn=Xt.text.length,er,Nr;function cr(Cr,hi){return nr(e,pt(At,Cr),"div",Xt,hi)}function vi(Cr,hi,Br){var Mr=Ht(e,Xt,null,Cr),Or=hi=="ltr"==(Br=="after")?"left":"right",mr=Br=="after"?Mr.begin:Mr.end-(/\s/.test(Xt.text.charAt(Mr.end-1))?2:1);return cr(mr,Or)[Or]}var di=yt(Xt,f.direction);return at(di,Nt||0,qt==null?yn:qt,function(Cr,hi,Br,Mr){var Or=Br=="ltr",mr=cr(Cr,Or?"left":"right"),fi=cr(hi-1,Or?"right":"left"),Ga=Nt==null&&Cr==0,pa=qt==null&&hi==yn,Yr=Mr==0,$i=!di||Mr==di.length-1;if(fi.top-mr.top<=3){var Ur=(ie?Ga:pa)&&Yr,ps=(ie?pa:Ga)&&$i,ra=Ur?Q:(Or?mr:fi).left,Ta=ps?q:(Or?fi:mr).right;xe(ra,mr.top,Ta-ra,mr.bottom)}else{var wa,ni,za,ms;Or?(wa=ie&&Ga&&Yr?Q:mr.left,ni=ie?q:vi(Cr,Br,"before"),za=ie?Q:vi(hi,Br,"after"),ms=ie&&pa&&$i?q:fi.right):(wa=ie?vi(Cr,Br,"before"):Q,ni=!ie&&Ga&&Yr?q:mr.right,za=!ie&&pa&&$i?Q:fi.left,ms=ie?vi(hi,Br,"after"):q),xe(wa,mr.top,ni-wa,mr.bottom),mr.bottom<fi.top&&xe(Q,mr.bottom,null,fi.top),xe(za,fi.top,ms-za,fi.bottom)}(!er||Zn(mr,er)<0)&&(er=mr),Zn(fi,er)<0&&(er=fi),(!Nr||Zn(mr,Nr)<0)&&(Nr=mr),Zn(fi,Nr)<0&&(Nr=fi)}),{start:er,end:Nr}}var Xe=t.from(),Ge=t.to();if(Xe.line==Ge.line)Oe(Xe.line,Xe.ch,Ge.ch);else{var nt=Lt(f,Xe.line),gt=Lt(f,Ge.line),St=wr(nt)==wr(gt),Ot=Oe(Xe.line,Xe.ch,St?nt.text.length+1:null).end,Dt=Oe(Ge.line,St?0:null,Ge.ch).start;St&&(Ot.top<Dt.top-2?(xe(Ot.right,Ot.top,null,Ot.bottom),xe(Q,Dt.top,Dt.left,Dt.bottom)):xe(Ot.right,Ot.top,Dt.left-Ot.right,Ot.bottom)),Ot.bottom<Dt.top&&xe(Q,Ot.bottom,null,Dt.top)}i.appendChild(F)}function Lr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||aa(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function To(e){e.state.focused||(e.display.input.focus(),zi(e))}function Ja(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,aa(e))},100)}function zi(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ne(e,"focus",e,t),e.state.focused=!0,B(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()),Lr(e)}function aa(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ne(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ca(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var f=t.view[r],F=e.options.lineWrapping,X=void 0,Q=0;if(f.hidden)continue;if(K&&N<8){var q=f.node.offsetTop+f.node.offsetHeight;X=q-i,i=q}else{var ie=f.node.getBoundingClientRect();X=ie.bottom-ie.top,!F&&f.text.firstChild&&(Q=f.text.firstChild.getBoundingClientRect().right-ie.left-1)}var xe=f.line.height-X;if((xe>.005||xe<-.005)&&(Nn(f.line,X),Qa(f.line),f.rest))for(var Oe=0;Oe<f.rest.length;Oe++)Qa(f.rest[Oe]);if(Q>e.display.sizerWidth){var Xe=Math.ceil(Q/Ar(e.display));Xe>e.display.maxLineLength&&(e.display.maxLineLength=Xe,e.display.maxLine=f.line,e.display.maxLineChanged=!0)}}}function Qa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Oa(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-$a(e));var f=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,F=Fn(t,r),X=Fn(t,f);if(i&&i.ensure){var Q=i.ensure.from.line,q=i.ensure.to.line;Q<F?(F=Q,X=Fn(t,$r(Lt(t,Q))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=X&&(F=Fn(t,$r(Lt(t,q))-e.wrapper.clientHeight),X=q)}return{from:F,to:Math.max(X,F+1)}}function Xo(e,t){if(je(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),f=null;if(t.top+r.top<0?f=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!s){var F=h("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-$a(e.display))+`px;
|
|
height: `+(t.bottom-t.top+ke(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(f),e.display.lineSpace.removeChild(F)}}function Yo(e,t,i,r){r==null&&(r=0);var f;!e.options.lineWrapping&&t==i&&(t=t.ch?pt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?pt(t.line,t.ch+1,"before"):t);for(var F=0;F<5;F++){var X=!1,Q=Tn(e,t),q=!i||i==t?Q:Tn(e,i);f={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-r,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+r};var ie=Za(e,f),xe=e.doc.scrollTop,Oe=e.doc.scrollLeft;if(ie.scrollTop!=null&&(la(e,ie.scrollTop),Math.abs(e.doc.scrollTop-xe)>1&&(X=!0)),ie.scrollLeft!=null&&(_i(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-Oe)>1&&(X=!0)),!X)break}return f}function wo(e,t){var i=Za(e,t);i.scrollTop!=null&&la(e,i.scrollTop),i.scrollLeft!=null&&_i(e,i.scrollLeft)}function Za(e,t){var i=e.display,r=pr(e.display);t.top<0&&(t.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,F=ne(e),X={};t.bottom-t.top>F&&(t.bottom=t.top+F);var Q=e.doc.height+ge(i),q=t.top<r,ie=t.bottom>Q-r;if(t.top<f)X.scrollTop=q?0:t.top;else if(t.bottom>f+F){var xe=Math.min(t.top,(ie?Q:t.bottom)-F);xe!=f&&(X.scrollTop=xe)}var Oe=e.options.fixedGutter?0:i.gutters.offsetWidth,Xe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Oe,Ge=_e(e)-i.gutters.offsetWidth,nt=t.right-t.left>Ge;return nt&&(t.right=t.left+Ge),t.left<10?X.scrollLeft=0:t.left<Xe?X.scrollLeft=Math.max(0,t.left+Oe-(nt?0:10)):t.right>Ge+Xe-3&&(X.scrollLeft=t.right+(nt?0:10)-Ge),X}function qa(e,t){if(t==null)return;Aa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function oa(e){Aa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sa(e,t,i){(t!=null||i!=null)&&Aa(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function $o(e,t){Aa(e),e.curOp.scrollToPos=t}function Aa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Yt(e,t.from),r=Yt(e,t.to);ya(e,i,r,t.margin)}}function ya(e,t,i,r){var f=Za(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});sa(e,f.scrollLeft,f.scrollTop)}function la(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||_a(e,{top:t}),ua(e,t,!0),P&&_a(e),Ea(e,100)}function ua(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function _i(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Cn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Qi(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+ge(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?i:0,docHeight:r,scrollHeight:r+ke(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Vi=function(e,t,i){this.cm=i;var r=this.vert=h("div",[h("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=h("div",[h("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=f.tabIndex=-1,e(r),e(f),Se(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Se(f,"scroll",function(){f.clientWidth&&t(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&N<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var f=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var F=e.viewWidth-e.barLeft-(i?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:i?r:0,bottom:t?r:0}},Vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Vi.prototype.zeroWidthHack=function(){var e=o&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},Vi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var f=e.getBoundingClientRect(),F=i=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);F!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function Zi(e,t){t||(t=Qi(e));var i=e.display.barWidth,r=e.display.barHeight;Ra(e,t);for(var f=0;f<4&&i!=e.display.barWidth||r!=e.display.barHeight;f++)i!=e.display.barWidth&&e.options.lineWrapping&&Ca(e),Ra(e,Qi(e)),i=e.display.barWidth,r=e.display.barHeight}function Ra(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var eo={native:Vi,null:ba};function La(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Se(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?_i(e,t):la(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var to=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:++to},Qr(e.curOp)}function qi(e){var t=e.curOp;t&&Pn(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;So(i)})}function So(e){for(var t=e.ops,i=0;i<t.length;i++)Jo(t[i]);for(var r=0;r<t.length;r++)Qo(t[r]);for(var f=0;f<t.length;f++)Zo(t[f]);for(var F=0;F<t.length;F++)no(t[F]);for(var X=0;X<t.length;X++)qo(t[X])}function Jo(e){var t=e.cm,i=t.display;Co(t),e.updateMaxLine&&Li(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new xi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qo(e){e.updatedDisplay=e.mustUpdate&&ea(e.cm,e.update)}function Zo(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ca(t),e.barMeasure=Qi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=we(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+ke(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-_e(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function no(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&_i(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==U();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Zi(t,e.barMeasure),e.updatedDisplay&&Wn(t,e.barMeasure),e.selectionChanged&&Lr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&To(e.cm)}function qo(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&Ia(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&ua(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&_i(t,e.scrollLeft,!0,!0),e.scrollToPos){var f=Yo(t,O(r,e.scrollToPos.from),O(r,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,f)}var F=e.maybeHiddenMarkers,X=e.maybeUnhiddenMarkers;if(F)for(var Q=0;Q<F.length;++Q)F[Q].lines.length||Ne(F[Q],"hide");if(X)for(var q=0;q<X.length;++q)X[q].lines.length&&Ne(X[q],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ne(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function qr(e,t){if(e.curOp)return t();Xi(e);try{return t()}finally{qi(e)}}function br(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xi(e);try{return t.apply(e,arguments)}finally{qi(e)}}}function jr(e){return function(){if(this.curOp)return e.apply(this,arguments);Xi(this);try{return e.apply(this,arguments)}finally{qi(this)}}}function Er(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{qi(t)}}}function Ea(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,j(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=wt(e,t.highlightFrontier),f=[];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?Mt(t.mode,r.state):null,q=Ce(e,F,r,!0);Q&&(r.state=Q),F.styles=q.styles;var ie=F.styleClasses,xe=q.classes;xe?F.styleClasses=xe:ie&&(F.styleClasses=null);for(var Oe=!X||X.length!=F.styles.length||ie!=xe&&(!ie||!xe||ie.bgClass!=xe.bgClass||ie.textClass!=xe.textClass),Xe=0;!Oe&&Xe<X.length;++Xe)Oe=X[Xe]!=F.styles[Xe];Oe&&f.push(r.line),F.stateAfter=r.save(),r.nextLine()}else F.text.length<=e.options.maxHighlightLength&&Pt(e,F.text,r),F.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return Ea(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),f.length&&qr(e,function(){for(var F=0;F<f.length;F++)lr(e,f[F],"text")})}var xi=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Oa(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=_e(e),this.force=i,this.dims=sr(e),this.events=[]};xi.prototype.signal=function(e,t){he(e,t)&&this.events.push(arguments)},xi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ne.apply(null,this.events[e])};function Co(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ke(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ke(e)+"px",t.scrollbarsClipped=!0)}function Oo(e){if(e.hasFocus())return null;var t=U();if(!t||!x(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&x(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function Ao(e){if(!e||!e.activeElt||e.activeElt==U())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function ea(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return ir(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Ki(e)==0)return!1;Ir(e)&&(ir(e),t.dims=sr(e));var f=r.first+r.size,F=Math.max(t.visible.from-e.options.viewportMargin,r.first),X=Math.min(f,t.visible.to+e.options.viewportMargin);i.viewFrom<F&&F-i.viewFrom<20&&(F=Math.max(r.first,i.viewFrom)),i.viewTo>X&&i.viewTo-X<20&&(X=Math.min(f,i.viewTo)),or&&(F=gi(e.doc,F),X=Fr(e.doc,X));var Q=F!=i.viewFrom||X!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Wi(e,F,X),i.viewOffset=$r(Lt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var q=Ki(e);if(!Q&&q==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ie=Oo(e);return q>4&&(i.lineDiv.style.display="none"),Ro(e,i.updateLineNumbers,t.dims),q>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Ao(ie),b(i.cursorDiv),b(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Q&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Ea(e,400)),i.updateLineNumbers=null,!0}function Ia(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==_e(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ge(e.display)-ne(e),i.top)}),t.visible=Oa(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Oa(e.display,e.doc,i));if(!ea(e,t))break;Ca(e);var f=Qi(e);zn(e),Zi(e,f),Wn(e,f),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 _a(e,t){var i=new xi(e,t);if(ea(e,i)){Ca(e),Ia(e,i);var r=Qi(e);zn(e),Zi(e,r),Wn(e,r),i.finish()}}function Ro(e,t,i){var r=e.display,f=e.options.lineNumbers,F=r.lineDiv,X=F.firstChild;function Q(nt){var gt=nt.nextSibling;return n&&o&&e.display.currentWheelTarget==nt?nt.style.display="none":nt.parentNode.removeChild(nt),gt}for(var q=r.view,ie=r.viewFrom,xe=0;xe<q.length;xe++){var Oe=q[xe];if(!Oe.hidden)if(!Oe.node||Oe.node.parentNode!=F){var Xe=_o(e,Oe,ie,i);F.insertBefore(Xe,X)}else{for(;X!=Oe.node;)X=Q(X);var Ge=f&&t!=null&&t<=ie&&Oe.lineNumber;Oe.changes&&(se(Oe.changes,"gutter")>-1&&(Ge=!1),Bi(e,Oe,ie,i)),Ge&&(b(Oe.lineNumber),Oe.lineNumber.appendChild(document.createTextNode(gr(e.options,ie)))),X=Oe.node.nextSibling}ie+=Oe.size}for(;X;)X=Q(X)}function Da(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Wn(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+ke(e)+"px"}function Cn(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Vr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,f=t.gutters.offsetWidth,F=r+"px",X=0;X<i.length;X++)if(!i[X].hidden){e.options.fixedGutter&&(i[X].gutter&&(i[X].gutter.style.left=F),i[X].gutterBackground&&(i[X].gutterBackground.style.left=F));var Q=i[X].alignable;if(Q)for(var q=0;q<Q.length;q++)Q[q].style.left=F}e.options.fixedGutter&&(t.gutters.style.left=r+f+"px")}function Ir(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=gr(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var f=r.measure.appendChild(h("div",[h("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),F=f.firstChild.offsetWidth,X=f.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?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Da(e.display),!0}return!1}function ei(e,t){for(var i=[],r=!1,f=0;f<e.length;f++){var F=e[f],X=null;if(typeof F!="string"&&(X=F.style,F=F.className),F=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:F,style:X})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function ca(e){var t=e.gutters,i=e.gutterSpecs;b(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var f=i[r],F=f.className,X=f.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=i.length?"":"none",Da(e)}function Di(e){ca(e.display),Yn(e),Cn(e)}function xa(e,t,i,r){var f=this;this.input=i,f.scrollbarFiller=h("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=h("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=_("div",null,"CodeMirror-code"),f.selectionDiv=h("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=h("div",null,"CodeMirror-cursors"),f.measure=h("div",null,"CodeMirror-measure"),f.lineMeasure=h("div",null,"CodeMirror-measure"),f.lineSpace=_("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var F=_("div",[f.lineSpace],"CodeMirror-lines");f.mover=h("div",[F],null,"position: relative"),f.sizer=h("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=h("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),f.gutters=h("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=h("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=h("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),K&&N<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!n&&!(P&&l)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=t.first,f.reportedViewFrom=f.reportedViewTo=t.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=ei(r.gutters,r.lineNumbers),ca(f),i.init(f)}var Yi=0,Dr=null;K?Dr=-.53:P?Dr=15:y?Dr=-.7:m&&(Dr=-1/3);function Ma(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function ro(e){var t=Ma(e);return t.x*=Dr,t.y*=Dr,t}function io(e,t){var i=Ma(t),r=i.x,f=i.y,F=e.display,X=F.scroller,Q=X.scrollWidth>X.clientWidth,q=X.scrollHeight>X.clientHeight;if(!(r&&Q||f&&q))return;if(f&&o&&n){e:for(var ie=t.target,xe=F.view;ie!=X;ie=ie.parentNode)for(var Oe=0;Oe<xe.length;Oe++)if(xe[Oe].node==ie){e.display.currentWheelTarget=ie;break e}}if(r&&!P&&!g&&Dr!=null){f&&q&&la(e,Math.max(0,X.scrollTop+f*Dr)),_i(e,Math.max(0,X.scrollLeft+r*Dr)),(!f||f&&q)&&re(t),F.wheelStartX=null;return}if(f&&Dr!=null){var Xe=f*Dr,Ge=e.doc.scrollTop,nt=Ge+F.wrapper.clientHeight;Xe<0?Ge=Math.max(0,Ge+Xe-50):nt=Math.min(e.doc.height,nt+Xe+50),_a(e,{top:Ge,bottom:nt})}Yi<20&&(F.wheelStartX==null?(F.wheelStartX=X.scrollLeft,F.wheelStartY=X.scrollTop,F.wheelDX=r,F.wheelDY=f,setTimeout(function(){if(F.wheelStartX==null)return;var gt=X.scrollLeft-F.wheelStartX,St=X.scrollTop-F.wheelStartY,Ot=St&&F.wheelDY&&St/F.wheelDY||gt&&F.wheelDX&>/F.wheelDX;if(F.wheelStartX=F.wheelStartY=null,!Ot)return;Dr=(Dr*Yi+Ot)/(Yi+1),++Yi},200)):(F.wheelDX+=r,F.wheelDY+=f))}var ti=function(e,t){this.ranges=e,this.primIndex=t};ti.prototype.primary=function(){return this.ranges[this.primIndex]},ti.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 i=this.ranges[t],r=e.ranges[t];if(!kr(i.anchor,r.anchor)||!kr(i.head,r.head))return!1}return!0},ti.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Hn(Hr(this.ranges[t].anchor),Hr(this.ranges[t].head));return new ti(e,this.primIndex)},ti.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ti.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(Gt(t,r.from())>=0&&Gt(e,r.to())<=0)return i}return-1};var Hn=function(e,t){this.anchor=e,this.head=t};Hn.prototype.from=function(){return Wr(this.anchor,this.head)},Hn.prototype.to=function(){return ri(this.anchor,this.head)},Hn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ti(e,t,i){var r=e&&e.options.selectionsMayTouch,f=t[i];t.sort(function(Xe,Ge){return Gt(Xe.from(),Ge.from())}),i=se(t,f);for(var F=1;F<t.length;F++){var X=t[F],Q=t[F-1],q=Gt(Q.to(),X.from());if(r&&!X.empty()?q>0:q>=0){var ie=Wr(Q.from(),X.from()),xe=ri(Q.to(),X.to()),Oe=Q.empty()?X.from()==X.head:Q.from()==Q.head;F<=i&&--i,t.splice(--F,2,new Hn(Oe?xe:ie,Oe?ie:xe))}}return new ti(t,i)}function Mi(e,t){return new ti([new Hn(e,t||e)],0)}function ki(e){return e.text?pt(e.from.line+e.text.length-1,Ye(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ao(e,t){if(Gt(e,t.from)<0)return e;if(Gt(e,t.to)<=0)return ki(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ki(t).ch-t.to.ch),pt(i,r)}function ka(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var f=e.sel.ranges[r];i.push(new Hn(ao(f.anchor,t),ao(f.head,t)))}return Ti(e.cm,i,e.sel.primIndex)}function Lo(e,t,i){return e.line==t.line?pt(i.line,e.ch-t.ch+i.ch):pt(i.line+(e.line-t.line),e.ch)}function Io(e,t,i){for(var r=[],f=pt(e.first,0),F=f,X=0;X<t.length;X++){var Q=t[X],q=Lo(Q.from,f,F),ie=Lo(ki(Q),f,F);if(f=Q.to,F=ie,i=="around"){var xe=e.sel.ranges[X],Oe=Gt(xe.head,xe.anchor)<0;r[X]=new Hn(Oe?ie:q,Oe?q:ie)}else r[X]=new Hn(q,q)}return new ti(r,e.sel.primIndex)}function ta(e){e.doc.mode=en(e.options,e.doc.modeOption),oo(e)}function oo(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,Ea(e,100),e.state.modeGen++,e.curOp&&Yn(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&Ye(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,i,r){function f(Dt){return i?i[Dt]:null}function F(Dt,At,Nt){Ji(Dt,At,Nt,r),_n(Dt,"change",Dt,t)}function X(Dt,At){for(var Nt=[],qt=Dt;qt<At;++qt)Nt.push(new Jr(ie[qt],f(qt),r));return Nt}var Q=t.from,q=t.to,ie=t.text,xe=Lt(e,Q.line),Oe=Lt(e,q.line),Xe=Ye(ie),Ge=f(ie.length-1),nt=q.line-Q.line;if(t.full)e.insert(0,X(0,ie.length)),e.remove(ie.length,e.size-ie.length);else if(gs(e,t)){var gt=X(0,ie.length-1);F(Oe,Oe.text,Ge),nt&&e.remove(Q.line,nt),gt.length&&e.insert(Q.line,gt)}else if(xe==Oe)if(ie.length==1)F(xe,xe.text.slice(0,Q.ch)+Xe+xe.text.slice(q.ch),Ge);else{var St=X(1,ie.length-1);St.push(new Jr(Xe+xe.text.slice(q.ch),Ge,r)),F(xe,xe.text.slice(0,Q.ch)+ie[0],f(0)),e.insert(Q.line+1,St)}else if(ie.length==1)F(xe,xe.text.slice(0,Q.ch)+ie[0]+Oe.text.slice(q.ch),f(0)),e.remove(Q.line+1,nt);else{F(xe,xe.text.slice(0,Q.ch)+ie[0],f(0)),F(Oe,Xe+Oe.text.slice(q.ch),Ge);var Ot=X(1,ie.length-1);nt>1&&e.remove(Q.line+1,nt-1),e.insert(Q.line+1,Ot)}_n(e,"change",e,t)}function da(e,t,i){function r(f,F,X){if(f.linked)for(var Q=0;Q<f.linked.length;++Q){var q=f.linked[Q];if(q.doc==F)continue;var ie=X&&q.sharedHist;if(i&&!ie)continue;t(q.doc,ie),r(q.doc,f,ie)}}r(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Zr(e),ta(e),ys(e),e.options.lineWrapping||Li(e),e.options.mode=t.modeOption,Yn(e)}function ys(e){(e.doc.direction=="rtl"?B:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){qr(e,function(){ys(e),Yn(e)})}function Do(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 ns(e,t){var i={from:Hr(t.from),to:ki(t),text:ar(e,t.from,t.to)};return _s(e,i,t.from.line,t.to.line+1),da(e,function(r){return _s(r,i,t.from.line,t.to.line+1)},!0),i}function bs(e){for(;e.length;){var t=Ye(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return bs(e.done),Ye(e.done);if(e.done.length&&!Ye(e.done).ranges)return Ye(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ye(e.done)}function Es(e,t,i,r){var f=e.history;f.undone.length=0;var F=+new Date,X,Q;if((f.lastOp==r||f.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&f.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(X=pl(f,f.lastOp==r)))Q=Ye(X.changes),Gt(t.from,t.to)==0&&Gt(t.from,Q.to)==0?Q.to=ki(t):X.changes.push(ns(e,t));else{var q=Ye(f.done);for((!q||!q.ranges)&&Mo(e.sel,f.done),X={changes:[ns(e,t)],generation:f.generation},f.done.push(X);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(i),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=F,f.lastOp=f.lastSelOp=r,f.lastOrigin=f.lastSelOrigin=t.origin,Q||Ne(e,"historyAdded")}function ml(e,t,i,r){var f=t.charAt(0);return f=="*"||f=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var f=e.history,F=r&&r.origin;i==f.lastSelOp||F&&f.lastSelOrigin==F&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==F||ml(e,F,Ye(f.done),t))?f.done[f.done.length-1]=t:Mo(t,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=F,f.lastSelOp=i,r&&r.clearRedo!==!1&&bs(f.undone)}function Mo(e,t){var i=Ye(t);i&&i.ranges&&i.equals(e)||t.push(e)}function _s(e,t,i,r){var f=t["spans_"+e.id],F=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(X){X.markedSpans&&((f||(f=t["spans_"+e.id]={}))[F]=X.markedSpans),++F})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],f=0;f<t.text.length;++f)r.push(vl(i[f]));return r}function xs(e,t){var i=yl(e,t),r=oi(e,t);if(!i)return r;if(!r)return i;for(var f=0;f<i.length;++f){var F=i[f],X=r[f];if(F&&X){e:for(var Q=0;Q<X.length;++Q){for(var q=X[Q],ie=0;ie<F.length;++ie)if(F[ie].marker==q.marker)continue e;F.push(q)}}else X&&(i[f]=X)}return i}function Pa(e,t,i){for(var r=[],f=0;f<e.length;++f){var F=e[f];if(F.ranges){r.push(i?ti.prototype.deepCopy.call(F):F);continue}var X=F.changes,Q=[];r.push({changes:Q});for(var q=0;q<X.length;++q){var ie=X[q],xe=void 0;if(Q.push({from:ie.from,to:ie.to,text:ie.text}),t)for(var Oe in ie)(xe=Oe.match(/^spans_(\d+)$/))&&(se(t,Number(xe[1]))>-1&&(Ye(Q)[Oe]=ie[Oe],delete ie[Oe]))}}return r}function rs(e,t,i,r){if(r){var f=e.anchor;if(i){var F=Gt(t,f)<0;F!=Gt(i,f)<0?(f=t,t=i):F!=Gt(t,i)<0&&(t=i)}return new Hn(f,t)}else return new Hn(i||t,t)}function ko(e,t,i,r,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Xr(e,new ti([rs(e.sel.primary(),t,i,f)],0),r)}function Ts(e,t,i){for(var r=[],f=e.cm&&(e.cm.display.shift||e.extend),F=0;F<e.sel.ranges.length;F++)r[F]=rs(e.sel.ranges[F],t[F],null,f);var X=Ti(e.cm,r,e.sel.primIndex);Xr(e,X,i)}function is(e,t,i,r){var f=e.sel.ranges.slice(0);f[t]=i,Xr(e,Ti(e.cm,f,e.sel.primIndex),r)}function ws(e,t,i,r){Xr(e,Mi(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(f){this.ranges=[];for(var F=0;F<f.length;F++)this.ranges[F]=new Hn(O(e,f[F].anchor),O(e,f[F].head))},origin:i&&i.origin};return Ne(e,"beforeSelectionChange",e,r),e.cm&&Ne(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ti(e.cm,r.ranges,r.ranges.length-1):t}function Ss(e,t,i){var r=e.history.done,f=Ye(r);f&&f.ranges?(r[r.length-1]=t,Po(e,t,i)):Xr(e,t,i)}function Xr(e,t,i){Po(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Po(e,t,i){(he(e,"beforeSelectionChange")||e.cm&&he(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(Gt(t.primary().head,e.sel.primary().head)<0?-1:1);Cs(e,As(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&oa(e.cm)}function Cs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ee(e.cm)),_n(e,"cursorActivity",e)}function Os(e){Cs(e,As(e,e.sel,null,!1))}function As(e,t,i,r){for(var f,F=0;F<t.ranges.length;F++){var X=t.ranges[F],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[F],q=No(e,X.anchor,Q&&Q.anchor,i,r),ie=No(e,X.head,Q&&Q.head,i,r);(f||q!=X.anchor||ie!=X.head)&&(f||(f=t.ranges.slice(0,F)),f[F]=new Hn(q,ie))}return f?Ti(e.cm,f,t.primIndex):t}function Na(e,t,i,r,f){var F=Lt(e,t.line);if(F.markedSpans)for(var X=0;X<F.markedSpans.length;++X){var Q=F.markedSpans[X],q=Q.marker,ie="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,xe="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Q.from==null||(ie?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(xe?Q.to>=t.ch:Q.to>t.ch))){if(f&&(Ne(q,"beforeCursorEnter"),q.explicitlyCleared))if(F.markedSpans){--X;continue}else break;if(!q.atomic)continue;if(i){var Oe=q.find(r<0?1:-1),Xe=void 0;if((r<0?xe:ie)&&(Oe=Rs(e,Oe,-r,Oe&&Oe.line==t.line?F:null)),Oe&&Oe.line==t.line&&(Xe=Gt(Oe,i))&&(r<0?Xe<0:Xe>0))return Na(e,Oe,t,r,f)}var Ge=q.find(r<0?-1:1);return(r<0?ie:xe)&&(Ge=Rs(e,Ge,r,Ge.line==t.line?F:null)),Ge?Na(e,Ge,t,r,f):null}}return t}function No(e,t,i,r,f){var F=r||1,X=Na(e,t,i,F,f)||!f&&Na(e,t,i,F,!0)||Na(e,t,i,-F,f)||!f&&Na(e,t,i,-F,!0);return X||(e.cantEdit=!0,pt(e.first,0))}function Rs(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?O(e,pt(t.line-1)):null:i>0&&t.ch==(r||Lt(e,t.line)).text.length?t.line<e.first+e.size-1?pt(t.line+1,0):null:new pt(t.line,t.ch+i)}function Ls(e){e.setSelection(pt(e.firstLine(),0),pt(e.lastLine()),Le)}function Is(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(f,F,X,Q){f&&(r.from=O(e,f)),F&&(r.to=O(e,F)),X&&(r.text=X),Q!==void 0&&(r.origin=Q)}),Ne(e,"beforeChange",e,r),e.cm&&Ne(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 Ua(e,t,i){if(e.cm){if(!e.cm.curOp)return br(e.cm,Ua)(e,t,i);if(e.cm.state.suppressEdits)return}if((he(e,"beforeChange")||e.cm&&he(e.cm,"beforeChange"))&&(t=Is(e,t,!0),!t))return;var r=wi&&!i&&pi(e,t.from,t.to);if(r)for(var f=r.length-1;f>=0;--f)Ds(e,{from:r[f].from,to:r[f].to,text:f?[""]:t.text,origin:t.origin});else Ds(e,t)}function Ds(e,t){if(t.text.length==1&&t.text[0]==""&&Gt(t.from,t.to)==0)return;var i=ka(e,t);Es(e,t,i,e.cm?e.cm.curOp.id:NaN),so(e,t,i,oi(e,t));var r=[];da(e,function(f,F){!F&&se(r,f.history)==-1&&(Ns(f.history,t),r.push(f.history)),so(f,t,null,oi(f,t))})}function Uo(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var f=e.history,F,X=e.sel,Q=t=="undo"?f.done:f.undone,q=t=="undo"?f.undone:f.done,ie=0;ie<Q.length&&!(F=Q[ie],i?F.ranges&&!F.equals(e.sel):!F.ranges);ie++);if(ie==Q.length)return;for(f.lastOrigin=f.lastSelOrigin=null;;)if(F=Q.pop(),F.ranges){if(Mo(F,q),i&&!F.equals(e.sel)){Xr(e,F,{clearRedo:!1});return}X=F}else if(r){Q.push(F);return}else break;var xe=[];Mo(X,q),q.push({changes:xe,generation:f.generation}),f.generation=F.generation||++f.maxGeneration;for(var Oe=he(e,"beforeChange")||e.cm&&he(e.cm,"beforeChange"),Xe=function(gt){var St=F.changes[gt];if(St.origin=t,Oe&&!Is(e,St,!1))return Q.length=0,{};xe.push(ns(e,St));var Ot=gt?ka(e,St):Ye(Q);so(e,St,Ot,xs(e,St)),!gt&&e.cm&&e.cm.scrollIntoView({from:St.from,to:ki(St)});var Dt=[];da(e,function(At,Nt){!Nt&&se(Dt,At.history)==-1&&(Ns(At.history,St),Dt.push(At.history)),so(At,St,null,xs(At,St))})},Ge=F.changes.length-1;Ge>=0;--Ge){var nt=Xe(Ge);if(nt)return nt.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new ti(vt(e.sel.ranges,function(f){return new Hn(pt(f.anchor.line+t,f.anchor.ch),pt(f.head.line+t,f.head.ch))}),e.sel.primIndex),e.cm){Yn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)lr(e.cm,r,"gutter")}}function so(e,t,i,r){if(e.cm&&!e.cm.curOp)return br(e.cm,so)(e,t,i,r);if(t.to.line<e.first){Ms(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 f=t.text.length-1-(e.first-t.from.line);Ms(e,f),t={from:pt(e.first,0),to:pt(t.to.line+f,t.to.ch),text:[Ye(t.text)],origin:t.origin}}var F=e.lastLine();t.to.line>F&&(t={from:t.from,to:pt(F,Lt(e,F).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ar(e,t.from,t.to),i||(i=ka(e,t)),e.cm?El(e.cm,t,r):ts(e,t,r),Po(e,i,Le),e.cantEdit&&No(e,pt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,f=e.display,F=t.from,X=t.to,Q=!1,q=F.line;e.options.lineWrapping||(q=tn(wr(Lt(r,F.line))),r.iter(q,X.line+1,function(Ge){if(Ge==f.maxLine)return Q=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ee(e),ts(r,t,i,bi(e)),e.options.lineWrapping||(r.iter(q,F.line+t.text.length,function(Ge){var nt=ji(Ge);nt>f.maxLineLength&&(f.maxLine=Ge,f.maxLineLength=nt,f.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),ii(r,F.line),Ea(e,400);var ie=t.text.length-(X.line-F.line)-1;t.full?Yn(e):F.line==X.line&&t.text.length==1&&!gs(e.doc,t)?lr(e,F.line,"text"):Yn(e,F.line,X.line+1,ie);var xe=he(e,"changes"),Oe=he(e,"change");if(Oe||xe){var Xe={from:F,to:X,text:t.text,removed:t.removed,origin:t.origin};Oe&&_n(e,"change",e,Xe),xe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Xe)}e.display.selForContextMenu=null}function Fa(e,t,i,r,f){var F;r||(r=i),Gt(r,i)<0&&(F=[r,i],i=F[0],r=F[1]),typeof t=="string"&&(t=e.splitLines(t)),Ua(e,{from:i,to:r,text:t,origin:f})}function ks(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ps(e,t,i,r){for(var f=0;f<e.length;++f){var F=e[f],X=!0;if(F.ranges){F.copied||(F=e[f]=F.deepCopy(),F.copied=!0);for(var Q=0;Q<F.ranges.length;Q++)ks(F.ranges[Q].anchor,t,i,r),ks(F.ranges[Q].head,t,i,r);continue}for(var q=0;q<F.changes.length;++q){var ie=F.changes[q];if(i<ie.from.line)ie.from=pt(ie.from.line+r,ie.from.ch),ie.to=pt(ie.to.line+r,ie.to.ch);else if(t<=ie.to.line){X=!1;break}}X||(e.splice(0,f+1),f=0)}}function Ns(e,t){var i=t.from.line,r=t.to.line,f=t.text.length-(r-i)-1;Ps(e.done,i,r,f),Ps(e.undone,i,r,f)}function lo(e,t,i,r){var f=t,F=t;return typeof t=="number"?F=Lt(e,$(e,t)):f=tn(t),f==null?null:(r(F,f)&&e.cm&&lr(e.cm,f,i),F)}function uo(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}uo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var f=this.lines[i];this.height-=f.height,jt(f),_n(f,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,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,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function co(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var f=e[r];t+=f.chunkSize(),i+=f.height,f.parent=this}this.size=t,this.height=i,this.parent=null}co.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],f=r.chunkSize();if(e<f){var F=Math.min(t,f-e),X=r.height;if(r.removeInner(e,F),this.height-=X-r.height,f==F&&(this.children.splice(i--,1),r.parent=null),(t-=F)==0)break;e=0}else e-=f}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof uo))){var Q=[];this.collapse(Q),this.children=[new uo(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,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var f=this.children[r],F=f.chunkSize();if(e<=F){if(f.insertInner(e,t,i),f.lines&&f.lines.length>50){for(var X=f.lines.length%25+25,Q=X;Q<f.lines.length;){var q=new uo(f.lines.slice(Q,Q+=25));f.height-=q.height,this.children.splice(++r,0,q),q.parent=this}f.lines=f.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),i=new co(t);if(e.parent){e.size-=i.size,e.height-=i.height;var f=se(e.parent.children,e);e.parent.children.splice(f+1,0,i)}else{var r=new co(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var f=this.children[r],F=f.chunkSize();if(e<F){var X=Math.min(t,F-e);if(f.iterN(e,X,i))return!0;if((t-=X)==0)break;e=0}else e-=F}}};var ho=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};ho.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=tn(i);if(r==null||!t)return;for(var f=0;f<t.length;++f)t[f]==this&&t.splice(f--,1);t.length||(i.widgets=null);var F=ia(this);Nn(i,Math.max(0,i.height-F)),e&&(qr(e,function(){Us(e,i,-F),lr(e,r,"widget")}),_n(e,"lineWidgetCleared",e,this,r))},ho.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var f=ia(this)-t;if(!f)return;Gr(this.doc,r)||Nn(r,r.height+f),i&&qr(i,function(){i.curOp.forceUpdate=!0,Us(i,r,f),_n(i,"lineWidgetChanged",i,e,tn(r))})},pe(ho);function Us(e,t,i){$r(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,i)}function _l(e,t,i,r){var f=new ho(e,i,r),F=e.cm;return F&&f.noHScroll&&(F.display.alignWidgets=!0),lo(e,t,"widget",function(X){var Q=X.widgets||(X.widgets=[]);if(f.insertAt==null?Q.push(f):Q.splice(Math.min(Q.length-1,Math.max(0,f.insertAt)),0,f),f.line=X,F&&!Gr(e,X)){var q=$r(X)<e.scrollTop;Nn(X,X.height+ia(f)),q&&qa(F,f.height),F.curOp.forceUpdate=!0}return!0}),F&&_n(F,"lineWidgetAdded",F,f,typeof t=="number"?t:tn(t)),f}var Fs=0,ha=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Fs};ha.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xi(e),he(this,"clear")){var i=this.find();i&&_n(this,"clear",i.from,i.to)}for(var r=null,f=null,F=0;F<this.lines.length;++F){var X=this.lines[F],Q=Tr(X.markedSpans,this);e&&!this.collapsed?lr(e,tn(X),"text"):e&&(Q.to!=null&&(f=tn(X)),Q.from!=null&&(r=tn(X))),X.markedSpans=Ai(X.markedSpans,Q),Q.from==null&&this.collapsed&&!Gr(this.doc,X)&&e&&Nn(X,pr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var ie=wr(this.lines[q]),xe=ji(ie);xe>e.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=xe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Yn(e,r,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&_n(e,"markerCleared",e,this,r,f),t&&qi(e),this.parent&&this.parent.clear()},ha.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,f=0;f<this.lines.length;++f){var F=this.lines[f],X=Tr(F.markedSpans,this);if(X.from!=null&&(i=pt(t?F:tn(F),X.from),e==-1))return i;if(X.to!=null&&(r=pt(t?F:tn(F),X.to),e==1))return r}return i&&{from:i,to:r}},ha.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;qr(r,function(){var f=t.line,F=tn(t.line),X=Ue(r,F);if(X&&(mn(X),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Gr(i.doc,f)&&i.height!=null){var Q=i.height;i.height=null;var q=ia(i)-Q;q&&Nn(f,f.height+q)}_n(r,"markerChanged",r,e)})},ha.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ha.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},pe(ha);function ja(e,t,i,r,f){if(r&&r.shared)return xl(e,t,i,r,f);if(e.cm&&!e.cm.curOp)return br(e.cm,ja)(e,t,i,r,f);var F=new ha(e,f),X=Gt(t,i);if(r&&S(r,F,!1),X>0||X==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=_("span",[F.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(fr(e,t.line,t,i,F)||t.line!=i.line&&fr(e,i.line,t,i,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");yi()}F.addToHistory&&Es(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,ie;if(e.iter(Q,i.line+1,function(Oe){q&&F.collapsed&&!q.options.lineWrapping&&wr(Oe)==q.display.maxLine&&(ie=!0),F.collapsed&&Q!=t.line&&Nn(Oe,0),Si(Oe,new ai(F,Q==t.line?t.ch:null,Q==i.line?i.ch:null)),++Q}),F.collapsed&&e.iter(t.line,i.line+1,function(Oe){Gr(e,Oe)&&Nn(Oe,0)}),F.clearOnEnter&&Se(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(Kr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++Fs,F.atomic=!0),q){if(ie&&(q.curOp.updateMaxLine=!0),F.collapsed)Yn(q,t.line,i.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var xe=t.line;xe<=i.line;xe++)lr(q,xe,"text");F.atomic&&Os(q.doc),_n(q,"markerAdded",q,F)}return F}var fo=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};fo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_n(this,"clear")},fo.prototype.find=function(e,t){return this.primary.find(e,t)},pe(fo);function xl(e,t,i,r,f){r=S(r),r.shared=!1;var F=[ja(e,t,i,r,f)],X=F[0],Q=r.widgetNode;return da(e,function(q){Q&&(r.widgetNode=Q.cloneNode(!0)),F.push(ja(q,O(q,t),O(q,i),r,f));for(var ie=0;ie<q.linked.length;++ie)if(q.linked[ie].isParent)return;X=Ye(F)}),new fo(F,X)}function js(e){return e.findMarks(pt(e.first,0),e.clipPos(pt(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var r=t[i],f=r.find(),F=e.clipPos(f.from),X=e.clipPos(f.to);if(Gt(F,X)){var Q=ja(e,F,X,r.primary,r.primary.type);r.markers.push(Q),Q.parent=r}}}function wl(e){for(var t=function(r){var f=e[r],F=[f.primary.doc];da(f.primary.doc,function(q){return F.push(q)});for(var X=0;X<f.markers.length;X++){var Q=f.markers[X];se(F,Q.doc)==-1&&(Q.parent=null,f.markers.splice(X--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,ci=function(e,t,i,r,f){if(!(this instanceof ci))return new ci(e,t,i,r,f);i==null&&(i=0),co.call(this,[new uo([new Jr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var F=pt(i,0);this.sel=Mi(F),this.history=new Do(null),this.id=++Sl,this.modeOption=t,this.lineSep=r,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:F,to:F,text:e}),Xr(this,Mi(F),Le)};ci.prototype=ft(co.prototype,{constructor:ci,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=In(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Er(function(e){var t=pt(this.first,0),i=this.first+this.size-1;Ua(this,{from:t,to:pt(i,Lt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&sa(this.cm,0,0),Xr(this,Mi(t),Le)}),replaceRange:function(e,t,i,r){t=O(this,t),i=i?O(this,i):t,Fa(this,e,t,i,r)},getRange:function(e,t,i){var r=ar(this,O(this,e),O(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(dr(this,e))return Lt(this,e)},getLineNumber:function(e){return tn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Lt(this,e)),wr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return O(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Er(function(e,t,i){ws(this,O(this,typeof e=="number"?pt(e,t||0):e),null,i)}),setSelection:Er(function(e,t,i){ws(this,O(this,e),O(this,t||e),i)}),extendSelection:Er(function(e,t,i){ko(this,O(this,e),t&&O(this,t),i)}),extendSelections:Er(function(e,t){Ts(this,W(this,e),t)}),extendSelectionsBy:Er(function(e,t){var i=vt(this.sel.ranges,e);Ts(this,W(this,i),t)}),setSelections:Er(function(e,t,i){if(!e.length)return;for(var r=[],f=0;f<e.length;f++)r[f]=new Hn(O(this,e[f].anchor),O(this,e[f].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Xr(this,Ti(this.cm,r,t),i)}),addSelection:Er(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Hn(O(this,e),O(this,t||e))),Xr(this,Ti(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var f=ar(this,t[r].from(),t[r].to());i=i?i.concat(f):f}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var f=ar(this,i[r].from(),i[r].to());e!==!1&&(f=f.join(e||this.lineSeparator())),t[r]=f}return t},replaceSelection:function(e,t,i){for(var r=[],f=0;f<this.sel.ranges.length;f++)r[f]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:Er(function(e,t,i){for(var r=[],f=this.sel,F=0;F<f.ranges.length;F++){var X=f.ranges[F];r[F]={from:X.from(),to:X.to(),text:this.splitLines(e[F]),origin:i}}for(var Q=t&&t!="end"&&Io(this,r,t),q=r.length-1;q>=0;q--)Ua(this,r[q]);Q?Ss(this,Q):this.cm&&oa(this.cm)}),undo:Er(function(){Uo(this,"undo")}),redo:Er(function(){Uo(this,"redo")}),undoSelection:Er(function(){Uo(this,"undo",!0)}),redoSelection:Er(function(){Uo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Do(this.history.maxGeneration),da(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:Pa(this.history.done),undone:Pa(this.history.undone)}},setHistory:function(e){var t=this.history=new Do(this.history.maxGeneration);t.done=Pa(e.done.slice(0),null,!0),t.undone=Pa(e.undone.slice(0),null,!0)},setGutterMarker:Er(function(e,t,i){return lo(this,e,"gutter",function(r){var f=r.gutterMarkers||(r.gutterMarkers={});return f[t]=i,!i&&de(f)&&(r.gutterMarkers=null),!0})}),clearGutter:Er(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&lo(t,i,"gutter",function(){return i.gutterMarkers[e]=null,de(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!dr(this,e))return null;if(t=e,e=Lt(this,e),!e)return null}else if(t=tn(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:Er(function(e,t,i){return lo(this,e,t=="gutter"?"gutter":"class",function(r){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[f])r[f]=i;else{if(A(i).test(r[f]))return!1;r[f]+=" "+i}return!0})}),removeLineClass:Er(function(e,t,i){return lo(this,e,t=="gutter"?"gutter":"class",function(r){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",F=r[f];if(F)if(i==null)r[f]=null;else{var X=F.match(A(i));if(!X)return!1;var Q=X.index+X[0].length;r[f]=F.slice(0,X.index)+(!X.index||Q==F.length?"":" ")+F.slice(Q)||null}else return!1;return!0})}),addLineWidget:Er(function(e,t,i){return _l(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ja(this,O(this,e),O(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=O(this,e),ja(this,e,e,i,"bookmark")},findMarksAt:function(e){e=O(this,e);var t=[],i=Lt(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var f=i[r];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&t.push(f.marker.parent||f.marker)}return t},findMarks:function(e,t,i){e=O(this,e),t=O(this,t);var r=[],f=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 q=X[Q];!(q.to!=null&&f==e.line&&e.ch>=q.to||q.from==null&&f!=e.line||q.from!=null&&f==t.line&&q.from>=t.ch)&&(!i||i(q.marker))&&r.push(q.marker.parent||q.marker)}++f}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(f){var F=f.text.length+r;if(F>e)return t=e,!0;e-=F,++i}),O(this,pt(i,t))},indexFromPos:function(e){e=O(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new ci(In(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new ci(In(this,t,i),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,js(this)),r},unlinkDoc:function(e){if(e instanceof ur&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(js(this));break}if(e.history==this.history){var r=[e.id];da(e,function(f){return r.push(f.id)},!0),e.history=new Do(null),e.history.done=Pa(this.history.done,r),e.history.undone=Pa(this.history.undone,r)}},iterLinkedDocs:function(e){da(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ut(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Er(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)})}),ci.prototype.eachLine=ci.prototype.iter;var Bs=0;function Cl(e){var t=this;if(Hs(t),je(t,e)||Ii(t.display,e))return;re(e),K&&(Bs=+new Date);var i=Rr(t,e,!0),r=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var f=r.length,F=Array(f),X=0,Q=function(){++X==f&&br(t,function(){i=O(t.doc,i);var Ge={from:i,to:i,text:t.doc.splitLines(F.filter(function(nt){return nt!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ua(t.doc,Ge),Ss(t.doc,Mi(O(t.doc,i),O(t.doc,ki(Ge))))})()},q=function(Ge,nt){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,Ge.type)==-1){Q();return}var gt=new FileReader;gt.onerror=function(){return Q()},gt.onload=function(){var St=gt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(St)){Q();return}F[nt]=St,Q()},gt.readAsText(Ge)},ie=0;ie<r.length;ie++)q(r[ie],ie);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var xe=e.dataTransfer.getData("Text");if(xe){var Oe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Oe=t.listSelections()),Po(t.doc,Mi(i,i)),Oe)for(var Xe=0;Xe<Oe.length;++Xe)Fa(t.doc,"",Oe[Xe].anchor,Oe[Xe].head,"drag");t.replaceSelection(xe,"around","paste"),t.display.input.focus()}}catch(Ge){}}}function Ol(e,t){if(K&&(!e.state.draggingText||+new Date-Bs<100)){me(t);return}if(je(e,t)||Ii(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var i=h("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),g&&i.parentNode.removeChild(i)}}function Al(e,t){var i=Rr(e,t);if(!i)return;var r=document.createDocumentFragment();Gi(e,i,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 Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var f=t[r].CodeMirror;f&&i.push(f)}i.length&&i[0].operation(function(){for(var F=0;F<i.length;F++)e(i[F])})}var Ks=!1;function Rl(){if(Ks)return;Ll(),Ks=!0}function Ll(){var e;Se(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Il)},100))}),Se(window,"blur",function(){return Ws(aa)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var fa={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"},po=0;po<10;po++)fa[po+48]=fa[po+96]=String(po);for(var Fo=65;Fo<=90;Fo++)fa[Fo]=String.fromCharCode(Fo);for(var mo=1;mo<=12;mo++)fa[mo+111]=fa[mo+63235]="F"+mo;var na={};na.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"},na.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"},na.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"},na.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"]},na.default=o?na.macDefault:na.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,f,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))i=!0;else if(/^(c|ctrl|control)$/i.test(Q))r=!0;else if(/^s(hift)?$/i.test(Q))f=!0;else throw new Error("Unrecognized modifier name: "+Q)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),F&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function Ml(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var f=vt(i.split(" "),Dl),F=0;F<f.length;F++){var X=void 0,Q=void 0;F==f.length-1?(Q=f.join(" "),X=r):(Q=f.slice(0,F+1).join(" "),X="...");var q=t[Q];if(!q)t[Q]=X;else if(q!=X)throw new Error("Inconsistent bindings for "+Q)}delete e[i]}for(var ie in t)e[ie]=t[ie];return e}function Ba(e,t,i,r){t=jo(t);var f=t.call?t.call(e,r):t[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&i(f))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ba(e,t.fallthrough,i,r);for(var F=0;F<t.fallthrough.length;F++){var X=Ba(e,t.fallthrough[F],i,r);if(X)return X}}}function Gs(e){var t=typeof e=="string"?e:fa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function zs(e,t,i){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),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(g&&e.keyCode==34&&e.char)return!1;var i=fa[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),zs(i,e,t))}function jo(e){return typeof e=="string"?na[e]:e}function Ha(e,t){for(var i=e.doc.sel.ranges,r=[],f=0;f<i.length;f++){for(var F=t(i[f]);r.length&&Gt(F.from,Ye(r).to)<=0;){var X=r.pop();if(Gt(X.from,F.from)<0){F.from=X.from;break}}r.push(F)}qr(e,function(){for(var Q=r.length-1;Q>=0;Q--)Fa(e.doc,"",r[Q].from,r[Q].to,"+delete");oa(e)})}function as(e,t,i){var r=Ke(e.text,t+i,i);return r<0||r>e.text.length?null:r}function os(e,t,i){var r=as(e,t.ch,i);return r==null?null:new pt(t.line,r,i<0?"after":"before")}function ss(e,t,i,r,f){if(e){t.doc.direction=="rtl"&&(f=-f);var F=yt(i,t.doc.direction);if(F){var X=f<0?Ye(F):F[0],Q=f<0==(X.level==1),q=Q?"after":"before",ie;if(X.level>0||t.doc.direction=="rtl"){var xe=Me(t,i);ie=f<0?i.text.length-1:0;var Oe=ze(t,xe,ie).top;ie=st(function(Xe){return ze(t,xe,Xe).top==Oe},f<0==(X.level==1)?X.from:X.to-1,ie),q=="before"&&(ie=as(i,ie,1))}else ie=f<0?X.to:X.from;return new pt(r,ie,q)}}return new pt(r,f<0?i.text.length:0,f<0?"before":"after")}function kl(e,t,i,r){var f=yt(t,e.doc.direction);if(!f)return os(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var F=tt(f,i.ch,i.sticky),X=f[F];if(e.doc.direction=="ltr"&&X.level%2==0&&(r>0?X.to>i.ch:X.from<i.ch))return os(t,i,r);var Q=function(Ot,Dt){return as(t,Ot instanceof pt?Ot.ch:Ot,Dt)},q,ie=function(Ot){return e.options.lineWrapping?(q=q||Me(e,t),Ht(e,t,q,Ot)):{begin:0,end:t.text.length}},xe=ie(i.sticky=="before"?Q(i,-1):i.ch);if(e.doc.direction=="rtl"||X.level==1){var Oe=X.level==1==r<0,Xe=Q(i,Oe?1:-1);if(Xe!=null&&(Oe?Xe<=X.to&&Xe<=xe.end:Xe>=X.from&&Xe>=xe.begin)){var Ge=Oe?"before":"after";return new pt(i.line,Xe,Ge)}}var nt=function(Ot,Dt,At){for(var Nt=function(er,Nr){return Nr?new pt(i.line,Q(er,1),"before"):new pt(i.line,er,"after")};Ot>=0&&Ot<f.length;Ot+=Dt){var qt=f[Ot],Xt=Dt>0==(qt.level!=1),yn=Xt?At.begin:Q(At.end,-1);if(qt.from<=yn&&yn<qt.to)return Nt(yn,Xt);if(yn=Xt?qt.from:Q(qt.to,-1),At.begin<=yn&&yn<At.end)return Nt(yn,Xt)}},gt=nt(F+r,r,xe);if(gt)return gt;var St=r>0?xe.end:Q(xe.begin,-1);return St!=null&&!(r>0&&St==t.text.length)&&(gt=nt(r>0?0:f.length-1,r,ie(St)),gt)?gt:null}var go={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Le)},killLine:function(e){return Ha(e,function(t){if(t.empty()){var i=Lt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:pt(t.head.line+1,0)}:{from:t.head,to:pt(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ha(e,function(t){return{from:pt(t.from().line,0),to:O(e.doc,pt(t.to().line+1,0))}})},delLineLeft:function(e){return Ha(e,function(t){return{from:pt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ha(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Ha(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"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(pt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(pt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(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 i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},He)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},He)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?Ys(e,t.head):r},He)},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=[],i=e.listSelections(),r=e.options.tabSize,f=0;f<i.length;f++){var F=i[f].from(),X=J(e.getLine(F.line),F.ch,r);t.push(ue(r-X%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return qr(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var f=t[r].head,F=Lt(e.doc,f.line).text;if(F){if(f.ch==F.length&&(f=new pt(f.line,f.ch-1)),f.ch>0)f=new pt(f.line,f.ch+1),e.replaceRange(F.charAt(f.ch-1)+F.charAt(f.ch-2),pt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var X=Lt(e.doc,f.line-1).text;X&&(f=new pt(f.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),pt(f.line-1,X.length-1),f,"+transpose"))}}i.push(new Hn(f,f))}e.setSelections(i)})},newlineAndIndent:function(e){return qr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);oa(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var i=Lt(e.doc,t),r=wr(i);return r!=i&&(t=tn(r)),ss(!0,e,r,t,1)}function Pl(e,t){var i=Lt(e.doc,t),r=Ci(i);return r!=i&&(t=tn(r)),ss(!0,e,i,t,-1)}function Ys(e,t){var i=Xs(e,t.line),r=Lt(e.doc,i.line),f=yt(r,e.doc.direction);if(!f||f[0].level==0){var F=Math.max(i.ch,r.text.search(/\S/)),X=t.line==i.line&&t.ch<=F&&t.ch;return pt(i.line,X?0:F,i.sticky)}return i}function Bo(e,t,i){if(typeof t=="string"&&(t=go[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),f=t(e)!=Fe}finally{e.display.shift=r,e.state.suppressEdits=!1}return f}function Nl(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var f=Ba(t,e.state.keyMaps[r],i,e);if(f)return f}return e.options.extraKeys&&Ba(t,e.options.extraKeys,i,e)||Ba(t,e.options.keyMap,i,e)}var Ul=new te;function vo(e,t,i,r){var f=e.state.keySeq;if(f){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,f+" "+t,i,r))return!0}return $s(e,t,i,r)}function $s(e,t,i,r){var f=Nl(e,t,r);return f=="multi"&&(e.state.keySeq=t),f=="handled"&&_n(e,"keyHandled",e,t,i),(f=="handled"||f=="multi")&&(re(i),Lr(e)),!!f}function Js(e,t){var i=Vs(t,!0);return i?t.shiftKey&&!e.state.keySeq?vo(e,"Shift-"+i,t,function(r){return Bo(e,r,!0)})||vo(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Bo(e,r)}):vo(e,i,t,function(r){return Bo(e,r)}):!1}function Fl(e,t,i){return vo(e,"'"+i+"'",t,function(r){return Bo(e,r,!0)})}var ls=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=U(),je(t,e))return;K&&N<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=Js(t,e);g&&(ls=r?i:null,!r&&i==88&&!kt&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!o&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(v(t,"CodeMirror-crosshair"),Je(document,"keyup",i),Je(document,"mouseover",i))}Se(document,"keyup",i),Se(document,"mouseover",i)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),je(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ii(t.display,e)||je(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(g&&i==ls){ls=null,re(e);return}if(g&&(!e.which||e.which<10)&&Js(t,e))return;var f=String.fromCharCode(r==null?i:r);if(f=="\b")return;if(Fl(t,e,f))return;t.display.input.onKeyPress(e)}var Bl=400,us=function(e,t,i){this.time=e,this.pos=t,this.button=i};us.prototype.compare=function(e,t,i){return this.time+Bl>e&&Gt(t,this.pos)==0&&i==this.button};var yo,bo;function Hl(e,t){var i=+new Date;return bo&&bo.compare(i,e,t)?(yo=bo=null,"triple"):yo&&yo.compare(i,e,t)?(bo=new us(i,e,t),yo=null,"double"):(yo=new us(i,e,t),bo=null,"single")}function el(e){var t=this,i=t.display;if(je(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Ii(i,e)){n||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(cs(t,e))return;var r=Rr(t,e),f=Be(e),F=r?Hl(r,f):"single";if(window.focus(),f==1&&t.state.selectingText&&t.state.selectingText(e),r&&Wl(t,f,r,F,e))return;f==1?r?Gl(t,r,F,e):be(e)==i.scroller&&re(e):f==2?(r&&ko(t.doc,r),setTimeout(function(){return i.input.focus()},20)):f==3&&(R?t.display.input.onContextMenu(e):Ja(t))}function Wl(e,t,i,r,f){var F="Click";return r=="double"?F="Double"+F:r=="triple"&&(F="Triple"+F),F=(t==1?"Left":t==2?"Middle":"Right")+F,vo(e,zs(F,f),f,function(X){if(typeof X=="string"&&(X=go[X]),!X)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=X(e,i)!=Fe}finally{e.state.suppressEdits=!1}return Q})}function Kl(e,t,i){var r=e.getOption("configureMouse"),f=r?r(e,t,i):{};if(f.unit==null){var F=a?i.shiftKey&&i.metaKey:i.altKey;f.unit=F?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||i.shiftKey),f.addNew==null&&(f.addNew=o?i.metaKey:i.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(o?i.altKey:i.ctrlKey)),f}function Gl(e,t,i,r){K?setTimeout(j(To,e),0):e.curOp.focus=U();var f=Kl(e,i,r),F=e.doc.sel,X;e.options.dragDrop&&$e&&!e.isReadOnly()&&i=="single"&&(X=F.contains(t))>-1&&(Gt((X=F.ranges[X]).from(),t)<0||t.xRel>0)&&(Gt(X.to(),t)>0||t.xRel<0)?zl(e,r,t,f):Vl(e,r,t,f)}function zl(e,t,i,r){var f=e.display,F=!1,X=br(e,function(ie){n&&(f.scroller.draggable=!1),e.state.draggingText=!1,Je(f.wrapper.ownerDocument,"mouseup",X),Je(f.wrapper.ownerDocument,"mousemove",Q),Je(f.scroller,"dragstart",q),Je(f.scroller,"drop",X),F||(re(ie),r.addNew||ko(e.doc,i,null,null,r.extend),n&&!m||K&&N==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),Q=function(ie){F=F||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},q=function(){return F=!0};n&&(f.scroller.draggable=!0),e.state.draggingText=X,X.copy=!r.moveOnDrag,f.scroller.dragDrop&&f.scroller.dragDrop(),Se(f.wrapper.ownerDocument,"mouseup",X),Se(f.wrapper.ownerDocument,"mousemove",Q),Se(f.scroller,"dragstart",q),Se(f.scroller,"drop",X),Ja(e),setTimeout(function(){return f.input.focus()},20)}function tl(e,t,i){if(i=="char")return new Hn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Hn(pt(t.line,0),O(e.doc,pt(t.line+1,0)));var r=i(e,t);return new Hn(r.from,r.to)}function Vl(e,t,i,r){var f=e.display,F=e.doc;re(t);var X,Q,q=F.sel,ie=q.ranges;if(r.addNew&&!r.extend?(Q=F.sel.contains(i),Q>-1?X=ie[Q]:X=new Hn(i,i)):(X=F.sel.primary(),Q=F.sel.primIndex),r.unit=="rectangle")r.addNew||(X=new Hn(i,i)),i=Rr(e,t,!0,!0),Q=-1;else{var xe=tl(e,i,r.unit);r.extend?X=rs(X,xe.anchor,xe.head,r.extend):X=xe}r.addNew?Q==-1?(Q=ie.length,Xr(F,Ti(e,ie.concat([X]),Q),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[Q].empty()&&r.unit=="char"&&!r.extend?(Xr(F,Ti(e,ie.slice(0,Q).concat(ie.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=F.sel):is(F,Q,X,De):(Q=0,Xr(F,new ti([X],0),De),q=F.sel);var Oe=i;function Xe(At){if(Gt(Oe,At)==0)return;if(Oe=At,r.unit=="rectangle"){for(var Nt=[],qt=e.options.tabSize,Xt=J(Lt(F,i.line).text,i.ch,qt),yn=J(Lt(F,At.line).text,At.ch,qt),er=Math.min(Xt,yn),Nr=Math.max(Xt,yn),cr=Math.min(i.line,At.line),vi=Math.min(e.lastLine(),Math.max(i.line,At.line));cr<=vi;cr++){var di=Lt(F,cr).text,Cr=We(di,er,qt);er==Nr?Nt.push(new Hn(pt(cr,Cr),pt(cr,Cr))):di.length>Cr&&Nt.push(new Hn(pt(cr,Cr),pt(cr,We(di,Nr,qt))))}Nt.length||Nt.push(new Hn(i,i)),Xr(F,Ti(e,q.ranges.slice(0,Q).concat(Nt),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(At)}else{var hi=X,Br=tl(e,At,r.unit),Mr=hi.anchor,Or;Gt(Br.anchor,Mr)>0?(Or=Br.head,Mr=Wr(hi.from(),Br.anchor)):(Or=Br.anchor,Mr=ri(hi.to(),Br.head));var mr=q.ranges.slice(0);mr[Q]=Xl(e,new Hn(O(F,Mr),Or)),Xr(F,Ti(e,mr,Q),De)}}var Ge=f.wrapper.getBoundingClientRect(),nt=0;function gt(At){var Nt=++nt,qt=Rr(e,At,!0,r.unit=="rectangle");if(!qt)return;if(Gt(qt,Oe)!=0){e.curOp.focus=U(),Xe(qt);var Xt=Oa(f,F);(qt.line>=Xt.to||qt.line<Xt.from)&&setTimeout(br(e,function(){nt==Nt&>(At)}),150)}else{var yn=At.clientY<Ge.top?-20:At.clientY>Ge.bottom?20:0;yn&&setTimeout(br(e,function(){if(nt!=Nt)return;f.scroller.scrollTop+=yn,gt(At)}),50)}}function St(At){e.state.selectingText=!1,nt=Infinity,At&&(re(At),f.input.focus()),Je(f.wrapper.ownerDocument,"mousemove",Ot),Je(f.wrapper.ownerDocument,"mouseup",Dt),F.history.lastSelOrigin=null}var Ot=br(e,function(At){At.buttons===0||!Be(At)?St(At):gt(At)}),Dt=br(e,St);e.state.selectingText=Dt,Se(f.wrapper.ownerDocument,"mousemove",Ot),Se(f.wrapper.ownerDocument,"mouseup",Dt)}function Xl(e,t){var i=t.anchor,r=t.head,f=Lt(e.doc,i.line);if(Gt(i,r)==0&&i.sticky==r.sticky)return t;var F=yt(f);if(!F)return t;var X=tt(F,i.ch,i.sticky),Q=F[X];if(Q.from!=i.ch&&Q.to!=i.ch)return t;var q=X+(Q.from==i.ch==(Q.level!=1)?0:1);if(q==0||q==F.length)return t;var ie;if(r.line!=i.line)ie=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var xe=tt(F,r.ch,r.sticky),Oe=xe-X||(r.ch-i.ch)*(Q.level==1?-1:1);xe==q-1||xe==q?ie=Oe<0:ie=Oe>0}var Xe=F[q+(ie?-1:0)],Ge=ie==(Xe.level==1),nt=Ge?Xe.from:Xe.to,gt=Ge?"after":"before";return i.ch==nt&&i.sticky==gt?t:new Hn(new pt(i.line,nt,gt),r)}function nl(e,t,i,r){var f,F;if(t.touches)f=t.touches[0].clientX,F=t.touches[0].clientY;else try{f=t.clientX,F=t.clientY}catch(Xe){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&re(t);var X=e.display,Q=X.lineDiv.getBoundingClientRect();if(F>Q.bottom||!he(e,i))return le(t);F-=Q.top-X.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var ie=X.gutters.childNodes[q];if(ie&&ie.getBoundingClientRect().right>=f){var xe=Fn(e.doc,F),Oe=e.display.gutterSpecs[q];return Ne(e,i,e,xe,Oe.className,t),le(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(Ii(e.display,t)||Yl(e,t))return;if(je(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return he(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),dn(e)}var Wa={toString:function(){return"CodeMirror.Init"}},al={},Ho={};function $l(e){var t=e.optionHandlers;function i(r,f,F,X){e.defaults[r]=f,F&&(t[r]=X?function(Q,q,ie){ie!=Wa&&F(Q,q,ie)}:F)}e.defineOption=i,e.Init=Wa,i("value","",function(r,f){return r.setValue(f)},!0),i("mode",null,function(r,f){r.doc.modeOption=f,ta(r)},!0),i("indentUnit",2,ta,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){oo(r),dn(r),Yn(r)},!0),i("lineSeparator",null,function(r,f){if(r.doc.lineSep=f,!f)return;var F=[],X=r.doc.first;r.doc.iter(function(q){for(var ie=0;;){var xe=q.text.indexOf(f,ie);if(xe==-1)break;ie=xe+f.length,F.push(pt(X,xe))}X++});for(var Q=F.length-1;Q>=0;Q--)Fa(r.doc,f,F[Q],pt(F[Q].line,F[Q].ch+f.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,f,F){r.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),F!=Wa&&r.refresh()}),i("specialCharPlaceholder",Bn,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",l?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,f){return r.getInputField().spellcheck=f},!0),i("autocorrect",!1,function(r,f){return r.getInputField().autocorrect=f},!0),i("autocapitalize",!1,function(r,f){return r.getInputField().autocapitalize=f},!0),i("rtlMoveVisually",!C),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){il(r),Di(r)},!0),i("keyMap","default",function(r,f,F){var X=jo(f),Q=F!=Wa&&jo(F);Q&&Q.detach&&Q.detach(r,X),X.attach&&X.attach(r,Q||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(r,f){r.display.gutterSpecs=ei(f,r.options.lineNumbers),Di(r)},!0),i("fixedGutter",!0,function(r,f){r.display.gutters.style.left=f?Vr(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Zi(r)},!0),i("scrollbarStyle","native",function(r){La(r),Zi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,f){r.display.gutterSpecs=ei(r.options.gutters,f),Di(r)},!0),i("firstLineNumber",1,Di,!0),i("lineNumberFormatter",function(r){return r},Di,!0),i("showCursorWhenSelecting",!1,zn,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,f){f=="nocursor"&&(aa(r),r.display.input.blur()),r.display.input.readOnlyChanged(f)}),i("screenReaderLabel",null,function(r,f){f=f===""?null:f,r.display.input.screenReaderLabelChanged(f)}),i("disableInput",!1,function(r,f){f||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,zn,!0),i("singleCursorHeightPerLine",!0,zn,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,oo,!0),i("addModeClass",!1,oo,!0),i("pollInterval",100),i("undoDepth",200,function(r,f){return r.doc.history.undoDepth=f}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,oo,!0),i("moveInputWithCursor",!0,function(r,f){f||r.display.input.resetPosition()}),i("tabindex",null,function(r,f){return r.display.input.getField().tabIndex=f||""}),i("autofocus",null),i("direction","ltr",function(r,f){return r.doc.setDirection(f)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=Wa;if(!t!=!r){var f=e.display.dragFunctions,F=t?Se:Je;F(e.display.scroller,"dragstart",f.start),F(e.display.scroller,"dragenter",f.enter),F(e.display.scroller,"dragover",f.over),F(e.display.scroller,"dragleave",f.leave),F(e.display.scroller,"drop",f.drop)}}function Ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Zr(e),Yn(e),dn(e),setTimeout(function(){return Zi(e)},100)}function ur(e,t){var i=this;if(!(this instanceof ur))return new ur(e,t);this.options=t=t?S(t):{},S(al,t,!1);var r=t.value;typeof r=="string"?r=new ci(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var f=new ur.inputStyles[t.inputStyle](this),F=this.display=new xa(e,r,f,t);F.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),La(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 te,keySeq:null,specialChars:null},t.autofocus&&!l&&F.input.focus(),K&&N<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Rl(),Xi(this),this.curOp.forceUpdate=!0,vs(this,r),t.autofocus&&!l||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&zi(i)},20):aa(this);for(var X in Ho)Ho.hasOwnProperty(X)&&Ho[X](this,t[X],Wa);Ir(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<ds.length;++Q)ds[Q](this);qi(this),n&&t.lineWrapping&&getComputedStyle(F.lineDiv).textRendering=="optimizelegibility"&&(F.lineDiv.style.textRendering="auto")}ur.defaults=al,ur.optionHandlers=Ho;function Zl(e){var t=e.display;Se(t.scroller,"mousedown",br(e,el)),K&&N<11?Se(t.scroller,"dblclick",br(e,function(q){if(je(e,q))return;var ie=Rr(e,q);if(!ie||cs(e,q)||Ii(e.display,q))return;re(q);var xe=e.findWordAt(ie);ko(e.doc,xe.anchor,xe.head)})):Se(t.scroller,"dblclick",function(q){return je(e,q)||re(q)}),Se(t.scroller,"contextmenu",function(q){return rl(e,q)}),Se(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||rl(e,q)});var i,r={end:0};function f(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function F(q){if(q.touches.length!=1)return!1;var ie=q.touches[0];return ie.radiusX<=1&&ie.radiusY<=1}function X(q,ie){if(ie.left==null)return!0;var xe=ie.left-q.left,Oe=ie.top-q.top;return xe*xe+Oe*Oe>20*20}Se(t.scroller,"touchstart",function(q){if(!je(e,q)&&!F(q)&&!cs(e,q)){t.input.ensurePolled(),clearTimeout(i);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-r.end<=300?r:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Se(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Se(t.scroller,"touchend",function(q){var ie=t.activeTouch;if(ie&&!Ii(t,q)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var xe=e.coordsChar(t.activeTouch,"page"),Oe;!ie.prev||X(ie,ie.prev)?Oe=new Hn(xe,xe):!ie.prev.prev||X(ie,ie.prev.prev)?Oe=e.findWordAt(xe):Oe=new Hn(pt(xe.line,0),O(e.doc,pt(xe.line+1,0))),e.setSelection(Oe.anchor,Oe.head),e.focus(),re(q)}f()}),Se(t.scroller,"touchcancel",f),Se(t.scroller,"scroll",function(){t.scroller.clientHeight&&(la(e,t.scroller.scrollTop),_i(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),Se(t.scroller,"mousewheel",function(q){return io(e,q)}),Se(t.scroller,"DOMMouseScroll",function(q){return io(e,q)}),Se(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){je(e,q)||me(q)},over:function(q){je(e,q)||(Al(e,q),me(q))},start:function(q){return Ol(e,q)},drop:br(e,Cl),leave:function(q){je(e,q)||Hs(e)}};var Q=t.input.getField();Se(Q,"keyup",function(q){return Zs.call(e,q)}),Se(Q,"keydown",br(e,Qs)),Se(Q,"keypress",br(e,qs)),Se(Q,"focus",function(q){return zi(e,q)}),Se(Q,"blur",function(q){return aa(e,q)})}var ds=[];ur.defineInitHook=function(e){return ds.push(e)};function Eo(e,t,i,r){var f=e.doc,F;i==null&&(i="add"),i=="smart"&&(f.mode.indent?F=wt(e,t).state:i="prev");var X=e.options.tabSize,Q=Lt(f,t),q=J(Q.text,null,X);Q.stateAfter&&(Q.stateAfter=null);var ie=Q.text.match(/^\s*/)[0],xe;if(!r&&!/\S/.test(Q.text))xe=0,i="not";else if(i=="smart"&&(xe=f.mode.indent(F,Q.text.slice(ie.length),Q.text),xe==Fe||xe>150)){if(!r)return;i="prev"}i=="prev"?t>f.first?xe=J(Lt(f,t-1).text,null,X):xe=0:i=="add"?xe=q+e.options.indentUnit:i=="subtract"?xe=q-e.options.indentUnit:typeof i=="number"&&(xe=q+i),xe=Math.max(0,xe);var Oe="",Xe=0;if(e.options.indentWithTabs)for(var Ge=Math.floor(xe/X);Ge;--Ge)Xe+=X,Oe+=" ";if(Xe<xe&&(Oe+=ue(xe-Xe)),Oe!=ie)return Fa(f,Oe,pt(t,0),pt(t,ie.length),"+input"),Q.stateAfter=null,!0;for(var nt=0;nt<f.sel.ranges.length;nt++){var gt=f.sel.ranges[nt];if(gt.head.line==t&>.head.ch<ie.length){var St=pt(t,ie.length);is(f,nt,new Hn(St,St));break}}}var Pi=null;function Wo(e){Pi=e}function hs(e,t,i,r,f){var F=e.doc;e.display.shift=!1,r||(r=F.sel);var X=+new Date-200,Q=f=="paste"||e.state.pasteIncoming>X,q=Ut(t),ie=null;if(Q&&r.ranges.length>1)if(Pi&&Pi.text.join(`
|
|
`)==t){if(r.ranges.length%Pi.text.length==0){ie=[];for(var xe=0;xe<Pi.text.length;xe++)ie.push(F.splitLines(Pi.text[xe]))}}else q.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(ie=vt(q,function(Ot){return[Ot]}));for(var Oe=e.curOp.updateInput,Xe=r.ranges.length-1;Xe>=0;Xe--){var Ge=r.ranges[Xe],nt=Ge.from(),gt=Ge.to();Ge.empty()&&(i&&i>0?nt=pt(nt.line,nt.ch-i):e.state.overwrite&&!Q?gt=pt(gt.line,Math.min(Lt(F,gt.line).text.length,gt.ch+Ye(q).length)):Q&&Pi&&Pi.lineWise&&Pi.text.join(`
|
|
`)==q.join(`
|
|
`)&&(nt=gt=pt(nt.line,0)));var St={from:nt,to:gt,text:ie?ie[Xe%ie.length]:q,origin:f||(Q?"paste":e.state.cutIncoming>X?"cut":"+input")};Ua(e.doc,St),_n(e,"inputRead",e,St)}t&&!Q&&sl(e,t),oa(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Oe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&qr(t,function(){return hs(t,i,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var f=i.ranges[r];if(f.head.ch>100||r&&i.ranges[r-1].head.line==f.head.line)continue;var F=e.getModeAt(f.head),X=!1;if(F.electricChars){for(var Q=0;Q<F.electricChars.length;Q++)if(t.indexOf(F.electricChars.charAt(Q))>-1){X=Eo(e,f.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(Lt(e.doc,f.head.line).text.slice(0,f.head.ch))&&(X=Eo(e,f.head.line,"smart")));X&&_n(e,"electricInput",e,f.head.line)}}function ll(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var f=e.doc.sel.ranges[r].head.line,F={anchor:pt(f,0),head:pt(f+1,0)};i.push(F),t.push(e.getRange(F.anchor,F.head))}return{text:t,ranges:i}}function ul(e,t,i,r){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){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"),ul(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,f){var F=this.options,X=F[r];if(F[r]==f&&r!="mode")return;F[r]=f,t.hasOwnProperty(r)&&br(this,t[r])(this,f,X),Ne(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,f){this.state.keyMaps[f?"push":"unshift"](jo(r))},removeKeyMap:function(r){for(var f=this.state.keyMaps,F=0;F<f.length;++F)if(f[F]==r||f[F].name==r)return f.splice(F,1),!0},addOverlay:jr(function(r,f){var F=r.token?r:e.getMode(this.options,r);if(F.startState)throw new Error("Overlays may not be stateful.");ct(this.state.overlays,{mode:F,modeSpec:r,opaque:f&&f.opaque,priority:f&&f.priority||0},function(X){return X.priority}),this.state.modeGen++,Yn(this)}),removeOverlay:jr(function(r){for(var f=this.state.overlays,F=0;F<f.length;++F){var X=f[F].modeSpec;if(X==r||typeof r=="string"&&X.name==r){f.splice(F,1),this.state.modeGen++,Yn(this);return}}}),indentLine:jr(function(r,f,F){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),dr(this.doc,r)&&Eo(this,r,f,F)}),indentSelection:jr(function(r){for(var f=this.doc.sel.ranges,F=-1,X=0;X<f.length;X++){var Q=f[X];if(Q.empty())Q.head.line>F&&(Eo(this,Q.head.line,r,!0),F=Q.head.line,X==this.doc.sel.primIndex&&oa(this));else{var q=Q.from(),ie=Q.to(),xe=Math.max(F,q.line);F=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var Oe=xe;Oe<F;++Oe)Eo(this,Oe,r);var Xe=this.doc.sel.ranges;q.ch==0&&f.length==Xe.length&&Xe[X].from().ch>0&&is(this.doc,X,new Hn(q,Xe[X].to()),Le)}}}),getTokenAt:function(r,f){return jn(this,r,f)},getLineTokens:function(r,f){return jn(this,pt(r),f,!0)},getTokenTypeAt:function(r){r=O(this.doc,r);var f=rt(this,Lt(this.doc,r.line)),F=0,X=(f.length-1)/2,Q=r.ch,q;if(Q==0)q=f[2];else for(;;){var ie=F+X>>1;if((ie?f[ie*2-1]:0)>=Q)X=ie;else if(f[ie*2+1]<Q)F=ie+1;else{q=f[ie*2+2];break}}var xe=q?q.indexOf("overlay "):-1;return xe<0?q:xe==0?null:q.slice(0,xe-1)},getModeAt:function(r){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(r).state).mode:f},getHelper:function(r,f){return this.getHelpers(r,f)[0]},getHelpers:function(r,f){var F=[];if(!i.hasOwnProperty(f))return F;var X=i[f],Q=this.getModeAt(r);if(typeof Q[f]=="string")X[Q[f]]&&F.push(X[Q[f]]);else if(Q[f])for(var q=0;q<Q[f].length;q++){var ie=X[Q[f][q]];ie&&F.push(ie)}else Q.helperType&&X[Q.helperType]?F.push(X[Q.helperType]):X[Q.name]&&F.push(X[Q.name]);for(var xe=0;xe<X._global.length;xe++){var Oe=X._global[xe];Oe.pred(Q,this)&&se(F,Oe.val)==-1&&F.push(Oe.val)}return F},getStateAfter:function(r,f){var F=this.doc;return r=$(F,r==null?F.first+F.size-1:r),wt(this,r+1,f).state},cursorCoords:function(r,f){var F,X=this.doc.sel.primary();return r==null?F=X.head:typeof r=="object"?F=O(this.doc,r):F=r?X.from():X.to(),Tn(this,F,f||"page")},charCoords:function(r,f){return nr(this,O(this.doc,r),f||"page")},coordsChar:function(r,f){return r=xn(this,r,f||"page"),Sn(this,r.left,r.top)},lineAtHeight:function(r,f){return r=xn(this,{top:r,left:0},f||"page").top,Fn(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,f,F){var X=!1,Q;if(typeof r=="number"){var q=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>q&&(r=q,X=!0),Q=Lt(this.doc,r)}else Q=r;return Rn(this,Q,{top:0,left:0},f||"page",F||X).top+(X?this.doc.height-$r(Q):0)},defaultTextHeight:function(){return pr(this.display)},defaultCharWidth:function(){return Ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,f,F,X,Q){var q=this.display;r=Tn(this,O(this.doc,r));var ie=r.bottom,xe=r.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),q.sizer.appendChild(f),X=="over")ie=r.top;else if(X=="above"||X=="near"){var Oe=Math.max(q.wrapper.clientHeight,this.doc.height),Xe=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(X=="above"||r.bottom+f.offsetHeight>Oe)&&r.top>f.offsetHeight?ie=r.top-f.offsetHeight:r.bottom+f.offsetHeight<=Oe&&(ie=r.bottom),xe+f.offsetWidth>Xe&&(xe=Xe-f.offsetWidth)}f.style.top=ie+"px",f.style.left=f.style.right="",Q=="right"?(xe=q.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(Q=="left"?xe=0:Q=="middle"&&(xe=(q.sizer.clientWidth-f.offsetWidth)/2),f.style.left=xe+"px"),F&&wo(this,{left:xe,top:ie,right:xe+f.offsetWidth,bottom:ie+f.offsetHeight})},triggerOnKeyDown:jr(Qs),triggerOnKeyPress:jr(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:jr(el),execCommand:function(r){if(go.hasOwnProperty(r))return go[r].call(null,this)},triggerElectric:jr(function(r){sl(this,r)}),findPosH:function(r,f,F,X){var Q=1;f<0&&(Q=-1,f=-f);for(var q=O(this.doc,r),ie=0;ie<f&&!(q=fs(this.doc,q,Q,F,X),q.hitSide);++ie);return q},moveH:jr(function(r,f){var F=this;this.extendSelectionsBy(function(X){return F.display.shift||F.doc.extend||X.empty()?fs(F.doc,X.head,r,f,F.options.rtlMoveVisually):r<0?X.from():X.to()},He)}),deleteH:jr(function(r,f){var F=this.doc.sel,X=this.doc;F.somethingSelected()?X.replaceSelection("",null,"+delete"):Ha(this,function(Q){var q=fs(X,Q.head,r,f,!1);return r<0?{from:q,to:Q.head}:{from:Q.head,to:q}})}),findPosV:function(r,f,F,X){var Q=1,q=X;f<0&&(Q=-1,f=-f);for(var ie=O(this.doc,r),xe=0;xe<f;++xe){var Oe=Tn(this,ie,"div");if(q==null?q=Oe.left:Oe.left=q,ie=dl(this,Oe,Q,F),ie.hitSide)break}return ie},moveV:jr(function(r,f){var F=this,X=this.doc,Q=[],q=!this.display.shift&&!X.extend&&X.sel.somethingSelected();if(X.extendSelectionsBy(function(xe){if(q)return r<0?xe.from():xe.to();var Oe=Tn(F,xe.head,"div");xe.goalColumn!=null&&(Oe.left=xe.goalColumn),Q.push(Oe.left);var Xe=dl(F,Oe,r,f);return f=="page"&&xe==X.sel.primary()&&qa(F,nr(F,Xe,"div").top-Oe.top),Xe},He),Q.length)for(var ie=0;ie<X.sel.ranges.length;ie++)X.sel.ranges[ie].goalColumn=Q[ie]}),findWordAt:function(r){var f=this.doc,F=Lt(f,r.line).text,X=r.ch,Q=r.ch;if(F){var q=this.getHelper(r,"wordChars");(r.sticky=="before"||Q==F.length)&&X?--X:++Q;for(var ie=F.charAt(X),xe=ht(ie,q)?function(Oe){return ht(Oe,q)}:/\s/.test(ie)?function(Oe){return/\s/.test(Oe)}:function(Oe){return!/\s/.test(Oe)&&!ht(Oe)};X>0&&xe(F.charAt(X-1));)--X;for(;Q<F.length&&xe(F.charAt(Q));)++Q}return new Hn(pt(r.line,X),pt(r.line,Q))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),Ne(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==U()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:jr(function(r,f){sa(this,r,f)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-ke(this)-this.display.barHeight,width:r.scrollWidth-ke(this)-this.display.barWidth,clientHeight:ne(this),clientWidth:_e(this)}},scrollIntoView:jr(function(r,f){r==null?(r={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof r=="number"?r={from:pt(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=f||0,r.from.line!=null?$o(this,r):ya(this,r.from,r.to,r.margin)}),setSize:jr(function(r,f){var F=this,X=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};r!=null&&(this.display.wrapper.style.width=X(r)),f!=null&&(this.display.wrapper.style.height=X(f)),this.options.lineWrapping&&rn(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(q){if(q.widgets){for(var ie=0;ie<q.widgets.length;ie++)if(q.widgets[ie].noHScroll){lr(F,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,Ne(this,"refresh",this)}),operation:function(r){return qr(this,r)},startOperation:function(){return Xi(this)},endOperation:function(){return qi(this)},refresh:jr(function(){var r=this.display.cachedTextHeight;Yn(this),this.curOp.forceUpdate=!0,dn(this),sa(this,this.doc.scrollLeft,this.doc.scrollTop),Da(this.display),(r==null||Math.abs(r-pr(this.display))>.5||this.options.lineWrapping)&&Zr(this),Ne(this,"refresh",this)}),swapDoc:jr(function(r){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,r),dn(this),this.display.input.reset(),sa(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,_n(this,"swapDoc",this,f),f}),phrase:function(r){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,r)?f[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}},pe(e),e.registerHelper=function(r,f,F){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][f]=F},e.registerGlobalHelper=function(r,f,F,X){e.registerHelper(r,f,X),i[r]._global.push({pred:F,val:X})}}function fs(e,t,i,r,f){var F=t,X=i,Q=Lt(e,t.line),q=f&&e.direction=="rtl"?-i:i;function ie(){var Dt=t.line+q;return Dt<e.first||Dt>=e.first+e.size?!1:(t=new pt(Dt,t.ch,t.sticky),Q=Lt(e,Dt))}function xe(Dt){var At;if(r=="codepoint"){var Nt=Q.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Nt)?At=null:At=new pt(t.line,Math.max(0,Math.min(Q.text.length,t.ch+i*(Nt>=55296&&Nt<56320?2:1))),-i)}else f?At=kl(e.cm,Q,t,i):At=os(Q,t,i);if(At==null)if(!Dt&&ie())t=ss(f,e.cm,Q,t.line,q);else return!1;else t=At;return!0}if(r=="char"||r=="codepoint")xe();else if(r=="column")xe(!0);else if(r=="word"||r=="group")for(var Oe=null,Xe=r=="group",Ge=e.cm&&e.cm.getHelper(t,"wordChars"),nt=!0;!(i<0&&!xe(!nt));nt=!1){var gt=Q.text.charAt(t.ch)||`
|
|
`,St=ht(gt,Ge)?"w":Xe&>==`
|
|
`?"n":!Xe||/\s/.test(gt)?null:"p";if(Xe&&!nt&&!St&&(St="s"),Oe&&Oe!=St){i<0&&(i=1,xe(),t.sticky="after");break}if(St&&(Oe=St),i>0&&!xe(!nt))break}var Ot=No(e,t,F,X,!0);return kr(F,Ot)&&(Ot.hitSide=!0),Ot}function dl(e,t,i,r){var f=e.doc,F=t.left,X;if(r=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*pr(e.display),3);X=(i>0?t.bottom:t.top)+i*q}else r=="line"&&(X=i>0?t.bottom+3:t.top-3);for(var ie;!(ie=Sn(e,F,X),!ie.outside);){if(i<0?X<=0:X>=f.height){ie.hitSide=!0;break}X+=i*5}return ie}var $n=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};$n.prototype.init=function(e){var t=this,i=this,r=i.cm,f=i.div=e.lineDiv;ul(f,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function F(Q){for(var q=Q.target;q;q=q.parentNode){if(q==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Se(f,"paste",function(Q){if(!F(Q)||je(r,Q)||ol(Q,r))return;N<=11&&setTimeout(br(r,function(){return t.updateFromDOM()}),20)}),Se(f,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Se(f,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Se(f,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Se(f,"touchstart",function(){return i.forceCompositionEnd()}),Se(f,"input",function(){t.composing||t.readFromDOMSoon()});function X(Q){if(!F(Q)||je(r,Q))return;if(r.somethingSelected())Wo({lineWise:!1,text:r.getSelections()}),Q.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var q=ll(r);Wo({lineWise:!0,text:q.text}),Q.type=="cut"&&r.operation(function(){r.setSelections(q.ranges,0,Le),r.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var ie=Pi.text.join(`
|
|
`);if(Q.clipboardData.setData("Text",ie),Q.clipboardData.getData("Text")==ie){Q.preventDefault();return}}var xe=cl(),Oe=xe.firstChild;r.display.lineSpace.insertBefore(xe,r.display.lineSpace.firstChild),Oe.value=Pi.text.join(`
|
|
`);var Xe=document.activeElement;H(Oe),setTimeout(function(){r.display.lineSpace.removeChild(xe),Xe.focus(),Xe==f&&i.showPrimarySelection()},50)}Se(f,"copy",X),Se(f,"cut",X)},$n.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},$n.prototype.prepareSelection=function(){var e=Oi(this.cm,!1);return e.focus=document.activeElement==this.div,e},$n.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},$n.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$n.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),f=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||f.line<t.display.viewFrom){e.removeAllRanges();return}var F=Ko(t,e.anchorNode,e.anchorOffset),X=Ko(t,e.focusNode,e.focusOffset);if(F&&!F.bad&&X&&!X.bad&&Gt(Wr(F,X),r)==0&&Gt(ri(F,X),f)==0)return;var Q=t.display.view,q=r.line>=t.display.viewFrom&&hl(t,r)||{node:Q[0].measure.map[2],offset:0},ie=f.line<t.display.viewTo&&hl(t,f);if(!ie){var xe=Q[Q.length-1].measure,Oe=xe.maps?xe.maps[xe.maps.length-1]:xe.map;ie={node:Oe[Oe.length-1],offset:Oe[Oe.length-2]-Oe[Oe.length-3]}}if(!q||!ie){e.removeAllRanges();return}var Xe=e.rangeCount&&e.getRangeAt(0),Ge;try{Ge=E(q.node,q.offset,ie.offset,ie.node)}catch(nt){}Ge&&(!P&&t.state.focused?(e.collapse(q.node,q.offset),Ge.collapsed||(e.removeAllRanges(),e.addRange(Ge))):(e.removeAllRanges(),e.addRange(Ge)),Xe&&e.anchorNode==null?e.addRange(Xe):P&&this.startGracePeriod()),this.rememberSelection()},$n.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)},$n.prototype.showMultipleSelections=function(e){p(this.cm.display.cursorDiv,e.cursors),p(this.cm.display.selectionDiv,e.selection)},$n.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},$n.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},$n.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},$n.prototype.blur=function(){this.div.blur()},$n.prototype.getField=function(){return this.div},$n.prototype.supportsTouch=function(){return!0},$n.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():qr(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)},$n.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},$n.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&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 i=Ko(t,e.anchorNode,e.anchorOffset),r=Ko(t,e.focusNode,e.focusOffset);i&&r&&qr(t,function(){Xr(t.doc,Mi(i,r),Le),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},$n.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),f=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=pt(r.line-1,Lt(e.doc,r.line-1).length)),f.ch==Lt(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=pt(f.line+1,0)),r.line<t.viewFrom||f.line>t.viewTo-1)return!1;var F,X,Q;r.line==t.viewFrom||(F=qn(e,r.line))==0?(X=tn(t.view[0].line),Q=t.view[0].node):(X=tn(t.view[F].line),Q=t.view[F-1].node.nextSibling);var q=qn(e,f.line),ie,xe;if(q==t.view.length-1?(ie=t.viewTo-1,xe=t.lineDiv.lastChild):(ie=tn(t.view[q+1].line)-1,xe=t.view[q+1].node.previousSibling),!Q)return!1;for(var Oe=e.doc.splitLines(tu(e,Q,xe,X,ie)),Xe=ar(e.doc,pt(X,0),pt(ie,Lt(e.doc,ie).text.length));Oe.length>1&&Xe.length>1;)if(Ye(Oe)==Ye(Xe))Oe.pop(),Xe.pop(),ie--;else if(Oe[0]==Xe[0])Oe.shift(),Xe.shift(),X++;else break;for(var Ge=0,nt=0,gt=Oe[0],St=Xe[0],Ot=Math.min(gt.length,St.length);Ge<Ot&>.charCodeAt(Ge)==St.charCodeAt(Ge);)++Ge;for(var Dt=Ye(Oe),At=Ye(Xe),Nt=Math.min(Dt.length-(Oe.length==1?Ge:0),At.length-(Xe.length==1?Ge:0));nt<Nt&&Dt.charCodeAt(Dt.length-nt-1)==At.charCodeAt(At.length-nt-1);)++nt;if(Oe.length==1&&Xe.length==1&&X==r.line)for(;Ge&&Ge>r.ch&&Dt.charCodeAt(Dt.length-nt-1)==At.charCodeAt(At.length-nt-1);)Ge--,nt++;Oe[Oe.length-1]=Dt.slice(0,Dt.length-nt).replace(/^\u200b+/,""),Oe[0]=Oe[0].slice(Ge).replace(/\u200b+$/,"");var qt=pt(X,Ge),Xt=pt(ie,Xe.length?Ye(Xe).length-nt:0);if(Oe.length>1||Oe[0]||Gt(qt,Xt))return Fa(e.doc,Oe,qt,Xt,"+input"),!0},$n.prototype.ensurePolled=function(){this.forceCompositionEnd()},$n.prototype.reset=function(){this.forceCompositionEnd()},$n.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},$n.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)},$n.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&qr(this.cm,function(){return Yn(e.cm)})},$n.prototype.setUneditable=function(e){e.contentEditable="false"},$n.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||br(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},$n.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},$n.prototype.onContextMenu=function(){},$n.prototype.resetPosition=function(){},$n.prototype.needsContentAttribute=!0;function hl(e,t){var i=Ue(e,t.line);if(!i||i.hidden)return null;var r=Lt(e.doc,t.line),f=ae(i,r,t.line),F=yt(r,e.doc.direction),X="left";if(F){var Q=tt(F,t.ch);X=Q%2?"right":"left"}var q=_t(f.map,t.ch,X);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ka(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,f){var F="",X=!1,Q=e.doc.lineSeparator(),q=!1;function ie(Ge){return function(nt){return nt.id==Ge}}function xe(){X&&(F+=Q,q&&(F+=Q),X=q=!1)}function Oe(Ge){Ge&&(xe(),F+=Ge)}function Xe(Ge){if(Ge.nodeType==1){var nt=Ge.getAttribute("cm-text");if(nt){Oe(nt);return}var gt=Ge.getAttribute("cm-marker"),St;if(gt){var Ot=e.findMarks(pt(r,0),pt(f+1,0),ie(+gt));Ot.length&&(St=Ot[0].find(0))&&Oe(ar(e.doc,St.from,St.to).join(Q));return}if(Ge.getAttribute("contenteditable")=="false")return;var Dt=/^(pre|div|p|li|table|br)$/i.test(Ge.nodeName);if(!/^br$/i.test(Ge.nodeName)&&Ge.textContent.length==0)return;Dt&&xe();for(var At=0;At<Ge.childNodes.length;At++)Xe(Ge.childNodes[At]);/^(pre|p)$/i.test(Ge.nodeName)&&(q=!0),Dt&&(X=!0)}else Ge.nodeType==3&&Oe(Ge.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Xe(t),t==i);)t=t.nextSibling,q=!1;return F}function Ko(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Ka(e.clipPos(pt(e.display.viewTo-1)),!0);t=null,i=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 f=0;f<e.display.view.length;f++){var F=e.display.view[f];if(F.node==r)return nu(F,t,i)}}function nu(e,t,i){var r=e.text.firstChild,f=!1;if(!t||!x(r,t))return Ka(pt(tn(e.line),0),!0);if(t==r&&(f=!0,t=r.childNodes[i],i=0,!t)){var F=e.rest?Ye(e.rest):e.line;return Ka(pt(tn(F),F.text.length),f)}var X=t.nodeType==3?t:null,Q=t;for(!X&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(X=t.firstChild,i&&(i=X.nodeValue.length));Q.parentNode!=r;)Q=Q.parentNode;var q=e.measure,ie=q.maps;function xe(St,Ot,Dt){for(var At=-1;At<(ie?ie.length:0);At++)for(var Nt=At<0?q.map:ie[At],qt=0;qt<Nt.length;qt+=3){var Xt=Nt[qt+2];if(Xt==St||Xt==Ot){var yn=tn(At<0?e.line:e.rest[At]),er=Nt[qt]+Dt;return(Dt<0||Xt!=St)&&(er=Nt[qt+(Dt?1:0)]),pt(yn,er)}}}var Oe=xe(X,Q,i);if(Oe)return Ka(Oe,f);for(var Xe=Q.nextSibling,Ge=X?X.nodeValue.length-i:0;Xe;Xe=Xe.nextSibling){if(Oe=xe(Xe,Xe.firstChild,0),Oe)return Ka(pt(Oe.line,Oe.ch-Ge),f);Ge+=Xe.textContent.length}for(var nt=Q.previousSibling,gt=i;nt;nt=nt.previousSibling){if(Oe=xe(nt,nt.firstChild,-1),Oe)return Ka(pt(Oe.line,Oe.ch+gt),f);gt+=nt.textContent.length}}var _r=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};_r.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(f.style.width="0px"),Se(f,"input",function(){K&&N>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Se(f,"paste",function(X){if(je(r,X)||ol(X,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function F(X){if(je(r,X))return;if(r.somethingSelected())Wo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var Q=ll(r);Wo({lineWise:!0,text:Q.text}),X.type=="cut"?r.setSelections(Q.ranges,null,Le):(i.prevInput="",f.value=Q.text.join(`
|
|
`),H(f))}else return;X.type=="cut"&&(r.state.cutIncoming=+new Date)}Se(f,"cut",F),Se(f,"copy",F),Se(e.scroller,"paste",function(X){if(Ii(e,X)||je(r,X))return;if(!f.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var Q=new Event("paste");Q.clipboardData=X.clipboardData,f.dispatchEvent(Q)}),Se(e.lineSpace,"selectstart",function(X){Ii(e,X)||re(X)}),Se(f,"compositionstart",function(){var X=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:X,range:r.markText(X,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Se(f,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},_r.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},_r.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},_r.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=Oi(e);if(e.options.moveInputWithCursor){var f=Tn(e,i.sel.primary().head,"div"),F=t.wrapper.getBoundingClientRect(),X=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,f.top+X.top-F.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,f.left+X.left-F.left))}return r},_r.prototype.showSelection=function(e){var t=this.cm,i=t.display;p(i.cursorDiv,e.cursors),p(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},_r.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&H(this.textarea),K&&N>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&N>=9&&(this.hasSelection=null))},_r.prototype.getField=function(){return this.textarea},_r.prototype.supportsTouch=function(){return!1},_r.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!l||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},_r.prototype.blur=function(){this.textarea.blur()},_r.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},_r.prototype.receivedFocus=function(){this.slowPoll()},_r.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()})},_r.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},_r.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Tt(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var f=i.value;if(f==r&&!t.somethingSelected())return!1;if(K&&N>=9&&this.hasSelection===f||o&&/[\uf700-\uf7ff]/.test(f))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var F=f.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,f.length);X<Q&&r.charCodeAt(X)==f.charCodeAt(X);)++X;return qr(t,function(){hs(t,f.slice(X),r.length-X,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=f,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},_r.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},_r.prototype.onKeyPress=function(){K&&N>=9&&(this.hasSelection=null),this.fastPoll()},_r.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,f=t.textarea;t.contextMenuPending&&t.contextMenuPending();var F=Rr(i,e),X=r.scroller.scrollTop;if(!F||g)return;var Q=i.options.resetSelectionOnContextMenu;Q&&i.doc.sel.contains(F)==-1&&br(i,Xr)(i.doc,Mi(F),Le);var q=f.style.cssText,ie=t.wrapper.style.cssText,xe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-xe.top-5)+"px; left: "+(e.clientX-xe.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 Oe;n&&(Oe=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Oe),r.input.reset(),i.somethingSelected()||(f.value=t.prevInput=" "),t.contextMenuPending=Ge,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function Xe(){if(f.selectionStart!=null){var gt=i.somethingSelected(),St="\u200B"+(gt?f.value:"");f.value="\u21DA",f.value=St,t.prevInput=gt?"":"\u200B",f.selectionStart=1,f.selectionEnd=St.length,r.selForContextMenu=i.doc.sel}}function Ge(){if(t.contextMenuPending!=Ge)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,f.style.cssText=q,K&&N<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=X),f.selectionStart!=null){(!K||K&&N<9)&&Xe();var gt=0,St=function(){r.selForContextMenu==i.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&t.prevInput=="\u200B"?br(i,Ls)(i):gt++<10?r.detectingSelectAll=setTimeout(St,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(St,200)}}if(K&&N>=9&&Xe(),R){me(e);var nt=function(){Je(window,"mouseup",nt),setTimeout(Ge,20)};Se(window,"mouseup",nt)}else setTimeout(Ge,50)},_r.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},_r.prototype.setUneditable=function(){},_r.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?S(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=U();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=Q.getValue()}var f;if(e.form&&(Se(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var F=e.form;f=F.submit;try{var X=F.submit=function(){r(),F.submit=f,F.submit(),F.submit=X}}catch(q){}}t.finishInit=function(q){q.save=r,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,r(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(Je(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var Q=ur(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function iu(e){e.off=Je,e.on=Se,e.wheelEventPixels=ro,e.Doc=ci,e.splitLines=Ut,e.countColumn=J,e.findColumn=We,e.isWordChar=qe,e.Pass=Fe,e.signal=Ne,e.Line=Jr,e.changeEnd=ki,e.scrollbarModel=eo,e.Pos=pt,e.cmpPos=Gt,e.modes=vn,e.mimeModes=Ft,e.resolveMode=ot,e.getMode=en,e.modeExtensions=It,e.extendMode=Rt,e.copyState=Mt,e.startState=ln,e.innerMode=On,e.commands=go,e.keyMap=na,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=Ba,e.normalizeKeyMap=Ml,e.StringStream=un,e.SharedTextMarker=fo,e.TextMarker=ha,e.LineWidget=ho,e.e_preventDefault=re,e.e_stopPropagation=oe,e.e_stop=me,e.addClass=B,e.contains=x,e.rmClass=v,e.keyNames=fa}$l(ur),ql(ur);var au="iter insert remove copy getEditor constructor".split(" ");for(var Go in ci.prototype)ci.prototype.hasOwnProperty(Go)&&se(au,Go)<0&&(ur.prototype[Go]=function(e){return function(){return e.apply(this.doc,arguments)}}(ci.prototype[Go]));return pe(ci),ur.inputStyles={textarea:_r,contenteditable:$n},ur.defineMode=function(e){!ur.defaults.mode&&e!="null"&&(ur.defaults.mode=e),an.apply(this,arguments)},ur.defineMIME=nn,ur.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ur.defineMIME("text/plain","null"),ur.defineExtension=function(e,t){ur.prototype[e]=t},ur.defineDocExtension=function(e,t){ci.prototype[e]=t},ur.fromTextArea=ru,iu(ur),ur.version="5.58.2",ur})},WaYH:function(xt,ve,G){"use strict";var Z=G("rePB"),V=G("Ff2n"),P=G("VTBJ"),z=G("1OyB"),I=G("vuIU"),k=G("JX7q"),K=G("Ji7U"),N=G("LK+K"),n=G("q1tI"),D=G("TSYQ"),y=G.n(D),g=G("sboe"),m=G("OZM5"),c=function(R){var A=R.prefixCls,v=R.level,b=R.isStart,p=R.isEnd;if(!v)return null;for(var h="".concat(A,"-indent-unit"),_=[],E=0;E<v;E+=1){var x;_.push(n.createElement("span",{key:E,className:y()(h,(x={},Object(Z.a)(x,"".concat(h,"-start"),b[E+1]),Object(Z.a)(x,"".concat(h,"-end"),p[E+1]),Object(Z.a)(x,"".concat(h,"-end-first-level"),!E&&p[0]),x))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},_)},s=c,d=G("815F"),u="open",l="close",o="---",a=function(T){Object(K.a)(A,T);var R=Object(N.a)(A);function A(){var v;return Object(z.a)(this,A),v=R.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(b){var p=v.props.context.onNodeClick;p(b,Object(d.b)(v.props)),v.isSelectable()?v.onSelect(b):v.onCheck(b)},v.onSelectorDoubleClick=function(b){var p=v.props.context.onNodeDoubleClick;p(b,Object(d.b)(v.props))},v.onSelect=function(b){if(v.isDisabled())return;var p=v.props.context.onNodeSelect;b.preventDefault(),p(b,Object(d.b)(v.props))},v.onCheck=function(b){if(v.isDisabled())return;var p=v.props,h=p.disableCheckbox,_=p.checked,E=v.props.context.onNodeCheck;if(!v.isCheckable()||h)return;b.preventDefault();var x=!_;E(b,Object(d.b)(v.props),x)},v.onMouseEnter=function(b){var p=v.props.context.onNodeMouseEnter;p(b,Object(d.b)(v.props))},v.onMouseLeave=function(b){var p=v.props.context.onNodeMouseLeave;p(b,Object(d.b)(v.props))},v.onContextMenu=function(b){var p=v.props.context.onNodeContextMenu;p(b,Object(d.b)(v.props))},v.onDragStart=function(b){var p=v.props.context.onNodeDragStart;b.stopPropagation(),v.setState({dragNodeHighlight:!0}),p(b,Object(k.a)(v));try{b.dataTransfer.setData("text/plain","")}catch(h){}},v.onDragEnter=function(b){var p=v.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),p(b,Object(k.a)(v))},v.onDragOver=function(b){var p=v.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),p(b,Object(k.a)(v))},v.onDragLeave=function(b){var p=v.props.context.onNodeDragLeave;b.stopPropagation(),p(b,Object(k.a)(v))},v.onDragEnd=function(b){var p=v.props.context.onNodeDragEnd;b.stopPropagation(),v.setState({dragNodeHighlight:!1}),p(b,Object(k.a)(v))},v.onDrop=function(b){var p=v.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),v.setState({dragNodeHighlight:!1}),p(b,Object(k.a)(v))},v.onExpand=function(b){var p=v.props.context.onNodeExpand;p(b,Object(d.b)(v.props))},v.setSelectHandle=function(b){v.selectHandle=b},v.getNodeState=function(){var b=v.props.expanded;return v.isLeaf()?null:b?u:l},v.hasChildren=function(){var b=v.props.eventKey,p=v.props.context.keyEntities,h=p[b]||{},_=h.children;return!!(_||[]).length},v.isLeaf=function(){var b=v.props,p=b.isLeaf,h=b.loaded,_=v.props.context.loadData,E=v.hasChildren();return p===!1?!1:p||!_&&!E||_&&h&&!E},v.isDisabled=function(){var b=v.props.disabled,p=v.props.context.disabled;return!!(p||b)},v.isCheckable=function(){var b=v.props.checkable,p=v.props.context.checkable;return!p||b===!1?!1:p},v.syncLoadData=function(b){var p=b.expanded,h=b.loading,_=b.loaded,E=v.props.context,x=E.loadData,U=E.onNodeLoad;if(h)return;x&&p&&!v.isLeaf()&&(!v.hasChildren()&&!_&&U(Object(d.b)(v.props)))},v.renderSwitcher=function(){var b=v.props,p=b.expanded,h=b.switcherIcon,_=v.props.context,E=_.prefixCls,x=_.switcherIcon,U=h||x;if(v.isLeaf())return n.createElement("span",{className:y()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof U=="function"?U(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!0})):U);var B=y()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(p?u:l));return n.createElement("span",{onClick:v.onExpand,className:B},typeof U=="function"?U(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!1})):U)},v.renderCheckbox=function(){var b=v.props,p=b.checked,h=b.halfChecked,_=b.disableCheckbox,E=v.props.context.prefixCls,x=v.isDisabled(),U=v.isCheckable();if(!U)return null;var B=typeof U!="boolean"?U:null;return n.createElement("span",{className:y()("".concat(E,"-checkbox"),p&&"".concat(E,"-checkbox-checked"),!p&&h&&"".concat(E,"-checkbox-indeterminate"),(x||_)&&"".concat(E,"-checkbox-disabled")),onClick:v.onCheck},B)},v.renderIcon=function(){var b=v.props.loading,p=v.props.context.prefixCls;return n.createElement("span",{className:y()("".concat(p,"-iconEle"),"".concat(p,"-icon__").concat(v.getNodeState()||"docu"),b&&"".concat(p,"-icon_loading"))})},v.renderSelector=function(){var b=v.state.dragNodeHighlight,p=v.props,h=p.title,_=p.selected,E=p.icon,x=p.loading,U=p.data,B=v.props.context,L=B.prefixCls,H=B.showIcon,j=B.icon,S=B.draggable,J=B.loadData,te=B.titleRender,se=v.isDisabled(),fe="".concat(L,"-node-content-wrapper"),Fe;if(H){var Le=E||j;Fe=Le?n.createElement("span",{className:y()("".concat(L,"-iconEle"),"".concat(L,"-icon__customize"))},typeof Le=="function"?Le(v.props):Le):v.renderIcon()}else J&&x&&(Fe=v.renderIcon());var De;typeof h=="function"?De=h(U):te?De=te(U):De=h;var He=n.createElement("span",{className:"".concat(L,"-title")},De);return n.createElement("span",{ref:v.setSelectHandle,title:typeof h=="string"?h:"",className:y()("".concat(fe),"".concat(fe,"-").concat(v.getNodeState()||"normal"),!se&&(_||b)&&"".concat(L,"-node-selected"),!se&&S&&"draggable"),draggable:!se&&S||void 0,"aria-grabbed":!se&&S||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:S?v.onDragStart:void 0},Fe,He)},v}return Object(I.a)(A,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,p=this.props.context.selectable;return typeof b=="boolean"?b:p}},{key:"render",value:function(){var b,p=this.props,h=p.eventKey,_=p.className,E=p.style,x=p.dragOver,U=p.dragOverGapTop,B=p.dragOverGapBottom,L=p.isLeaf,H=p.isStart,j=p.isEnd,S=p.expanded,J=p.selected,te=p.checked,se=p.halfChecked,fe=p.loading,Fe=p.domRef,Le=p.active,De=p.onMouseMove,He=Object(V.a)(p,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),We=this.props.context,ye=We.prefixCls,ue=We.filterTreeNode,Ye=We.draggable,vt=We.keyEntities,ct=this.isDisabled(),it=Object(m.f)(He),ft=vt[h]||{},Qe=ft.level,qe=j[j.length-1];return n.createElement("div",Object.assign({ref:Fe,className:y()(_,"".concat(ye,"-treenode"),(b={},Object(Z.a)(b,"".concat(ye,"-treenode-disabled"),ct),Object(Z.a)(b,"".concat(ye,"-treenode-switcher-").concat(S?"open":"close"),!L),Object(Z.a)(b,"".concat(ye,"-treenode-checkbox-checked"),te),Object(Z.a)(b,"".concat(ye,"-treenode-checkbox-indeterminate"),se),Object(Z.a)(b,"".concat(ye,"-treenode-selected"),J),Object(Z.a)(b,"".concat(ye,"-treenode-loading"),fe),Object(Z.a)(b,"".concat(ye,"-treenode-active"),Le),Object(Z.a)(b,"".concat(ye,"-treenode-leaf-last"),qe),Object(Z.a)(b,"drag-over",!ct&&x),Object(Z.a)(b,"drag-over-gap-top",!ct&&U),Object(Z.a)(b,"drag-over-gap-bottom",!ct&&B),Object(Z.a)(b,"filter-node",ue&&ue(Object(d.b)(this.props))),b)),style:E,onDragEnter:Ye?this.onDragEnter:void 0,onDragOver:Ye?this.onDragOver:void 0,onDragLeave:Ye?this.onDragLeave:void 0,onDrop:Ye?this.onDrop:void 0,onDragEnd:Ye?this.onDragEnd:void 0,onMouseMove:De},it),n.createElement(s,{prefixCls:ye,level:Qe,isStart:H,isEnd:j}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(n.Component),C=function(R){return n.createElement(g.a.Consumer,null,function(A){return n.createElement(a,Object.assign({},R,{context:A}))})};C.displayName="TreeNode",C.defaultProps={title:o},C.isTreeNode=1;var w=ve.a=C},Y1PL:function(xt,ve,G){"use strict";G.r(ve),G.d(ve,"ResizableTextArea",function(){return se});var Z=G("wx14"),V=G("1OyB"),P=G("vuIU"),z=G("Ji7U"),I=G("LK+K"),k=G("q1tI"),K=G("VTBJ"),N=G("rePB"),n=G("Zm9Q"),D=G("Kwbf"),y=G("c+Xe"),g=G("m+aA"),m=G("bdgK"),c=new Map;function s(Le){Le.forEach(function(De){var He,We=De.target;(He=c.get(We))===null||He===void 0||He.forEach(function(ye){return ye(We)})})}var d=new m.default(s),u=null,l=null;function o(Le,De){c.has(Le)||(c.set(Le,new Set),d.observe(Le)),c.get(Le).add(De)}function a(Le,De){c.has(Le)&&(c.get(Le).delete(De),c.get(Le).size||(d.unobserve(Le),c.delete(Le)))}var C=function(Le){Object(z.a)(He,Le);var De=Object(I.a)(He);function He(){return Object(V.a)(this,He),De.apply(this,arguments)}return Object(P.a)(He,[{key:"render",value:function(){return this.props.children}}]),He}(k.Component),w=k.createContext(null);function T(Le){var De=Le.children,He=Le.onBatchResize,We=k.useRef(0),ye=k.useRef([]),ue=k.useContext(w),Ye=k.useCallback(function(vt,ct,it){We.current+=1;var ft=We.current;ye.current.push({size:vt,element:ct,data:it}),Promise.resolve().then(function(){ft===We.current&&(He==null||He(ye.current),ye.current=[])}),ue==null||ue(vt,ct,it)},[He,ue]);return k.createElement(w.Provider,{value:Ye},De)}function R(Le){var De=Le.children,He=Le.disabled,We=k.useRef(null),ye=k.useRef(null),ue=k.useContext(w),Ye=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),vt=k.isValidElement(De)&&Object(y.c)(De),ct=vt?De.ref:null,it=k.useMemo(function(){return Object(y.a)(ct,We)},[ct,We]),ft=k.useRef(Le);ft.current=Le;var Qe=k.useCallback(function(qe){var ht=ft.current,de=ht.onResize,Ie=ht.data,Pe=qe.getBoundingClientRect(),Ke=Pe.width,st=Pe.height,at=qe.offsetWidth,et=qe.offsetHeight,tt=Math.floor(Ke),dt=Math.floor(st);if(Ye.current.width!==tt||Ye.current.height!==dt||Ye.current.offsetWidth!==at||Ye.current.offsetHeight!==et){var yt={width:tt,height:dt,offsetWidth:at,offsetHeight:et};Ye.current=yt;var Ae=at===Math.round(Ke)?Ke:at,Se=et===Math.round(st)?st:et,Ve=Object(K.a)(Object(K.a)({},yt),{},{offsetWidth:Ae,offsetHeight:Se});ue==null||ue(Ve,qe,Ie),de&&Promise.resolve().then(function(){de(Ve,qe)})}},[]);return k.useEffect(function(){var qe=Object(g.a)(We.current)||Object(g.a)(ye.current);return qe&&!He&&o(qe,Qe),function(){return a(qe,Qe)}},[We.current,He]),k.createElement(C,{ref:ye},vt?k.cloneElement(De,{ref:it}):De)}var A="rc-observer-key";function v(Le){var De=Le.children,He=Object(n.a)(De);return He.map(function(We,ye){var ue=(We==null?void 0:We.key)||"".concat(A,"-").concat(ye);return k.createElement(R,Object(Z.a)({},Le,{key:ue}),We)})}v.Collection=T;var b=v,p=G("bT9E"),h=G("TSYQ"),_=G.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
|
|
`,x=["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"],U={},B;function L(Le){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,He=Le.getAttribute("id")||Le.getAttribute("data-reactid")||Le.getAttribute("name");if(De&&U[He])return U[He];var We=window.getComputedStyle(Le),ye=We.getPropertyValue("box-sizing")||We.getPropertyValue("-moz-box-sizing")||We.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(We.getPropertyValue("padding-bottom"))+parseFloat(We.getPropertyValue("padding-top")),Ye=parseFloat(We.getPropertyValue("border-bottom-width"))+parseFloat(We.getPropertyValue("border-top-width")),vt=x.map(function(it){return"".concat(it,":").concat(We.getPropertyValue(it))}).join(";"),ct={sizingStyle:vt,paddingSize:ue,borderSize:Ye,boxSizing:ye};return De&&He&&(U[He]=ct),ct}function H(Le){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,He=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,We=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Le.getAttribute("wrap")?B.setAttribute("wrap",Le.getAttribute("wrap")):B.removeAttribute("wrap");var ye=L(Le,De),ue=ye.paddingSize,Ye=ye.borderSize,vt=ye.boxSizing,ct=ye.sizingStyle;B.setAttribute("style","".concat(ct,";").concat(E)),B.value=Le.value||Le.placeholder||"";var it=Number.MIN_SAFE_INTEGER,ft=Number.MAX_SAFE_INTEGER,Qe=B.scrollHeight,qe;if(vt==="border-box"?Qe+=Ye:vt==="content-box"&&(Qe-=ue),He!==null||We!==null){B.value=" ";var ht=B.scrollHeight-ue;He!==null&&(it=ht*He,vt==="border-box"&&(it=it+ue+Ye),Qe=Math.max(it,Qe)),We!==null&&(ft=ht*We,vt==="border-box"&&(ft=ft+ue+Ye),qe=Qe>ft?"":"hidden",Qe=Math.min(ft,Qe))}return{height:Qe,minHeight:it,maxHeight:ft,overflowY:qe,resize:"none"}}var j=G("Gytx"),S=G.n(j),J;(function(Le){Le[Le.NONE=0]="NONE",Le[Le.RESIZING=1]="RESIZING",Le[Le.RESIZED=2]="RESIZED"})(J||(J={}));var te=function(Le){Object(z.a)(He,Le);var De=Object(I.a)(He);function He(We){var ye;return Object(V.a)(this,He),ye=De.call(this,We),ye.nextFrameActionId=void 0,ye.resizeFrameId=void 0,ye.textArea=void 0,ye.saveTextArea=function(ue){ye.textArea=ue},ye.handleResize=function(ue){var Ye=ye.state.resizeStatus,vt=ye.props,ct=vt.autoSize,it=vt.onResize;if(Ye!==J.NONE)return;typeof it=="function"&&it(ue),ct&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var ue=ye.props.autoSize;if(!ue||!ye.textArea)return;var Ye=ue.minRows,vt=ue.maxRows,ct=H(ye.textArea,!1,Ye,vt);ye.setState({textareaStyles:ct,resizeStatus:J.RESIZING},function(){cancelAnimationFrame(ye.resizeFrameId),ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:J.RESIZED},function(){ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:J.NONE}),ye.fixFirefoxAutoScroll()})})})})},ye.renderTextArea=function(){var ue=ye.props,Ye=ue.prefixCls,vt=Ye===void 0?"rc-textarea":Ye,ct=ue.autoSize,it=ue.onResize,ft=ue.className,Qe=ue.disabled,qe=ye.state,ht=qe.textareaStyles,de=qe.resizeStatus,Ie=Object(p.a)(ye.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Pe=_()(vt,ft,Object(N.a)({},"".concat(vt,"-disabled"),Qe));"value"in Ie&&(Ie.value=Ie.value||"");var Ke=Object(K.a)(Object(K.a)(Object(K.a)({},ye.props.style),ht),de===J.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(b,{onResize:ye.handleResize,disabled:!(ct||it)},k.createElement("textarea",Object(Z.a)({},Ie,{className:Pe,style:Ke,ref:ye.saveTextArea})))},ye.state={textareaStyles:{},resizeStatus:J.NONE},ye}return Object(P.a)(He,[{key:"componentDidUpdate",value:function(ye){(ye.value!==this.props.value||!S()(ye.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 ye=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,ue)}}catch(Ye){}}},{key:"render",value:function(){return this.renderTextArea()}}]),He}(k.Component),se=te,fe=function(Le){Object(z.a)(He,Le);var De=Object(I.a)(He);function He(We){var ye;Object(V.a)(this,He),ye=De.call(this,We),ye.resizableTextArea=void 0,ye.focus=function(){ye.resizableTextArea.textArea.focus()},ye.saveTextArea=function(Ye){ye.resizableTextArea=Ye},ye.handleChange=function(Ye){var vt=ye.props.onChange;ye.setValue(Ye.target.value,function(){ye.resizableTextArea.resizeTextarea()}),vt&&vt(Ye)},ye.handleKeyDown=function(Ye){var vt=ye.props,ct=vt.onPressEnter,it=vt.onKeyDown;Ye.keyCode===13&&ct&&ct(Ye),it&&it(Ye)};var ue=typeof We.value=="undefined"||We.value===null?We.defaultValue:We.value;return ye.state={value:ue},ye}return Object(P.a)(He,[{key:"setValue",value:function(ye,ue){"value"in this.props||this.setState({value:ye},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return k.createElement(se,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ye){return"value"in ye?{value:ye.value}:null}}]),He}(k.Component),Fe=ve.default=fe},ZW9T:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return j});var Z=G("k1fw"),V=G("oBTY"),P=G("miYZ"),z=G("tsqr"),I=G("rAM+"),k=G("tJVT"),K=G("PpiC"),N=G("q1tI"),n=G.n(N),D=G("bdgK"),y=G("9og8"),g=G("WmNS"),m=G.n(g),c={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},s={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},d={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},u={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(`
|
|
`)}]},l=G("5VLF"),o=G.n(l),a={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"]}},C=function(J,te){return te.map(function(se){return{label:se,kind:J.languages.CompletionItemKind.Keyword,insertText:se}})},w=function(J){return Object.keys(a.tables).map(function(te){return{label:te,kind:J.languages.CompletionItemKind.Variable,insertText:te}})},T=function(J,te){var se=a.tables[J];return se?se.map(function(fe){return{label:fe,kind:te.languages.CompletionItemKind.Field,insertText:fe}}):[]};function R(S,J,te,se,fe){var Fe=J.getWordUntilPosition(te),Le={startLineNumber:te.lineNumber,endLineNumber:te.lineNumber,startColumn:Fe.startColumn,endColumn:Fe.endColumn},De=se.map(function(He){return{label:He,kind:S.languages.CompletionItemKind.Keyword,insertText:He,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}});return fe.map(function(He){De.push(Object(Z.a)(Object(Z.a)({},He),{},{range:Le}))}),De}var A=function(S){a.languages.map(function(fe){return S.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(Le,De,He){return Object(y.a)(m.a.mark(function We(){var ye;return m.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return ye=o()(Le.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}),Ye.abrupt("return",[{range:Le.getFullModelRange(),text:ye}]);case 2:case"end":return Ye.stop()}},We)}))()}}),fe});var J=d.quickKey.map(function(fe){return{label:fe.label,kind:S.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=u.quickKey.map(function(fe){return{label:fe.label,kind:S.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),se=s.quickKey.map(function(fe){return{label:fe.label,kind:S.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet}});S.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Fe,Le){var De=Fe.getWordUntilPosition(Le),He={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:De.startColumn,endColumn:De.endColumn},We=Fe.getLineContent(Le.lineNumber).substring(De.startColumn-2,De.endColumn);return{suggestions:[].concat(Object(V.a)(d.keywords.map(function(ye){return{label:ye,kind:S.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:He}})),Object(V.a)(d.quickKey.map(function(ye){return{label:ye.label,kind:S.languages.CompletionItemKind.Function,documentation:ye.content,insertText:We.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:He}})))}}}),S.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Fe,Le){var De=Fe.getWordUntilPosition(Le),He={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:De.startColumn,endColumn:De.endColumn};return{suggestions:Object(V.a)(c.keywords.map(function(We){return{label:We,kind:S.languages.CompletionItemKind.Function,documentation:We,insertText:We,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:He}}))}}}),S.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Fe,Le){var De=Fe.getWordUntilPosition(Le),He={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:De.startColumn,endColumn:De.endColumn},We=Fe.getLineContent(Le.lineNumber).substring(De.startColumn-2,De.endColumn);return{suggestions:[].concat(Object(V.a)(s.keywords.map(function(ye){return{label:ye,kind:S.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:He}})),Object(V.a)(s.quickKey.map(function(ye){return{label:ye.label,kind:S.languages.CompletionItemKind.Function,documentation:ye.content,insertText:We.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:He}})))}}}),S.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Fe,Le){var De=Fe.getWordUntilPosition(Le),He={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:De.startColumn,endColumn:De.endColumn},We=Fe.getLineContent(Le.lineNumber).substring(De.startColumn-2,De.endColumn);return{suggestions:[].concat(Object(V.a)(u.keywords.map(function(ye){return{label:ye,kind:S.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:He}})),Object(V.a)(u.quickKey.map(function(ye){return{label:ye.label,kind:S.languages.CompletionItemKind.Function,documentation:ye.content,insertText:We.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:He}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=G("fjLI"),p=G("LvDl"),h=G("+ua5");function _(S){return/^\d+$/.test(S)?"".concat(S,"px"):S}function E(){}var x=!1,U={"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 B(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],J=S;if(Array.isArray(S)){for(var te=0;te<S.length;te++){var se=U[S[te]];if(se)return se}return J[0]}return U[J]||J}var L=null,H=ve.b=function(S){var J=S.width,te=J===void 0?"100%":J,se=S.height,fe=se===void 0?"100%":se,Fe=S.value,Le=S.language,De=Le===void 0?"javascript":Le,He=S.style,We=He===void 0?{}:He,ye=S.options,ue=ye===void 0?{}:ye,Ye=S.overrideServices,vt=Ye===void 0?{}:Ye,ct=S.theme,it=ct===void 0?"vs-dark":ct,ft=S.onEditBlur,Qe=S.onSave,qe=S.autoHeight,ht=qe===void 0?!1:qe,de=S.forbidCopy,Ie=de===void 0?!1:de,Pe=S.onChange,Ke=Pe===void 0?E:Pe,st=S.editorDidMount,at=st===void 0?E:st,et=S.onFocus,tt=et===void 0?E:et,dt=S.filename,yt=dt===void 0?"educoder.txt":dt,Ae=S.errorLine,Se=S.errorContent,Ve=Se===void 0?"":Se,Je=Object(K.a)(S,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ne=Object(N.useRef)(),je=Object(N.useRef)({}),Ee=Object(N.useRef)(),he=Object(N.useRef)(),pe=Object(N.useRef)(!1),re=Object(N.useRef)(),oe=Object(N.useState)(!1),le=Object(k.a)(oe,2),me=le[0],be=le[1];function Be(){var It;return Ne.current&&(It=new D.default(function(Rt){var Mt=Object(I.a)(Rt),On;try{for(Mt.s();!(On=Mt.n()).done;){var ln=On.value;(ln.target.offsetHeight>0||ln.target.offsetWidth>0)&&je.current.instance.layout()}}catch(un){Mt.e(un)}finally{Mt.f()}}),It.observe(Ne.current)),It}function $e(){z.b.warn(decodeURIComponent(v))}var ut=function(){var Rt=je.current.instance;if(Fe!=null&&Rt&&me){var Mt=Rt.getModel();Mt&&Fe!==Mt.getValue()&&(x=!0,Mt.setValue(Fe),Rt.layout(),x=!1)}};Object(N.useEffect)(function(){he.current&&clearTimeout(he.current),he.current=setTimeout(function(){ut()},500)},[Fe,me,je.current]),Object(N.useEffect)(function(){if(Ae&&je.current&&je.current.instance){var It=je.current.instance;It.changeViewZones(function(Mt){var On=document.createElement("div");On.style.padding="10px 20px",On.style.width="calc(100% - 20px)",On.className="my-error-line-wrp",On.innerHTML=Ve,Mt.addZone({afterLineNumber:Ae||11,heightInLines:3,domNode:On})});var Rt={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}};It.addOverlayWidget(Rt),It.revealPositionInCenter({lineNumber:20,column:1})}},[Ae,je.current,me]);function Et(){var It=je.current.instance;if(It){var Rt=It.getSelection(),Mt=je.current.pastePos||{},On=new L.Range(Mt.startLineNumber||Rt.endLineNumber,Mt.startColumn||Rt.endColumn,Mt.endLineNumber||Rt.endLineNumber,Mt.endColumn||Rt.endColumn);setTimeout(function(){It.executeEdits("",[{range:On,text:""}])},300)}}function mt(It){(window.navigator.platform.match("Mac")?It.metaKey:It.ctrlKey)&&It.keyCode==83&&(It.preventDefault(),Qe())}var Bt=function(){if(ht&&je.current.instance){var Rt=je.current.instance.getContentHeight();ot(Rt<fe?fe:Rt)}else ot(fe)};function Ut(It){var Rt=document.createEvent("MouseEvents");Rt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),It.dispatchEvent(Rt)}function Tt(It,Rt){var Mt=window.URL||window.webkitURL||window,On=new Blob([Rt]),ln=document.createElementNS("http://www.w3.org/1999/xhtml","a");ln.href=Mt.createObjectURL(On),ln.download=It,Ut(ln)}Object(N.useEffect)(function(){Bt()},[Bt]),Object(N.useEffect)(function(){Ne.current&&!me&&Promise.all([G.e(15),G.e(27)]).then(G.t.bind(null,"M/lh",7)).then(function(It){try{L=It,je.current.instance=L.editor.create(Ne.current,{value:Fe,language:B(De),theme:it,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},vt);var Rt=je.current.instance,Mt=b.d._menuItems,On=Object(V.a)(Mt).find(function(In){return In[0]._debugName=="EditorContext"}),ln=On[1],un=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Lt=function(Nn,tn){var Fn=Nn._first;do{var dr,gr,pt=tn.includes((dr=Fn.element)===null||dr===void 0||((gr=dr.command)===null||gr===void 0)?void 0:gr.id);pt&&Nn._remove(Fn)}while(Fn=Fn.next)};if(at(Rt,L),setTimeout(function(){Bt(),je.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Tt(yt||"educoder.txt",Rt.getValue())}}),Rt.getDomNode().addEventListener("input",function(){Ee.current.autoFormat&&Rt.getAction("editor.action.formatDocument").run()})},500),je.current.subscription=Rt.onDidChangeModelContent(function(In){pe.current?clearTimeout(re.current):(Bt(),Ke(Rt.getValue(),In)),re.current=setTimeout(function(){pe.current=!1},500)}),window.Monaco||A(L,B(De)),Ie&&(Lt(ln,un),Ne.current.classList.add("noCopyPaste"),Rt.onKeyDown(function(In){var Nn=In.keyCode,tn=In.ctrlKey,Fn=In.metaKey;(Nn===33||Nn===52)&&(Fn||tn)&&($e(),In.preventDefault())})),window.Monaco=L,ft&&Rt.onDidBlurEditorWidget(function(){ft(Rt.getValue())}),tt&&Rt.onDidFocusEditorText(function(){tt(Rt.getValue())}),Ie){Rt.addCommand(L.KeyMod.CtrlCmd|L.KeyCode.KEY_V,function(){return $e(),null}),Rt.onDidPaste(function(In){je.current.pastePos=In});try{window.addEventListener("paste",Et)}catch(In){}}var ar=Be();return be(!0),function(){var In=je.current.instance;In.dispose();var Nn=In.getModel();Nn&&Nn.dispose(),je.current.subscription&&je.current.subscription.dispose(),Ie&&window.removeEventListener("paste",Et),ar.unobserve(Ne.current)}}catch(In){}})},[]),Object(N.useEffect)(function(){var It=je.current.instance;if(It&&me)return document.addEventListener("keydown",mt,!1),function(){document.removeEventListener("keydown",mt)}},[Qe,me]),Object(N.useEffect)(function(){var It=je.current.instance;if(It&&me){var Rt=B(De);L.editor.setModelLanguage(It.getModel(),Rt),console.log("language:",De,It.getModel(),Rt)}},[De,me]),Object(N.useEffect)(function(){var It=je.current.instance;It&&me&&L.editor.setTheme(it)},[it,me]),Object(N.useEffect)(function(){var It=je.current.instance;Ee.current=ue,It&&me&&(It.updateOptions(Object(Z.a)({},ue)),setTimeout(function(){It.getModel().updateOptions(Object(Z.a)({},ue))},200))},[JSON.stringify(ue),me]),Object(N.useEffect)(function(){var It=je.current.instance;It&&me&&It.layout()},[te,fe,me]);var kt=Object(N.useState)(_(te)),zt=Object(k.a)(kt,2),$t=zt[0],vn=zt[1],Ft=Object(N.useState)(_(fe)),an=Object(k.a)(Ft,2),nn=an[0],ot=an[1],en=Object(Z.a)(Object(Z.a)({},We),{},{width:$t,height:nn});return n.a.createElement("div",{className:"my-monaco-editor",ref:Ne,style:en})};function j(S){var J=S.width,te=J===void 0?"100%":J,se=S.height,fe=se===void 0?"100%":se,Fe=S.original,Le=S.modified,De=S.language,He=S.options,We=He===void 0?{}:He,ye=Object(N.useRef)(),ue=Object(N.useState)(null),Ye=Object(k.a)(ue,2),vt=Ye[0],ct=Ye[1];function it(ht){var de;return ye.current&&(de=new D.default(function(Ie){var Pe=Object(I.a)(Ie),Ke;try{for(Pe.s();!(Ke=Pe.n()).done;){var st=Ke.value;(st.target.offsetHeight>0||st.target.offsetWidth>0)&&ht.layout()}}catch(at){Pe.e(at)}finally{Pe.f()}}),de.observe(ye.current)),de}Object(N.useEffect)(function(){ye.current&&Promise.all([G.e(15),G.e(27)]).then(G.t.bind(null,"M/lh",7)).then(function(ht){L=ht;var de=L.editor.createDiffEditor(ye.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},We),{},{wordWrap:!0}));ct(de);var Ie=it(de);return function(){de.dispose();var Pe=de.getModel();Pe&&Pe.dispose(),Ie.unobserve(ye.current)}})},[]),Object(N.useEffect)(function(){vt&&vt.setModel({original:L.editor.createModel(Fe,De),modified:L.editor.createModel(Le,De)})},[Fe,Le,De,vt]);var ft=_(te),Qe=_(fe),qe={width:ft,height:Qe};return n.a.createElement("div",{className:"my-diff-editor",ref:ye,style:qe})}},ZpRC:function(xt,ve,G){"use strict";function Z(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function V(y,g){return(!g||y!=="hidden")&&y!=="visible"&&y!=="clip"}function P(y,g){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var m=getComputedStyle(y,null);return V(m.overflowY,g)||V(m.overflowX,g)||function(c){var s=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(u){return null}}(c);return!!s&&(s.clientHeight<c.scrollHeight||s.clientWidth<c.scrollWidth)}(y)}return!1}function z(y,g,m,c,s,d,u,l){return d<y&&u>g||d>y&&u<g?0:d<=y&&l<=m||u>=g&&l>=m?d-y-c:u>g&&l<m||d<y&&l>m?u-g+s:0}var I=function(y,g){var m=window,c=g.scrollMode,s=g.block,d=g.inline,u=g.boundary,l=g.skipOverflowHiddenElements,o=typeof u=="function"?u:function(ht){return ht!==u};if(!Z(y))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,C=[],w=y;Z(w)&&o(w);){if((w=w.parentElement)===a){C.push(w);break}w!=null&&w===document.body&&P(w)&&!P(document.documentElement)||w!=null&&P(w,l)&&C.push(w)}for(var T=m.visualViewport?m.visualViewport.width:innerWidth,R=m.visualViewport?m.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,b=y.getBoundingClientRect(),p=b.height,h=b.width,_=b.top,E=b.right,x=b.bottom,U=b.left,B=s==="start"||s==="nearest"?_:s==="end"?x:_+p/2,L=d==="center"?U+h/2:d==="end"?E:U,H=[],j=0;j<C.length;j++){var S=C[j],J=S.getBoundingClientRect(),te=J.height,se=J.width,fe=J.top,Fe=J.right,Le=J.bottom,De=J.left;if(c==="if-needed"&&_>=0&&U>=0&&x<=R&&E<=T&&_>=fe&&x<=Le&&U>=De&&E<=Fe)return H;var He=getComputedStyle(S),We=parseInt(He.borderLeftWidth,10),ye=parseInt(He.borderTopWidth,10),ue=parseInt(He.borderRightWidth,10),Ye=parseInt(He.borderBottomWidth,10),vt=0,ct=0,it="offsetWidth"in S?S.offsetWidth-S.clientWidth-We-ue:0,ft="offsetHeight"in S?S.offsetHeight-S.clientHeight-ye-Ye:0;if(a===S)vt=s==="start"?B:s==="end"?B-R:s==="nearest"?z(v,v+R,R,ye,Ye,v+B,v+B+p,p):B-R/2,ct=d==="start"?L:d==="center"?L-T/2:d==="end"?L-T:z(A,A+T,T,We,ue,A+L,A+L+h,h),vt=Math.max(0,vt+v),ct=Math.max(0,ct+A);else{vt=s==="start"?B-fe-ye:s==="end"?B-Le+Ye+ft:s==="nearest"?z(fe,Le,te,ye,Ye+ft,B,B+p,p):B-(fe+te/2)+ft/2,ct=d==="start"?L-De-We:d==="center"?L-(De+se/2)+it/2:d==="end"?L-Fe+ue+it:z(De,Fe,se,We,ue+it,L,L+h,h);var Qe=S.scrollLeft,qe=S.scrollTop;B+=qe-(vt=Math.max(0,Math.min(qe+vt,S.scrollHeight-te+ft))),L+=Qe-(ct=Math.max(0,Math.min(Qe+ct,S.scrollWidth-se+it)))}H.push({el:S,top:vt,left:ct})}return H};function k(y){return y===Object(y)&&Object.keys(y).length!==0}function K(y,g){g===void 0&&(g="auto");var m="scrollBehavior"in document.body.style;y.forEach(function(c){var s=c.el,d=c.top,u=c.left;s.scroll&&m?s.scroll({top:d,left:u,behavior:g}):(s.scrollTop=d,s.scrollLeft=u)})}function N(y){return y===!1?{block:"end",inline:"nearest"}:k(y)?y:{block:"start",inline:"nearest"}}function n(y,g){var m=!y.ownerDocument.documentElement.contains(y);if(k(g)&&typeof g.behavior=="function")return g.behavior(m?[]:I(y,g));if(m)return;var c=N(g);return K(I(y,c),c.behavior)}var D=ve.a=n},bT9E:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return V});var Z=G("VTBJ");function V(P,z){var I=Object(Z.a)({},P);return Array.isArray(z)&&z.forEach(function(k){delete I[k]}),I}},biw7:function(xt,ve,G){"use strict";var Z=G("q1tI"),V=G.n(Z),P=Z.createContext(null);ve.a=P},c5Ni:function(xt,ve,G){},dejd:function(xt,ve,G){},dmUQ:function(xt,ve,G){"use strict";var Z=G("Ff2n"),V=G("rePB"),P=G("1OyB"),z=G("vuIU"),I=G("Ji7U"),k=G("md7G"),K=G("foSv"),N=G("q1tI"),n=G.n(N),D=G("TSYQ"),y=G.n(D),g=G("4IlW");function m(p,h){var _=Object.keys(p);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(p);h&&(E=E.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),_.push.apply(_,E)}return _}function c(p){for(var h=1;h<arguments.length;h++){var _=arguments[h]!=null?arguments[h]:{};h%2?m(Object(_),!0).forEach(function(E){Object(V.a)(p,E,_[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(_)):m(Object(_)).forEach(function(E){Object.defineProperty(p,E,Object.getOwnPropertyDescriptor(_,E))})}return p}function s(p){var h=d();return function(){var E=Object(K.a)(p),x;if(h){var U=Object(K.a)(this).constructor;x=Reflect.construct(E,arguments,U)}else x=E.apply(this,arguments);return Object(k.a)(this,x)}}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 u(){}function l(p){p.preventDefault()}var o=function(h){return h.replace(/[^\w.-]+/g,"")},a=200,C=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(h){return h!=null},R=function(h,_){return _===h||typeof _=="number"&&typeof h=="number"&&isNaN(_)&&isNaN(h)},A=function(p){Object(I.a)(_,p);var h=s(_);function _(E){var x;Object(P.a)(this,_),x=h.call(this,E),x.onKeyDown=function(L){var H=x.props,j=H.onKeyDown,S=H.onPressEnter;if(L.keyCode===g.a.UP){var J=x.getRatio(L);x.up(L,J,null),x.stop()}else if(L.keyCode===g.a.DOWN){var te=x.getRatio(L);x.down(L,te,null),x.stop()}else L.keyCode===g.a.ENTER&&S&&S(L);if(x.recordCursorPosition(),x.lastKeyCode=L.keyCode,j){for(var se=arguments.length,fe=new Array(se>1?se-1:0),Fe=1;Fe<se;Fe++)fe[Fe-1]=arguments[Fe];j.apply(void 0,[L].concat(fe))}},x.onKeyUp=function(L){var H=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),H){for(var j=arguments.length,S=new Array(j>1?j-1:0),J=1;J<j;J++)S[J-1]=arguments[J];H.apply(void 0,[L].concat(S))}},x.onChange=function(L){var H=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(L)),x.setState({inputValue:x.rawInput}),H(x.toNumber(x.rawInput))},x.onMouseUp=function(){var L=x.props.onMouseUp;x.recordCursorPosition(),L&&L.apply(void 0,arguments)},x.onFocus=function(){var L;x.setState({focused:!0}),(L=x.props).onFocus.apply(L,arguments)},x.onBlur=function(){var L=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var H=x.getCurrentValidValue(x.state.inputValue),j=x.setValue(H,u);if(L){var S=x.input.value,J=x.getInputDisplayValue({focus:!1,value:j});x.input.value=J&&Number(J),L.apply(void 0,arguments),x.input.value=S}},x.getRatio=function(L){var H=1;return L.metaKey||L.ctrlKey?H=.1:L.shiftKey&&(H=10),H},x.getFullNum=function(L){return isNaN(L)?L:/e/i.test(String(L))?Number(L).toFixed(18).replace(/\.?0+$/,""):L},x.getPrecision=function(L){if(T(x.props.precision))return x.props.precision;var H=String(L);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var j=0;return H.indexOf(".")>=0&&(j=H.length-H.indexOf(".")-1),j},x.getInputDisplayValue=function(L){var H=L||x.state,j=H.focused,S=H.inputValue,J=H.value,te;j?te=S:te=x.toPrecisionAsStep(J),te==null&&(te="");var se=x.formatWrapper(te);return T(x.props.decimalSeparator)&&(se=se.toString().replace(".",x.props.decimalSeparator)),se},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(L){}},x.restoreByAfter=function(L){if(L===void 0)return!1;var H=x.input.value,j=H.lastIndexOf(L);if(j===-1)return!1;var S=x.cursorBefore.length;return x.lastKeyCode===g.a.DELETE&&x.cursorBefore.charAt(S-1)===L[0]?(x.fixCaret(S,S),!0):j+L.length===H.length?(x.fixCaret(j,j),!0):!1},x.partRestoreByAfter=function(L){return L===void 0?!1:Array.prototype.some.call(L,function(H,j){var S=L.substring(j);return x.restoreByAfter(S)})},x.isNotCompleteNumber=function(L){return isNaN(L)||L===""||L===null||L&&L.toString().indexOf(".")===L.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(L,H,j){x.pressingUpOrDown=!0,x.step("down",L,H,j)},x.up=function(L,H,j){x.pressingUpOrDown=!0,x.step("up",L,H,j)},x.saveInput=function(L){x.input=L};var U=E.value;U===void 0&&(U=E.defaultValue),x.state={focused:E.autoFocus};var B=x.getValidValue(x.toNumber(U));return x.state=c(c({},x.state),{},{inputValue:x.toPrecisionAsStep(B),value:B}),x}return Object(z.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var U=this.props,B=U.value,L=U.onChange,H=U.max,j=U.min,S=this.state.focused;if(x){if(!R(x.value,B)||!R(x.max,H)||!R(x.min,j)){var J=S?B:this.getValidValue(B),te;this.pressingUpOrDown?te=J:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(J),this.setState({value:J,inputValue:te})}var se="value"in this.props?B:this.state.value;"max"in this.props&&x.max!==H&&typeof se=="number"&&se>H&&L&&L(H),"min"in this.props&&x.min!==j&&typeof se=="number"&&se<j&&L&&L(j)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.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(x){var U=x;return U===""?U="":this.isNotCompleteNumber(parseFloat(U))?U=this.state.value:U=this.getValidValue(U),this.toNumber(U)}},{key:"getValueFromEvent",value:function(x){var U=x.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(U=U.replace(this.props.decimalSeparator,".")),U}},{key:"getValidValue",value:function(x){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,L=parseFloat(x);return isNaN(L)?x:(L<U&&(L=U),L>B&&(L=B),L)}},{key:"setValue",value:function(x,U){var B=this.props.precision,L=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),H=this.state.value,j=H===void 0?null:H,S=this.state.inputValue,J=S===void 0?null:S,te=typeof L=="number"?L.toFixed(B):"".concat(L),se=L!==j||te!=="".concat(J);return"value"in this.props?(J=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:J},U)):this.setState({value:L,inputValue:this.toPrecisionAsStep(x)},U),se&&this.props.onChange(L),L}},{key:"getMaxPrecision",value:function(x){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,L=B.precision,H=B.step;if(T(L))return L;var j=this.getPrecision(U),S=this.getPrecision(H),J=this.getPrecision(x);return x?Math.max(J,j+S):j+S}},{key:"getPrecisionFactor",value:function(x){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(x,U);return Math.pow(10,B)}},{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(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var U=Math.abs(this.getMaxPrecision(x));return isNaN(U)?x.toString():Number(x).toFixed(U)}},{key:"toNumber",value:function(x){var U=this.props.precision,B=this.state.focused,L=x&&x.length>16&&B;return this.isNotCompleteNumber(x)||L?x:T(U)?Math.round(x*Math.pow(10,U))/Math.pow(10,U):Number(x)}},{key:"upStep",value:function(x,U){var B=this.props.step,L=this.getPrecisionFactor(x,U),H=Math.abs(this.getMaxPrecision(x,U)),j=((L*x+L*B*U)/L).toFixed(H);return this.toNumber(j)}},{key:"downStep",value:function(x,U){var B=this.props.step,L=this.getPrecisionFactor(x,U),H=Math.abs(this.getMaxPrecision(x,U)),j=((L*x-L*B*U)/L).toFixed(H);return this.toNumber(j)}},{key:"step",value:function(x,U){var B=this,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var j=this.props;if(j.disabled)return;var S=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(S))return;var J=this["".concat(x,"Step")](S,L),te=J>j.max||J<j.min;if(J>j.max?J=j.max:J<j.min&&(J=j.min),this.setValue(J,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){B[x](U,L,!0)},H?a:C)}},{key:"fixCaret",value:function(x,U){if(x===void 0||U===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,L=this.input.selectionEnd;(x!==B||U!==L)&&this.input.setSelectionRange(x,U)}catch(H){}}},{key:"render",value:function(){var x,U=this.props,B=U.prefixCls,L=U.disabled,H=U.readOnly,j=U.useTouch,S=U.autoComplete,J=U.upHandler,te=U.downHandler,se=U.className,fe=U.max,Fe=U.min,Le=U.style,De=U.title,He=U.onMouseEnter,We=U.onMouseLeave,ye=U.onMouseOver,ue=U.onMouseOut,Ye=U.required,vt=U.onClick,ct=U.tabIndex,it=U.type,ft=U.placeholder,Qe=U.id,qe=U.inputMode,ht=U.pattern,de=U.step,Ie=U.maxLength,Pe=U.autoFocus,Ke=U.name,st=U.onPaste,at=U.onInput,et=Object(Z.a)(U,["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"]),tt=this.state,dt=tt.value,yt=tt.focused,Ae=y()(B,(x={},Object(V.a)(x,se,!!se),Object(V.a)(x,"".concat(B,"-disabled"),L),Object(V.a)(x,"".concat(B,"-focused"),yt),x)),Se={};Object.keys(et).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Se[me]=et[me])});var Ve=!H&&!L,Je=this.getInputDisplayValue(null),Ne=(dt||dt===0)&&(isNaN(dt)||Number(dt)>=fe),je=(dt||dt===0)&&(isNaN(dt)||Number(dt)<=Fe),Ee=Ne||L||H,he=je||L||H,pe=y()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(V.a)({},"".concat(B,"-handler-up-disabled"),Ee)),re=y()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(V.a)({},"".concat(B,"-handler-down-disabled"),he)),oe=j?{onTouchStart:Ee?u:this.up,onTouchEnd:this.stop}:{onMouseDown:Ee?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},le=j?{onTouchStart:he?u:this.down,onTouchEnd:this.stop}:{onMouseDown:he?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ae,style:Le,title:De,onMouseEnter:He,onMouseLeave:We,onMouseOver:ye,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(B,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":Ee,className:pe}),J||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:l})),n.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Decrease Value","aria-disabled":he,className:re}),te||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:l}))),n.a.createElement("div",{className:"".concat(B,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Fe,"aria-valuemax":fe,"aria-valuenow":dt,required:Ye,type:it,placeholder:ft,onPaste:st,onClick:vt,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:ct,autoComplete:S,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ve?this.onKeyDown:u,onKeyUp:Ve?this.onKeyUp:u,autoFocus:Pe,maxLength:Ie,readOnly:H,disabled:L,max:fe,min:Fe,step:de,name:Ke,title:De,id:Qe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Je),pattern:ht,inputMode:qe,onInput:at},Se))))}}]),_}(n.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:o,required:!1,autoComplete:"off"};var v=A,b=ve.a=v},fjLI:function(xt,ve,G){"use strict";G.d(ve,"f",function(){return m}),G.d(ve,"b",function(){return c}),G.d(ve,"a",function(){return s}),G.d(ve,"d",function(){return d}),G.d(ve,"e",function(){return u}),G.d(ve,"c",function(){return l});var Z=G("8HAY"),V=G("Vhoy"),P=G("MI8n"),z=G("JYp7"),I=G("pmY6"),k=G("24hK"),K=G("nnTU"),N=G("T8No"),n=G("Cg/j"),D=G("t9D7"),y=function(o,a,C,w){var T=arguments.length,R=T<3?a:w===null?w=Object.getOwnPropertyDescriptor(a,C):w,A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(o,a,C,w);else for(var v=o.length-1;v>=0;v--)(A=o[v])&&(R=(T<3?A(R):T>3?A(a,C,R):A(a,C))||R);return T>3&&R&&Object.defineProperty(a,C,R),R},g=function(o,a){return function(C,w){a(C,w,o)}};function m(o){return o.command!==void 0}class c{constructor(o){this.id=c._idPool++,this._debugName=o}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const s=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:o=>o===c.CommandPalette}}addCommand(o){return this.addCommands(z.a.single(o))}addCommands(o){for(const a of o)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(I.i)(()=>{let a=!1;for(const C of o)a=this._commands.delete(C.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((a,C)=>o.set(C,a)),o}appendMenuItem(o,a){return this.appendMenuItems(z.a.single({id:o,item:a}))}appendMenuItems(o){const a=new Set,C=new k.a;for(const{id:w,item:T}of o){let R=this._menuItems.get(w);R||(R=new k.a,this._menuItems.set(w,R)),C.push(R.push(T)),a.add(w)}return this._onDidChangeMenu.fire(a),Object(I.i)(()=>{if(C.size>0){for(let w of C)w();this._onDidChangeMenu.fire(a),C.clear()}})}getMenuItems(o){let a;return this._menuItems.has(o)?a=[...this._menuItems.get(o)]:a=[],o===c.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(o){const a=new Set;for(const C of o)m(C)&&(a.add(C.command.id),C.alt&&a.add(C.alt.id));this._commands.forEach((C,w)=>{a.has(w)||o.push({command:C})})}};class u extends Z.e{constructor(o,a,C,w){super(`submenuitem.${o.submenu.id}`,typeof o.title=="string"?o.title:o.title.value,[],"submenu");this.item=o,this._menuService=a,this._contextKeyService=C,this._options=w}get actions(){const o=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),C=a.getActions(this._options);a.dispose();for(const[,w]of C)w.length>0&&(o.push(...w),o.push(new Z.d));return o.length&&o.pop(),o}}let l=class o{constructor(a,C,w,T,R){var A,v;if(this._commandService=R,this.id=a.id,this.label=(w==null?void 0:w.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(v=typeof a.tooltip=="string"?a.tooltip:(A=a.tooltip)===null||A===void 0?void 0:A.value)!==null&&v!==void 0?v:"",this.enabled=!a.precondition||T.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const b=a.toggled.condition?a.toggled:{condition:a.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=a,this.alt=C?new o(C,void 0,w,T,R):void 0,this._options=w,D.d.isThemeIcon(a.icon)&&(this.class=V.a.asClassName(a.icon))}dispose(){}run(...a){var C,w;let T=[];return((C=this._options)===null||C===void 0?void 0:C.arg)&&(T=[...T,this._options.arg]),((w=this._options)===null||w===void 0?void 0:w.shouldForwardArgs)&&(T=[...T,...a]),this._commandService.executeCommand(this.id,...T)}};l=y([g(3,N.b),g(4,K.b)],l)},fyJ8:function(xt,ve,G){"use strict";var Z=G("rePB"),V=G("VTBJ"),P=G("Ff2n"),z=G("U8pU"),I=G("q1tI"),k=G.n(I),K=G("TSYQ"),N=G.n(K),n=G("c+Xe"),D=G("sR1s");function y(d){return d&&Object(z.a)(d)==="object"&&!Array.isArray(d)&&!I.isValidElement(d)}function g(d){return typeof d=="string"?!0:Object(n.c)(d)}function m(d,u){var l,o=d.prefixCls,a=d.className,C=d.record,w=d.index,T=d.dataIndex,R=d.render,A=d.children,v=d.component,b=v===void 0?"td":v,p=d.colSpan,h=d.rowSpan,_=d.fixLeft,E=d.fixRight,x=d.firstFixLeft,U=d.lastFixLeft,B=d.firstFixRight,L=d.lastFixRight,H=d.appendNode,j=d.additionalProps,S=j===void 0?{}:j,J=d.ellipsis,te=d.align,se=d.rowType,fe=d.isSticky,Fe="".concat(o,"-cell"),Le,De;if(A)De=A;else{var He=Object(D.b)(C,T);if(De=He,R){var We=R(He,C,w);y(We)?(De=We.children,Le=We.props):De=We}}Object(z.a)(De)==="object"&&!Array.isArray(De)&&!I.isValidElement(De)&&(De=null),J&&(U||B)&&(De=I.createElement("span",{className:"".concat(Fe,"-content")},De));var ye=Le||{},ue=ye.colSpan,Ye=ye.rowSpan,vt=ye.style,ct=ye.className,it=Object(P.a)(ye,["colSpan","rowSpan","style","className"]),ft=ue!==void 0?ue:p,Qe=Ye!==void 0?Ye:h;if(ft===0||Qe===0)return null;var qe={},ht=typeof _=="number",de=typeof E=="number";ht&&(qe.position="sticky",qe.left=_),de&&(qe.position="sticky",qe.right=E);var Ie={};te&&(Ie.textAlign=te);var Pe,Ke=J===!0?{showTitle:!0}:J;Ke&&(Ke.showTitle||se==="header")&&(typeof De=="string"||typeof De=="number"?Pe=De.toString():I.isValidElement(De)&&typeof De.props.children=="string"&&(Pe=De.props.children));var st=Object(V.a)(Object(V.a)(Object(V.a)({title:Pe},it),S),{},{colSpan:ft&&ft!==1?ft:null,rowSpan:Qe&&Qe!==1?Qe:null,className:N()(Fe,a,(l={},Object(Z.a)(l,"".concat(Fe,"-fix-left"),ht),Object(Z.a)(l,"".concat(Fe,"-fix-left-first"),x),Object(Z.a)(l,"".concat(Fe,"-fix-left-last"),U),Object(Z.a)(l,"".concat(Fe,"-fix-right"),de),Object(Z.a)(l,"".concat(Fe,"-fix-right-first"),B),Object(Z.a)(l,"".concat(Fe,"-fix-right-last"),L),Object(Z.a)(l,"".concat(Fe,"-ellipsis"),J),Object(Z.a)(l,"".concat(Fe,"-with-append"),H),Object(Z.a)(l,"".concat(Fe,"-fix-sticky"),(ht||de)&&fe),l),S.className,ct),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},S.style),Ie),qe),vt),ref:g(b)?u:null});return I.createElement(b,Object.assign({},st),H,De)}var c=I.forwardRef(m);c.displayName="Cell";var s=I.memo(c,function(d,u){return u.shouldCellUpdate?!u.shouldCellUpdate(u.record,d.record):!1});ve.a=s},hW8S:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return z}),G.d(ve,"c",function(){return I}),G.d(ve,"b",function(){return k});var Z=G("VTBJ"),V=G("Ff2n"),P=G("Kwbf"),z="RC_TABLE_INTERNAL_COL_DEFINE";function I(K){var N=K.expandable,n=Object(V.a)(K,["expandable"]);return"expandable"in K?Object(Z.a)(Object(Z.a)({},n),N):n}function k(K){return Object.keys(K).reduce(function(N,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(N[n]=K[n]),N},{})}},ic2d:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return z});var Z=G("FWmy"),V=G("746U");class P{constructor(){this.data=new Map}add(I,k){Z.a(V.l(I)),Z.a(V.k(k)),Z.a(!this.data.has(I),"There is already an extension with this id"),this.data.set(I,k)}as(I){return this.data.get(I)||null}}const z=new P},k3GJ:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return _o});var Z=G("rePB"),V=G("ODXe"),P=G("Ff2n"),z=G("VTBJ"),I=G("q1tI"),k=G("TSYQ"),K=G.n(k),N=G("Zm9Q"),n=G("6cGi"),D=G("KQm4"),y=G("xEkU"),g=G.n(y),m=G("t23M");function c(ge){var Re=Object(I.useRef)(),ke=Object(I.useRef)(!1);function _e(){for(var ne=arguments.length,ce=new Array(ne),ae=0;ae<ne;ae++)ce[ae]=arguments[ae];ke.current||(g.a.cancel(Re.current),Re.current=g()(function(){ge.apply(void 0,ce)}))}return Object(I.useEffect)(function(){return function(){ke.current=!0,g.a.cancel(Re.current)}},[]),_e}function s(ge){var Re=Object(I.useRef)([]),ke=Object(I.useState)({}),_e=Object(V.a)(ke,2),ne=_e[1],ce=Object(I.useRef)(typeof ge=="function"?ge():ge),ae=c(function(){var we=ce.current;Re.current.forEach(function(Ue){we=Ue(we)}),Re.current=[],ce.current=we,ne({})});function Te(we){Re.current.push(we),ae()}return[ce.current,Te]}var d=G("4IlW");function u(ge,Re){var ke,_e=ge.prefixCls,ne=ge.id,ce=ge.active,ae=ge.rtl,Te=ge.tab,we=Te.key,Ue=Te.tab,Me=Te.disabled,ze=Te.closeIcon,Ze=ge.tabBarGutter,_t=ge.tabPosition,bt=ge.closable,Ct=ge.renderWrapper,Zt=ge.removeAriaLabel,mn=ge.editable,rn=ge.onClick,dn=ge.onRemove,gn=ge.onFocus,pn="".concat(_e,"-tab");I.useEffect(function(){return dn},[]);var hn={};_t==="top"||_t==="bottom"?hn[ae?"marginLeft":"marginRight"]=Ze:hn.marginBottom=Ze;var Rn=mn&&bt!==!1&&!Me;function xn(Yt){if(Me)return;rn(Yt)}function nr(Yt){Yt.preventDefault(),Yt.stopPropagation(),mn.onEdit("remove",{key:we,event:Yt})}var Tn=I.createElement("div",{key:we,ref:Re,className:K()(pn,(ke={},Object(Z.a)(ke,"".concat(pn,"-with-remove"),Rn),Object(Z.a)(ke,"".concat(pn,"-active"),ce),Object(Z.a)(ke,"".concat(pn,"-disabled"),Me),ke)),style:hn,onClick:xn},I.createElement("div",{role:"tab","aria-selected":ce,id:ne&&"".concat(ne,"-tab-").concat(we),className:"".concat(pn,"-btn"),"aria-controls":ne&&"".concat(ne,"-panel-").concat(we),"aria-disabled":Me,tabIndex:Me?null:0,onClick:function(Vt){Vt.stopPropagation(),xn(Vt)},onKeyDown:function(Vt){[d.a.SPACE,d.a.ENTER].includes(Vt.which)&&(Vt.preventDefault(),xn(Vt))},onFocus:gn},Ue),Rn&&I.createElement("button",{type:"button","aria-label":Zt||"remove",tabIndex:0,className:"".concat(pn,"-remove"),onClick:function(Vt){Vt.stopPropagation(),nr(Vt)}},ze||mn.removeIcon||"\xD7"));return Ct&&(Tn=Ct(Tn)),Tn}var l=I.forwardRef(u),o={width:0,height:0,left:0,top:0};function a(ge,Re,ke){return Object(I.useMemo)(function(){for(var _e,ne=new Map,ce=Re.get((_e=ge[0])===null||_e===void 0?void 0:_e.key)||o,ae=ce.left+ce.width,Te=0;Te<ge.length;Te+=1){var we=ge[Te].key,Ue=Re.get(we);if(!Ue){var Me;Ue=Re.get((Me=ge[Te-1])===null||Me===void 0?void 0:Me.key)||o}var ze=ne.get(we)||Object(z.a)({},Ue);ze.right=ae-ze.left-ze.width,ne.set(we,ze)}return ne},[ge.map(function(_e){return _e.key}).join("_"),Re,ke])}var C={width:0,height:0,left:0,top:0,right:0};function w(ge,Re,ke,_e,ne){var ce=ne.tabs,ae=ne.tabPosition,Te=ne.rtl,we,Ue,Me;["top","bottom"].includes(ae)?(we="width",Ue=Te?"right":"left",Me=Math.abs(Re.left)):(we="height",Ue="top",Me=-Re.top);var ze=Re[we],Ze=ke[we],_t=_e[we],bt=ze;return Ze+_t>ze&&(bt=ze-_t),Object(I.useMemo)(function(){if(!ce.length)return[0,0];for(var Ct=ce.length,Zt=Ct,mn=0;mn<Ct;mn+=1){var rn=ge.get(ce[mn].key)||C;if(rn[Ue]+rn[we]>Me+bt){Zt=mn-1;break}}for(var dn=0,gn=Ct-1;gn>=0;gn-=1){var pn=ge.get(ce[gn].key)||C;if(pn[Ue]<Me){dn=gn+1;break}}return[dn,Zt]},[ge,Me,bt,ae,ce.map(function(Ct){return Ct.key}).join("_"),Te])}var T=G("wx14"),R=G("1OyB"),A=G("vuIU"),v=G("JX7q"),b=G("Ji7U"),p=G("LK+K"),h=G("I8Z2"),_=G("bT9E"),E=G("2GS6"),x=G("Gytx"),U=G.n(x),B=G("U8pU"),L=/iPhone/i,H=/iPod/i,j=/iPad/i,S=/\bAndroid(?:.+)Mobile\b/i,J=/Android/i,te=/\bAndroid(?:.+)SD4930UR\b/i,se=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,fe=/Windows Phone/i,Fe=/\bWindows(?:.+)ARM\b/i,Le=/BlackBerry/i,De=/BB10/i,He=/Opera Mini/i,We=/\b(CriOS|Chrome)(?:.+)Mobile/i,ye=/Mobile(?:.+)Firefox\b/i;function ue(ge,Re){return ge.test(Re)}function Ye(ge){var Re=ge||(typeof navigator!="undefined"?navigator.userAgent:""),ke=(Re||"").split("[FBAN");if(typeof ke[1]!="undefined"){var _e=ke,ne=Object(V.a)(_e,1);Re=ne[0]}if(ke=Re.split("Twitter"),typeof ke[1]!="undefined"){var ce=ke,ae=Object(V.a)(ce,1);Re=ae[0]}var Te={apple:{phone:ue(L,Re)&&!ue(fe,Re),ipod:ue(H,Re),tablet:!ue(L,Re)&&ue(j,Re)&&!ue(fe,Re),device:(ue(L,Re)||ue(H,Re)||ue(j,Re))&&!ue(fe,Re)},amazon:{phone:ue(te,Re),tablet:!ue(te,Re)&&ue(se,Re),device:ue(te,Re)||ue(se,Re)},android:{phone:!ue(fe,Re)&&ue(te,Re)||!ue(fe,Re)&&ue(S,Re),tablet:!ue(fe,Re)&&!ue(te,Re)&&!ue(S,Re)&&(ue(se,Re)||ue(J,Re)),device:!ue(fe,Re)&&(ue(te,Re)||ue(se,Re)||ue(S,Re)||ue(J,Re))||ue(/\bokhttp\b/i,Re)},windows:{phone:ue(fe,Re),tablet:ue(Fe,Re),device:ue(fe,Re)||ue(Fe,Re)},other:{blackberry:ue(Le,Re),blackberry10:ue(De,Re),opera:ue(He,Re),firefox:ue(ye,Re),chrome:ue(We,Re),device:ue(Le,Re)||ue(De,Re)||ue(He,Re)||ue(ye,Re)||ue(We,Re)},any:null,phone:null,tablet:null};return Te.any=Te.apple.device||Te.android.device||Te.windows.device||Te.other.device,Te.phone=Te.apple.phone||Te.android.phone||Te.windows.phone,Te.tablet=Te.apple.tablet||Te.android.tablet||Te.windows.tablet,Te}var vt=Object(z.a)(Object(z.a)({},Ye()),{},{isMobile:Ye}),ct=vt;function it(){}function ft(ge,Re,ke){var _e=Re||"";return ge.key||"".concat(_e,"item_").concat(ke)}function Qe(ge){return"".concat(ge,"-menu-")}function qe(ge,Re){var ke=-1;I.Children.forEach(ge,function(_e){ke+=1,_e&&_e.type&&_e.type.isMenuItemGroup?I.Children.forEach(_e.props.children,function(ne){ke+=1,Re(ne,ke)}):Re(_e,ke)})}function ht(ge,Re,ke){if(!ge||ke.find)return;I.Children.forEach(ge,function(_e){if(_e){var ne=_e.type;if(!ne||!(ne.isSubMenu||ne.isMenuItem||ne.isMenuItemGroup))return;Re.indexOf(_e.key)!==-1?ke.find=!0:_e.props.children&&ht(_e.props.children,Re,ke)}})}var de=["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"],Ie=function(Re){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e=Re&&typeof Re.getBoundingClientRect=="function"&&Re.getBoundingClientRect().width;if(_e){if(ke){var ne=getComputedStyle(Re),ce=ne.marginLeft,ae=ne.marginRight;_e+=+ce.replace("px","")+ +ae.replace("px","")}_e=+_e.toFixed(6)}return _e||0},Pe=function(Re,ke,_e){Re&&Object(B.a)(Re.style)==="object"&&(Re.style[ke]=_e)},Ke=function(){return ct.any},st=G("bdgK"),at=G("i8i4"),et=G.n(at),tt=G("wgJM"),dt=G("l4aY"),yt=G("m+aA"),Ae=G("c+Xe"),Se=G("zT1h"),Ve=G("QC+M");function Je(ge,Re,ke){return ke?ge[0]===Re[0]:ge[0]===Re[0]&&ge[1]===Re[1]}function Ne(ge,Re,ke){var _e=ge[Re]||{};return Object(z.a)(Object(z.a)({},_e),ke)}function je(ge,Re,ke,_e){for(var ne=ke.points,ce=Object.keys(ge),ae=0;ae<ce.length;ae+=1){var Te=ce[ae];if(Je(ge[Te].points,ne,_e))return"".concat(Re,"-placement-").concat(Te)}return""}var Ee=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ge=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ge)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ge==null?void 0:ge.substr(0,4)))},he=G("MNnm");function pe(ge,Re){var ke={};return ke[ge.toLowerCase()]=Re.toLowerCase(),ke["Webkit".concat(ge)]="webkit".concat(Re),ke["Moz".concat(ge)]="moz".concat(Re),ke["ms".concat(ge)]="MS".concat(Re),ke["O".concat(ge)]="o".concat(Re.toLowerCase()),ke}function re(ge,Re){var ke={animationend:pe("Animation","AnimationEnd"),transitionend:pe("Transition","TransitionEnd")};return ge&&("AnimationEvent"in Re||delete ke.animationend.animation,"TransitionEvent"in Re||delete ke.transitionend.transition),ke}var oe=re(Object(he.a)(),typeof window!="undefined"?window:{}),le={};if(Object(he.a)()){var me=document.createElement("div");le=me.style}var be={};function Be(ge){if(be[ge])return be[ge];var Re=oe[ge];if(Re)for(var ke=Object.keys(Re),_e=ke.length,ne=0;ne<_e;ne+=1){var ce=ke[ne];if(Object.prototype.hasOwnProperty.call(Re,ce)&&ce in le)return be[ge]=Re[ce],be[ge]}return""}var $e=Be("animationend"),ut=Be("transitionend"),Et=!!($e&&ut),mt=$e||"animationend",Bt=ut||"transitionend";function Ut(ge,Re){if(!ge)return null;if(Object(B.a)(ge)==="object"){var ke=Re.replace(/-\w/g,function(_e){return _e[1].toUpperCase()});return ge[ke]}return"".concat(ge,"-").concat(Re)}var Tt="none",kt="appear",zt="enter",$t="leave",vn="none",Ft="prepare",an="start",nn="active",ot="end";function en(ge){var Re=Object(I.useRef)(!1),ke=Object(I.useState)(ge),_e=Object(V.a)(ke,2),ne=_e[0],ce=_e[1];function ae(Te){Re.current||ce(Te)}return Object(I.useEffect)(function(){return function(){Re.current=!0}},[]),[ne,ae]}var It=Object(he.a)()?I.useLayoutEffect:I.useEffect,Rt=It,Mt=function(){var ge=I.useRef(null);function Re(){tt.a.cancel(ge.current)}function ke(_e){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Re();var ce=Object(tt.a)(function(){ne<=1?_e({isCanceled:function(){return ce!==ge.current}}):ke(_e,ne-1)});ge.current=ce}return I.useEffect(function(){return function(){Re()}},[]),[ke,Re]},On=[Ft,an,nn,ot],ln=!1,un=!0;function Lt(ge){return ge===nn||ge===ot}var ar=function(ge,Re){var ke=I.useState(vn),_e=Object(V.a)(ke,2),ne=_e[0],ce=_e[1],ae=Mt(),Te=Object(V.a)(ae,2),we=Te[0],Ue=Te[1];function Me(){ce(Ft)}return Rt(function(){if(ne!==vn&&ne!==ot){var ze=On.indexOf(ne),Ze=On[ze+1],_t=Re(ne);_t===ln?ce(Ze):we(function(bt){function Ct(){if(bt.isCanceled())return;ce(Ze)}_t===!0?Ct():Promise.resolve(_t).then(Ct)})}},[ge,ne]),I.useEffect(function(){return function(){Ue()}},[]),[Me,ne]},In=function(ge){var Re=Object(I.useRef)(),ke=Object(I.useRef)(ge);ke.current=ge;var _e=I.useCallback(function(ae){ke.current(ae)},[]);function ne(ae){ae&&(ae.removeEventListener(Bt,_e),ae.removeEventListener(mt,_e))}function ce(ae){Re.current&&Re.current!==ae&&ne(Re.current),ae&&ae!==Re.current&&(ae.addEventListener(Bt,_e),ae.addEventListener(mt,_e),Re.current=ae)}return I.useEffect(function(){return function(){ne(Re.current)}},[]),[ce,ne]};function Nn(ge,Re,ke,_e){var ne=_e.motionEnter,ce=ne===void 0?!0:ne,ae=_e.motionAppear,Te=ae===void 0?!0:ae,we=_e.motionLeave,Ue=we===void 0?!0:we,Me=_e.motionDeadline,ze=_e.motionLeaveImmediately,Ze=_e.onAppearPrepare,_t=_e.onEnterPrepare,bt=_e.onLeavePrepare,Ct=_e.onAppearStart,Zt=_e.onEnterStart,mn=_e.onLeaveStart,rn=_e.onAppearActive,dn=_e.onEnterActive,gn=_e.onLeaveActive,pn=_e.onAppearEnd,hn=_e.onEnterEnd,Rn=_e.onLeaveEnd,xn=_e.onVisibleChanged,nr=en(),Tn=Object(V.a)(nr,2),Yt=Tn[0],Vt=Tn[1],Sn=en(Tt),Ln=Object(V.a)(Sn,2),Ht=Ln[0],Dn=Ln[1],rr=en(null),Un=Object(V.a)(rr,2),Xn=Un[0],Gn=Un[1],pr=Object(I.useRef)(!1),Ar=Object(I.useRef)(null),sr=Object(I.useRef)(!1),Vr=Object(I.useRef)(null);function bi(){var Zn=ke();return Zn||Vr.current}var Zr=Object(I.useRef)(!1);function Rr(Zn){var Kn=bi();if(Zn&&!Zn.deadline&&Zn.target!==Kn)return;var Lr;Ht===kt&&Zr.current?Lr=pn==null?void 0:pn(Kn,Zn):Ht===zt&&Zr.current?Lr=hn==null?void 0:hn(Kn,Zn):Ht===$t&&Zr.current&&(Lr=Rn==null?void 0:Rn(Kn,Zn)),Lr!==!1&&!sr.current&&(Dn(Tt),Gn(null))}var qn=In(Rr),Yn=Object(V.a)(qn,1),lr=Yn[0],ir=I.useMemo(function(){var Zn,Kn,Lr;switch(Ht){case"appear":return Zn={},Object(Z.a)(Zn,Ft,Ze),Object(Z.a)(Zn,an,Ct),Object(Z.a)(Zn,nn,rn),Zn;case"enter":return Kn={},Object(Z.a)(Kn,Ft,_t),Object(Z.a)(Kn,an,Zt),Object(Z.a)(Kn,nn,dn),Kn;case"leave":return Lr={},Object(Z.a)(Lr,Ft,bt),Object(Z.a)(Lr,an,mn),Object(Z.a)(Lr,nn,gn),Lr;default:return{}}},[Ht]),Ei=ar(Ht,function(Zn){if(Zn===Ft){var Kn=ir[Ft];return Kn?Kn(bi()):ln}if(zn in ir){var Lr;Gn(((Lr=ir[zn])===null||Lr===void 0?void 0:Lr.call(ir,bi(),null))||null)}return zn===nn&&(lr(bi()),Me>0&&(clearTimeout(Ar.current),Ar.current=setTimeout(function(){Rr({deadline:!0})},Me))),un}),Wi=Object(V.a)(Ei,2),Ki=Wi[0],zn=Wi[1],Oi=Lt(zn);Zr.current=Oi,Rt(function(){Vt(Re);var Zn=pr.current;if(pr.current=!0,!ge)return;var Kn;!Zn&&Re&&Te&&(Kn=kt),Zn&&Re&&ce&&(Kn=zt),(Zn&&!Re&&Ue||!Zn&&ze&&!Re&&Ue)&&(Kn=$t),Kn&&(Dn(Kn),Ki())},[Re]),Object(I.useEffect)(function(){(Ht===kt&&!Te||Ht===zt&&!ce||Ht===$t&&!Ue)&&Dn(Tt)},[Te,ce,Ue]),Object(I.useEffect)(function(){return function(){clearTimeout(Ar.current),sr.current=!0}},[]),Object(I.useEffect)(function(){Yt!==void 0&&Ht===Tt&&(xn==null||xn(Yt))},[Yt,Ht]);var Gi=Xn;return ir[Ft]&&zn===an&&(Gi=Object(z.a)({transition:"none"},Gi)),[Ht,zn,Gi,Yt!=null?Yt:Re]}var tn=function(ge){Object(b.a)(ke,ge);var Re=Object(p.a)(ke);function ke(){return Object(R.a)(this,ke),Re.apply(this,arguments)}return Object(A.a)(ke,[{key:"render",value:function(){return this.props.children}}]),ke}(I.Component),Fn=tn;function dr(ge){var Re=ge;Object(B.a)(ge)==="object"&&(Re=ge.transitionSupport);function ke(ne){return!!(ne.motionName&&Re)}var _e=I.forwardRef(function(ne,ce){var ae=ne.visible,Te=ae===void 0?!0:ae,we=ne.removeOnLeave,Ue=we===void 0?!0:we,Me=ne.forceRender,ze=ne.children,Ze=ne.motionName,_t=ne.leavedClassName,bt=ne.eventProps,Ct=ke(ne),Zt=Object(I.useRef)(),mn=Object(I.useRef)();function rn(){try{return Object(yt.a)(Zt.current||mn.current)}catch(Dn){return null}}var dn=Nn(Ct,Te,rn,ne),gn=Object(V.a)(dn,4),pn=gn[0],hn=gn[1],Rn=gn[2],xn=gn[3],nr=I.useRef(xn);xn&&(nr.current=!0);var Tn=Object(I.useRef)(ce);Tn.current=ce;var Yt=I.useCallback(function(Dn){Zt.current=Dn,Object(Ae.b)(Tn.current,Dn)},[]),Vt,Sn=Object(z.a)(Object(z.a)({},bt),{},{visible:Te});if(!ze)Vt=null;else if(pn===Tt||!ke(ne))xn?Vt=ze(Object(z.a)({},Sn),Yt):!Ue&&nr.current?Vt=ze(Object(z.a)(Object(z.a)({},Sn),{},{className:_t}),Yt):Me?Vt=ze(Object(z.a)(Object(z.a)({},Sn),{},{style:{display:"none"}}),Yt):Vt=null;else{var Ln,Ht;hn===Ft?Ht="prepare":Lt(hn)?Ht="active":hn===an&&(Ht="start"),Vt=ze(Object(z.a)(Object(z.a)({},Sn),{},{className:K()(Ut(Ze,pn),(Ln={},Object(Z.a)(Ln,Ut(Ze,"".concat(pn,"-").concat(Ht)),Ht),Object(Z.a)(Ln,Ze,typeof Ze=="string"),Ln)),style:Rn}),Yt)}return I.createElement(Fn,{ref:mn},Vt)});return _e.displayName="CSSMotion",_e}var gr=dr(Et),pt="add",Gt="keep",kr="remove",Hr="removed";function ri(ge){var Re;return ge&&Object(B.a)(ge)==="object"&&"key"in ge?Re=ge:Re={key:ge},Object(z.a)(Object(z.a)({},Re),{},{key:String(Re.key)})}function Wr(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ge.map(ri)}function $(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ke=[],_e=0,ne=Re.length,ce=Wr(ge),ae=Wr(Re);ce.forEach(function(Ue){for(var Me=!1,ze=_e;ze<ne;ze+=1){var Ze=ae[ze];if(Ze.key===Ue.key){_e<ze&&(ke=ke.concat(ae.slice(_e,ze).map(function(_t){return Object(z.a)(Object(z.a)({},_t),{},{status:pt})})),_e=ze),ke.push(Object(z.a)(Object(z.a)({},Ze),{},{status:Gt})),_e+=1,Me=!0;break}}Me||ke.push(Object(z.a)(Object(z.a)({},Ue),{},{status:kr}))}),_e<ne&&(ke=ke.concat(ae.slice(_e).map(function(Ue){return Object(z.a)(Object(z.a)({},Ue),{},{status:pt})})));var Te={};ke.forEach(function(Ue){var Me=Ue.key;Te[Me]=(Te[Me]||0)+1});var we=Object.keys(Te).filter(function(Ue){return Te[Ue]>1});return we.forEach(function(Ue){ke=ke.filter(function(Me){var ze=Me.key,Ze=Me.status;return ze!==Ue||Ze!==kr}),ke.forEach(function(Me){Me.key===Ue&&(Me.status=Gt)})}),ke}var O=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function M(ge){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gr,ke=function(_e){Object(b.a)(ce,_e);var ne=Object(p.a)(ce);function ce(){var ae;return Object(R.a)(this,ce),ae=ne.apply(this,arguments),ae.state={keyEntities:[]},ae.removeKey=function(Te){ae.setState(function(we){var Ue=we.keyEntities;return{keyEntities:Ue.map(function(Me){return Me.key!==Te?Me:Object(z.a)(Object(z.a)({},Me),{},{status:Hr})})}})},ae}return Object(A.a)(ce,[{key:"render",value:function(){var Te=this,we=this.state.keyEntities,Ue=this.props,Me=Ue.component,ze=Ue.children,Ze=Ue.onVisibleChanged,_t=Object(P.a)(Ue,["component","children","onVisibleChanged"]),bt=Me||I.Fragment,Ct={};return O.forEach(function(Zt){Ct[Zt]=_t[Zt],delete _t[Zt]}),delete _t.keys,I.createElement(bt,_t,we.map(function(Zt){var mn=Zt.status,rn=Object(P.a)(Zt,["status"]),dn=mn===pt||mn===Gt;return I.createElement(Re,Object(T.a)({},Ct,{key:rn.key,visible:dn,eventProps:rn,onVisibleChanged:function(pn){Ze==null||Ze(pn,{key:rn.key}),pn||Te.removeKey(rn.key)}}),ze)}))}}],[{key:"getDerivedStateFromProps",value:function(Te,we){var Ue=Te.keys,Me=we.keyEntities,ze=Wr(Ue),Ze=$(Me,ze);return{keyEntities:Ze.filter(function(_t){var bt=Me.find(function(Ct){var Zt=Ct.key;return _t.key===Zt});return!(bt&&bt.status===Hr&&_t.status===kr)})}}}]),ce}(I.Component);return ke.defaultProps={component:"div"},ke}var W=M(Et),ee=gr;function Y(ge){var Re=ge.prefixCls,ke=ge.motion,_e=ge.animation,ne=ge.transitionName;return ke||(_e?{motionName:"".concat(Re,"-").concat(_e)}:ne?{motionName:ne}:null)}function Ce(ge){var Re=ge.prefixCls,ke=ge.visible,_e=ge.zIndex,ne=ge.mask,ce=ge.maskMotion,ae=ge.maskAnimation,Te=ge.maskTransitionName;if(!ne)return null;var we={};return(ce||Te||ae)&&(we=Object(z.a)({motionAppear:!0},Y({motion:ce,prefixCls:Re,transitionName:Te,animation:ae}))),I.createElement(ee,Object(T.a)({},we,{visible:ke,removeOnLeave:!0}),function(Ue){var Me=Ue.className;return I.createElement("div",{style:{zIndex:_e},className:K()("".concat(Re,"-mask"),Me)})})}var rt=G("9mu1"),wt=G("o0o1"),Pt=G.n(wt),lt=G("HaE+"),Kt=["measure","align",null,"motion"],Jt=function(ge,Re){var ke=Object(I.useState)(null),_e=Object(V.a)(ke,2),ne=_e[0],ce=_e[1],ae=Object(I.useRef)(),Te=Object(I.useRef)(!1);function we(ze){Te.current||ce(ze)}function Ue(){tt.a.cancel(ae.current)}function Me(ze){Ue(),ae.current=Object(tt.a)(function(){we(function(Ze){switch(ne){case"align":return"motion";case"motion":return"stable";default:}return Ze}),ze==null||ze()})}return Object(I.useEffect)(function(){we("measure")},[ge]),Object(I.useEffect)(function(){switch(ne){case"measure":Re();break;default:}ne&&(ae.current=Object(tt.a)(Object(lt.a)(Pt.a.mark(function ze(){var Ze,_t;return Pt.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:Ze=Kt.indexOf(ne),_t=Kt[Ze+1],_t&&Ze!==-1&&we(_t);case 3:case"end":return Ct.stop()}},ze)}))))},[ne]),Object(I.useEffect)(function(){return function(){Te.current=!0,Ue()}},[]),[ne,Me]},jn=function(ge){var Re=I.useState({width:0,height:0}),ke=Object(V.a)(Re,2),_e=ke[0],ne=ke[1];function ce(Te){ne({width:Te.offsetWidth,height:Te.offsetHeight})}var ae=I.useMemo(function(){var Te={};if(ge){var we=_e.width,Ue=_e.height;ge.indexOf("height")!==-1&&Ue?Te.height=Ue:ge.indexOf("minHeight")!==-1&&Ue&&(Te.minHeight=Ue),ge.indexOf("width")!==-1&&we?Te.width=we:ge.indexOf("minWidth")!==-1&&we&&(Te.minWidth=we)}return Te},[ge,_e]);return[ae,ce]},xr=I.forwardRef(function(ge,Re){var ke=ge.visible,_e=ge.prefixCls,ne=ge.className,ce=ge.style,ae=ge.children,Te=ge.zIndex,we=ge.stretch,Ue=ge.destroyPopupOnHide,Me=ge.forceRender,ze=ge.align,Ze=ge.point,_t=ge.getRootDomNode,bt=ge.getClassNameFromAlign,Ct=ge.onAlign,Zt=ge.onMouseEnter,mn=ge.onMouseLeave,rn=ge.onMouseDown,dn=ge.onTouchStart,gn=Object(I.useRef)(),pn=Object(I.useRef)(),hn=Object(I.useState)(),Rn=Object(V.a)(hn,2),xn=Rn[0],nr=Rn[1],Tn=jn(we),Yt=Object(V.a)(Tn,2),Vt=Yt[0],Sn=Yt[1];function Ln(){we&&Sn(_t())}var Ht=Jt(ke,Ln),Dn=Object(V.a)(Ht,2),rr=Dn[0],Un=Dn[1],Xn=Object(I.useRef)();function Gn(){return Ze||_t}function pr(){var qn;(qn=gn.current)===null||qn===void 0||qn.forceAlign()}function Ar(qn,Yn){var lr=bt(Yn);xn!==lr&&nr(lr),rr==="align"&&(xn!==lr?Promise.resolve().then(function(){pr()}):Un(function(){var ir;(ir=Xn.current)===null||ir===void 0||ir.call(Xn)}),Ct==null||Ct(qn,Yn))}var sr=Object(z.a)({},Y(ge));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(qn){var Yn=sr[qn];sr[qn]=function(lr,ir){return Un(),Yn==null?void 0:Yn(lr,ir)}});function Vr(){return new Promise(function(qn){Xn.current=qn})}I.useEffect(function(){!sr.motionName&&rr==="motion"&&Un()},[sr.motionName,rr]),I.useImperativeHandle(Re,function(){return{forceAlign:pr,getElement:function(){return pn.current}}});var bi=Object(z.a)(Object(z.a)({},Vt),{},{zIndex:Te,opacity:rr==="motion"||rr==="stable"||!ke?void 0:0,pointerEvents:rr==="stable"?void 0:"none"},ce),Zr=!0;(ze==null?void 0:ze.points)&&(rr==="align"||rr==="stable")&&(Zr=!1);var Rr=ae;return I.Children.count(ae)>1&&(Rr=I.createElement("div",{className:"".concat(_e,"-content")},ae)),I.createElement(ee,Object(T.a)({visible:ke,ref:pn,leavedClassName:"".concat(_e,"-hidden")},sr,{onAppearPrepare:Vr,onEnterPrepare:Vr,removeOnLeave:Ue,forceRender:Me}),function(qn,Yn){var lr=qn.className,ir=qn.style,Ei=K()(_e,ne,xn,lr);return I.createElement(rt.a,{target:Gn(),key:"popup",ref:gn,monitorWindowResize:!0,disabled:Zr,align:ze,onAlign:Ar},I.createElement("div",{ref:Yn,className:Ei,onMouseEnter:Zt,onMouseLeave:mn,onMouseDownCapture:rn,onTouchStartCapture:dn,style:Object(z.a)(Object(z.a)({},ir),bi)},Rr))})});xr.displayName="PopupInner";var vr=xr,Jn=I.forwardRef(function(ge,Re){var ke=ge.prefixCls,_e=ge.visible,ne=ge.zIndex,ce=ge.children,ae=ge.mobile;ae=ae===void 0?{}:ae;var Te=ae.popupClassName,we=ae.popupStyle,Ue=ae.popupMotion,Me=Ue===void 0?{}:Ue,ze=ae.popupRender,Ze=I.useRef();I.useImperativeHandle(Re,function(){return{forceAlign:function(){},getElement:function(){return Ze.current}}});var _t=Object(z.a)({zIndex:ne},we),bt=ce;return I.Children.count(ce)>1&&(bt=I.createElement("div",{className:"".concat(ke,"-content")},ce)),ze&&(bt=ze(bt)),I.createElement(ee,Object(T.a)({visible:_e,ref:Ze,removeOnLeave:!0},Me),function(Ct,Zt){var mn=Ct.className,rn=Ct.style,dn=K()(ke,Te,mn);return I.createElement("div",{ref:Zt,className:dn,style:Object(z.a)(Object(z.a)({},rn),_t)},bt)})});Jn.displayName="MobilePopupInner";var ii=Jn,wi=["visible","mobile"],or=I.forwardRef(function(ge,Re){var ke=ge.visible,_e=ge.mobile,ne=Object(P.a)(ge,wi),ce=Object(I.useState)(ke),ae=Object(V.a)(ce,2),Te=ae[0],we=ae[1],Ue=Object(I.useState)(!1),Me=Object(V.a)(Ue,2),ze=Me[0],Ze=Me[1],_t=Object(z.a)(Object(z.a)({},ne),{},{visible:Te});Object(I.useEffect)(function(){we(ke),ke&&_e&&Ze(Ee())},[ke,_e]);var bt=ze?I.createElement(ii,Object(T.a)({},_t,{mobile:_e,ref:Re})):I.createElement(vr,Object(T.a)({},_t,{ref:Re}));return I.createElement("div",null,I.createElement(Ce,_t),bt)});or.displayName="Popup";var Kr=or,yi=I.createContext(null),ai=yi;function Tr(){}function Ai(){return""}function Si(ge){return ge?ge.ownerDocument:window.document}var Ri=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Ni(ge){var Re=function(ke){Object(b.a)(ne,ke);var _e=Object(p.a)(ne);function ne(ce){var ae;Object(R.a)(this,ne),ae=_e.call(this,ce),ae.popupRef=I.createRef(),ae.triggerRef=I.createRef(),ae.attachId=void 0,ae.clickOutsideHandler=void 0,ae.touchOutsideHandler=void 0,ae.contextMenuOutsideHandler1=void 0,ae.contextMenuOutsideHandler2=void 0,ae.mouseDownTimeout=void 0,ae.focusTime=void 0,ae.preClickTime=void 0,ae.preTouchTime=void 0,ae.delayTimer=void 0,ae.hasPopupMouseDown=void 0,ae.onMouseEnter=function(we){var Ue=ae.props.mouseEnterDelay;ae.fireEvents("onMouseEnter",we),ae.delaySetPopupVisible(!0,Ue,Ue?null:we)},ae.onMouseMove=function(we){ae.fireEvents("onMouseMove",we),ae.setPoint(we)},ae.onMouseLeave=function(we){ae.fireEvents("onMouseLeave",we),ae.delaySetPopupVisible(!1,ae.props.mouseLeaveDelay)},ae.onPopupMouseEnter=function(){ae.clearDelayTimer()},ae.onPopupMouseLeave=function(we){var Ue;if(we.relatedTarget&&!we.relatedTarget.setTimeout&&Object(dt.a)((Ue=ae.popupRef.current)===null||Ue===void 0?void 0:Ue.getElement(),we.relatedTarget))return;ae.delaySetPopupVisible(!1,ae.props.mouseLeaveDelay)},ae.onFocus=function(we){ae.fireEvents("onFocus",we),ae.clearDelayTimer(),ae.isFocusToShow()&&(ae.focusTime=Date.now(),ae.delaySetPopupVisible(!0,ae.props.focusDelay))},ae.onMouseDown=function(we){ae.fireEvents("onMouseDown",we),ae.preClickTime=Date.now()},ae.onTouchStart=function(we){ae.fireEvents("onTouchStart",we),ae.preTouchTime=Date.now()},ae.onBlur=function(we){ae.fireEvents("onBlur",we),ae.clearDelayTimer(),ae.isBlurToHide()&&ae.delaySetPopupVisible(!1,ae.props.blurDelay)},ae.onContextMenu=function(we){we.preventDefault(),ae.fireEvents("onContextMenu",we),ae.setPopupVisible(!0,we)},ae.onContextMenuClose=function(){ae.isContextMenuToShow()&&ae.close()},ae.onClick=function(we){if(ae.fireEvents("onClick",we),ae.focusTime){var Ue;if(ae.preClickTime&&ae.preTouchTime?Ue=Math.min(ae.preClickTime,ae.preTouchTime):ae.preClickTime?Ue=ae.preClickTime:ae.preTouchTime&&(Ue=ae.preTouchTime),Math.abs(Ue-ae.focusTime)<20)return;ae.focusTime=0}ae.preClickTime=0,ae.preTouchTime=0,ae.isClickToShow()&&(ae.isClickToHide()||ae.isBlurToHide())&&we&&we.preventDefault&&we.preventDefault();var Me=!ae.state.popupVisible;(ae.isClickToHide()&&!Me||Me&&ae.isClickToShow())&&ae.setPopupVisible(!ae.state.popupVisible,we)},ae.onPopupMouseDown=function(){if(ae.hasPopupMouseDown=!0,clearTimeout(ae.mouseDownTimeout),ae.mouseDownTimeout=window.setTimeout(function(){ae.hasPopupMouseDown=!1},0),ae.context){var we;(we=ae.context).onPopupMouseDown.apply(we,arguments)}},ae.onDocumentClick=function(we){if(ae.props.mask&&!ae.props.maskClosable)return;var Ue=we.target,Me=ae.getRootDomNode(),ze=ae.getPopupDomNode();(!Object(dt.a)(Me,Ue)||ae.isContextMenuOnly())&&!Object(dt.a)(ze,Ue)&&!ae.hasPopupMouseDown&&ae.close()},ae.getRootDomNode=function(){var we=ae.props.getTriggerDOMNode;if(we)return we(ae.triggerRef.current);try{var Ue=Object(yt.a)(ae.triggerRef.current);if(Ue)return Ue}catch(Me){}return et.a.findDOMNode(Object(v.a)(ae))},ae.getPopupClassNameFromAlign=function(we){var Ue=[],Me=ae.props,ze=Me.popupPlacement,Ze=Me.builtinPlacements,_t=Me.prefixCls,bt=Me.alignPoint,Ct=Me.getPopupClassNameFromAlign;return ze&&Ze&&Ue.push(je(Ze,_t,we,bt)),Ct&&Ue.push(Ct(we)),Ue.join(" ")},ae.getComponent=function(){var we=ae.props,Ue=we.prefixCls,Me=we.destroyPopupOnHide,ze=we.popupClassName,Ze=we.onPopupAlign,_t=we.popupMotion,bt=we.popupAnimation,Ct=we.popupTransitionName,Zt=we.popupStyle,mn=we.mask,rn=we.maskAnimation,dn=we.maskTransitionName,gn=we.maskMotion,pn=we.zIndex,hn=we.popup,Rn=we.stretch,xn=we.alignPoint,nr=we.mobile,Tn=we.forceRender,Yt=ae.state,Vt=Yt.popupVisible,Sn=Yt.point,Ln=ae.getPopupAlign(),Ht={};return ae.isMouseEnterToShow()&&(Ht.onMouseEnter=ae.onPopupMouseEnter),ae.isMouseLeaveToHide()&&(Ht.onMouseLeave=ae.onPopupMouseLeave),Ht.onMouseDown=ae.onPopupMouseDown,Ht.onTouchStart=ae.onPopupMouseDown,I.createElement(Kr,Object(T.a)({prefixCls:Ue,destroyPopupOnHide:Me,visible:Vt,point:xn&&Sn,className:ze,align:Ln,onAlign:Ze,animation:bt,getClassNameFromAlign:ae.getPopupClassNameFromAlign},Ht,{stretch:Rn,getRootDomNode:ae.getRootDomNode,style:Zt,mask:mn,zIndex:pn,transitionName:Ct,maskAnimation:rn,maskTransitionName:dn,maskMotion:gn,ref:ae.popupRef,motion:_t,mobile:nr,forceRender:Tn}),typeof hn=="function"?hn():hn)},ae.attachParent=function(we){tt.a.cancel(ae.attachId);var Ue=ae.props,Me=Ue.getPopupContainer,ze=Ue.getDocument,Ze=ae.getRootDomNode(),_t;Me?(Ze||Me.length===0)&&(_t=Me(Ze)):_t=ze(ae.getRootDomNode()).body,_t?_t.appendChild(we):ae.attachId=Object(tt.a)(function(){ae.attachParent(we)})},ae.getContainer=function(){var we=ae.props.getDocument,Ue=we(ae.getRootDomNode()).createElement("div");return Ue.style.position="absolute",Ue.style.top="0",Ue.style.left="0",Ue.style.width="100%",ae.attachParent(Ue),Ue},ae.setPoint=function(we){var Ue=ae.props.alignPoint;if(!Ue||!we)return;ae.setState({point:{pageX:we.pageX,pageY:we.pageY}})},ae.handlePortalUpdate=function(){ae.state.prevPopupVisible!==ae.state.popupVisible&&ae.props.afterPopupVisibleChange(ae.state.popupVisible)},ae.triggerContextValue={onPopupMouseDown:ae.onPopupMouseDown};var Te;return"popupVisible"in ce?Te=!!ce.popupVisible:Te=!!ce.defaultPopupVisible,ae.state={prevPopupVisible:Te,popupVisible:Te},Ri.forEach(function(we){ae["fire".concat(we)]=function(Ue){ae.fireEvents(we,Ue)}}),ae}return Object(A.a)(ne,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ae=this.props,Te=this.state;if(Te.popupVisible){var we;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(we=ae.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Se.a)(we,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(we=we||ae.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Se.a)(we,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(we=we||ae.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Se.a)(we,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Se.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ae;return((ae=this.popupRef.current)===null||ae===void 0?void 0:ae.getElement())||null}},{key:"getPopupAlign",value:function(){var ae=this.props,Te=ae.popupPlacement,we=ae.popupAlign,Ue=ae.builtinPlacements;return Te&&Ue?Ne(Ue,Te,we):we}},{key:"setPopupVisible",value:function(ae,Te){var we=this.props.alignPoint,Ue=this.state.popupVisible;this.clearDelayTimer(),Ue!==ae&&("popupVisible"in this.props||this.setState({popupVisible:ae,prevPopupVisible:Ue}),this.props.onPopupVisibleChange(ae)),we&&Te&&ae&&this.setPoint(Te)}},{key:"delaySetPopupVisible",value:function(ae,Te,we){var Ue=this,Me=Te*1e3;if(this.clearDelayTimer(),Me){var ze=we?{pageX:we.pageX,pageY:we.pageY}:null;this.delayTimer=window.setTimeout(function(){Ue.setPopupVisible(ae,ze),Ue.clearDelayTimer()},Me)}else this.setPopupVisible(ae,we)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(ae){var Te=this.props.children.props,we=this.props;return Te[ae]&&we[ae]?this["fire".concat(ae)]:Te[ae]||we[ae]}},{key:"isClickToShow",value:function(){var ae=this.props,Te=ae.action,we=ae.showAction;return Te.indexOf("click")!==-1||we.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ae=this.props.action;return ae==="contextMenu"||ae.length===1&&ae[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ae=this.props,Te=ae.action,we=ae.showAction;return Te.indexOf("contextMenu")!==-1||we.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ae=this.props,Te=ae.action,we=ae.hideAction;return Te.indexOf("click")!==-1||we.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ae=this.props,Te=ae.action,we=ae.showAction;return Te.indexOf("hover")!==-1||we.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ae=this.props,Te=ae.action,we=ae.hideAction;return Te.indexOf("hover")!==-1||we.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ae=this.props,Te=ae.action,we=ae.showAction;return Te.indexOf("focus")!==-1||we.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ae=this.props,Te=ae.action,we=ae.hideAction;return Te.indexOf("focus")!==-1||we.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ae;(ae=this.popupRef.current)===null||ae===void 0||ae.forceAlign()}}},{key:"fireEvents",value:function(ae,Te){var we=this.props.children.props[ae];we&&we(Te);var Ue=this.props[ae];Ue&&Ue(Te)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ae=this.state.popupVisible,Te=this.props,we=Te.children,Ue=Te.forceRender,Me=Te.alignPoint,ze=Te.className,Ze=Te.autoDestroy,_t=I.Children.only(we),bt={key:"trigger"};this.isContextMenuToShow()?bt.onContextMenu=this.onContextMenu:bt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(bt.onClick=this.onClick,bt.onMouseDown=this.onMouseDown,bt.onTouchStart=this.onTouchStart):(bt.onClick=this.createTwoChains("onClick"),bt.onMouseDown=this.createTwoChains("onMouseDown"),bt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(bt.onMouseEnter=this.onMouseEnter,Me&&(bt.onMouseMove=this.onMouseMove)):bt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?bt.onMouseLeave=this.onMouseLeave:bt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(bt.onFocus=this.onFocus,bt.onBlur=this.onBlur):(bt.onFocus=this.createTwoChains("onFocus"),bt.onBlur=this.createTwoChains("onBlur"));var Ct=K()(_t&&_t.props&&_t.props.className,ze);Ct&&(bt.className=Ct);var Zt=Object(z.a)({},bt);Object(Ae.c)(_t)&&(Zt.ref=Object(Ae.a)(this.triggerRef,_t.ref));var mn=I.cloneElement(_t,Zt),rn;return(ae||this.popupRef.current||Ue)&&(rn=I.createElement(ge,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ae&&Ze&&(rn=null),I.createElement(ai.Provider,{value:this.triggerContextValue},mn,rn)}}],[{key:"getDerivedStateFromProps",value:function(ae,Te){var we=ae.popupVisible,Ue={};return we!==void 0&&Te.popupVisible!==we&&(Ue.popupVisible=we,Ue.prevPopupVisible=Te.popupVisible),Ue}}]),ne}(I.Component);return Re.contextType=ai,Re.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Ai,getDocument:Si,onPopupVisibleChange:Tr,afterPopupVisibleChange:Tr,onPopupAlign:Tr,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Re}var oi=Ni(Ve.a),hr={adjustX:1,adjustY:1},pi={topLeft:{points:["bl","tl"],overflow:hr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:hr,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:hr,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:hr,offset:[4,0]}},Ui={topLeft:{points:["bl","tl"],overflow:hr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:hr,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:hr,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:hr,offset:[4,0]}},mi=pi,Mn=0,on={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Vn=function(Re,ke,_e){var ne=Qe(ke),ce=Re.getState();Re.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},ce.defaultActiveFirst),{},Object(Z.a)({},ne,_e))})},cn=function(ge){Object(b.a)(ke,ge);var Re=Object(p.a)(ke);function ke(_e){var ne;Object(R.a)(this,ke),ne=Re.call(this,_e),ne.onDestroy=function(Me){ne.props.onDestroy(Me)},ne.onKeyDown=function(Me){var ze=Me.keyCode,Ze=ne.menuInstance,_t=ne.props.store,bt=ne.getVisible();if(ze===d.a.ENTER)return ne.onTitleClick(Me),Vn(_t,ne.props.eventKey,!0),!0;if(ze===d.a.RIGHT)return bt?Ze.onKeyDown(Me):(ne.triggerOpenChange(!0),Vn(_t,ne.props.eventKey,!0)),!0;if(ze===d.a.LEFT){var Ct;if(bt)Ct=Ze.onKeyDown(Me);else return;return Ct||(ne.triggerOpenChange(!1),Ct=!0),Ct}return bt&&(ze===d.a.UP||ze===d.a.DOWN)?Ze.onKeyDown(Me):void 0},ne.onOpenChange=function(Me){ne.props.onOpenChange(Me)},ne.onPopupVisibleChange=function(Me){ne.triggerOpenChange(Me,Me?"mouseenter":"mouseleave")},ne.onMouseEnter=function(Me){var ze=ne.props,Ze=ze.eventKey,_t=ze.onMouseEnter,bt=ze.store;Vn(bt,ne.props.eventKey,!1),_t({key:Ze,domEvent:Me})},ne.onMouseLeave=function(Me){var ze=ne.props,Ze=ze.parentMenu,_t=ze.eventKey,bt=ze.onMouseLeave;Ze.subMenuInstance=Object(v.a)(ne),bt({key:_t,domEvent:Me})},ne.onTitleMouseEnter=function(Me){var ze=ne.props,Ze=ze.eventKey,_t=ze.onItemHover,bt=ze.onTitleMouseEnter;_t({key:Ze,hover:!0}),bt({key:Ze,domEvent:Me})},ne.onTitleMouseLeave=function(Me){var ze=ne.props,Ze=ze.parentMenu,_t=ze.eventKey,bt=ze.onItemHover,Ct=ze.onTitleMouseLeave;Ze.subMenuInstance=Object(v.a)(ne),bt({key:_t,hover:!1}),Ct({key:_t,domEvent:Me})},ne.onTitleClick=function(Me){var ze=Object(v.a)(ne),Ze=ze.props;if(Ze.onTitleClick({key:Ze.eventKey,domEvent:Me}),Ze.triggerSubMenuAction==="hover")return;ne.triggerOpenChange(!ne.getVisible(),"click"),Vn(Ze.store,ne.props.eventKey,!1)},ne.onSubMenuClick=function(Me){typeof ne.props.onClick=="function"&&ne.props.onClick(ne.addKeyPath(Me))},ne.onSelect=function(Me){ne.props.onSelect(Me)},ne.onDeselect=function(Me){ne.props.onDeselect(Me)},ne.getPrefixCls=function(){return"".concat(ne.props.rootPrefixCls,"-submenu")},ne.getActiveClassName=function(){return"".concat(ne.getPrefixCls(),"-active")},ne.getDisabledClassName=function(){return"".concat(ne.getPrefixCls(),"-disabled")},ne.getSelectedClassName=function(){return"".concat(ne.getPrefixCls(),"-selected")},ne.getOpenClassName=function(){return"".concat(ne.props.rootPrefixCls,"-submenu-open")},ne.getVisible=function(){return ne.state.isOpen},ne.getMode=function(){return ne.state.mode},ne.saveMenuInstance=function(Me){ne.menuInstance=Me},ne.addKeyPath=function(Me){return Object(z.a)(Object(z.a)({},Me),{},{keyPath:(Me.keyPath||[]).concat(ne.props.eventKey)})},ne.triggerOpenChange=function(Me,ze){var Ze=ne.props.eventKey,_t=function(){ne.onOpenChange({key:Ze,item:Object(v.a)(ne),trigger:ze,open:Me})};ze==="mouseenter"?ne.mouseenterTimeout=setTimeout(function(){_t()},0):_t()},ne.isChildrenSelected=function(){var Me={find:!1};return ht(ne.props.children,ne.props.selectedKeys,Me),Me.find},ne.isInlineMode=function(){return ne.getMode()==="inline"},ne.adjustWidth=function(){if(!ne.subMenuTitle||!ne.menuInstance)return;var Me=at.findDOMNode(ne.menuInstance);if(Me.offsetWidth>=ne.subMenuTitle.offsetWidth)return;Me.style.minWidth="".concat(ne.subMenuTitle.offsetWidth,"px")},ne.saveSubMenuTitle=function(Me){ne.subMenuTitle=Me},ne.getBaseProps=function(){var Me=Object(v.a)(ne),ze=Me.props,Ze=ne.getMode();return{mode:Ze==="horizontal"?"vertical":Ze,visible:ne.getVisible(),level:ze.level+1,inlineIndent:ze.inlineIndent,focusable:!1,onClick:ne.onSubMenuClick,onSelect:ne.onSelect,onDeselect:ne.onDeselect,onDestroy:ne.onDestroy,selectedKeys:ze.selectedKeys,eventKey:"".concat(ze.eventKey,"-menu-"),openKeys:ze.openKeys,motion:ze.motion,onOpenChange:ne.onOpenChange,subMenuOpenDelay:ze.subMenuOpenDelay,parentMenu:Object(v.a)(ne),subMenuCloseDelay:ze.subMenuCloseDelay,forceSubMenuRender:ze.forceSubMenuRender,triggerSubMenuAction:ze.triggerSubMenuAction,builtinPlacements:ze.builtinPlacements,defaultActiveFirst:ze.store.getState().defaultActiveFirst[Qe(ze.eventKey)],multiple:ze.multiple,prefixCls:ze.rootPrefixCls,id:ne.internalMenuId,manualRef:ne.saveMenuInstance,itemIcon:ze.itemIcon,expandIcon:ze.expandIcon,direction:ze.direction}},ne.getMotion=function(Me,ze){var Ze=Object(v.a)(ne),_t=Ze.haveRendered,bt=ne.props,Ct=bt.motion,Zt=bt.rootPrefixCls,mn=Object(z.a)(Object(z.a)({},Ct),{},{leavedClassName:"".concat(Zt,"-hidden"),removeOnLeave:!1,motionAppear:_t||!ze||Me!=="inline"});return mn};var ce=_e.store,ae=_e.eventKey,Te=ce.getState(),we=Te.defaultActiveFirst;ne.isRootMenu=!1;var Ue=!1;return we&&(Ue=we[ae]),Vn(ce,ae,Ue),ne.state={mode:_e.mode,isOpen:_e.isOpen},ne}return Object(A.a)(ke,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ne=this,ce=this.props,ae=ce.mode,Te=ce.parentMenu,we=ce.manualRef,Ue=ce.isOpen,Me=function(){ne.setState({mode:ae,isOpen:Ue})},ze=Ue!==this.state.isOpen,Ze=ae!==this.state.mode;if((Ze||ze)&&(tt.a.cancel(this.updateStateRaf),Ze?this.updateStateRaf=Object(tt.a)(Me):Me()),we&&we(this),ae!=="horizontal"||!(Te==null?void 0:Te.isRootMenu)||!Ue)return;this.minWidthTimeout=setTimeout(function(){return ne.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ne=this.props,ce=ne.onDestroy,ae=ne.eventKey;ce&&ce(ae),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ne,ce){var ae=this.getBaseProps();return I.createElement(Li,Object(T.a)({},ae,{id:this.internalMenuId,className:ne,style:ce}),this.props.children)}},{key:"renderChildren",value:function(){var ne=this,ce=this.getBaseProps(),ae=ce.mode,Te=ce.visible,we=ce.forceSubMenuRender,Ue=ce.direction,Me=this.getMotion(ae,Te);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Te||we,!this.haveOpened)return I.createElement("div",null);var ze=K()("".concat(ce.prefixCls,"-sub"),Object(Z.a)({},"".concat(ce.prefixCls,"-rtl"),Ue==="rtl"));return this.isInlineMode()?I.createElement(ee,Object(T.a)({visible:ce.visible,forceRender:we},Me),function(Ze){var _t=Ze.className,bt=Ze.style,Ct=K()(ze,_t);return ne.renderPopupMenu(Ct,bt)}):this.renderPopupMenu(ze)}},{key:"render",value:function(){var ne,ce,ae,Te=Object(z.a)({},this.props),we=this.getVisible(),Ue=this.getPrefixCls(),Me=this.isInlineMode(),ze=this.getMode(),Ze=K()(Ue,"".concat(Ue,"-").concat(ze),(ne={},Object(Z.a)(ne,Te.className,!!Te.className),Object(Z.a)(ne,this.getOpenClassName(),we),Object(Z.a)(ne,this.getActiveClassName(),Te.active||we&&!Me),Object(Z.a)(ne,this.getDisabledClassName(),Te.disabled),Object(Z.a)(ne,this.getSelectedClassName(),this.isChildrenSelected()),ne));this.internalMenuId||(Te.eventKey?this.internalMenuId="".concat(Te.eventKey,"$Menu"):(Mn+=1,this.internalMenuId="$__$".concat(Mn,"$Menu")));var _t={},bt={},Ct={};Te.disabled||(_t={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},bt={onClick:this.onTitleClick},Ct={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Zt={},mn=Te.direction,rn=mn==="rtl";Me&&(rn?Zt.paddingRight=Te.inlineIndent*Te.level:Zt.paddingLeft=Te.inlineIndent*Te.level);var dn={};this.getVisible()&&(dn={"aria-owns":this.internalMenuId});var gn=null;ze!=="horizontal"&&(gn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(gn=I.createElement(this.props.expandIcon,Object(z.a)({},this.props))));var pn=I.createElement("div",Object(T.a)({ref:this.saveSubMenuTitle,style:Zt,className:"".concat(Ue,"-title"),role:"button"},Ct,bt,{"aria-expanded":we},dn,{"aria-haspopup":"true",title:typeof Te.title=="string"?Te.title:void 0}),Te.title,gn||I.createElement("i",{className:"".concat(Ue,"-arrow")})),hn=this.renderChildren(),Rn=((ce=Te.parentMenu)===null||ce===void 0?void 0:ce.isRootMenu)?Te.parentMenu.props.getPopupContainer:function(Gn){return Gn.parentNode},xn=on[ze],nr=Te.popupOffset?{offset:Te.popupOffset}:{},Tn=K()((ae={},Object(Z.a)(ae,Te.popupClassName,Te.popupClassName&&!Me),Object(Z.a)(ae,"".concat(Ue,"-rtl"),rn),ae)),Yt=Te.disabled,Vt=Te.triggerSubMenuAction,Sn=Te.subMenuOpenDelay,Ln=Te.forceSubMenuRender,Ht=Te.subMenuCloseDelay,Dn=Te.builtinPlacements;de.forEach(function(Gn){return delete Te[Gn]}),delete Te.onClick;var rr=rn?Object(z.a)(Object(z.a)({},Ui),Dn):Object(z.a)(Object(z.a)({},pi),Dn);delete Te.direction;var Un=this.getBaseProps(),Xn=Me?null:this.getMotion(Un.mode,Un.visible);return I.createElement("li",Object(T.a)({},Te,_t,{className:Ze,role:"menuitem"}),I.createElement(oi,{prefixCls:Ue,popupClassName:K()("".concat(Ue,"-popup"),Tn),getPopupContainer:Rn,builtinPlacements:rr,popupPlacement:xn,popupVisible:Me?!1:we,popupAlign:nr,popup:Me?null:hn,action:Yt||Me?[]:[Vt],mouseEnterDelay:Sn,mouseLeaveDelay:Ht,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Ln,popupMotion:Xn},pn),Me?hn:null)}}]),ke}(I.Component);cn.defaultProps={onMouseEnter:it,onMouseLeave:it,onTitleMouseEnter:it,onTitleMouseLeave:it,onTitleClick:it,manualRef:it,mode:"vertical",title:""};var Qn=Object(h.b)(function(ge,Re){var ke=ge.openKeys,_e=ge.activeKey,ne=ge.selectedKeys,ce=Re.eventKey,ae=Re.subMenuKey;return{isOpen:ke.indexOf(ce)>-1,active:_e[ae]===ce,selectedKeys:ne}})(cn);Qn.isSubMenu=!0;var An=Qn,si="menuitem-overflowed",fr=.5,wr=function(ge){Object(b.a)(ke,ge);var Re=Object(p.a)(ke);function ke(){var _e;return Object(R.a)(this,ke),_e=Re.apply(this,arguments),_e.resizeObserver=null,_e.mutationObserver=null,_e.originalTotalWidth=0,_e.overflowedItems=[],_e.menuItemSizes=[],_e.cancelFrameId=null,_e.state={lastVisibleIndex:void 0},_e.childRef=I.createRef(),_e.getMenuItemNodes=function(){var ne=_e.props.prefixCls,ce=_e.childRef.current;return ce?[].slice.call(ce.children).filter(function(ae){return ae.className.split(" ").indexOf("".concat(ne,"-overflowed-submenu"))<0}):[]},_e.getOverflowedSubMenuItem=function(ne,ce,ae){var Te=_e.props,we=Te.overflowedIndicator,Ue=Te.level,Me=Te.mode,ze=Te.prefixCls,Ze=Te.theme;if(Ue!==1||Me!=="horizontal")return null;var _t=_e.props.children[0],bt=_t.props,Ct=bt.children,Zt=bt.title,mn=bt.style,rn=Object(P.a)(bt,["children","title","style"]),dn=Object(z.a)({},mn),gn="".concat(ne,"-overflowed-indicator"),pn="".concat(ne,"-overflowed-indicator");ce.length===0&&ae!==!0?dn=Object(z.a)(Object(z.a)({},dn),{},{display:"none"}):ae&&(dn=Object(z.a)(Object(z.a)({},dn),{},{visibility:"hidden",position:"absolute"}),gn="".concat(gn,"-placeholder"),pn="".concat(pn,"-placeholder"));var hn=Ze?"".concat(ze,"-").concat(Ze):"",Rn={};return de.forEach(function(xn){rn[xn]!==void 0&&(Rn[xn]=rn[xn])}),I.createElement(An,Object(T.a)({title:we,className:"".concat(ze,"-overflowed-submenu"),popupClassName:hn},Rn,{key:gn,eventKey:pn,disabled:!1,style:dn}),ce)},_e.setChildrenWidthAndResize=function(){if(_e.props.mode!=="horizontal")return;var ne=_e.childRef.current;if(!ne)return;var ce=ne.children;if(!ce||ce.length===0)return;var ae=ne.children[ce.length-1];Pe(ae,"display","inline-block");var Te=_e.getMenuItemNodes(),we=Te.filter(function(Ue){return Ue.className.split(" ").indexOf(si)>=0});we.forEach(function(Ue){Pe(Ue,"display","inline-block")}),_e.menuItemSizes=Te.map(function(Ue){return Ie(Ue,!0)}),we.forEach(function(Ue){Pe(Ue,"display","none")}),_e.overflowedIndicatorWidth=Ie(ne.children[ne.children.length-1],!0),_e.originalTotalWidth=_e.menuItemSizes.reduce(function(Ue,Me){return Ue+Me},0),_e.handleResize(),Pe(ae,"display","none")},_e.handleResize=function(){if(_e.props.mode!=="horizontal")return;var ne=_e.childRef.current;if(!ne)return;var ce=Ie(ne);_e.overflowedItems=[];var ae=0,Te;_e.originalTotalWidth>ce+fr&&(Te=-1,_e.menuItemSizes.forEach(function(we){ae+=we,ae+_e.overflowedIndicatorWidth<=ce&&(Te+=1)})),_e.setState({lastVisibleIndex:Te})},_e}return Object(A.a)(ke,[{key:"componentDidMount",value:function(){var ne=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ce=this.childRef.current;if(!ce)return;this.resizeObserver=new st.default(function(ae){ae.forEach(function(){var Te=ne.cancelFrameId;cancelAnimationFrame(Te),ne.cancelFrameId=requestAnimationFrame(ne.setChildrenWidthAndResize)})}),[].slice.call(ce.children).concat(ce).forEach(function(ae){ne.resizeObserver.observe(ae)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ne.resizeObserver.disconnect(),[].slice.call(ce.children).concat(ce).forEach(function(ae){ne.resizeObserver.observe(ae)}),ne.setChildrenWidthAndResize()}),this.mutationObserver.observe(ce,{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(ne){var ce=this,ae=this.state.lastVisibleIndex;return(ne||[]).reduce(function(Te,we,Ue){var Me=we;if(ce.props.mode==="horizontal"){var ze=ce.getOverflowedSubMenuItem(we.props.eventKey,[]);ae!==void 0&&ce.props.className.indexOf("".concat(ce.props.prefixCls,"-root"))!==-1&&(Ue>ae&&(Me=I.cloneElement(we,{style:{display:"none"},eventKey:"".concat(we.props.eventKey,"-hidden"),className:"".concat(si)})),Ue===ae+1&&(ce.overflowedItems=ne.slice(ae+1).map(function(_t){return I.cloneElement(_t,{key:_t.props.eventKey,mode:"vertical-left"})}),ze=ce.getOverflowedSubMenuItem(we.props.eventKey,ce.overflowedItems)));var Ze=[].concat(Object(D.a)(Te),[ze,Me]);return Ue===ne.length-1&&Ze.push(ce.getOverflowedSubMenuItem(we.props.eventKey,[],!0)),Ze}return[].concat(Object(D.a)(Te),[Me])},[])}},{key:"render",value:function(){var ne=this.props,ce=ne.visible,ae=ne.prefixCls,Te=ne.overflowedIndicator,we=ne.mode,Ue=ne.level,Me=ne.tag,ze=ne.children,Ze=ne.theme,_t=Object(P.a)(ne,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),bt=Me;return I.createElement(bt,Object(T.a)({ref:this.childRef},_t),this.renderChildren(ze))}}]),ke}(I.Component);wr.defaultProps={tag:"div",className:""};var Ci=wr;function li(ge){return ge.length?ge.every(function(Re){return!!Re.props.disabled}):!0}function gi(ge,Re,ke){var _e=ge.getState();ge.setState({activeKey:Object(z.a)(Object(z.a)({},_e.activeKey),{},Object(Z.a)({},Re,ke))})}function Fr(ge){return ge.eventKey||"0-menu-"}function Gr(ge,Re){var ke=Re,_e=ge.children,ne=ge.eventKey;if(ke){var ce;if(qe(_e,function(ae,Te){ae&&ae.props&&!ae.props.disabled&&ke===ft(ae,ne,Te)&&(ce=!0)}),ce)return ke}return ke=null,ge.defaultActiveFirst&&qe(_e,function(ae,Te){!ke&&ae&&!ae.props.disabled&&(ke=ft(ae,ne,Te))}),ke}function Fi(ge){if(!ge)return;var Re=this.instanceArray.indexOf(ge);Re!==-1?this.instanceArray[Re]=ge:this.instanceArray.push(ge)}var $r=function(ge){Object(b.a)(ke,ge);var Re=Object(p.a)(ke);function ke(_e){var ne;return Object(R.a)(this,ke),ne=Re.call(this,_e),ne.onKeyDown=function(ce,ae){var Te=ce.keyCode,we;if(ne.getFlatInstanceArray().forEach(function(Me){Me&&Me.props.active&&Me.onKeyDown&&(we=Me.onKeyDown(ce))}),we)return 1;var Ue=null;return(Te===d.a.UP||Te===d.a.DOWN)&&(Ue=ne.step(Te===d.a.UP?-1:1)),Ue?(ce.preventDefault(),gi(ne.props.store,Fr(ne.props),Ue.props.eventKey),typeof ae=="function"&&ae(Ue),1):void 0},ne.onItemHover=function(ce){var ae=ce.key,Te=ce.hover;gi(ne.props.store,Fr(ne.props),Te?ae:null)},ne.onDeselect=function(ce){ne.props.onDeselect(ce)},ne.onSelect=function(ce){ne.props.onSelect(ce)},ne.onClick=function(ce){ne.props.onClick(ce)},ne.onOpenChange=function(ce){ne.props.onOpenChange(ce)},ne.onDestroy=function(ce){ne.props.onDestroy(ce)},ne.getFlatInstanceArray=function(){return ne.instanceArray},ne.step=function(ce){var ae=ne.getFlatInstanceArray(),Te=ne.props.store.getState().activeKey[Fr(ne.props)],we=ae.length;if(!we)return null;ce<0&&(ae=ae.concat().reverse());var Ue=-1;if(ae.every(function(_t,bt){return _t&&_t.props.eventKey===Te?(Ue=bt,!1):!0}),!ne.props.defaultActiveFirst&&Ue!==-1&&li(ae.slice(Ue,we-1)))return;var Me=(Ue+1)%we,ze=Me;do{var Ze=ae[ze];if(!Ze||Ze.props.disabled)ze=(ze+1)%we;else return Ze}while(ze!==Me);return null},ne.renderCommonMenuItem=function(ce,ae,Te){var we=ne.props.store.getState(),Ue=Object(v.a)(ne),Me=Ue.props,ze=ft(ce,Me.eventKey,ae),Ze=ce.props;if(!Ze||typeof ce.type=="string")return ce;var _t=ze===we.activeKey,bt=Object(z.a)(Object(z.a)({mode:Ze.mode||Me.mode,level:Me.level,inlineIndent:Me.inlineIndent,renderMenuItem:ne.renderMenuItem,rootPrefixCls:Me.prefixCls,index:ae,parentMenu:Me.parentMenu,manualRef:Ze.disabled?void 0:Object(E.a)(ce.ref,Fi.bind(Object(v.a)(ne))),eventKey:ze,active:!Ze.disabled&&_t,multiple:Me.multiple,onClick:function(Zt){(Ze.onClick||it)(Zt),ne.onClick(Zt)},onItemHover:ne.onItemHover,motion:Me.motion,subMenuOpenDelay:Me.subMenuOpenDelay,subMenuCloseDelay:Me.subMenuCloseDelay,forceSubMenuRender:Me.forceSubMenuRender,onOpenChange:ne.onOpenChange,onDeselect:ne.onDeselect,onSelect:ne.onSelect,builtinPlacements:Me.builtinPlacements,itemIcon:Ze.itemIcon||ne.props.itemIcon,expandIcon:Ze.expandIcon||ne.props.expandIcon},Te),{},{direction:Me.direction});return(Me.mode==="inline"||Ke())&&(bt.triggerSubMenuAction="click"),I.cloneElement(ce,Object(z.a)(Object(z.a)({},bt),{},{key:ze||ae}))},ne.renderMenuItem=function(ce,ae,Te){if(!ce)return null;var we=ne.props.store.getState(),Ue={openKeys:we.openKeys,selectedKeys:we.selectedKeys,triggerSubMenuAction:ne.props.triggerSubMenuAction,subMenuKey:Te};return ne.renderCommonMenuItem(ce,ae,Ue)},_e.store.setState({activeKey:Object(z.a)(Object(z.a)({},_e.store.getState().activeKey),{},Object(Z.a)({},_e.eventKey,Gr(_e,_e.activeKey)))}),ne.instanceArray=[],ne}return Object(A.a)(ke,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ne){return this.props.visible||ne.visible||this.props.className!==ne.className||!U()(this.props.style,ne.style)}},{key:"componentDidUpdate",value:function(ne){var ce=this.props,ae="activeKey"in ce?ce.activeKey:ce.store.getState().activeKey[Fr(ce)],Te=Gr(ce,ae);if(Te!==ae)gi(ce.store,Fr(ce),Te);else if("activeKey"in ne){var we=Gr(ne,ne.activeKey);Te!==we&&gi(ce.store,Fr(ce),Te)}}},{key:"render",value:function(){var ne=this,ce=Object(T.a)({},this.props);this.instanceArray=[];var ae=K()(ce.prefixCls,ce.className,"".concat(ce.prefixCls,"-").concat(ce.mode)),Te={className:ae,role:ce.role||"menu"};ce.id&&(Te.id=ce.id),ce.focusable&&(Te.tabIndex=0,Te.onKeyDown=this.onKeyDown);var we=ce.prefixCls,Ue=ce.eventKey,Me=ce.visible,ze=ce.level,Ze=ce.mode,_t=ce.overflowedIndicator,bt=ce.theme;return de.forEach(function(Ct){return delete ce[Ct]}),delete ce.onClick,I.createElement(Ci,Object(T.a)({},ce,{prefixCls:we,mode:Ze,tag:"ul",level:ze,theme:bt,visible:Me,overflowedIndicator:_t},Te),Object(N.a)(ce.children).map(function(Ct,Zt){return ne.renderMenuItem(Ct,Zt,Ue||"0-menu-")}))}}]),ke}(I.Component);$r.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:it};var ji=Object(h.b)()($r),Li=ji,Jr=G("Kwbf");function Ji(ge,Re,ke){var _e=ge.prefixCls,ne=ge.motion,ce=ge.defaultMotions,ae=ce===void 0?{}:ce,Te=ge.openAnimation,we=ge.openTransitionName,Ue=Re.switchingModeFromInline;if(ne)return ne;if(Object(B.a)(Te)==="object"&&Te)Object(Jr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Te=="string")return{motionName:"".concat(_e,"-open-").concat(Te)};if(we)return{motionName:we};var Me=ae[ke];return Me||(Ue?null:ae.other)}var jt=function(ge){Object(b.a)(ke,ge);var Re=Object(p.a)(ke);function ke(_e){var ne;Object(R.a)(this,ke),ne=Re.call(this,_e),ne.onSelect=function(Te){var we=Object(v.a)(ne),Ue=we.props;if(Ue.selectable){var Me=ne.store.getState(),ze=Me.selectedKeys,Ze=Te.key;Ue.multiple?ze=ze.concat([Ze]):ze=[Ze],"selectedKeys"in Ue||ne.store.setState({selectedKeys:ze}),Ue.onSelect(Object(z.a)(Object(z.a)({},Te),{},{selectedKeys:ze}))}},ne.onClick=function(Te){var we=ne.getRealMenuMode(),Ue=Object(v.a)(ne),Me=Ue.store,ze=Ue.props.onOpenChange;we!=="inline"&&!("openKeys"in ne.props)&&(Me.setState({openKeys:[]}),ze([])),ne.props.onClick(Te)},ne.onKeyDown=function(Te,we){ne.innerMenu.getWrappedInstance().onKeyDown(Te,we)},ne.onOpenChange=function(Te){var we=Object(v.a)(ne),Ue=we.props,Me=ne.store.getState().openKeys.concat(),ze=!1,Ze=function(bt){var Ct=!1;if(bt.open)Ct=Me.indexOf(bt.key)===-1,Ct&&Me.push(bt.key);else{var Zt=Me.indexOf(bt.key);Ct=Zt!==-1,Ct&&Me.splice(Zt,1)}ze=ze||Ct};Array.isArray(Te)?Te.forEach(Ze):Ze(Te),ze&&("openKeys"in ne.props||ne.store.setState({openKeys:Me}),Ue.onOpenChange(Me))},ne.onDeselect=function(Te){var we=Object(v.a)(ne),Ue=we.props;if(Ue.selectable){var Me=ne.store.getState().selectedKeys.concat(),ze=Te.key,Ze=Me.indexOf(ze);Ze!==-1&&Me.splice(Ze,1),"selectedKeys"in Ue||ne.store.setState({selectedKeys:Me}),Ue.onDeselect(Object(z.a)(Object(z.a)({},Te),{},{selectedKeys:Me}))}},ne.onMouseEnter=function(Te){ne.restoreModeVerticalFromInline();var we=ne.props.onMouseEnter;we&&we(Te)},ne.onTransitionEnd=function(Te){var we=Te.propertyName==="width"&&Te.target===Te.currentTarget,Ue=Te.target.className,Me=Object.prototype.toString.call(Ue)==="[object SVGAnimatedString]"?Ue.animVal:Ue,ze=Te.propertyName==="font-size"&&Me.indexOf("anticon")>=0;(we||ze)&&ne.restoreModeVerticalFromInline()},ne.setInnerMenu=function(Te){ne.innerMenu=Te},ne.isRootMenu=!0;var ce=_e.defaultSelectedKeys,ae=_e.defaultOpenKeys;return"selectedKeys"in _e&&(ce=_e.selectedKeys||[]),"openKeys"in _e&&(ae=_e.openKeys||[]),ne.store=Object(h.c)({selectedKeys:ce,openKeys:ae,activeKey:{"0-menu-":Gr(_e,_e.activeKey)}}),ne.state={switchingModeFromInline:!1,prevProps:_e,inlineOpenKeys:[],store:ne.store},ne}return Object(A.a)(ke,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ne){var ce=this.props,ae=ce.siderCollapsed,Te=ce.inlineCollapsed,we=ce.onOpenChange;(!ne.inlineCollapsed&&Te||!ne.siderCollapsed&&ae)&&we([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ne=this.props.collapsedWidth,ce=this.store,ae=this.prevOpenKeys,Te=this.getInlineCollapsed()&&(ne===0||ne==="0"||ne==="0px");Te?(this.prevOpenKeys=ce.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ae&&(this.store.setState({openKeys:ae}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ne=this.props.mode,ce=this.state.switchingModeFromInline,ae=this.getInlineCollapsed();return ce&&ae?"inline":ae?"vertical":ne}},{key:"getInlineCollapsed",value:function(){var ne=this.props,ce=ne.inlineCollapsed,ae=ne.siderCollapsed;return ae!==void 0?ae:ce}},{key:"restoreModeVerticalFromInline",value:function(){var ne=this.state.switchingModeFromInline;ne&&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 ne=Object(z.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ce=this.getRealMenuMode();return ne.className+=" ".concat(ne.prefixCls,"-root"),ne.direction==="rtl"&&(ne.className+=" ".concat(ne.prefixCls,"-rtl")),ne=Object(z.a)(Object(z.a)({},ne),{},{mode:ce,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ji(this.props,this.state,ce)}),delete ne.openAnimation,delete ne.openTransitionName,I.createElement(h.a,{store:this.store},I.createElement(Li,Object(T.a)({},ne,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ne,ce){var ae=ce.prevProps,Te=ce.store,we=Te.getState(),Ue={},Me={prevProps:ne};return ae.mode==="inline"&&ne.mode!=="inline"&&(Me.switchingModeFromInline=!0),"openKeys"in ne?Ue.openKeys=ne.openKeys||[]:((ne.inlineCollapsed&&!ae.inlineCollapsed||ne.siderCollapsed&&!ae.siderCollapsed)&&(Me.switchingModeFromInline=!0,Me.inlineOpenKeys=we.openKeys,Ue.openKeys=[]),(!ne.inlineCollapsed&&ae.inlineCollapsed||!ne.siderCollapsed&&ae.siderCollapsed)&&(Ue.openKeys=ce.inlineOpenKeys,Me.inlineOpenKeys=[])),Object.keys(Ue).length&&Te.setState(Ue),Me}}]),ke}(I.Component);jt.defaultProps={selectable:!0,onClick:it,onSelect:it,onOpenChange:it,onDeselect:it,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:I.createElement("span",null,"\xB7\xB7\xB7")};var Qt=jt,Wt=function(ge){Object(b.a)(ke,ge);var Re=Object(p.a)(ke);function ke(){var _e;return Object(R.a)(this,ke),_e=Re.apply(this,arguments),_e.onKeyDown=function(ne){var ce=ne.keyCode;return ce===d.a.ENTER?(_e.onClick(ne),!0):void 0},_e.onMouseLeave=function(ne){var ce=_e.props,ae=ce.eventKey,Te=ce.onItemHover,we=ce.onMouseLeave;Te({key:ae,hover:!1}),we({key:ae,domEvent:ne})},_e.onMouseEnter=function(ne){var ce=_e.props,ae=ce.eventKey,Te=ce.onItemHover,we=ce.onMouseEnter;Te({key:ae,hover:!0}),we({key:ae,domEvent:ne})},_e.onClick=function(ne){var ce=_e.props,ae=ce.eventKey,Te=ce.multiple,we=ce.onClick,Ue=ce.onSelect,Me=ce.onDeselect,ze=ce.isSelected,Ze={key:ae,keyPath:[ae],item:Object(v.a)(_e),domEvent:ne};we(Ze),Te?ze?Me(Ze):Ue(Ze):ze||Ue(Ze)},_e.saveNode=function(ne){_e.node=ne},_e}return Object(A.a)(ke,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ne=this.props;ne.onDestroy&&ne.onDestroy(ne.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 ne,ce=Object(z.a)({},this.props),ae=K()(this.getPrefixCls(),ce.className,(ne={},Object(Z.a)(ne,this.getActiveClassName(),!ce.disabled&&ce.active),Object(Z.a)(ne,this.getSelectedClassName(),ce.isSelected),Object(Z.a)(ne,this.getDisabledClassName(),ce.disabled),ne)),Te=Object(z.a)(Object(z.a)({},ce.attribute),{},{title:typeof ce.title=="string"?ce.title:void 0,className:ae,role:ce.role||"menuitem","aria-disabled":ce.disabled});ce.role==="option"?Te=Object(z.a)(Object(z.a)({},Te),{},{role:"option","aria-selected":ce.isSelected}):(ce.role===null||ce.role==="none")&&(Te.role="none");var we={onClick:ce.disabled?null:this.onClick,onMouseLeave:ce.disabled?null:this.onMouseLeave,onMouseEnter:ce.disabled?null:this.onMouseEnter},Ue=Object(z.a)({},ce.style);ce.mode==="inline"&&(ce.direction==="rtl"?Ue.paddingRight=ce.inlineIndent*ce.level:Ue.paddingLeft=ce.inlineIndent*ce.level),de.forEach(function(ze){return delete ce[ze]}),delete ce.direction;var Me=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Me=I.createElement(this.props.itemIcon,this.props)),I.createElement("li",Object(T.a)({},Object(_.a)(ce,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Te,we,{style:Ue,ref:this.saveNode}),ce.children,Me)}}]),ke}(I.Component);Wt.isMenuItem=!0,Wt.defaultProps={onSelect:it,onMouseEnter:it,onMouseLeave:it,manualRef:it};var sn=Object(h.b)(function(ge,Re){var ke=ge.activeKey,_e=ge.selectedKeys,ne=Re.eventKey,ce=Re.subMenuKey;return{active:ke[ce]===ne,isSelected:Array.isArray(_e)?_e.indexOf(ne)!==-1:_e===ne}})(Wt),bn=sn,Bn=function(ge){Object(b.a)(ke,ge);var Re=Object(p.a)(ke);function ke(){var _e;return Object(R.a)(this,ke),_e=Re.apply(this,arguments),_e.renderInnerMenuItem=function(ne){var ce=_e.props,ae=ce.renderMenuItem,Te=ce.index;return ae(ne,Te,_e.props.subMenuKey)},_e}return Object(A.a)(ke,[{key:"render",value:function(){var ne=Object(T.a)({},this.props),ce=ne.className,ae=ce===void 0?"":ce,Te=ne.rootPrefixCls,we="".concat(Te,"-item-group-title"),Ue="".concat(Te,"-item-group-list"),Me=ne.title,ze=ne.children;return de.forEach(function(Ze){return delete ne[Ze]}),delete ne.direction,I.createElement("li",Object(T.a)({},ne,{onClick:function(_t){return _t.stopPropagation()},className:"".concat(ae," ").concat(Te,"-item-group")}),I.createElement("div",{className:we,title:typeof Me=="string"?Me:void 0},Me),I.createElement("ul",{className:Ue},I.Children.map(ze,this.renderInnerMenuItem)))}}]),ke}(I.Component);Bn.isMenuItemGroup=!0,Bn.defaultProps={disabled:!0};var En=Bn,tr=function(Re){var ke=Re.className,_e=Re.rootPrefixCls,ne=Re.style;return I.createElement("li",{className:"".concat(ke," ").concat(_e,"-item-divider"),style:ne})};tr.defaultProps={disabled:!0,className:"",style:{}};var Pr=tr,fn=Qt,ui=G("eDIo");function kn(ge,Re){var ke=ge.prefixCls,_e=ge.editable,ne=ge.locale,ce=ge.style;return!_e||_e.showAdd===!1?null:I.createElement("button",{ref:Re,type:"button",className:"".concat(ke,"-nav-add"),style:ce,"aria-label":(ne==null?void 0:ne.addAriaLabel)||"Add tab",onClick:function(Te){_e.onEdit("add",{event:Te})}},_e.addIcon||"+")}var yr=I.forwardRef(kn);function Sr(ge,Re){var ke=ge.prefixCls,_e=ge.id,ne=ge.tabs,ce=ge.locale,ae=ge.mobile,Te=ge.moreIcon,we=Te===void 0?"More":Te,Ue=ge.moreTransitionName,Me=ge.style,ze=ge.className,Ze=ge.editable,_t=ge.tabBarGutter,bt=ge.rtl,Ct=ge.onTabClick,Zt=Object(I.useState)(!1),mn=Object(V.a)(Zt,2),rn=mn[0],dn=mn[1],gn=Object(I.useState)(null),pn=Object(V.a)(gn,2),hn=pn[0],Rn=pn[1],xn="".concat(_e,"-more-popup"),nr="".concat(ke,"-dropdown"),Tn=hn!==null?"".concat(xn,"-").concat(hn):null,Yt=ce==null?void 0:ce.dropdownAriaLabel,Vt=I.createElement(fn,{onClick:function(Xn){var Gn=Xn.key,pr=Xn.domEvent;Ct(Gn,pr),dn(!1)},id:xn,tabIndex:-1,role:"listbox","aria-activedescendant":Tn,selectedKeys:[hn],"aria-label":Yt!==void 0?Yt:"expanded dropdown"},ne.map(function(Un){return I.createElement(bn,{key:Un.key,id:"".concat(xn,"-").concat(Un.key),role:"option","aria-controls":_e&&"".concat(_e,"-panel-").concat(Un.key),disabled:Un.disabled},Un.tab)}));function Sn(Un){for(var Xn=ne.filter(function(Vr){return!Vr.disabled}),Gn=Xn.findIndex(function(Vr){return Vr.key===hn})||0,pr=Xn.length,Ar=0;Ar<pr;Ar+=1){Gn=(Gn+Un+pr)%pr;var sr=Xn[Gn];if(!sr.disabled){Rn(sr.key);return}}}function Ln(Un){var Xn=Un.which;if(!rn){[d.a.DOWN,d.a.SPACE,d.a.ENTER].includes(Xn)&&(dn(!0),Un.preventDefault());return}switch(Xn){case d.a.UP:Sn(-1),Un.preventDefault();break;case d.a.DOWN:Sn(1),Un.preventDefault();break;case d.a.ESC:dn(!1);break;case d.a.SPACE:case d.a.ENTER:hn!==null&&Ct(hn,Un);break}}Object(I.useEffect)(function(){var Un=document.getElementById(Tn);Un&&Un.scrollIntoView&&Un.scrollIntoView(!1)},[hn]),Object(I.useEffect)(function(){rn||Rn(null)},[rn]);var Ht=Object(Z.a)({},bt?"marginLeft":"marginRight",_t);ne.length||(Ht.visibility="hidden",Ht.order=1);var Dn=K()(Object(Z.a)({},"".concat(nr,"-rtl"),bt)),rr=ae?null:I.createElement(ui.a,{prefixCls:nr,overlay:Vt,trigger:["hover"],visible:rn,transitionName:Ue,onVisibleChange:dn,overlayClassName:Dn,mouseEnterDelay:.1,mouseLeaveDelay:.1},I.createElement("button",{type:"button",className:"".concat(ke,"-nav-more"),style:Ht,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":xn,id:"".concat(_e,"-more"),"aria-expanded":rn,onKeyDown:Ln},we));return I.createElement("div",{className:K()("".concat(ke,"-nav-operations"),ze),style:Me,ref:Re},rr,I.createElement(yr,{prefixCls:ke,locale:ce,editable:Ze}))}var Qr=I.forwardRef(Sr),ma=Object(I.createContext)(null),Pn=.1,wn=.01,_n=20,zr=Math.pow(.995,_n);function Bi(){var ge=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ge)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ge.substr(0,4)))}function Hi(ge,Re){var ke=Object(I.useState)(),_e=Object(V.a)(ke,2),ne=_e[0],ce=_e[1],ae=Object(I.useState)(0),Te=Object(V.a)(ae,2),we=Te[0],Ue=Te[1],Me=Object(I.useState)(0),ze=Object(V.a)(Me,2),Ze=ze[0],_t=ze[1],bt=Object(I.useState)(),Ct=Object(V.a)(bt,2),Zt=Ct[0],mn=Ct[1],rn=Object(I.useRef)();function dn(Yt){var Vt=Yt.touches[0],Sn=Vt.screenX,Ln=Vt.screenY;ce({x:Sn,y:Ln}),window.clearInterval(rn.current)}function gn(Yt){if(!ne)return;Yt.preventDefault();var Vt=Yt.touches[0],Sn=Vt.screenX,Ln=Vt.screenY;ce({x:Sn,y:Ln});var Ht=Sn-ne.x,Dn=Ln-ne.y;Re(Ht,Dn);var rr=Date.now();Ue(rr),_t(rr-we),mn({x:Ht,y:Dn})}function pn(){if(!ne)return;if(ce(null),mn(null),Zt){var Yt=Zt.x/Ze,Vt=Zt.y/Ze,Sn=Math.abs(Yt),Ln=Math.abs(Vt);if(Math.max(Sn,Ln)<Pn)return;var Ht=Yt,Dn=Vt;rn.current=window.setInterval(function(){if(Math.abs(Ht)<wn&&Math.abs(Dn)<wn){window.clearInterval(rn.current);return}Ht*=zr,Dn*=zr,Re(Ht*_n,Dn*_n)},_n)}}var hn=Object(I.useRef)(0),Rn=Object(I.useRef)(!1),xn=Object(I.useRef)();function nr(Yt){var Vt=Yt.deltaX,Sn=Yt.deltaY,Ln=0,Ht=Math.abs(Vt),Dn=Math.abs(Sn);Ht===Dn?Ln=xn.current==="x"?Vt:Sn:Ht>Dn?(Ln=Vt,xn.current="x"):(Ln=Sn,xn.current="y");var rr=Date.now();rr-hn.current>100&&(Rn.current=!1),(Re(-Ln,-Ln)||Rn.current)&&(Yt.preventDefault(),Rn.current=!0),hn.current=rr}var Tn=Object(I.useRef)(null);Tn.current={onTouchStart:dn,onTouchMove:gn,onTouchEnd:pn,onWheel:nr},I.useEffect(function(){function Yt(Ht){Tn.current.onTouchStart(Ht)}function Vt(Ht){Tn.current.onTouchMove(Ht)}function Sn(Ht){Tn.current.onTouchEnd(Ht)}function Ln(Ht){Tn.current.onWheel(Ht)}return document.addEventListener("touchmove",Vt,{passive:!1}),document.addEventListener("touchend",Sn,{passive:!1}),ge.current.addEventListener("touchstart",Yt,{passive:!1}),ge.current.addEventListener("wheel",Ln),function(){document.removeEventListener("touchmove",Vt),document.removeEventListener("touchend",Sn)}},[])}function ga(){var ge=Object(I.useRef)(new Map);function Re(_e){return ge.current.has(_e)||ge.current.set(_e,I.createRef()),ge.current.get(_e)}function ke(_e){ge.current.delete(_e)}return[Re,ke]}function va(ge,Re){var ke=I.useRef(ge),_e=I.useState({}),ne=Object(V.a)(_e,2),ce=ne[1];function ae(Te){var we=typeof Te=="function"?Te(ke.current):Te;we!==ke.current&&Re(we,ke.current),ke.current=we,ce({})}return[ke.current,ae]}var Sa=function(Re){var ke=Re.position,_e=Re.prefixCls,ne=Re.extra;if(!ne)return null;var ce,ae=ne;return ke==="right"&&(ce=ae.right||!ae.left&&ae||null),ke==="left"&&(ce=ae.left||null),ce?I.createElement("div",{className:"".concat(_e,"-extra-content")},ce):null};function Va(ge,Re){var ke,_e=I.useContext(ma),ne=_e.prefixCls,ce=_e.tabs,ae=ge.className,Te=ge.style,we=ge.id,Ue=ge.animated,Me=ge.activeKey,ze=ge.rtl,Ze=ge.extra,_t=ge.editable,bt=ge.locale,Ct=ge.tabPosition,Zt=ge.tabBarGutter,mn=ge.children,rn=ge.onTabClick,dn=ge.onTabScroll,gn=Object(I.useRef)(),pn=Object(I.useRef)(),hn=Object(I.useRef)(),Rn=Object(I.useRef)(),xn=ga(),nr=Object(V.a)(xn,2),Tn=nr[0],Yt=nr[1],Vt=Ct==="top"||Ct==="bottom",Sn=va(0,function(Wn,Cn){Vt&&dn&&dn({direction:Wn>Cn?"left":"right"})}),Ln=Object(V.a)(Sn,2),Ht=Ln[0],Dn=Ln[1],rr=va(0,function(Wn,Cn){!Vt&&dn&&dn({direction:Wn>Cn?"top":"bottom"})}),Un=Object(V.a)(rr,2),Xn=Un[0],Gn=Un[1],pr=Object(I.useState)(0),Ar=Object(V.a)(pr,2),sr=Ar[0],Vr=Ar[1],bi=Object(I.useState)(0),Zr=Object(V.a)(bi,2),Rr=Zr[0],qn=Zr[1],Yn=Object(I.useState)(0),lr=Object(V.a)(Yn,2),ir=lr[0],Ei=lr[1],Wi=Object(I.useState)(0),Ki=Object(V.a)(Wi,2),zn=Ki[0],Oi=Ki[1],Gi=Object(I.useState)(null),Zn=Object(V.a)(Gi,2),Kn=Zn[0],Lr=Zn[1],To=Object(I.useState)(null),Ja=Object(V.a)(To,2),zi=Ja[0],aa=Ja[1],Ca=Object(I.useState)(0),Qa=Object(V.a)(Ca,2),Oa=Qa[0],Xo=Qa[1],Yo=Object(I.useState)(0),wo=Object(V.a)(Yo,2),Za=wo[0],qa=wo[1],oa=s(new Map),sa=Object(V.a)(oa,2),$o=sa[0],Aa=sa[1],ya=a(ce,$o,sr),la="".concat(ne,"-nav-operations-hidden"),ua=0,_i=0;Vt?ze?(ua=0,_i=Math.max(0,sr-Kn)):(ua=Math.min(0,Kn-sr),_i=0):(ua=Math.min(0,zi-Rr),_i=0);function Qi(Wn){return Wn<ua?[ua,!1]:Wn>_i?[_i,!1]:[Wn,!0]}var Vi=Object(I.useRef)(),ba=Object(I.useState)(),Zi=Object(V.a)(ba,2),Ra=Zi[0],eo=Zi[1];function La(){eo(Date.now())}function to(){window.clearTimeout(Vi.current)}Hi(gn,function(Wn,Cn){var Ir=!1;function ei(ca,Di){ca(function(xa){var Yi=Qi(xa+Di),Dr=Object(V.a)(Yi,2),Ma=Dr[0],ro=Dr[1];return Ir=ro,Ma})}if(Vt){if(Kn>=sr)return Ir;ei(Dn,Wn)}else{if(zi>=Rr)return Ir;ei(Gn,Cn)}return to(),La(),Ir}),Object(I.useEffect)(function(){return to(),Ra&&(Vi.current=window.setTimeout(function(){eo(0)},100)),to},[Ra]);function Xi(){var Wn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Me,Cn=ya.get(Wn);if(!Cn)return;if(Vt){var Ir=Ht;ze?Cn.right<Ht?Ir=Cn.right:Cn.right+Cn.width>Ht+Kn&&(Ir=Cn.right+Cn.width-Kn):Cn.left<-Ht?Ir=-Cn.left:Cn.left+Cn.width>-Ht+Kn&&(Ir=-(Cn.left+Cn.width-Kn)),Gn(0),Dn(Qi(Ir)[0])}else{var ei=Xn;Cn.top<-Xn?ei=-Cn.top:Cn.top+Cn.height>-Xn+zi&&(ei=-(Cn.top+Cn.height-zi)),Dn(0),Gn(Qi(ei)[0])}}var qi=w(ya,{width:Kn,height:zi,left:Ht,top:Xn},{width:ir,height:zn},{width:Oa,height:Za},Object(z.a)(Object(z.a)({},ge),{},{tabs:ce})),So=Object(V.a)(qi,2),Jo=So[0],Qo=So[1],Zo=ce.map(function(Wn){var Cn=Wn.key;return I.createElement(l,{id:we,prefixCls:ne,key:Cn,rtl:ze,tab:Wn,closable:Wn.closable,editable:_t,active:Cn===Me,tabPosition:Ct,tabBarGutter:Zt,renderWrapper:mn,removeAriaLabel:bt==null?void 0:bt.removeAriaLabel,ref:Tn(Cn),onClick:function(ei){rn(Cn,ei)},onRemove:function(){Yt(Cn)},onFocus:function(){Xi(Cn),La(),ze||(gn.current.scrollLeft=0),gn.current.scrollTop=0}})}),no=c(function(){var Wn,Cn,Ir,ei,ca,Di,xa,Yi,Dr,Ma=((Wn=gn.current)===null||Wn===void 0?void 0:Wn.offsetWidth)||0,ro=((Cn=gn.current)===null||Cn===void 0?void 0:Cn.offsetHeight)||0,io=((Ir=Rn.current)===null||Ir===void 0?void 0:Ir.offsetWidth)||0,ti=((ei=Rn.current)===null||ei===void 0?void 0:ei.offsetHeight)||0,Hn=((ca=hn.current)===null||ca===void 0?void 0:ca.offsetWidth)||0,Ti=((Di=hn.current)===null||Di===void 0?void 0:Di.offsetHeight)||0;Lr(Ma),aa(ro),Xo(io),qa(ti);var Mi=(((xa=pn.current)===null||xa===void 0?void 0:xa.offsetWidth)||0)-io,ki=(((Yi=pn.current)===null||Yi===void 0?void 0:Yi.offsetHeight)||0)-ti;Vr(Mi),qn(ki);var ao=(Dr=hn.current)===null||Dr===void 0?void 0:Dr.className.includes(la);Ei(Mi-(ao?0:Hn)),Oi(ki-(ao?0:Ti)),Aa(function(){var ka=new Map;return ce.forEach(function(Lo){var Io=Lo.key,ta=Tn(Io).current;ta&&ka.set(Io,{width:ta.offsetWidth,height:ta.offsetHeight,left:ta.offsetLeft,top:ta.offsetTop})}),ka})}),qo=ce.slice(0,Jo),qr=ce.slice(Qo+1),br=[].concat(Object(D.a)(qo),Object(D.a)(qr)),jr=Object(I.useState)(),Er=Object(V.a)(jr,2),Ea=Er[0],es=Er[1],xi=ya.get(Me),Co=Object(I.useRef)();function Oo(){g.a.cancel(Co.current)}Object(I.useEffect)(function(){var Wn={};return xi&&(Vt?(ze?Wn.right=xi.right:Wn.left=xi.left,Wn.width=xi.width):(Wn.top=xi.top,Wn.height=xi.height)),Oo(),Co.current=g()(function(){es(Wn)}),Oo},[xi,Vt,ze]),Object(I.useEffect)(function(){Xi()},[Me,xi,ya,Vt]),Object(I.useEffect)(function(){no()},[ze,Zt,Me,ce.map(function(Wn){return Wn.key}).join("_")]);var Ao=!!br.length,ea="".concat(ne,"-nav-wrap"),Ia,_a,Ro,Da;return Vt?ze?(_a=Ht>0,Ia=Ht+Kn<sr):(Ia=Ht<0,_a=-Ht+Kn<sr):(Ro=Xn<0,Da=-Xn+zi<Rr),I.createElement("div",{ref:Re,role:"tablist",className:K()("".concat(ne,"-nav"),ae),style:Te,onKeyDown:function(){La()}},I.createElement(Sa,{position:"left",extra:Ze,prefixCls:ne}),I.createElement(m.a,{onResize:no},I.createElement("div",{className:K()(ea,(ke={},Object(Z.a)(ke,"".concat(ea,"-ping-left"),Ia),Object(Z.a)(ke,"".concat(ea,"-ping-right"),_a),Object(Z.a)(ke,"".concat(ea,"-ping-top"),Ro),Object(Z.a)(ke,"".concat(ea,"-ping-bottom"),Da),ke)),ref:gn},I.createElement(m.a,{onResize:no},I.createElement("div",{ref:pn,className:"".concat(ne,"-nav-list"),style:{transform:"translate(".concat(Ht,"px, ").concat(Xn,"px)"),transition:Ra?"none":void 0}},Zo,I.createElement(yr,{ref:Rn,prefixCls:ne,locale:bt,editable:_t,style:{visibility:Ao?"hidden":null}}),I.createElement("div",{className:K()("".concat(ne,"-ink-bar"),Object(Z.a)({},"".concat(ne,"-ink-bar-animated"),Ue.inkBar)),style:Ea}))))),I.createElement(Qr,Object.assign({},ge,{ref:hn,prefixCls:ne,tabs:br,className:!Ao&&la})),I.createElement(Sa,{position:"right",extra:Ze,prefixCls:ne}))}var Xa=I.forwardRef(Va);function zo(ge){var Re=ge.id,ke=ge.activeKey,_e=ge.animated,ne=ge.tabPosition,ce=ge.rtl,ae=ge.destroyInactiveTabPane,Te=I.useContext(ma),we=Te.prefixCls,Ue=Te.tabs,Me=_e.tabPane,ze=Ue.findIndex(function(Ze){return Ze.key===ke});return I.createElement("div",{className:K()("".concat(we,"-content-holder"))},I.createElement("div",{className:K()("".concat(we,"-content"),"".concat(we,"-content-").concat(ne),Object(Z.a)({},"".concat(we,"-content-animated"),Me)),style:ze&&Me?Object(Z.a)({},ce?"marginRight":"marginLeft","-".concat(ze,"00%")):null},Ue.map(function(Ze){return I.cloneElement(Ze.node,{key:Ze.key,prefixCls:we,tabKey:Ze.key,id:Re,animated:Me,active:Ze.key===ke,destroyInactiveTabPane:ae})})))}function _o(ge){var Re=ge.prefixCls,ke=ge.forceRender,_e=ge.className,ne=ge.style,ce=ge.id,ae=ge.active,Te=ge.animated,we=ge.destroyInactiveTabPane,Ue=ge.tabKey,Me=ge.children,ze=I.useState(ke),Ze=Object(V.a)(ze,2),_t=Ze[0],bt=Ze[1];I.useEffect(function(){ae?bt(!0):we&&bt(!1)},[ae,we]);var Ct={};return ae||(Te?(Ct.visibility="hidden",Ct.height=0,Ct.overflowY="hidden"):Ct.display="none"),I.createElement("div",{id:ce&&"".concat(ce,"-panel-").concat(Ue),role:"tabpanel",tabIndex:ae?0:-1,"aria-labelledby":ce&&"".concat(ce,"-tab-").concat(Ue),"aria-hidden":!ae,style:Object(z.a)(Object(z.a)({},Ct),ne),className:K()("".concat(Re,"-tabpane"),ae&&"".concat(Re,"-tabpane-active"),_e)},(ae||_t||ke)&&Me)}var Ya=0;function xo(ge){return Object(N.a)(ge).map(function(Re){if(I.isValidElement(Re)){var ke=Re.key!==void 0?String(Re.key):void 0;return Object(z.a)(Object(z.a)({key:ke},Re.props),{},{node:Re})}return null}).filter(function(Re){return Re})}function Vo(ge,Re){var ke,_e=ge.id,ne=ge.prefixCls,ce=ne===void 0?"rc-tabs":ne,ae=ge.className,Te=ge.children,we=ge.direction,Ue=ge.activeKey,Me=ge.defaultActiveKey,ze=ge.editable,Ze=ge.animated,_t=ge.tabPosition,bt=_t===void 0?"top":_t,Ct=ge.tabBarGutter,Zt=ge.tabBarStyle,mn=ge.tabBarExtraContent,rn=ge.locale,dn=ge.moreIcon,gn=ge.moreTransitionName,pn=ge.destroyInactiveTabPane,hn=ge.renderTabBar,Rn=ge.onChange,xn=ge.onTabClick,nr=ge.onTabScroll,Tn=Object(P.a)(ge,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Yt=xo(Te),Vt=we==="rtl",Sn;Ze===!1?Sn={inkBar:!1,tabPane:!1}:Sn=Object(z.a)({inkBar:!0,tabPane:!1},Ze!==!0?Ze:null);var Ln=Object(I.useState)(!1),Ht=Object(V.a)(Ln,2),Dn=Ht[0],rr=Ht[1];Object(I.useEffect)(function(){rr(Bi())},[]);var Un=Object(n.a)(function(){var zn;return(zn=Yt[0])===null||zn===void 0?void 0:zn.key},{value:Ue,defaultValue:Me}),Xn=Object(V.a)(Un,2),Gn=Xn[0],pr=Xn[1],Ar=Object(I.useState)(function(){return Yt.findIndex(function(zn){return zn.key===Gn})}),sr=Object(V.a)(Ar,2),Vr=sr[0],bi=sr[1];Object(I.useEffect)(function(){var zn=Yt.findIndex(function(Gi){return Gi.key===Gn});if(zn===-1){var Oi;zn=Math.max(0,Math.min(Vr,Yt.length-1)),pr((Oi=Yt[zn])===null||Oi===void 0?void 0:Oi.key)}bi(zn)},[Yt.map(function(zn){return zn.key}).join("_"),Gn,Vr]);var Zr=Object(n.a)(null,{value:_e}),Rr=Object(V.a)(Zr,2),qn=Rr[0],Yn=Rr[1],lr=bt;Dn&&!["left","right"].includes(bt)&&(lr="top"),Object(I.useEffect)(function(){_e||(Yn("rc-tabs-".concat(Ya)),Ya+=1)},[]);function ir(zn,Oi){xn==null||xn(zn,Oi),pr(zn),Rn==null||Rn(zn)}var Ei={id:qn,activeKey:Gn,animated:Sn,tabPosition:lr,rtl:Vt,mobile:Dn},Wi,Ki=Object(z.a)(Object(z.a)({},Ei),{},{editable:ze,locale:rn,moreIcon:dn,moreTransitionName:gn,tabBarGutter:Ct,onTabClick:ir,onTabScroll:nr,extra:mn,style:Zt,panes:Te});return hn?Wi=hn(Ki,Xa):Wi=I.createElement(Xa,Object.assign({},Ki)),I.createElement(ma.Provider,{value:{tabs:Yt,prefixCls:ce}},I.createElement("div",Object.assign({ref:Re,id:_e,className:K()(ce,"".concat(ce,"-").concat(lr),(ke={},Object(Z.a)(ke,"".concat(ce,"-mobile"),Dn),Object(Z.a)(ke,"".concat(ce,"-editable"),ze),Object(Z.a)(ke,"".concat(ce,"-rtl"),Vt),ke),ae)},Tn),Wi,I.createElement(zo,Object.assign({destroyInactiveTabPane:pn},Ei,{animated:Sn}))))}var ia=I.forwardRef(Vo);ia.TabPane=_o;var Ii=ia,$a=ve.b=Ii},kSUc:function(xt,ve,G){},lZu9:function(xt,ve,G){(function(Z){Z(G("VrN/"),G("1eCo"),G("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(V,P){var z=Z.getMode(V,"text/html"),I=z.name=="null";function k(j){if(Z.findModeByName){var S=Z.findModeByName(j);S&&(j=S.mime||S.mimes[0])}var J=Z.getMode(V,j);return J.name=="null"?null:J}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var 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 N in K)K.hasOwnProperty(N)&&P.tokenTypeOverrides[N]&&(K[N]=P.tokenTypeOverrides[N]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,g=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,l=" ";function o(j,S,J){return S.f=S.inline=J,J(j,S)}function a(j,S,J){return S.f=S.block=J,J(j,S)}function C(j){return!j||!/\S/.test(j.string)}function w(j){if(j.linkTitle=!1,j.linkHref=!1,j.linkText=!1,j.em=!1,j.strong=!1,j.strikethrough=!1,j.quote=0,j.indentedCode=!1,j.f==R){var S=I;if(!S){var J=Z.innerMode(z,j.htmlState);S=J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText}S&&(j.f=p,j.block=T,j.htmlState=null)}return j.trailingSpace=0,j.trailingSpaceNewLine=!1,j.prevLine=j.thisLine,j.thisLine={stream:null},null}function T(j,S){var J=j.column()===S.indentation,te=C(S.prevLine.stream),se=S.indentedCode,fe=S.prevLine.hr,Fe=S.list!==!1,Le=(S.listStack[S.listStack.length-1]||0)+3;S.indentedCode=!1;var De=S.indentation;if(S.indentationDiff===null&&(S.indentationDiff=S.indentation,Fe)){for(S.list=null;De<S.listStack[S.listStack.length-1];)S.listStack.pop(),S.listStack.length?S.indentation=S.listStack[S.listStack.length-1]:S.list=!1;S.list!==!1&&(S.indentationDiff=De-S.listStack[S.listStack.length-1])}var He=!te&&!fe&&!S.prevLine.header&&(!Fe||!se)&&!S.prevLine.fencedCodeEnd,We=(S.list===!1||fe||te)&&S.indentation<=Le&&j.match(n),ye=null;if(S.indentationDiff>=4&&(se||S.prevLine.fencedCodeEnd||S.prevLine.header||te))return j.skipToEnd(),S.indentedCode=!0,K.code;if(j.eatSpace())return null;if(J&&S.indentation<=Le&&(ye=j.match(g))&&ye[1].length<=6)return S.quote=0,S.header=ye[1].length,S.thisLine.header=!0,P.highlightFormatting&&(S.formatting="header"),S.f=S.inline,v(S);if(S.indentation<=Le&&j.eat(">"))return S.quote=J?1:S.quote+1,P.highlightFormatting&&(S.formatting="quote"),j.eatSpace(),v(S);if(!We&&!S.setext&&J&&S.indentation<=Le&&(ye=j.match(D))){var ue=ye[1]?"ol":"ul";return S.indentation=De+j.current().length,S.list=!0,S.quote=0,S.listStack.push(S.indentation),S.em=!1,S.strong=!1,S.code=!1,S.strikethrough=!1,P.taskLists&&j.match(y,!1)&&(S.taskList=!0),S.f=S.inline,P.highlightFormatting&&(S.formatting=["list","list-"+ue]),v(S)}else{if(J&&S.indentation<=Le&&(ye=j.match(s,!0)))return S.quote=0,S.fencedEndRE=new RegExp(ye[1]+"+ *$"),S.localMode=P.fencedCodeBlockHighlighting&&k(ye[2]||P.fencedCodeBlockDefaultMode),S.localMode&&(S.localState=Z.startState(S.localMode)),S.f=S.block=A,P.highlightFormatting&&(S.formatting="code-block"),S.code=-1,v(S);if(S.setext||(!He||!Fe)&&!S.quote&&S.list===!1&&!S.code&&!We&&!d.test(j.string)&&(ye=j.lookAhead(1))&&(ye=ye.match(m)))return S.setext?(S.header=S.setext,S.setext=0,j.skipToEnd(),P.highlightFormatting&&(S.formatting="header")):(S.header=ye[0].charAt(0)=="="?1:2,S.setext=S.header),S.thisLine.header=!0,S.f=S.inline,v(S);if(We)return j.skipToEnd(),S.hr=!0,S.thisLine.hr=!0,K.hr;if(j.peek()==="[")return o(j,S,U)}return o(j,S,S.inline)}function R(j,S){var J=z.token(j,S.htmlState);if(!I){var te=Z.innerMode(z,S.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||S.md_inside&&j.current().indexOf(">")>-1)&&(S.f=p,S.block=T,S.htmlState=null)}return J}function A(j,S){var J=S.listStack[S.listStack.length-1]||0,te=S.indentation<J,se=J+3;if(S.fencedEndRE&&S.indentation<=se&&(te||j.match(S.fencedEndRE))){P.highlightFormatting&&(S.formatting="code-block");var fe;return te||(fe=v(S)),S.localMode=S.localState=null,S.block=T,S.f=p,S.fencedEndRE=null,S.code=0,S.thisLine.fencedCodeEnd=!0,te?a(j,S,S.block):fe}else return S.localMode?S.localMode.token(j,S.localState):(j.skipToEnd(),K.code)}function v(j){var S=[];if(j.formatting){S.push(K.formatting),typeof j.formatting=="string"&&(j.formatting=[j.formatting]);for(var J=0;J<j.formatting.length;J++)S.push(K.formatting+"-"+j.formatting[J]),j.formatting[J]==="header"&&S.push(K.formatting+"-"+j.formatting[J]+"-"+j.header),j.formatting[J]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=j.quote?S.push(K.formatting+"-"+j.formatting[J]+"-"+j.quote):S.push("error"))}if(j.taskOpen)return S.push("meta"),S.length?S.join(" "):null;if(j.taskClosed)return S.push("property"),S.length?S.join(" "):null;if(j.linkHref?S.push(K.linkHref,"url"):(j.strong&&S.push(K.strong),j.em&&S.push(K.em),j.strikethrough&&S.push(K.strikethrough),j.emoji&&S.push(K.emoji),j.linkText&&S.push(K.linkText),j.code&&S.push(K.code),j.image&&S.push(K.image),j.imageAltText&&S.push(K.imageAltText,"link"),j.imageMarker&&S.push(K.imageMarker)),j.header&&S.push(K.header,K.header+"-"+j.header),j.quote&&(S.push(K.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=j.quote?S.push(K.quote+"-"+j.quote):S.push(K.quote+"-"+P.maxBlockquoteDepth)),j.list!==!1){var te=(j.listStack.length-1)%3;te?te===1?S.push(K.list2):S.push(K.list3):S.push(K.list1)}return j.trailingSpaceNewLine?S.push("trailing-space-new-line"):j.trailingSpace&&S.push("trailing-space-"+(j.trailingSpace%2?"a":"b")),S.length?S.join(" "):null}function b(j,S){return j.match(c,!0)?v(S):void 0}function p(j,S){var J=S.text(j,S);if(typeof J!="undefined")return J;if(S.list)return S.list=null,v(S);if(S.taskList){var te=j.match(y,!0)[1]===" ";return te?S.taskOpen=!0:S.taskClosed=!0,P.highlightFormatting&&(S.formatting="task"),S.taskList=!1,v(S)}if(S.taskOpen=!1,S.taskClosed=!1,S.header&&j.match(/^#+$/,!0))return P.highlightFormatting&&(S.formatting="header"),v(S);var se=j.next();if(S.linkTitle){S.linkTitle=!1;var fe=se;se==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Fe="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(j.match(new RegExp(Fe),!0))return K.linkHref}if(se==="`"){var Le=S.formatting;P.highlightFormatting&&(S.formatting="code"),j.eatWhile("`");var De=j.current().length;if(S.code==0&&(!S.quote||De==1))return S.code=De,v(S);if(De==S.code){var He=v(S);return S.code=0,He}else return S.formatting=Le,v(S)}else if(S.code)return v(S);if(se==="\\"&&(j.next(),P.highlightFormatting)){var We=v(S),ye=K.formatting+"-escape";return We?We+" "+ye:ye}if(se==="!"&&j.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return S.imageMarker=!0,S.image=!0,P.highlightFormatting&&(S.formatting="image"),v(S);if(se==="["&&S.imageMarker&&j.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return S.imageMarker=!1,S.imageAltText=!0,P.highlightFormatting&&(S.formatting="image"),v(S);if(se==="]"&&S.imageAltText){P.highlightFormatting&&(S.formatting="image");var We=v(S);return S.imageAltText=!1,S.image=!1,S.inline=S.f=_,We}if(se==="["&&!S.image)return S.linkText&&j.match(/^.*?\]/)||(S.linkText=!0,P.highlightFormatting&&(S.formatting="link")),v(S);if(se==="]"&&S.linkText){P.highlightFormatting&&(S.formatting="link");var We=v(S);return S.linkText=!1,S.inline=S.f=j.match(/\(.*?\)| ?\[.*?\]/,!1)?_:p,We}if(se==="<"&&j.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){S.f=S.inline=h,P.highlightFormatting&&(S.formatting="link");var We=v(S);return We?We+=" ":We="",We+K.linkInline}if(se==="<"&&j.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){S.f=S.inline=h,P.highlightFormatting&&(S.formatting="link");var We=v(S);return We?We+=" ":We="",We+K.linkEmail}if(P.xml&&se==="<"&&j.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=j.string.indexOf(">",j.pos);if(ue!=-1){var Ye=j.string.substring(j.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ye)&&(S.md_inside=!0)}return j.backUp(1),S.htmlState=Z.startState(z),a(j,S,R)}if(P.xml&&se==="<"&&j.match(/^\/\w*?>/))return S.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var vt=1,ct=j.pos==1?" ":j.string.charAt(j.pos-2);vt<3&&j.eat(se);)vt++;var it=j.peek()||" ",ft=!/\s/.test(it)&&(!u.test(it)||/\s/.test(ct)||u.test(ct)),Qe=!/\s/.test(ct)&&(!u.test(ct)||/\s/.test(it)||u.test(it)),qe=null,ht=null;if(vt%2&&(!S.em&&ft&&(se==="*"||!Qe||u.test(ct))?qe=!0:S.em==se&&Qe&&(se==="*"||!ft||u.test(it))&&(qe=!1)),vt>1&&(!S.strong&&ft&&(se==="*"||!Qe||u.test(ct))?ht=!0:S.strong==se&&Qe&&(se==="*"||!ft||u.test(it))&&(ht=!1)),ht!=null||qe!=null){P.highlightFormatting&&(S.formatting=qe==null?"strong":ht==null?"em":"strong em"),qe===!0&&(S.em=se),ht===!0&&(S.strong=se);var He=v(S);return qe===!1&&(S.em=!1),ht===!1&&(S.strong=!1),He}}else if(se===" "&&(j.eat("*")||j.eat("_"))){if(j.peek()===" ")return v(S);j.backUp(1)}if(P.strikethrough){if(se==="~"&&j.eatWhile(se)){if(S.strikethrough){P.highlightFormatting&&(S.formatting="strikethrough");var He=v(S);return S.strikethrough=!1,He}else if(j.match(/^[^\s]/,!1))return S.strikethrough=!0,P.highlightFormatting&&(S.formatting="strikethrough"),v(S)}else if(se===" "&&j.match(/^~~/,!0)){if(j.peek()===" ")return v(S);j.backUp(2)}}if(P.emoji&&se===":"&&j.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){S.emoji=!0,P.highlightFormatting&&(S.formatting="emoji");var de=v(S);return S.emoji=!1,de}return se===" "&&(j.match(/^ +$/,!1)?S.trailingSpace++:S.trailingSpace&&(S.trailingSpaceNewLine=!0)),v(S)}function h(j,S){var J=j.next();if(J===">"){S.f=S.inline=p,P.highlightFormatting&&(S.formatting="link");var te=v(S);return te?te+=" ":te="",te+K.linkInline}return j.match(/^[^>]+/,!0),K.linkInline}function _(j,S){if(j.eatSpace())return null;var J=j.next();return J==="("||J==="["?(S.f=S.inline=x(J==="("?")":"]"),P.highlightFormatting&&(S.formatting="link-string"),S.linkHref=!0,v(S)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(j){return function(S,J){var te=S.next();if(te===j){J.f=J.inline=p,P.highlightFormatting&&(J.formatting="link-string");var se=v(J);return J.linkHref=!1,se}return S.match(E[j]),J.linkHref=!0,v(J)}}function U(j,S){return j.match(/^([^\]\\]|\\.)*\]:/,!1)?(S.f=B,j.next(),P.highlightFormatting&&(S.formatting="link"),S.linkText=!0,v(S)):o(j,S,p)}function B(j,S){if(j.match(/^\]:/,!0)){S.f=S.inline=L,P.highlightFormatting&&(S.formatting="link");var J=v(S);return S.linkText=!1,J}return j.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function L(j,S){return j.eatSpace()?null:(j.match(/^[^\s]+/,!0),j.peek()===void 0?S.linkTitle=!0:j.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),S.f=S.inline=p,K.linkHref+" url")}var H={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(j){return{f:j.f,prevLine:j.prevLine,thisLine:j.thisLine,block:j.block,htmlState:j.htmlState&&Z.copyState(z,j.htmlState),indentation:j.indentation,localMode:j.localMode,localState:j.localMode?Z.copyState(j.localMode,j.localState):null,inline:j.inline,text:j.text,formatting:!1,linkText:j.linkText,linkTitle:j.linkTitle,linkHref:j.linkHref,code:j.code,em:j.em,strong:j.strong,strikethrough:j.strikethrough,emoji:j.emoji,header:j.header,setext:j.setext,hr:j.hr,taskList:j.taskList,list:j.list,listStack:j.listStack.slice(0),quote:j.quote,indentedCode:j.indentedCode,trailingSpace:j.trailingSpace,trailingSpaceNewLine:j.trailingSpaceNewLine,md_inside:j.md_inside,fencedEndRE:j.fencedEndRE}},token:function(j,S){if(S.formatting=!1,j!=S.thisLine.stream){if(S.header=0,S.hr=!1,j.match(/^\s*$/,!0))return w(S),null;if(S.prevLine=S.thisLine,S.thisLine={stream:j},S.taskList=!1,S.trailingSpace=0,S.trailingSpaceNewLine=!1,!S.localState&&(S.f=S.block,S.f!=R)){var J=j.match(/^\s*/,!0)[0].replace(/\t/g,l).length;if(S.indentation=J,S.indentationDiff=null,J>0)return null}}return S.f(j,S)},innerMode:function(j){return j.block==R?{state:j.htmlState,mode:z}:j.localState?{state:j.localState,mode:j.localMode}:{state:j,mode:H}},indent:function(j,S,J){return j.block==R&&z.indent?z.indent(j.htmlState,S,J):j.localState&&j.localMode.indent?j.localMode.indent(j.localState,S,J):Z.Pass},blankLine:w,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},n6Qo:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return N});var Z=G("q1tI"),V=G("biw7"),P=G("fyJ8");function z(n){var D=n.className,y=n.index,g=n.children,m=n.colSpan,c=n.rowSpan,s=Z.useContext(V.a),d=s.prefixCls,u=s.fixedInfoList,l=u[y];return Z.createElement(P.a,Object.assign({className:D,index:y,component:"td",prefixCls:d,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:m,rowSpan:c}}}},l))}function I(n){return Z.createElement("tr",Object.assign({},n))}function k(n){var D=n.children,y=Z.useContext(V.a),g=y.prefixCls;return Z.createElement("tfoot",{className:"".concat(g,"-summary")},D)}var K=ve.b=k,N={Cell:z,Row:I}},nEHx:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return Z});var Z;(function(V){V.DARK="dark",V.LIGHT="light",V.HIGH_CONTRAST="hc"})(Z||(Z={}))},nnTU:function(xt,ve,G){"use strict";G.d(ve,"b",function(){return K}),G.d(ve,"a",function(){return N});var Z=G("MI8n"),V=G("JYp7"),P=G("pmY6"),z=G("24hK"),I=G("746U"),k=G("Cg/j");const K=Object(k.c)("commandService"),N=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 s=[];for(let u of n.description.args)s.push(u.constraint);const d=n.handler;n.handler=function(u,...l){return Object(I.o)(l,s),d(u,...l)}}const{id:y}=n;let g=this._commands.get(y);g||(g=new z.a,this._commands.set(y,g));let m=g.unshift(n),c=Object(P.i)(()=>{m();const s=this._commands.get(y);(s==null?void 0:s.isEmpty())&&this._commands.delete(y)});return this._onDidRegisterCommand.fire(y),c}registerCommandAlias(n,D){return N.registerCommand(n,(y,...g)=>y.get(K).executeCommand(D,...g))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:V.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}};N.registerCommand("noop",()=>{})},osHv:function(xt,ve,G){(function(Z){Z(G("VrN/"))})(function(Z){"use strict";var V=Z.Pos;function P(u,l){return u.line-l.line||u.ch-l.ch}var z="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",I=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",k=new RegExp("<(/?)(["+z+"]["+I+"]*)","g");function K(u,l,o,a){this.line=l,this.ch=o,this.cm=u,this.text=u.getLine(l),this.min=a?Math.max(a.from,u.firstLine()):u.firstLine(),this.max=a?Math.min(a.to-1,u.lastLine()):u.lastLine()}function N(u,l){var o=u.cm.getTokenTypeAt(V(u.line,l));return o&&/\btag\b/.test(o)}function n(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function D(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function y(u){for(;;){var l=u.text.indexOf(">",u.ch);if(l==-1){if(n(u))continue;return}if(!N(u,l+1)){u.ch=l+1;continue}var o=u.text.lastIndexOf("/",l),a=o>-1&&!/\S/.test(u.text.slice(o+1,l));return u.ch=l+1,a?"selfClose":"regular"}}function g(u){for(;;){var l=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(l==-1){if(D(u))continue;return}if(!N(u,l+1)){u.ch=l;continue}k.lastIndex=l,u.ch=l;var o=k.exec(u.text);if(o&&o.index==l)return o}}function m(u){for(;;){k.lastIndex=u.ch;var l=k.exec(u.text);if(!l){if(n(u))continue;return}if(!N(u,l.index+1)){u.ch=l.index+1;continue}return u.ch=l.index+l[0].length,l}}function c(u){for(;;){var l=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(l==-1){if(D(u))continue;return}if(!N(u,l+1)){u.ch=l;continue}var o=u.text.lastIndexOf("/",l),a=o>-1&&!/\S/.test(u.text.slice(o+1,l));return u.ch=l+1,a?"selfClose":"regular"}}function s(u,l){for(var o=[];;){var a=m(u),C,w=u.line,T=u.ch-(a?a[0].length:0);if(!a||!(C=y(u)))return;if(C=="selfClose")continue;if(a[1]){for(var R=o.length-1;R>=0;--R)if(o[R]==a[2]){o.length=R;break}if(R<0&&(!l||l==a[2]))return{tag:a[2],from:V(w,T),to:V(u.line,u.ch)}}else o.push(a[2])}}function d(u,l){for(var o=[];;){var a=c(u);if(!a)return;if(a=="selfClose"){g(u);continue}var C=u.line,w=u.ch,T=g(u);if(!T)return;if(T[1])o.push(T[2]);else{for(var R=o.length-1;R>=0;--R)if(o[R]==T[2]){o.length=R;break}if(R<0&&(!l||l==T[2]))return{tag:T[2],from:V(u.line,u.ch),to:V(C,w)}}}}Z.registerHelper("fold","xml",function(u,l){for(var o=new K(u,l.line,0);;){var a=m(o);if(!a||o.line!=l.line)return;var C=y(o);if(!C)return;if(!a[1]&&C!="selfClose"){var w=V(o.line,o.ch),T=s(o,a[2]);return T&&P(T.from,w)>0?{from:w,to:T.from}:null}}}),Z.findMatchingTag=function(u,l,o){var a=new K(u,l.line,l.ch,o);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var C=y(a),w=C&&V(a.line,a.ch),T=C&&g(a);if(!C||!T||P(a,l)>0)return;var R={from:V(a.line,a.ch),to:w,tag:T[2]};return C=="selfClose"?{open:R,close:null,at:"open"}:T[1]?{open:d(a,T[2]),close:R,at:"close"}:(a=new K(u,w.line,w.ch,o),{open:R,close:s(a,T[2]),at:"open"})},Z.findEnclosingTag=function(u,l,o,a){for(var C=new K(u,l.line,l.ch,o);;){var w=d(C,a);if(!w)break;var T=new K(u,l.line,l.ch,o),R=s(T,w.tag);if(R)return{open:w,close:R}}},Z.scanForClosingTag=function(u,l,o,a){var C=new K(u,l.line,l.ch,a?{from:0,to:a}:null);return s(C,o)}})},p5ED:function(xt,ve,G){"use strict";var Z=G("+L6B"),V=G("2/Rp"),P=G("5Dmo"),z=G("3S7+"),I=G("k1fw"),k=G("tJVT"),K=G("q1tI"),N=G.n(K),n=G("vHTk"),D=G.n(n),y=G("yEEn"),g=G("ZW9T"),m=G("1vsH");ve.a=function(c){var s=c.name,d=c.data,u=c.theme,l=c.type,o=c.filename,a=c.monacoEditor,C=c.className,w=c.style,T=c.close,R=c.onClose,A=c.hasMask,v=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),b=Object(k.a)(v,2),p=b[0],h=b[1],_=Object(K.useState)(""),E=Object(k.a)(_,2),x=E[0],U=E[1],B,L=1024*1024,H=10*L,j=Object(K.useRef)();l==="office"&&(B=Object(m.T)(d).filesize,B>H&&(l="other")),o&&(a.filename=o),Object(K.useEffect)(function(){var te,se,fe=(te=document.cookie)===null||te===void 0||((se=te.replace(/\s/g,""))===null||se===void 0)?void 0:se.split(";");fe==null||fe.map(function(Fe){var Le=Fe.split("=");Le[0]==="_educoder_session"&&U(Le[1])})},[]);var S=function(){if(d.startsWith("http")||d.startsWith("/")){J();return}Object(m.z)(o||"educoder",d,o)},J=function(){Object(m.x)(o||s,d)};return console.log("data:",d,"fileanme:",o," name:",s),N.a.createElement("div",{style:Object(I.a)({},w||{}),className:"".concat(A&&D.a.bgBlack," ").concat(l?D.a.wrp:"hide")},T&&N.a.createElement("div",{className:D.a.close,ref:j},N.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return j.current}},N.a.createElement("span",{onClick:J},N.a.createElement("i",{className:"icon-quxiaozhiding"}))),N.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return j.current}},N.a.createElement("span",{className:"",onClick:R},N.a.createElement("i",{className:"icon-guanbi1"})))),N.a.createElement("div",{className:"".concat(D.a[C]," ").concat(C," ").concat(D.a.monaco," ").concat(l==="txt"?"show":"hide")},l==="txt"&&N.a.createElement(g.b,a)),l==="audio"&&N.a.createElement("audio",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?d:"data:audio/mp3;base64,").concat(d),autoPlay:!0}),l==="video"&&N.a.createElement(N.a.Fragment,null,d!=null&&d.startsWith("/")?N.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):N.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),l==="html"&&N.a.createElement("iframe",{src:d+"&disposition=inline"}),l==="pdf"&&N.a.createElement("embed",{className:D.a.embed,src:d}),l==="image"&&N.a.createElement(N.a.Fragment,null,N.a.createElement("img",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(d)})),l==="other"&&N.a.createElement("div",null,N.a.createElement(V.a,{type:"primary",size:"large",onClick:S},N.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(l==="download"||l==="office")&&N.a.createElement(V.a,{type:"primary",size:"large",onClick:S},N.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(xt,ve,G){},pmY6:function(xt,ve,G){"use strict";G.d(ve,"h",function(){return D}),G.d(ve,"g",function(){return g}),G.d(ve,"f",function(){return m}),G.d(ve,"e",function(){return c}),G.d(ve,"i",function(){return s}),G.d(ve,"b",function(){return d}),G.d(ve,"a",function(){return u}),G.d(ve,"d",function(){return l}),G.d(ve,"c",function(){return o});var Z=G("C/vA"),V=G("JYp7");const P=!1;let z=null;function I(a){z=a}if(P){const a="__is_disposable_tracked__";I(new class{trackDisposable(C){const w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{C[a]||console.log(w)},3e3)}setParent(C,w){if(C&&C!==u.None)try{C[a]=!0}catch(T){}}markAsDisposed(C){if(C&&C!==u.None)try{C[a]=!0}catch(w){}}markAsSingleton(C){}})}function k(a){return z==null||z.trackDisposable(a),a}function K(a){z==null||z.markAsDisposed(a)}function N(a,C){z==null||z.setParent(a,C)}function n(a,C){if(!z)return;for(const w of a)z.setParent(w,C)}function D(a){return z==null||z.markAsSingleton(a),a}class y extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function g(a){return typeof a.dispose=="function"&&a.dispose.length===0}function m(a){if(V.a.is(a)){let C=[];for(const w of a)if(w)try{w.dispose()}catch(T){C.push(T)}if(C.length===1)throw C[0];if(C.length>1)throw new y(C);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function c(...a){const C=s(()=>m(a));return n(a,C),C}function s(a){const C=k({dispose:Object(Z.a)(()=>{K(C),a()})});return C}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,k(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return N(a,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(a),a}}d.DISABLE_DISPOSED_WARNING=!1;class u{constructor(){this._store=new d,k(this),N(this._store,this)}dispose(){K(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}u.None=Object.freeze({dispose(){}});class l{constructor(){this._isDisposed=!1,k(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var C;if(this._isDisposed||a===this._value)return;(C=this._value)===null||C===void 0||C.dispose(),a&&N(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,K(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&N(a,null),a}}class o{constructor(a){this.object=a}dispose(){}}},psGv:function(xt,ve,G){var Z,V;(function(){var P;(function(){"use strict";var K=[,,function(y){function g(s){this.__parent=s,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}g.prototype.clone_empty=function(){var s=new g(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},g.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},g.prototype.has_match=function(s){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(s))return!0;return!1},g.prototype.set_indent=function(s,d){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},g.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)},g.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},g.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.prototype.push=function(s){this.__items.push(s);var d=s.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=s.length-d:this.__character_count+=s.length},g.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function m(s,d){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),d=d||"",s.indent_level>0&&(d=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}m.prototype.get_indent_size=function(s,d){var u=this.__base_string_length;return d=d||0,s<0&&(u=0),u+=s*this.__indent_size,u+=d,u},m.prototype.get_indent_string=function(s,d){var u=this.__base_string;return d=d||0,s<0&&(s=0,u=""),d+=s*this.__indent_size,this.__ensure_cache(d),u+=this.__cache[d],u},m.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var s=this.__cache.length,d=0,u="";this.__indent_size&&s>=this.__indent_size&&(d=Math.floor(s/this.__indent_size),s-=d*this.__indent_size,u=new Array(d+1).join(this.__indent_string)),s&&(u+=new Array(s+1).join(" ")),this.__cache.push(u)};function c(s,d){this.__indent_cache=new m(s,d),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new g(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(s,d){return this.__indent_cache.get_indent_string(s,d)},c.prototype.get_indent_size=function(s,d){return this.__indent_cache.get_indent_size(s,d)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(s){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return s!==`
|
|
`&&(u=u.replace(/[\n]/g,s)),u},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(s,d){return s=s||0,d=d||0,this.next_line.set_indent(s,d),this.__lines.length>1?(this.current_line.set_indent(s,d),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(s){for(var d=0;d<s.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(s){for(var d=this.__lines.length;s<d;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(s,d){for(var u=this.__lines.length-2;u>=0;){var l=this.__lines[u];if(l.is_empty())break;if(l.item(0).indexOf(s)!==0&&l.item(-1)!==d){this.__lines.splice(u+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},y.exports.Output=c},function(y){function g(m,c,s,d){this.type=m,this.text=c,this.comments_before=null,this.newlines=s||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}y.exports.Token=g},,,function(y){function g(s,d){this.raw_options=m(s,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}g.prototype._get_array=function(s,d){var u=this.raw_options[s],l=d||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(l=u.concat()):typeof u=="string"&&(l=u.split(/[^a-zA-Z0-9_\/\-]+/)),l},g.prototype._get_boolean=function(s,d){var u=this.raw_options[s],l=u===void 0?!!d:!!u;return l},g.prototype._get_characters=function(s,d){var u=this.raw_options[s],l=d||"";return typeof u=="string"&&(l=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},g.prototype._get_number=function(s,d){var u=this.raw_options[s];d=parseInt(d,10),isNaN(d)&&(d=0);var l=parseInt(u,10);return isNaN(l)&&(l=d),l},g.prototype._get_selection=function(s,d,u){var l=this._get_selection_list(s,d,u);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[s]+"'");return l[0]},g.prototype._get_selection_list=function(s,d,u){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[d[0]],!this._is_valid_selection(u,d))throw new Error("Invalid Default Value!");var l=this._get_array(s,u);if(!this._is_valid_selection(l,d))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[s]+"'");return l},g.prototype._is_valid_selection=function(s,d){return s.length&&d.length&&!s.some(function(u){return d.indexOf(u)===-1})};function m(s,d){var u={};s=c(s);var l;for(l in s)l!==d&&(u[l]=s[l]);if(d&&s[d])for(l in s[d])u[l]=s[d][l];return u}function c(s){var d={},u;for(u in s){var l=u.replace(/-/g,"_");d[l]=s[u]}return d}y.exports.Options=g,y.exports.normalizeOpts=c,y.exports.mergeOpts=m},,function(y){var g=RegExp.prototype.hasOwnProperty("sticky");function m(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},m.prototype.peek=function(c){var s=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(s=this.__input.charAt(c)),s},m.prototype.__match=function(c,s){c.lastIndex=s;var d=c.exec(this.__input);return d&&!(g&&c.sticky)&&(d.index!==s&&(d=null)),d},m.prototype.test=function(c,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(c,s):!1},m.prototype.testChar=function(c,s){var d=this.peek(s);return c.lastIndex=0,d!==null&&c.test(d)},m.prototype.match=function(c){var s=this.__match(c,this.__position);return s?this.__position+=s[0].length:s=null,s},m.prototype.read=function(c,s,d){var u="",l;return c&&(l=this.match(c),l&&(u+=l[0])),s&&(l||!c)&&(u+=this.readUntil(s,d)),u},m.prototype.readUntil=function(c,s){var d="",u=this.__position;c.lastIndex=this.__position;var l=c.exec(this.__input);return l?(u=l.index,s&&(u+=l[0].length)):u=this.__input_length,d=this.__input.substring(this.__position,u),this.__position=u,d},m.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},m.prototype.get_regexp=function(c,s){var d=null,u="g";return s&&g&&(u="y"),typeof c=="string"&&c!==""?d=new RegExp(c,u):c&&(d=new RegExp(c.source,u)),d},m.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(c){var s=this.__position,d=this.readUntilAfter(c);return this.__position=s,d},m.prototype.lookBack=function(c){var s=this.__position-1;return s>=c.length&&this.__input.substring(s-c.length,s).toLowerCase()===c},y.exports.InputScanner=m},function(y,g,m){var c=m(8).InputScanner,s=m(3).Token,d=m(10).TokenStream,u=m(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(a,C){this._input=new c(a),this._options=C||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var a,C=new s(l.START,""),w=null,T=[],R=new d;C.type!==l.EOF;){for(a=this._get_next_token(C,w);this._is_comment(a);)R.add(a),a=this._get_next_token(C,w);R.isEmpty()||(a.comments_before=R,R=new d),a.parent=w,this._is_opening(a)?(T.push(w),w=a):w&&this._is_closing(a,w)&&(a.opened=w,w.closed=a,w=T.pop(),a.parent=w),a.previous=C,C.next=a,this.__tokens.add(a),C=a}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(a,C){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(l.RAW,w):this._create_token(l.EOF,"")},o.prototype._is_comment=function(a){return!1},o.prototype._is_opening=function(a){return!1},o.prototype._is_closing=function(a,C){return!1},o.prototype._create_token=function(a,C){var w=new s(a,C,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=o,y.exports.TOKEN=l},function(y){function g(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},g.prototype.peek=function(m){var c=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(c=this.__tokens[m]),c},g.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},y.exports.TokenStream=g},function(y,g,m){var c=m(12).Pattern;function s(d,u){c.call(this,d,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new c,s.prototype.__set_whitespace_patterns=function(d,u){d+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var u=this.__split(this._newline_regexp,d);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return d},s.prototype.matching=function(d,u){var l=this._create();return l.__set_whitespace_patterns(d,u),l._update(),l},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(d,u){d.lastIndex=0;for(var l=0,o=[],a=d.exec(u);a;)o.push(u.substring(l,a.index)),l=a.index+a[0].length,a=d.exec(u);return l<u.length?o.push(u.substring(l,u.length)):o.push(""),o},y.exports.WhitespacePattern=s},function(y){function g(m,c){this._input=m,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)}g.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(m){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(m),c._update(),c},g.prototype.until=function(m){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(m),c._update(),c},g.prototype.starting_with=function(m){var c=this._create();return c._starting_pattern=this._input.get_regexp(m,!0),c._update(),c},g.prototype.matching=function(m){var c=this._create();return c._match_pattern=this._input.get_regexp(m,!0),c._update(),c},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},y.exports.Pattern=g},function(y){function g(m,c){m=typeof m=="string"?m:m.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+c,"g")}g.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(m);s;)c[s[1]]=s[2],s=this.__directive_pattern.exec(m);return c},g.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},y.exports.Directives=g},function(y,g,m){var c=m(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(u,l){c.call(this,u,l),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var o=new c(u);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}/)}}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(u){var l=this._create();return l._disabled[u]=!0,l._update(),l},d.prototype.read_options=function(u){var l=this._create();for(var o in s)l._disabled[o]=u.templating.indexOf(o)===-1;return l._update(),l},d.prototype.exclude=function(u){var l=this._create();return l._excluded[u]=!0,l._update(),l},d.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),u+=l,l=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},d.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},d.prototype._read_template=function(){var u="",l=this._input.peek();if(l==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(u=u||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},y.exports.TemplatablePattern=d},,,,function(y,g,m){var c=m(19).Beautifier,s=m(20).Options;function d(u,l,o,a){var C=new c(u,l,o,a);return C.beautify()}y.exports=d,y.exports.defaultOptions=function(){return new s}},function(y,g,m){var c=m(20).Options,s=m(2).Output,d=m(21).Tokenizer,u=m(21).TOKEN,l=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=function(_,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new s(_,E)};a.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},a.prototype.set_space_before_token=function(_,E){this._output.space_before_token=_,this._output.non_breaking_space=E},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(_){this._output.add_raw_token(_)},a.prototype.print_preserved_newlines=function(_){var E=0;_.type!==u.TEXT&&_.previous.type!==u.TEXT&&(E=_.newlines?1:0),this.preserve_newlines&&(E=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var x=0;x<E;x++)this.print_newline(x>0);return E!==0},a.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(_){this._output.add_new_line(_)},a.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var C=function(_){for(var E=null,x=_.next;x.type!==u.EOF&&_.closed!==x;){if(x.type===u.ATTRIBUTE&&x.text==="type"){x.next&&x.next.type===u.EQUALS&&x.next.next&&x.next.next.type===u.VALUE&&(E=x.next.next.text);break}x=x.next}return E},w=function(_,E){var x=null,U=null;return E.closed?(_==="script"?x="text/javascript":_==="style"&&(x="text/css"),x=C(E)||x,x.search("text/css")>-1?U="css":x.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":x.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":x.search(/test\/null/)>-1&&(U="null"),U):null};function T(_,E){return E.indexOf(_)!==-1}function R(_,E,x){this.parent=_||null,this.tag=E?E.tag_name:"",this.indent_level=x||0,this.parser_token=E||null}function A(_){this._printer=_,this._current_frame=null}A.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},A.prototype.record_tag=function(_){var E=new R(this._current_frame,_,this._printer.indent_level);this._current_frame=E},A.prototype._try_pop_frame=function(_){var E=null;return _&&(E=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),E},A.prototype._get_frame=function(_,E){for(var x=this._current_frame;x&&!(_.indexOf(x.tag)!==-1);){if(E&&E.indexOf(x.tag)!==-1){x=null;break}x=x.parent}return x},A.prototype.try_pop=function(_,E){var x=this._get_frame([_],E);return this._try_pop_frame(x)},A.prototype.indent_to_tag=function(_){var E=this._get_frame(_);E&&(this._printer.indent_level=E.indent_level)};function v(_,E,x,U){this._source_text=_||"",E=E||{},this._js_beautify=x,this._css_beautify=U,this._tag_stack=null;var B=new c(E,"html");this._options=B,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"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
|
|
`,_&&l.test(_)&&(E=_.match(l)[0])),_=_.replace(o,`
|
|
`);var x=_.match(/^[\t ]*/)[0],U={text:"",type:""},B=new b,L=new a(this._options,x),H=new d(_,this._options).tokenize();this._tag_stack=new A(L);for(var j=null,S=H.next();S.type!==u.EOF;)S.type===u.TAG_OPEN||S.type===u.COMMENT?(j=this._handle_tag_open(L,S,B,U),B=j):S.type===u.ATTRIBUTE||S.type===u.EQUALS||S.type===u.VALUE||S.type===u.TEXT&&!B.tag_complete?j=this._handle_inside_tag(L,S,B,H):S.type===u.TAG_CLOSE?j=this._handle_tag_close(L,S,B):S.type===u.TEXT?j=this._handle_text(L,S,B):L.add_raw_token(S),U=j,S=H.next();var J=L._output.get_code(E);return J},v.prototype._handle_tag_close=function(_,E,x){var U={text:E.text,type:E.type};return _.alignment_size=0,x.tag_complete=!0,_.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),x.is_unformatted?_.add_raw_token(E):(x.tag_start_char==="<"&&(_.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&x.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(E)),x.indent_content&&!(x.is_unformatted||x.is_content_unformatted)&&(_.indent(),x.indent_content=!1),!x.is_inline_element&&!(x.is_unformatted||x.is_content_unformatted)&&_.set_wrap_point(),U},v.prototype._handle_inside_tag=function(_,E,x,U){var B=x.has_wrapped_attrs,L={text:E.text,type:E.type};if(_.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),x.is_unformatted)_.add_raw_token(E);else if(x.tag_start_char==="{"&&E.type===u.TEXT)_.print_preserved_newlines(E)?(E.newlines=0,_.add_raw_token(E)):_.print_token(E);else{if(E.type===u.ATTRIBUTE?(_.set_space_before_token(!0),x.attr_count+=1):(E.type===u.EQUALS||E.type===u.VALUE&&E.previous.type===u.EQUALS)&&_.set_space_before_token(!1),E.type===u.ATTRIBUTE&&x.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(E),B=B||E.newlines!==0),this._is_wrap_attributes_force)){var H=x.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&x.attr_count===1){var j=!0,S=0,J;do{if(J=U.peek(S),J.type===u.ATTRIBUTE){j=!1;break}S+=1}while(S<4&&J.type!==u.EOF&&J.type!==u.TAG_CLOSE);H=!j}H&&(_.print_newline(!1),B=!0)}_.print_token(E),B=B||_.previous_token_wrapped(),x.has_wrapped_attrs=B}return L},v.prototype._handle_text=function(_,E,x){var U={text:E.text,type:"TK_CONTENT"};return x.custom_beautifier_name?this._print_custom_beatifier_text(_,E,x):x.is_unformatted||x.is_content_unformatted?_.add_raw_token(E):(_.traverse_whitespace(E),_.print_token(E)),U},v.prototype._print_custom_beatifier_text=function(_,E,x){var U=this;if(E.text!==""){var B=E.text,L,H=1,j="",S="";x.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?L=this._js_beautify:x.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?L=this._css_beautify:x.custom_beautifier_name==="html"&&(L=function(Le,De){var He=new v(Le,De,U._js_beautify,U._css_beautify);return He.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-_.indent_level);var J=_.get_full_indent(H);if(B=B.replace(/\n[ \t]*$/,""),x.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var te=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!te){_.add_raw_token(E);return}j=J+te[1]+`
|
|
`,B=te[4],te[5]&&(S=J+te[5]),B=B.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(`
|
|
`)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(E.whitespace_before=te[0]))}if(B)if(L){var se=function(){this.eol=`
|
|
`};se.prototype=this._options.raw_options;var fe=new se;B=L(J+B,fe)}else{var Fe=E.whitespace_before;Fe&&(B=B.replace(new RegExp(`
|
|
(`+Fe+")?","g"),`
|
|
`)),B=J+B.replace(/\n/g,`
|
|
`+J)}j&&(B?B=j+B+`
|
|
`+S:B=j+S),_.print_newline(!1),B&&(E.text=B,E.whitespace_before="",E.newlines=0,_.add_raw_token(E),_.print_newline(!0))}},v.prototype._handle_tag_open=function(_,E,x,U){var B=this._get_tag_open_token(E);return(x.is_unformatted||x.is_content_unformatted)&&!x.is_empty_element&&E.type===u.TAG_OPEN&&E.text.indexOf("</")===0?(_.add_raw_token(E),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(_.traverse_whitespace(E),this._set_tag_position(_,E,B,x,U),B.is_inline_element||_.set_wrap_point(),_.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=E.text.length+1),!B.tag_complete&&!B.is_unformatted&&(_.alignment_size=B.alignment_size),B};var b=function(_,E){if(this.parent=_||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 x;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(x=E.text.match(/^<([^\s>]*)/),this.tag_check=x?x[1]:""):(x=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=x?x[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===u.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 U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};v.prototype._get_tag_open_token=function(_){var E=new b(this._tag_stack.get_parser_token(),_);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},v.prototype._set_tag_position=function(_,E,x,U,B){if(x.is_empty_element||(x.is_end_tag?x.start_tag_token=this._tag_stack.try_pop(x.tag_name):(this._do_optional_end_element(x)&&(x.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(x),(x.tag_name==="script"||x.tag_name==="style")&&!(x.is_unformatted||x.is_content_unformatted)&&(x.custom_beautifier_name=w(x.tag_check,E)))),T(x.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),x.is_empty_element){if(x.tag_start_char==="{"&&x.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),x.indent_content=!0;var L=_.current_line_has_match(/{{#if/);L||_.print_newline(!1)}x.tag_name==="!--"&&B.type===u.TAG_CLOSE&&U.is_end_tag&&x.text.indexOf(`
|
|
`)===-1||(x.is_inline_element||x.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,x))}else if(x.is_end_tag){var H=!1;H=x.start_tag_token&&x.start_tag_token.multiline_content,H=H||!x.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(B.type===u.TAG_CLOSE&&x.start_tag_token===U)&&B.type!=="TK_CONTENT",(x.is_content_unformatted||x.is_unformatted)&&(H=!1),H&&_.print_newline(!1)}else x.indent_content=!x.custom_beautifier_name,x.tag_start_char==="<"&&(x.tag_name==="html"?x.indent_content=this._options.indent_inner_html:x.tag_name==="head"?x.indent_content=this._options.indent_head_inner_html:x.tag_name==="body"&&(x.indent_content=this._options.indent_body_inner_html)),!(x.is_inline_element||x.is_unformatted)&&(B.type!=="TK_CONTENT"||x.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,x)},v.prototype._calcluate_parent_multiline=function(_,E){E.parent&&_._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"];v.prototype._do_optional_end_element=function(_){var E=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(_.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&p.indexOf(_.tag_name)!==-1){var x=_.parent.parent;(!x||h.indexOf(x.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.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"])):_.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"])):(_.tag_name==="th"||_.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 _.parent=this._tag_stack.get_parser_token(),E},y.exports.Beautifier=v},function(y,g,m){var c=m(6).Options;function s(d){c.call(this,d,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}s.prototype=new c,y.exports.Options=s},function(y,g,m){var c=m(9).Tokenizer,s=m(9).TOKEN,d=m(13).Directives,u=m(14).TemplatablePattern,l=m(12).Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},a=new d(/<\!--/,/-->/),C=function(w,T){c.call(this,w,T),this._current_tag_name="";var R=new u(this._input).read_options(this._options),A=new l(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:A.starting_with(/{{!--/).until_after(/--}}/),handlebars:A.starting_with(/{{/).until_after(/}}/),handlebars_open:A.until(/[\n\r\t }]/),handlebars_raw_close:A.until(/}}/),comment:A.starting_with(/<!--/).until_after(/-->/),cdata:A.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:A.starting_with(/<!\[/).until_after(/]>/),processing:A.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=A.matching(v).until_after(v)}};C.prototype=new c,C.prototype._is_comment=function(w){return!1},C.prototype._is_opening=function(w){return w.type===o.TAG_OPEN},C.prototype._is_closing=function(w,T){return w.type===o.TAG_CLOSE&&T&&((w.text===">"||w.text==="/>")&&T.text[0]==="<"||w.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},C.prototype._reset=function(){this._current_tag_name=""},C.prototype._get_next_token=function(w,T){var R=null;this._readWhitespace();var A=this._input.peek();return A===null?this._create_token(o.EOF,""):(R=R||this._read_open_handlebars(A,T),R=R||this._read_attribute(A,w,T),R=R||this._read_close(A,T),R=R||this._read_raw_content(A,w,T),R=R||this._read_content_word(A),R=R||this._read_comment_or_cdata(A),R=R||this._read_processing(A),R=R||this._read_open(A,T),R=R||this._create_token(o.UNKNOWN,this._input.next()),R)},C.prototype._read_comment_or_cdata=function(w){var T=null,R=null,A=null;if(w==="<"){var v=this._input.peek(1);v==="!"&&(R=this.__patterns.comment.read(),R?(A=a.get_directives(R),A&&A.ignore==="start"&&(R+=a.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(T=this._create_token(o.COMMENT,R),T.directives=A)}return T},C.prototype._read_processing=function(w){var T=null,R=null,A=null;if(w==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(T=this._create_token(o.COMMENT,R),T.directives=A)}return T},C.prototype._read_open=function(w,T){var R=null,A=null;return T||w==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),A=this._create_token(o.TAG_OPEN,R)),A},C.prototype._read_open_handlebars=function(w,T){var R=null,A=null;return T||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),A=this._create_token(o.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),A=this._create_token(o.TAG_OPEN,R))),A},C.prototype._read_close=function(w,T){var R=null,A=null;return T&&(T.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(R=this._input.next(),w==="/"&&(R+=this._input.next()),A=this._create_token(o.TAG_CLOSE,R)):T.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),A=this._create_token(o.TAG_CLOSE,"}}"))),A},C.prototype._read_attribute=function(w,T,R){var A=null,v="";if(R&&R.text[0]==="<")if(w==="=")A=this._create_token(o.EQUALS,this._input.next());else if(w==='"'||w==="'"){var b=this._input.next();w==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),A=this._create_token(o.VALUE,b)}else v=this.__patterns.attribute.read(),v&&(T.type===o.EQUALS?A=this._create_token(o.VALUE,v):A=this._create_token(o.ATTRIBUTE,v));return A},C.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},C.prototype._read_raw_content=function(w,T,R){var A="";if(R&&R.text[0]==="{")A=this.__patterns.handlebars_raw_close.read();else if(T.type===o.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var v=T.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var b=this._read_comment_or_cdata(w);if(b)return b.type=o.TEXT,b;A=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(A=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return A?this._create_token(o.TEXT,A):null},C.prototype._read_content_word=function(w){var T="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(o.TEXT,T)},y.exports.Tokenizer=C,y.exports.TOKEN=o}],N={};function n(y){var g=N[y];if(g!==void 0)return g.exports;var m=N[y]={exports:{}};return K[y](m,m.exports,n),m.exports}var D=n(18);P=D})();var z=P;if(!0)!(Z=[G,G("6UM0"),G("TXwP")],V=function(K){var N=G("6UM0"),n=G("TXwP");return{html_beautify:function(D,y){return z(D,y,N.js_beautify,n.css_beautify)}}}.apply(ve,Z),V!==void 0&&(xt.exports=V));else var I,k})()},"rAM+":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return V});var Z=G("Qw5x");function V(P,z){var I;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(I=Object(Z.a)(P))||z&&P&&typeof P.length=="number"){I&&(P=I);var k=0,K=function(){};return{s:K,n:function(){return k>=P.length?{done:!0}:{done:!1,value:P[k++]}},e:function(g){throw g},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 N=!0,n=!1,D;return{s:function(){I=P[Symbol.iterator]()},n:function(){var g=I.next();return N=g.done,g},e:function(g){n=!0,D=g},f:function(){try{!N&&I.return!=null&&I.return()}finally{if(n)throw D}}}}},rUJ1:function(xt,ve){const G=/[&<>"']/,Z=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},I=A=>z[A];function k(A,v){if(v){if(G.test(A))return A.replace(Z,I)}else if(V.test(A))return A.replace(P,I);return A}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(A){return A.replace(K,(v,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(A,v){A=A.source||A,v=v||"";const b={replace:(p,h)=>(h=h.source||h,h=h.replace(n,"$1"),A=A.replace(p,h),b),getRegex:()=>new RegExp(A,v)};return b}const y=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(A,v,b){if(A){let p;try{p=decodeURIComponent(N(b)).replace(y,"").toLowerCase()}catch(h){return null}if(p.indexOf("javascript:")===0||p.indexOf("vbscript:")===0||p.indexOf("data:")===0)return null}v&&!g.test(b)&&(b=l(v,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(p){return null}return b}const c={},s=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(A,v){c[" "+A]||(s.test(A)?c[" "+A]=A+"/":c[" "+A]=w(A,"/",!0)),A=c[" "+A];const b=A.indexOf(":")===-1;return v.substring(0,2)==="//"?b?v:A.replace(d,"$1")+v:v.charAt(0)==="/"?b?v:A.replace(u,"$1")+v:A+v}const o={exec:function(){}};function a(A){let v=1,b,p;for(;v<arguments.length;v++){b=arguments[v];for(p in b)Object.prototype.hasOwnProperty.call(b,p)&&(A[p]=b[p])}return A}function C(A,v){const b=A.replace(/\|/g,(_,E,x)=>{let U=!1,B=E;for(;--B>=0&&x[B]==="\\";)U=!U;return U?"|":" |"}),p=b.split(/ \|/);let h=0;if(p.length>v)p.splice(v);else for(;p.length<v;)p.push("");for(;h<p.length;h++)p[h]=p[h].trim().replace(/\\\|/g,"|");return p}function w(A,v,b){const p=A.length;if(p===0)return"";let h=0;for(;h<p;){const _=A.charAt(p-h-1);if(_===v&&!b)h++;else if(_!==v&&b)h++;else break}return A.substr(0,p-h)}function T(A,v){if(A.indexOf(v[1])===-1)return-1;const b=A.length;let p=0,h=0;for(;h<b;h++)if(A[h]==="\\")h++;else if(A[h]===v[0])p++;else if(A[h]===v[1]&&(p--,p<0))return h;return-1}function R(A){A&&A.sanitize&&!A.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}xt.exports={escape:k,unescape:N,edit:D,cleanUrl:m,resolveUrl:l,noopTest:o,merge:a,splitCells:C,rtrim:w,findClosingBracket:T,checkSanitizeDeprecation:R}},sR1s:function(xt,ve,G){"use strict";G.d(ve,"b",function(){return z}),G.d(ve,"a",function(){return I}),G.d(ve,"c",function(){return k}),G.d(ve,"d",function(){return K});var Z=G("U8pU"),V="RC_TABLE_KEY";function P(N){return N==null?[]:Array.isArray(N)?N:[N]}function z(N,n){if(!n&&typeof n!="number")return N;for(var D=P(n),y=N,g=0;g<D.length;g+=1){if(!y)return null;var m=D[g];y=y[m]}return y}function I(N){var n=[],D={};return N.forEach(function(y){for(var g=y||{},m=g.key,c=g.dataIndex,s=m||P(c).join("-")||V;D[s];)s="".concat(s,"_next");D[s]=!0,n.push(s)}),n}function k(){var N={};function n(m,c){c&&Object.keys(c).forEach(function(s){var d=c[s];d&&Object(Z.a)(d)==="object"?(m[s]=m[s]||{},n(m[s],d)):m[s]=d})}for(var D=arguments.length,y=new Array(D),g=0;g<D;g++)y[g]=arguments[g];return y.forEach(function(m){n(N,m)}),N}function K(N){return N!=null}},sboe:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return P});var Z=G("q1tI"),V=G.n(Z),P=Z.createContext(null)},t23M:function(xt,ve,G){"use strict";var Z=G("VTBJ"),V=G("1OyB"),P=G("vuIU"),z=G("Ji7U"),I=G("LK+K"),k=G("q1tI"),K=G.n(k),N=G("m+aA"),n=G("Zm9Q"),D=G("Kwbf"),y=G("c+Xe"),g=G("bdgK"),m="rc-observer-key",c=function(s){Object(z.a)(u,s);var d=Object(I.a)(u);function u(){var l;return Object(V.a)(this,u),l=d.apply(this,arguments),l.resizeObserver=null,l.childNode=null,l.currentElement=null,l.state={width:0,height:0,offsetHeight:0,offsetWidth:0},l.onResize=function(o){var a=l.props.onResize,C=o[0].target,w=C.getBoundingClientRect(),T=w.width,R=w.height,A=C.offsetWidth,v=C.offsetHeight,b=Math.floor(T),p=Math.floor(R);if(l.state.width!==b||l.state.height!==p||l.state.offsetWidth!==A||l.state.offsetHeight!==v){var h={width:b,height:p,offsetWidth:A,offsetHeight:v};l.setState(h),a&&Promise.resolve().then(function(){a(Object(Z.a)(Object(Z.a)({},h),{},{offsetWidth:A,offsetHeight:v}))})}},l.setChildNode=function(o){l.childNode=o},l}return Object(P.a)(u,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var o=this.props.disabled;if(o){this.destroyObserver();return}var a=Object(N.a)(this.childNode||this),C=a!==this.currentElement;C&&(this.destroyObserver(),this.currentElement=a),!this.resizeObserver&&a&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(a))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var o=this.props.children,a=Object(n.a)(o);if(a.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(a.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var C=a[0];if(k.isValidElement(C)&&Object(y.c)(C)){var w=C.ref;a[0]=k.cloneElement(C,{ref:Object(y.a)(w,this.setChildNode)})}return a.length===1?a[0]:a.map(function(T,R){return!k.isValidElement(T)||"key"in T&&T.key!==null?T:k.cloneElement(T,{key:"".concat(m,"-").concat(R)})})}}]),u}(k.Component);c.displayName="ResizeObserver",ve.a=c},t9D7:function(xt,ve,G){"use strict";G.d(ve,"b",function(){return K}),G.d(ve,"g",function(){return n}),G.d(ve,"d",function(){return D}),G.d(ve,"e",function(){return y}),G.d(ve,"a",function(){return g}),G.d(ve,"f",function(){return s}),G.d(ve,"c",function(){return d});var Z=G("Vhoy"),V=G("MI8n"),P=G("pmY6"),z=G("Cg/j"),I=G("ic2d"),k=G("nEHx");const K=Object(z.c)("themeService");var N;(function(u){function l(o){return o&&typeof o=="object"&&typeof o.id=="string"}u.isThemeColor=l})(N||(N={}));function n(u){return{id:u}}var D;(function(u){function l(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||N.isThemeColor(R.color))}u.isThemeIcon=l;const o=new RegExp(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function a(R){const A=o.exec(R);if(!A)return;let[,v]=A;return{id:v}}u.fromString=a;function C(R,A){let v=R.id;const b=v.lastIndexOf("~");return b!==-1&&(v=v.substring(0,b)),A&&(v=`${v}~${A}`),{id:v}}u.modify=C;function w(R,A){var v,b;return R.id===A.id&&((v=R.color)===null||v===void 0?void 0:v.id)===((b=A.color)===null||b===void 0?void 0:b.id)}u.isEqual=w;function T(R,A){return{id:R.id,color:A?n(A):void 0}}u.asThemeIcon=T,u.asClassNameArray=Z.a.asClassNameArray,u.asClassName=Z.a.asClassName,u.asCSSSelector=Z.a.asCSSSelector})(D||(D={}));function y(u){switch(u){case k.a.DARK:return"vs-dark";case k.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const g={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new V.b}onColorThemeChange(u){return this.themingParticipants.push(u),this.onThemingParticipantAddedEmitter.fire(u),Object(P.i)(()=>{const l=this.themingParticipants.indexOf(u);this.themingParticipants.splice(l,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new m;I.a.add(g.ThemingContribution,c);function s(u){return c.onColorThemeChange(u)}class d extends P.a{constructor(u){super();this.themeService=u,this.theme=u.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(l=>this.onThemeChange(l)))}onThemeChange(u){this.theme=u,this.updateStyles()}updateStyles(){}}},ulZh:function(xt,ve,G){typeof window!="undefined"&&function(V,P){xt.exports=P()}(this,function(){return function(Z){var V={};function P(z){if(V[z])return V[z].exports;var I=V[z]={i:z,l:!1,exports:{}};return Z[z].call(I.exports,I,I.exports,P),I.l=!0,I.exports}return P.m=Z,P.c=V,P.d=function(z,I,k){P.o(z,I)||Object.defineProperty(z,I,{enumerable:!0,get:k})},P.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},P.t=function(z,I){if(I&1&&(z=P(z)),I&8)return z;if(I&4&&typeof z=="object"&&z&&z.__esModule)return z;var k=Object.create(null);if(P.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:z}),I&2&&typeof z!="string")for(var K in z)P.d(k,K,function(N){return z[N]}.bind(null,K));return k},P.n=function(z){var I=z&&z.__esModule?function(){return z.default}:function(){return z};return P.d(I,"a",I),I},P.o=function(z,I){return Object.prototype.hasOwnProperty.call(z,I)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,V,P){"use strict";var z=Object.prototype.hasOwnProperty,I="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(I=!1));function K(y,g,m){this.fn=y,this.context=g,this.once=m||!1}function N(y,g,m,c,s){if(typeof m!="function")throw new TypeError("The listener must be a function");var d=new K(m,c||y,s),u=I?I+g:g;return y._events[u]?y._events[u].fn?y._events[u]=[y._events[u],d]:y._events[u].push(d):(y._events[u]=d,y._eventsCount++),y}function n(y,g){--y._eventsCount===0?y._events=new k:delete y._events[g]}function D(){this._events=new k,this._eventsCount=0}D.prototype.eventNames=function(){var g=[],m,c;if(this._eventsCount===0)return g;for(c in m=this._events)z.call(m,c)&&g.push(I?c.slice(1):c);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(m)):g},D.prototype.listeners=function(g){var m=I?I+g:g,c=this._events[m];if(!c)return[];if(c.fn)return[c.fn];for(var s=0,d=c.length,u=new Array(d);s<d;s++)u[s]=c[s].fn;return u},D.prototype.listenerCount=function(g){var m=I?I+g:g,c=this._events[m];return c?c.fn?1:c.length:0},D.prototype.emit=function(g,m,c,s,d,u){var l=I?I+g:g;if(!this._events[l])return!1;var o=this._events[l],a=arguments.length,C,w;if(o.fn){o.once&&this.removeListener(g,o.fn,void 0,!0);switch(a){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,m),!0;case 3:return o.fn.call(o.context,m,c),!0;case 4:return o.fn.call(o.context,m,c,s),!0;case 5:return o.fn.call(o.context,m,c,s,d),!0;case 6:return o.fn.call(o.context,m,c,s,d,u),!0}for(w=1,C=new Array(a-1);w<a;w++)C[w-1]=arguments[w];o.fn.apply(o.context,C)}else{var T=o.length,R;for(w=0;w<T;w++){o[w].once&&this.removeListener(g,o[w].fn,void 0,!0);switch(a){case 1:o[w].fn.call(o[w].context);break;case 2:o[w].fn.call(o[w].context,m);break;case 3:o[w].fn.call(o[w].context,m,c);break;case 4:o[w].fn.call(o[w].context,m,c,s);break;default:if(!C)for(R=1,C=new Array(a-1);R<a;R++)C[R-1]=arguments[R];o[w].fn.apply(o[w].context,C)}}}return!0},D.prototype.on=function(g,m,c){return N(this,g,m,c,!1)},D.prototype.once=function(g,m,c){return N(this,g,m,c,!0)},D.prototype.removeListener=function(g,m,c,s){var d=I?I+g:g;if(!this._events[d])return this;if(!m)return n(this,d),this;var u=this._events[d];if(u.fn)u.fn===m&&(!s||u.once)&&(!c||u.context===c)&&n(this,d);else{for(var l=0,o=[],a=u.length;l<a;l++)(u[l].fn!==m||s&&!u[l].once||c&&u[l].context!==c)&&o.push(u[l]);o.length?this._events[d]=o.length===1?o[0]:o:n(this,d)}return this},D.prototype.removeAllListeners=function(g){var m;return g?(m=I?I+g:g,this._events[m]&&n(this,m)):(this._events=new k,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=I,D.EventEmitter=D,Z.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,V,P){(function(z){var I=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,k=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(D,y,g){if(g=g||{},D=D.trim(),y=y.trim(),!y){if(!g.alwaysNormalize)return D;var m=n.parseURL(D);if(!m)throw new Error("Error trying to parse base URL.");return m.path=n.normalizePath(m.path),n.buildURLFromParts(m)}var c=n.parseURL(y);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return g.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):y;var s=n.parseURL(D);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var d=k.exec(s.path);s.netLoc=d[1],s.path=d[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(u.netLoc=s.netLoc,c.path[0]!=="/"))if(!c.path)u.path=s.path,c.params||(u.params=s.params,c.query||(u.query=s.query));else{var l=s.path,o=l.substring(0,l.lastIndexOf("/")+1)+c.path;u.path=n.normalizePath(o)}return u.path===null&&(u.path=g.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(u)},parseURL:function(D){var y=I.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(N,"")).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,V,P){function z(g){var m={};function c(d){if(m[d])return m[d].exports;var u=m[d]={i:d,l:!1,exports:{}};return g[d].call(u.exports,u,u.exports,c),u.l=!0,u.exports}c.m=g,c.c=m,c.i=function(d){return d},c.d=function(d,u,l){c.o(d,u)||Object.defineProperty(d,u,{configurable:!1,enumerable:!0,get:l})},c.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},c.n=function(d){var u=d&&d.__esModule?function(){return d.default}:function(){return d};return c.d(u,"a",u),u},c.o=function(d,u){return Object.prototype.hasOwnProperty.call(d,u)},c.p="/",c.oe=function(d){throw console.error(d),d};var s=c(c.s=ENTRY_MODULE);return s.default||s}var I="[\\.|\\-|\\+|\\w|/|@]+",k="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+I+").*?\\)";function K(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(g){return!isNaN(1*g)}function n(g,m,c){var s={};s[c]=[];var d=m.toString(),u=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var l=u[1],o=new RegExp("(\\\\n|\\W)"+K(l)+k,"g"),a;a=o.exec(d);){if(a[3]==="dll-reference")continue;s[c].push(a[3])}for(o=new RegExp("\\("+K(l)+'\\("(dll-reference\\s('+I+'))"\\)\\)'+k,"g");a=o.exec(d);)g[a[2]]||(s[c].push(a[1]),g[a[2]]=P(a[1]).m),s[a[2]]=s[a[2]]||[],s[a[2]].push(a[4]);for(var C=Object.keys(s),w=0;w<C.length;w++)for(var T=0;T<s[C[w]].length;T++)N(s[C[w]][T])&&(s[C[w]][T]=1*s[C[w]][T]);return s}function D(g){var m=Object.keys(g);return m.reduce(function(c,s){return c||g[s].length>0},!1)}function y(g,m){for(var c={main:[m]},s={main:[]},d={main:{}};D(c);)for(var u=Object.keys(c),l=0;l<u.length;l++){var o=u[l],a=c[o],C=a.pop();if(d[o]=d[o]||{},d[o][C]||!g[o][C])continue;d[o][C]=!0,s[o]=s[o]||[],s[o].push(C);for(var w=n(g,g[o][C],o),T=Object.keys(w),R=0;R<T.length;R++)c[T[R]]=c[T[R]]||[],c[T[R]]=c[T[R]].concat(w[T[R]])}return s}Z.exports=function(g,m){m=m||{};var c={main:P.m},s=m.all?{main:Object.keys(c.main)}:y(c,g),d="";Object.keys(s).filter(function(C){return C!=="main"}).forEach(function(C){for(var w=0;s[C][w];)w++;s[C].push(w),c[C][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+C+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+s[C].map(function(T){return""+JSON.stringify(T)+": "+c[C][T].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+s.main.map(function(C){return""+JSON.stringify(C)+": "+c.main[C].toString()}).join(",")+"}))(self);";var u=new window.Blob([d],{type:"text/javascript"});if(m.bare)return u;var l=window.URL||window.webkitURL||window.mozURL||window.msURL,o=l.createObjectURL(u),a=new window.Worker(o);return a.objectURL=o,a}},"./src/config.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"hlsDefaultConfig",function(){return R}),P.d(V,"mergeConfig",function(){return v}),P.d(V,"enableStreamingMode",function(){return b});var z=P("./src/controller/abr-controller.ts"),I=P("./src/controller/audio-stream-controller.ts"),k=P("./src/controller/audio-track-controller.ts"),K=P("./src/controller/subtitle-stream-controller.ts"),N=P("./src/controller/subtitle-track-controller.ts"),n=P("./src/controller/buffer-controller.ts"),D=P("./src/controller/timeline-controller.ts"),y=P("./src/controller/cap-level-controller.ts"),g=P("./src/controller/fps-controller.ts"),m=P("./src/controller/eme-controller.ts"),c=P("./src/controller/cmcd-controller.ts"),s=P("./src/utils/xhr-loader.ts"),d=P("./src/utils/fetch-loader.ts"),u=P("./src/utils/cues.ts"),l=P("./src/utils/mediakeys-helper.ts"),o=P("./src/utils/logger.ts");function a(){return a=Object.assign||function(p){for(var h=1;h<arguments.length;h++){var _=arguments[h];for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&(p[E]=_[E])}return p},a.apply(this,arguments)}function C(p,h){var _=Object.keys(p);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(p);h&&(E=E.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),_.push.apply(_,E)}return _}function w(p){for(var h=1;h<arguments.length;h++){var _=arguments[h]!=null?arguments[h]:{};h%2?C(Object(_),!0).forEach(function(E){T(p,E,_[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(_)):C(Object(_)).forEach(function(E){Object.defineProperty(p,E,Object.getOwnPropertyDescriptor(_,E))})}return p}function T(p,h,_){return h in p?Object.defineProperty(p,h,{value:_,enumerable:!0,configurable:!0,writable:!0}):p[h]=_,p}var R=w(w({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:z.default,bufferController:n.default,capLevelController:y.default,fpsController:g.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:l.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:N.default,timelineController:D.TimelineController,audioStreamController:I.default,audioTrackController:k.default,emeController:m.default,cmcdController:c.default});function A(){return{cueHandler:u.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 v(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 a({},p,h)}function b(p){var h=p.loader;if(h!==d.default&&h!==s.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),p.progressive=!1;else{var _=Object(d.fetchSupported)();_&&(p.loader=d.default,p.progressive=!0,p.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/polyfills/number.ts"),I=P("./src/utils/ewma-bandwidth-estimator.ts"),k=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),N=P("./src/errors.ts"),n=P("./src/types/loader.ts"),D=P("./src/utils/logger.ts");function y(c,s){for(var d=0;d<s.length;d++){var u=s[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}function g(c,s,d){return s&&y(c.prototype,s),d&&y(c,d),c}var m=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 u=d.config;this.bwEstimator=new I.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var s=c.prototype;return s.registerListeners=function(){var u=this.hls;u.on(k.Events.FRAG_LOADING,this.onFragLoading,this),u.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(k.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var u=this.hls;u.off(k.Events.FRAG_LOADING,this.onFragLoading,this),u.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(k.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(u,l){var o=l.frag;if(o.type===n.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=o,this.partCurrent=(a=l.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(u,l){var o=this.hls.config;l.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var u=this.fragCurrent,l=this.partCurrent,o=this.hls,a=o.autoLevelEnabled,C=o.config,w=o.media;if(!u||!w)return;var T=l?l.stats:u.stats,R=l?l.duration:u.duration;if(T.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||w.paused||!w.playbackRate||!w.readyState)return;var A=performance.now()-T.loading.start,v=Math.abs(w.playbackRate);if(A<=500*R/v)return;var b=o.levels,p=o.minAutoLevel,h=b[u.level],_=T.total||Math.max(T.loaded,Math.round(R*h.maxBitrate/8)),E=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/A),x=(_-T.loaded)/E,U=w.currentTime,B=(K.BufferHelper.bufferInfo(w,U,C.maxBufferHole).end-U)/v;if(B>=2*R/v||x<=B)return;var L=Number.POSITIVE_INFINITY,H;for(H=u.level-1;H>p;H--){var j=b[H].maxBitrate;if(L=R*j/(8*.8*E),L<B)break}if(L>=x)return;var S=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+u.sn+(l?" part "+l.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
|
|
Current BW estimate: `+(Object(z.isFiniteNumber)(S)?(S/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+x.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+L.toFixed(3)+` s
|
|
Time to underbuffer: `+B.toFixed(3)+" s"),o.nextLoadLevel=H,this.bwEstimator.sample(A,T.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),o.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:l,stats:T})},s.onFragLoaded=function(u,l){var o=l.frag,a=l.part;if(o.type===n.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(o.sn)){var C=a?a.stats:o.stats,w=a?a.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[o.level],R=(T.loaded?T.loaded.bytes:0)+C.loaded,A=(T.loaded?T.loaded.duration:0)+w;T.loaded={bytes:R,duration:A},T.realBitrate=Math.round(8*R/A)}if(o.bitrateTest){var v={stats:C,frag:o,part:a,id:o.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,v),o.bitrateTest=!1}}},s.onFragBuffered=function(u,l){var o=l.frag,a=l.part,C=a?a.stats:o.stats;if(C.aborted)return;if(o.type!==n.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var w=C.parsing.end-C.loading.start;this.bwEstimator.sample(w,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},s.onError=function(u,l){switch(l.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var u=this.fragCurrent,l=this.partCurrent,o=this.hls,a=o.maxAutoLevel,C=o.config,w=o.minAutoLevel,T=o.media,R=l?l.duration:u?u.duration:0,A=T?T.currentTime:0,v=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,p=(K.BufferHelper.bufferInfo(T,A,C.maxBufferHole).end-A)/v,h=this.findBestLevel(b,w,a,p,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(h>=0)return h;D.logger.trace((p?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=R?Math.min(R,C.maxStarvationDelay):C.maxStarvationDelay,E=C.abrBandWidthFactor,x=C.abrBandWidthUpFactor;if(!p){var U=this.bitrateTestDelay;if(U){var B=R?Math.min(R,C.maxLoadingDelay):C.maxLoadingDelay;_=B-U,D.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),E=x=1}}return h=this.findBestLevel(b,w,a,p+_,E,x),Math.max(h,0)},s.findBestLevel=function(u,l,o,a,C,w){for(var T,R=this.fragCurrent,A=this.partCurrent,v=this.lastLoadedFragLevel,b=this.hls.levels,p=b[v],h=!!(p!=null&&(T=p.details)!==null&&T!==void 0&&T.live),_=p==null?void 0:p.codecSet,E=A?A.duration:R?R.duration:0,x=o;x>=l;x--){var U=b[x];if(!U||_&&U.codecSet!==_)continue;var B=U.details,L=(A?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||E,H=void 0;x<=v?H=C*u:H=w*u;var j=b[x].maxBitrate,S=j*L/H;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(H)+"/"+j+"/"+L+"/"+a+"/"+S),H>j&&(!S||h&&!this.bitrateTestDelay||S<a))return x}return-1},g(c,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,l=this.bwEstimator;if(u!==-1&&(!l||!l.canEstimate()))return u;var o=this.getNextABRAutoLevel();return u!==-1&&(o=Math.min(u,o)),o},set:function(u){this._nextAutoLevel=u}}]),c}();V.default=m},"./src/controller/audio-stream-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/polyfills/number.ts"),I=P("./src/controller/base-stream-controller.ts"),k=P("./src/events.ts"),K=P("./src/utils/buffer-helper.ts"),N=P("./src/controller/fragment-tracker.ts"),n=P("./src/types/level.ts"),D=P("./src/types/loader.ts"),y=P("./src/loader/fragment.ts"),g=P("./src/demux/chunk-cache.ts"),m=P("./src/demux/transmuxer-interface.ts"),c=P("./src/types/transmuxer.ts"),s=P("./src/controller/fragment-finders.ts"),d=P("./src/utils/discontinuities.ts"),u=P("./src/errors.ts"),l=P("./src/utils/logger.ts");function o(){return o=Object.assign||function(R){for(var A=1;A<arguments.length;A++){var v=arguments[A];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(R[b]=v[b])}return R},o.apply(this,arguments)}function a(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,C(R,A)}function C(R,A){return C=Object.setPrototypeOf||function(b,p){return b.__proto__=p,b},C(R,A)}var w=100,T=function(R){a(A,R);function A(b,p){var h;return h=R.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 v=A.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var p=this.hls;p.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),p.on(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),p.on(k.Events.ERROR,this.onError,this),p.on(k.Events.BUFFER_RESET,this.onBufferReset,this),p.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this),p.on(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var p=this.hls;p.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),p.off(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),p.off(k.Events.ERROR,this.onError,this),p.off(k.Events.BUFFER_RESET,this.onBufferReset,this),p.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),p.off(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(p,h){var _=h.frag,E=h.id,x=h.initPTS;if(E==="main"){var U=_.cc;this.initPTS[_.cc]=x,this.log("InitPTS for cc: "+U+" found from main: "+x),this.videoTrackCC=U,this.state===I.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(p){if(!this.levels){this.startPosition=p,this.state=I.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,h>0&&p===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=I.State.IDLE):(this.loadedmetadata=!1,this.state=I.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=p,this.tick()},v.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_TRACK:{var p,h=this.levels,_=this.trackId,E=h==null||((p=h[_])===null||p===void 0)?void 0:p.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=I.State.WAITING_INIT_PTS}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var x,U=performance.now(),B=this.retryDate;(!B||U>=B||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=I.State.IDLE);break}case I.State.WAITING_INIT_PTS:{var L=this.waitingData;if(L){var H=L.frag,j=L.part,S=L.cache,J=L.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.FRAG_LOADING;var te=S.flush(),se={frag:H,part:j,payload:te,networkDetails:null};this._handleFragmentLoadProgress(se),J&&R.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)l.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),Fe=K.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Le=Object(s.fragmentWithinToleranceTest)(Fe.end,this.config.maxFragLookUpTolerance,H);Le<0&&(l.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+Fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=I.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var p=this.waitingData;p&&(this.fragmentTracker.removeFragment(p.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.IDLE)},v.onTickEnd=function(){var p=this.media;if(!p||!p.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:p,_=h.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=p.currentTime},v.doTickIdle=function(){var p,h,_=this.hls,E=this.levels,x=this.media,U=this.trackId,B=_.config;if(!E||!E[U])return;if(!x&&(this.startFragRequested||!B.startFragPrefetch))return;var L=E[U],H=L.details;if(!H||H.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(H)){this.state=I.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(j===null)return;var S=j.len,J=this.getMaxBufferLength(),te=this.audioSwitch;if(S>=J&&!te)return;if(!te&&this._streamEnded(j,H)){_.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=I.State.ENDED;return}var se=H.fragments,fe=se[0].start,Fe=j.end;if(te){var Le=this.getLoadPosition();Fe=Le,H.PTSKnown&&Le<fe&&((j.end>fe||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=fe+.05))}var De=this.getNextFragment(Fe,H);if(!De){this.bufferFlushed=!0;return}((p=De.decryptdata)===null||p===void 0?void 0:p.keyFormat)==="identity"&&!((h=De.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(De,H):this.loadFragment(De,H,Fe)},v.getMaxBufferLength=function(){var p=R.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)},v.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(p,h){var _=h.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(E){return new n.Level(E)})},v.onAudioTrackSwitching=function(p,h){var _=!!h.url;this.trackId=h.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(w):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=I.State.IDLE):this.state=I.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(p,h){this.mainDetails=h.details},v.onAudioTrackLoaded=function(p,h){var _,E=this.levels,x=h.details,U=h.id;if(!E){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var B=E[U],L=0;if(x.live||(_=B.details)!==null&&_!==void 0&&_.live){var H=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!H)return;!B.details&&x.hasProgramDateTime&&H.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(x,H),L=x.fragments[0].start):L=this.alignPlaylists(x,B.details)}B.details=x,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(B.details,L),this.state===I.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=I.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(p){var h,_=p.frag,E=p.part,x=p.payload,U=this.config,B=this.trackId,L=this.levels;if(!L){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var H=L[B];console.assert(H,"Audio track is defined on fragment load progress");var j=H.details;console.assert(j,"Audio track details are defined on fragment load progress");var S=U.defaultAudioCodec||H.audioCodec||"mp4a.40.2",J=this.transmuxer;J||(J=this.transmuxer=new m.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[_.cc],se=(h=_.initSegment)===null||h===void 0?void 0:h.data;if(te!==void 0){var fe=!1,Fe=E?E.index:-1,Le=Fe!==-1,De=new c.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,x.byteLength,Fe,Le);J.push(x,se,S,"",_,E,j.totalduration,fe,De,te)}else{l.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+B);var He=this.waitingData=this.waitingData||{frag:_,part:E,cache:new g.default,complete:!1},We=He.cache;We.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=I.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(p){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,p)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(p,h){var _=h.tracks.audio;_&&(this.mediaBuffer=_.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},v.onFragBuffered=function(p,h){var _=h.frag,E=h.part;if(_.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(E?" p: "+E.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,E)},v.onError=function(p,h){switch(h.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,h);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==I.State.ERROR&&this.state!==I.State.STOPPED&&(this.state=h.fatal?I.State.ERROR:I.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var _=!0,E=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);E&&E.len>.5&&(_=!this.reduceMaxBufferLength(E.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(p,h){var _=h.type;_===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(p){var h,_="audio",E=this.hls,x=p.remuxResult,U=p.chunkMeta,B=this.getCurrentContext(U);if(!B){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var L=B.frag,H=B.part,j=x.audio,S=x.text,J=x.id3,te=x.initSegment;if(this.fragContextChanged(L))return;if(this.state=I.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,L,U),E.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:_,tracks:te.tracks})),j){var se=j.startPTS,fe=j.endPTS,Fe=j.startDTS,Le=j.endDTS;H&&(H.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:fe,startDTS:Fe,endDTS:Le}),L.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,se,fe,Fe,Le),this.bufferFragmentData(j,L,H,U)}if(J!=null&&(h=J.samples)!==null&&h!==void 0&&h.length){var De=o({frag:L,id:_},J);E.trigger(k.Events.FRAG_PARSING_METADATA,De)}if(S){var He=o({frag:L,id:_},S);E.trigger(k.Events.FRAG_PARSING_USERDATA,He)}},v._bufferInitSegment=function(p,h,_){if(this.state!==I.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(k.Events.BUFFER_CODECS,p);var x=E.initSegment;if(x!=null&&x.byteLength){var U={type:"audio",frag:h,part:null,chunkMeta:_,parent:h.type,data:x};this.hls.trigger(k.Events.BUFFER_APPENDING,U)}this.tick()},v.loadFragment=function(p,h,_){var E=this.fragmentTracker.getState(p);this.fragCurrent=p,(this.audioSwitch||E===N.FragmentState.NOT_LOADED||E===N.FragmentState.PARTIAL)&&(p.sn==="initSegment"?this._loadInitSegment(p):h.live&&!Object(z.isFiniteNumber)(this.initPTS[p.cc])?(this.log("Waiting for video PTS in continuity counter "+p.cc+" of live stream before loading audio fragment "+p.sn+" of level "+this.trackId),this.state=I.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,p,h,_)))},v.completeAudioSwitch=function(){var p=this.hls,h=this.media,_=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,p.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:_})},A}(I.default);V.default=T},"./src/controller/audio-track-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/events.ts"),I=P("./src/errors.ts"),k=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function N(m,c){for(var s=0;s<c.length;s++){var d=c[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}function n(m,c,s){return c&&N(m.prototype,c),s&&N(m,s),m}function D(m,c){m.prototype=Object.create(c.prototype),m.prototype.constructor=m,y(m,c)}function y(m,c){return y=Object.setPrototypeOf||function(d,u){return d.__proto__=u,d},y(m,c)}var g=function(m){D(c,m);function c(d){var u;return u=m.call(this,d,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var s=c.prototype;return s.registerListeners=function(){var u=this.hls;u.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(z.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(z.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(u,l){this.tracks=l.audioTracks||[]},s.onAudioTrackLoaded=function(u,l){var o=l.id,a=l.details,C=this.tracksInGroup[o];if(!C){this.warn("Invalid audio track id "+o);return}var w=C.details;C.details=l.details,this.log("audioTrack "+o+" loaded ["+a.startSN+"-"+a.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,l,w))},s.onLevelLoading=function(u,l){this.switchLevel(l.level)},s.onLevelSwitching=function(u,l){this.switchLevel(l.level)},s.switchLevel=function(u){var l=this.hls.levels[u];if(!(l!=null&&l.audioGroupIds))return;var o=l.audioGroupIds[l.urlId];if(this.groupId!==o){this.groupId=o;var a=this.tracks.filter(function(w){return!o||w.groupId===o});this.selectDefaultTrack&&!a.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var C={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}},s.onError=function(u,l){if(m.prototype.onError.call(this,u,l),l.fatal||!l.context)return;l.context.type===K.PlaylistContextType.AUDIO_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},s.setAudioTrack=function(u){var l=this.tracksInGroup;if(u<0||u>=l.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=l[this.trackId];this.log("Now switching to audio-track index "+u);var a=l[u],C=a.id,w=a.groupId,T=w===void 0?"":w,R=a.name,A=a.type,v=a.url;if(this.trackId=u,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:T,name:R,type:A,url:v}),a.details&&!a.details.live)return;var b=this.switchParams(a.url,o==null?void 0:o.details);this.loadPlaylist(b)},s.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.length,"Initial audio track should be selected when tracks are known");var l=this.trackName,o=this.findTrackId(l)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(u){for(var l=this.tracksInGroup,o=0;o<l.length;o++){var a=l[o];if((!this.selectDefaultTrack||a.default)&&(!u||u===a.name))return a.id}return-1},s.loadPlaylist=function(u){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var o=l.id,a=l.groupId,C=l.url;if(u)try{C=u.addDirectives(C)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(z.Events.AUDIO_TRACK_LOADING,{url:C,id:o,groupId:a,deliveryDirectives:u||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),c}(k.default);V.default=g},"./src/controller/base-playlist-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n});var z=P("./src/polyfills/number.ts"),I=P("./src/types/level.ts"),k=P("./src/controller/level-helper.ts"),K=P("./src/utils/logger.ts"),N=P("./src/errors.ts"),n=function(){function D(g,m){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,m+":"),this.warn=K.logger.warn.bind(K.logger,m+":"),this.hls=g}var y=D.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(m,c){c.fatal&&c.type===N.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(m,c){var s=c==null?void 0:c.renditionReports;if(s)for(var d=0;d<s.length;d++){var u=s[d],l=""+u.URI;if(l===m.substr(-l.length)){var o=parseInt(u["LAST-MSN"]),a=parseInt(u["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var C=Math.min(c.age-c.partTarget,c.targetduration);a!==void 0&&C>c.partTarget&&(a+=1)}if(Object(z.isFiniteNumber)(o))return new I.HlsUrlParameters(o,Object(z.isFiniteNumber)(a)?a:void 0,I.HlsSkip.No)}}},y.loadPlaylist=function(m){},y.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},y.playlistLoaded=function(m,c,s){var d=this,u=c.details,l=c.stats,o=l.loading.end?Math.max(0,self.performance.now()-l.loading.end):0;if(u.advancedDateTime=Date.now()-o,u.live||s!=null&&s.live){if(u.reloaded(s),s&&this.log("live playlist "+m+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),s&&u.fragments.length>0&&Object(k.mergeDetails)(s,u),!this.canLoad||!u.live)return;var a,C=void 0,w=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var T=this.hls.config.lowLatencyMode,R=u.lastPartSn,A=u.endSN,v=u.lastPartIndex,b=v!==-1,p=R===A,h=T?0:v;b?(C=p?A+1:R,w=p?h:v+1):C=A+1;var _=u.age,E=_+u.ageHeader,x=Math.min(E-u.partTarget,u.targetduration*1.5);if(x>0){if(s&&x>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+x+" with playlist age: "+u.age),x=0;else{var U=Math.floor(x/u.targetduration);if(C+=U,w!==void 0){var B=Math.round(x%u.targetduration/u.partTarget);w+=B}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+x+" skip sn "+U+" to part "+w)}u.tuneInGoal=x}if(a=this.getDeliveryDirectives(u,c.deliveryDirectives,C,w),T||!p){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(u,c.deliveryDirectives,C,w);var L=Object(k.computeReloadInterval)(u,l);C!==void 0&&u.canBlockReload&&(L-=u.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(L)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(a)},L)}else this.clearTimer()},y.getDeliveryDirectives=function(m,c,s,d){var u=Object(I.getSkipValue)(m,s);return c!=null&&c.skip&&m.deltaUpdateFailed&&(s=c.msn,d=c.part,u=I.HlsSkip.No),new I.HlsUrlParameters(s,d,u)},y.retryLoadingOrFail=function(m){var c=this,s=this.hls.config,d=this.retryCount<s.levelLoadingMaxRetry;if(d){var u;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(u=m.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var l=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return d},D}()},"./src/controller/base-stream-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"State",function(){return A}),P.d(V,"default",function(){return v});var z=P("./src/polyfills/number.ts"),I=P("./src/task-loop.ts"),k=P("./src/controller/fragment-tracker.ts"),K=P("./src/utils/buffer-helper.ts"),N=P("./src/utils/logger.ts"),n=P("./src/events.ts"),D=P("./src/errors.ts"),y=P("./src/types/transmuxer.ts"),g=P("./src/utils/mp4-tools.ts"),m=P("./src/utils/discontinuities.ts"),c=P("./src/controller/fragment-finders.ts"),s=P("./src/controller/level-helper.ts"),d=P("./src/loader/fragment-loader.ts"),u=P("./src/crypt/decrypter.ts"),l=P("./src/utils/time-ranges.ts"),o=P("./src/types/loader.ts");function a(b,p){for(var h=0;h<p.length;h++){var _=p[h];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(b,_.key,_)}}function C(b,p,h){return p&&a(b.prototype,p),h&&a(b,h),b}function w(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,R(b,p)}function R(b,p){return R=Object.setPrototypeOf||function(_,E){return _.__proto__=E,_},R(b,p)}var A={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},v=function(b){T(p,b);function p(_,E,x){var U;return U=b.call(this)||this,U.hls=void 0,U.fragPrevious=null,U.fragCurrent=null,U.fragmentTracker=void 0,U.transmuxer=null,U._state=A.STOPPED,U.media=void 0,U.mediaBuffer=void 0,U.config=void 0,U.bitrateTest=!1,U.lastCurrentTime=0,U.nextLoadPosition=0,U.startPosition=0,U.loadedmetadata=!1,U.fragLoadError=0,U.retryDate=0,U.levels=null,U.fragmentLoader=void 0,U.levelLastLoaded=null,U.startFragRequested=!1,U.decrypter=void 0,U.initPTS=[],U.onvseeking=null,U.onvended=null,U.logPrefix="",U.log=void 0,U.warn=void 0,U.logPrefix=x,U.log=N.logger.log.bind(N.logger,x+":"),U.warn=N.logger.warn.bind(N.logger,x+":"),U.hls=_,U.fragmentLoader=new d.default(_.config),U.fragmentTracker=E,U.config=_.config,U.decrypter=new u.default(_,_.config),_.on(n.Events.KEY_LOADED,U.onKeyLoaded,w(U)),U}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=A.STOPPED},h._streamEnded=function(E,x){var U=this.fragCurrent,B=this.fragmentTracker;if(!x.live&&U&&U.sn===x.endSN&&!E.nextStart){var L=B.getState(U);return L===k.FragmentState.PARTIAL||L===k.FragmentState.OK}return!1},h.onMediaAttached=function(E,x){var U=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),U.addEventListener("seeking",this.onvseeking),U.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(B.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,x=this.fragCurrent,U=this.media,B=this.mediaBuffer,L=this.state,H=U?U.currentTime:0,j=K.BufferHelper.bufferInfo(B||U,H,E.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+L),L===A.ENDED)this.resetLoadingState();else if(x&&!j.len){var S=E.maxFragLookUpTolerance,J=x.start-S,te=x.start+x.duration+S,se=H>te;(H<J||se)&&(se&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}U&&(this.lastCurrentTime=H),!this.loadedmetadata&&!j.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(E,x){if(this.state!==A.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var U=this.levels[x.frag.level].details;U&&this.loadFragment(x.frag,U,x.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,b.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(E,x){this.log("Loading key for "+E.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=A.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},h.loadFragment=function(E,x,U){this._loadFragForPlayback(E,x,U)},h._loadFragForPlayback=function(E,x,U){var B=this,L=function(j){if(B.fragContextChanged(E)){B.warn("Fragment "+E.sn+(j.part?" p: "+j.part.index:"")+" of level "+E.level+" was dropped during download."),B.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,B._handleFragmentLoadProgress(j)};this._doFragLoad(E,x,U,L).then(function(H){if(!H)return;B.fragLoadError=0;var j=B.state;if(B.fragContextChanged(E)){(j===A.FRAG_LOADING||j===A.BACKTRACKING||!B.fragCurrent&&j===A.PARSING)&&(B.fragmentTracker.removeFragment(E),B.state=A.IDLE);return}if("payload"in H&&(B.log("Loaded fragment "+E.sn+" of level "+E.level),B.hls.trigger(n.Events.FRAG_LOADED,H),B.state===A.BACKTRACKING)){B.fragmentTracker.backtrack(E,H),B.resetFragmentLoading(E);return}B._handleFragmentLoadComplete(H)}).catch(function(H){B.warn(H),B.resetFragmentLoading(E)})},h.flushMainBuffer=function(E,x,U){if(U===void 0&&(U=null),!(E-x))return;var B={startOffset:E,endOffset:x,type:U};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,B)},h._loadInitSegment=function(E){var x=this;this._doFragLoad(E).then(function(U){if(!U||x.fragContextChanged(E)||!x.levels)throw new Error("init load aborted");return U}).then(function(U){var B=x.hls,L=U.payload,H=E.decryptdata;if(L&&L.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var j=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(L),H.key.buffer,H.iv.buffer).then(function(S){var J=self.performance.now();return B.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:S,stats:{tstart:j,tdecrypt:J}}),U.payload=S,U})}return U}).then(function(U){var B=x.fragCurrent,L=x.hls,H=x.levels;if(!H)throw new Error("init load aborted, missing levels");var j=H[E.level].details;console.assert(j,"Level details are defined when init segment is loaded");var S=E.stats;x.state=A.IDLE,x.fragLoadError=0,E.data=new Uint8Array(U.payload),S.parsing.start=S.buffering.start=self.performance.now(),S.parsing.end=S.buffering.end=self.performance.now(),U.frag===B&&L.trigger(n.Events.FRAG_BUFFERED,{stats:S,frag:B,part:null,id:E.type}),x.tick()}).catch(function(U){x.warn(U),x.resetFragmentLoading(E)})},h.fragContextChanged=function(E){var x=this.fragCurrent;return!E||!x||E.level!==x.level||E.sn!==x.sn||E.urlId!==x.urlId},h.fragBufferedComplete=function(E,x){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+l.default.toString(K.BufferHelper.getBuffered(U))),this.state=A.IDLE,this.tick()},h._handleFragmentLoadComplete=function(E){var x=this.transmuxer;if(!x)return;var U=E.frag,B=E.part,L=E.partsLoaded,H=!L||L.length===0||L.some(function(S){return!S}),j=new y.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,B?B.index:-1,!H);x.flush(j)},h._handleFragmentLoadProgress=function(E){},h._doFragLoad=function(E,x,U,B){var L=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(E.start,U||0),this.config.lowLatencyMode&&x){var H=x.partList;if(H&&B){U>E.end&&x.fragmentHint&&(E=x.fragmentHint);var j=this.getNextPart(H,E,U);if(j>-1){var S=H[j];return this.log("Loading part sn: "+E.sn+" p: "+S.index+" cc: "+E.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+j+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=S.start+S.duration,this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:H[j],targetBufferTime:U}),this.doFragPartsLoad(E,H,j,B).catch(function(J){return L.handleFragLoadError(J)})}else if(!E.url||this.loadedEndOfParts(H,U))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(U.toFixed(3))),Object(z.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:U}),this.fragmentLoader.load(E,B).catch(function(J){return L.handleFragLoadError(J)})},h.doFragPartsLoad=function(E,x,U,B){var L=this;return new Promise(function(H,j){var S=[],J=function te(se){var fe=x[se];L.fragmentLoader.loadPart(E,fe,B).then(function(Fe){S[fe.index]=Fe;var Le=Fe.part;L.hls.trigger(n.Events.FRAG_LOADED,Fe);var De=x[se+1];if(De&&De.fragment===E)te(se+1);else return H({frag:E,part:Le,partsLoaded:S})}).catch(j)};J(U)})},h.handleFragLoadError=function(E){var x=E.data;return x&&x.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(n.Events.ERROR,x),null},h._handleTransmuxerFlush=function(E){var x=this.getCurrentContext(E);if(!x||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var U=x.frag,B=x.part,L=x.level,H=self.performance.now();U.stats.parsing.end=H,B&&(B.stats.parsing.end=H),this.updateLevelTiming(U,B,L,E.partial)},h.getCurrentContext=function(E){var x=this.levels,U=E.level,B=E.sn,L=E.part;if(!x||!x[U])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+U+". The current chunk will not be buffered."),null;var H=x[U],j=L>-1?Object(s.getPartWith)(H,B,L):null,S=j?j.fragment:Object(s.getFragmentWithSN)(H,B,this.fragCurrent);return S?{frag:S,part:j,level:H}:null},h.bufferFragmentData=function(E,x,U,B){if(!E||this.state!==A.PARSING)return;var L=E.data1,H=E.data2,j=L;if(L&&H&&(j=Object(g.appendUint8Array)(L,H)),!j||!j.length)return;var S={type:E.type,frag:x,part:U,chunkMeta:B,parent:x.type,data:j};this.hls.trigger(n.Events.BUFFER_APPENDING,S),E.dropped&&E.independent&&!U&&this.flushBufferGap(x)},h.flushBufferGap=function(E){var x=this.media;if(!x)return;if(!K.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,E.start);return}var U=x.currentTime,B=K.BufferHelper.bufferInfo(x,U,0),L=E.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,L*.25),j=Math.max(Math.min(E.start-H,B.end-H),U+H);E.start-j>H&&this.flushMainBuffer(j,E.start)},h.getFwdBufferInfo=function(E,x){var U=this.config,B=this.getLoadPosition();if(!Object(z.isFiniteNumber)(B))return null;var L=K.BufferHelper.bufferInfo(E,B,U.maxBufferHole);if(L.len===0&&L.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(B,x);if(H&&L.nextStart<H.end)return K.BufferHelper.bufferInfo(E,B,Math.max(L.nextStart,U.maxBufferHole))}return L},h.getMaxBufferLength=function(E){var x=this.config,U;return E?U=Math.max(8*x.maxBufferSize/E,x.maxBufferLength):U=x.maxBufferLength,Math.min(U,x.maxMaxBufferLength)},h.reduceMaxBufferLength=function(E){var x=this.config,U=E||x.maxBufferLength;return x.maxMaxBufferLength>=U?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(E,x){var U,B,L=x.fragments,H=L.length;if(!H)return null;var j=this.config,S=L[0].start,J;if(x.live){var te=j.initialLiveManifestSize;if(H<te)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+te+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(J=this.getInitialLiveFragment(x,L),this.startPosition=J?this.hls.liveSyncPosition||J.start:E)}else E<=S&&(J=L[0]);if(!J){var se=j.lowLatencyMode?x.partEnd:x.fragmentEnd;J=this.getFragmentAtPosition(E,se,x)}return(U=J)!==null&&U!==void 0&&U.initSegment&&!((B=J)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(J=J.initSegment),J},h.getNextPart=function(E,x,U){for(var B=-1,L=!1,H=!0,j=0,S=E.length;j<S;j++){var J=E[j];if(H=H&&!J.independent,B>-1&&U<J.start)break;var te=J.loaded;!te&&(L||J.independent||H)&&J.fragment===x&&(B=j),L=te}return B},h.loadedEndOfParts=function(E,x){var U=E[E.length-1];return U&&x>U.start&&U.loaded},h.getInitialLiveFragment=function(E,x){var U=this.fragPrevious,B=null;if(U){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),B=Object(c.findFragmentByPDT)(x,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var L=U.sn+1;if(L>=E.startSN&&L<=E.endSN){var H=x[L-E.startSN];U.cc===H.cc&&(B=H,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(c.findFragWithCC)(x,U.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(B=this.getFragmentAtPosition(j,this.bitrateTest?E.fragmentEnd:E.edge,E))}return B},h.getFragmentAtPosition=function(E,x,U){var B=this.config,L=this.fragPrevious,H=U.fragments,j=U.endSN,S=U.fragmentHint,J=B.maxFragLookUpTolerance,te=!!(B.lowLatencyMode&&U.partList&&S);te&&S&&!this.bitrateTest&&(H=H.concat(S),j=S.sn);var se;if(E<x){var fe=E>x-J?0:J;se=Object(c.findFragmentByPTS)(L,H,E,fe)}else se=H[H.length-1];if(se){var Fe=se.sn-U.startSN,Le=L&&se.level===L.level,De=H[Fe+1],He=this.fragmentTracker.getState(se);if(He===k.FragmentState.BACKTRACKED){se=null;for(var We=Fe;H[We]&&this.fragmentTracker.getState(H[We])===k.FragmentState.BACKTRACKED;)L?se=H[We--]:se=H[--We];se||(se=De)}else L&&se.sn===L.sn&&!te&&(Le&&(se.sn<j&&this.fragmentTracker.getState(De)!==k.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+De.sn),se=De):se=null))}return se},h.synchronizeToLiveEdge=function(E){var x=this.config,U=this.media;if(!U)return;var B=this.hls.liveSyncPosition,L=U.currentTime,H=E.fragments[0].start,j=E.edge,S=L>=H-x.maxFragLookUpTolerance&&L<=j;if(B!==null&&U.duration>B&&(L<B||!S)){var J=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*E.targetduration;(!S&&U.readyState<4||L<j-J)&&(this.loadedmetadata||(this.nextLoadPosition=B),U.readyState&&(this.warn("Playback: "+L.toFixed(3)+" is located too far from the end of live sliding playlist: "+j+", reset currentTime to : "+B.toFixed(3)),U.currentTime=B))}},h.alignPlaylists=function(E,x){var U=this.levels,B=this.levelLastLoaded,L=this.fragPrevious,H=B!==null?U[B]:null,j=E.fragments.length;if(!j)return this.warn("No fragments in live playlist"),0;var S=E.fragments[0].start,J=!x,te=E.alignedSliding&&Object(z.isFiniteNumber)(S);if(J||!te&&!S){Object(m.alignStream)(L,H,E);var se=E.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+E.startSN+" prev-sn: "+(L?L.sn:"na")+" fragments: "+j),se}return S},h.waitForCdnTuneIn=function(E){var x=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*x)},h.setStartPosition=function(E,x){var U=this.startPosition;if(U<x&&(U=-1),U===-1||this.lastCurrentTime===-1){var B=E.startTimeOffset;Object(z.isFiniteNumber)(B)?(U=x+B,B<0&&(U+=E.totalduration),U=Math.min(Math.max(x,U),x+E.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+U),this.startPosition=U):E.live?U=this.hls.liveSyncPosition||x:this.startPosition=U=0,this.lastCurrentTime=U}this.nextLoadPosition=U},h.getLoadPosition=function(){var E=this.media,x=0;return this.loadedmetadata&&E?x=E.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},h.handleFragLoadAborted=function(E,x){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(x?" part"+x.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},h.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=A.IDLE)},h.onFragmentOrKeyLoadError=function(E,x){if(x.fatal)return;var U=x.frag;if(!U||U.type!==E)return;var B=this.fragCurrent;console.assert(B&&U.sn===B.sn&&U.level===B.level&&U.urlId===B.urlId,"Frag load error must match current frag to retry");var L=this.config;if(this.fragLoadError+1<=L.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(U.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*L.fragLoadingRetryDelay,L.fragLoadingMaxRetryTimeout);this.warn("Fragment "+U.sn+" of "+E+" "+U.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(E===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(N.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},h.afterBufferFlushed=function(E,x,U){if(!E)return;var B=K.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(x,B,U),this.state===A.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},h.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[E].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(E,x,U,B){var L=this,H=U.details;console.assert(!!H,"level.details must be defined");var j=Object.keys(E.elementaryStreams).reduce(function(S,J){var te=E.elementaryStreams[J];if(te){var se=te.endPTS-te.startPTS;if(se<=0)return L.warn("Could not parse fragment "+E.sn+" "+J+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),L.resetTransmuxer(),S||!1;var fe=B?0:Object(s.updateFragPTSDTS)(H,E,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return L.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:H,level:U,drift:fe,type:J,frag:E,start:te.startPTS,end:te.endPTS}),!0}return S},!1);j?(this.state=A.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:x})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C(p,[{key:"state",get:function(){return this._state},set:function(E){var x=this._state;x!==E&&(this._state=E,this.log(x+"->"+E))}}]),p}(I.default)},"./src/controller/buffer-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return c});var z=P("./src/polyfills/number.ts"),I=P("./src/events.ts"),k=P("./src/utils/logger.ts"),K=P("./src/errors.ts"),N=P("./src/utils/buffer-helper.ts"),n=P("./src/utils/mediasource-helper.ts"),D=P("./src/loader/fragment.ts"),y=P("./src/controller/buffer-operation-queue.ts"),g=Object(n.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function s(u){var l=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 o=l.hls,a=l.media,C=l.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),a&&(l.updateMediaElementDuration(),o.trigger(I.Events.MEDIA_ATTACHED,{media:a})),C&&C.removeEventListener("sourceopen",l._onMediaSourceOpen),l.checkPendingTracks()},this._onMediaSourceClose=function(){k.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){k.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var d=s.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var l=this.hls;l.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(I.Events.BUFFER_RESET,this.onBufferReset,this),l.on(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.on(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(I.Events.BUFFER_EOS,this.onBufferEos,this),l.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.on(I.Events.FRAG_PARSED,this.onFragParsed,this),l.on(I.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var l=this.hls;l.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(I.Events.BUFFER_RESET,this.onBufferReset,this),l.off(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.off(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(I.Events.BUFFER_EOS,this.onBufferEos,this),l.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.off(I.Events.FRAG_PARSED,this.onFragParsed,this),l.off(I.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(l,o){var a=2;(o.audio&&!o.video||!o.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(l,o){var a=this.media=o.media;if(a&&g){var C=this.mediaSource=new g;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(C),this._objectUrl=a.src}},d.onMediaDetaching=function(){var l=this.media,o=this.mediaSource,a=this._objectUrl;if(o){if(k.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(C){k.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),l&&(a&&self.URL.revokeObjectURL(a),l.src===a?(l.removeAttribute("src"),l.load()):k.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(I.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var l=this;this.getSourceBufferTypes().forEach(function(o){var a=l.sourceBuffer[o];try{a&&(l.removeBufferListeners(o),l.mediaSource&&l.mediaSource.removeSourceBuffer(a),l.sourceBuffer[o]=void 0)}catch(C){k.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",C)}}),this._initSourceBuffer()},d.onBufferCodecs=function(l,o){var a=this,C=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(w){if(C){var T=a.tracks[w];if(T&&typeof T.buffer.changeType=="function"){var R=o[w],A=R.codec,v=R.levelCodec,b=R.container,p=(T.levelCodec||T.codec).replace(m,"$1"),h=(v||A).replace(m,"$1");if(p!==h){var _=b+";codecs="+(v||A);a.appendChangeType(w,_)}}}else a.pendingTracks[w]=o[w]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(l,o){var a=this,C=this.operationQueue,w={execute:function(){var R=a.sourceBuffer[l];R&&(k.logger.log("[buffer-controller]: changing "+l+" sourceBuffer type to "+o),R.changeType(o)),C.shiftAndExecuteNext(l)},onStart:function(){},onComplete:function(){},onError:function(R){k.logger.warn("[buffer-controller]: Failed to change "+l+" SourceBuffer type",R)}};C.append(w,l)},d.onBufferAppending=function(l,o){var a=this,C=this.hls,w=this.operationQueue,T=this.tracks,R=o.data,A=o.type,v=o.frag,b=o.part,p=o.chunkMeta,h=p.buffering[A],_=self.performance.now();h.start=_;var E=v.stats.buffering,x=b?b.stats.buffering:null;E.start===0&&(E.start=_),x&&x.start===0&&(x.start=_);var U=T.audio,B=A==="audio"&&p.id===1&&(U==null?void 0:U.container)==="audio/mpeg",L={execute:function(){if(h.executeStart=self.performance.now(),B){var j=a.sourceBuffer[A];if(j){var S=v.start-j.timestampOffset;Math.abs(S)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+S+") sn: "+v.sn+")"),j.timestampOffset=v.start)}}a.appendExecutor(R,A)},onStart:function(){},onComplete:function(){var j=self.performance.now();h.executeEnd=h.end=j,E.first===0&&(E.first=j),x&&x.first===0&&(x.first=j);var S=a.sourceBuffer,J={};for(var te in S)J[te]=N.BufferHelper.getBuffered(S[te]);a.appendError=0,a.hls.trigger(I.Events.BUFFER_APPENDED,{type:A,frag:v,part:b,chunkMeta:p,parent:v.type,timeRanges:J})},onError:function(j){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",j);var S={type:K.ErrorTypes.MEDIA_ERROR,parent:v.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?S.details=K.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,S.details=K.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>C.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),S.fatal=!0)),C.trigger(I.Events.ERROR,S)}};w.append(L,A)},d.onBufferFlushing=function(l,o){var a=this,C=this.operationQueue,w=function(R){return{execute:a.removeExecutor.bind(a,R,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(I.Events.BUFFER_FLUSHED,{type:R})},onError:function(v){k.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",v)}}};o.type?C.append(w(o.type),o.type):this.getSourceBufferTypes().forEach(function(T){C.append(w(T),T)})},d.onFragParsed=function(l,o){var a=this,C=o.frag,w=o.part,T=[],R=w?w.elementaryStreams:C.elementaryStreams;R[D.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(R[D.ElementaryStreamTypes.AUDIO]&&T.push("audio"),R[D.ElementaryStreamTypes.VIDEO]&&T.push("video"));var A=function(){var b=self.performance.now();C.stats.buffering.end=b,w&&(w.stats.buffering.end=b);var p=w?w.stats:C.stats;a.hls.trigger(I.Events.FRAG_BUFFERED,{frag:C,part:w,stats:p,id:C.type})};T.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(A,T)},d.onFragChanged=function(l,o){this.flushBackBuffer()},d.onBufferEos=function(l,o){var a=this,C=this.getSourceBufferTypes().reduce(function(w,T){var R=a.sourceBuffer[T];return(!o.type||o.type===T)&&(R&&!R.ended&&(R.ended=!0,k.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),w&&!!(!R||R.ended)},!0);C&&this.blockBuffers(function(){var w=a.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},d.onLevelUpdated=function(l,o){var a=o.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var l=this.hls,o=this.details,a=this.media,C=this.sourceBuffer;if(!a||o===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var T=o.live&&l.config.liveBackBufferLength!==null?l.config.liveBackBufferLength:l.config.backBufferLength;if(!Object(z.isFiniteNumber)(T)||T<0)return;var R=a.currentTime,A=o.levelTargetDuration,v=Math.max(T,A),b=Math.floor(R/A)*A-v;w.forEach(function(p){var h=C[p];if(h){var _=N.BufferHelper.getBuffered(h);_.length>0&&b>_.start(0)&&(l.trigger(I.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),o.live&&l.trigger(I.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),l.trigger(I.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 l=this.details,o=this.hls,a=this.media,C=this.mediaSource,w=l.fragments[0].start+l.totalduration,T=a.duration,R=Object(z.isFiniteNumber)(C.duration)?C.duration:0;l.live&&o.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(l)):(w>R&&w>T||!Object(z.isFiniteNumber)(T))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),C.duration=w)},d.updateSeekableRange=function(l){var o=this.mediaSource,a=l.fragments,C=a.length;if(C&&l.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var w=Math.max(0,a[0].start),T=Math.max(w,w+l.totalduration);o.setLiveSeekableRange(w,T)}},d.checkPendingTracks=function(){var l=this.bufferCodecEventsExpected,o=this.operationQueue,a=this.pendingTracks,C=Object.keys(a).length;if(C&&!l||C===2){this.createSourceBuffers(a),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(T){o.executeNext(T)})}},d.createSourceBuffers=function(l){var o=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var w in l)if(!o[w]){var T=l[w];if(!T)throw Error("source buffer exists for track "+w+", however track does not");var R=T.levelCodec||T.codec,A=T.container+";codecs="+R;k.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var v=o[w]=a.addSourceBuffer(A),b=w;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[w]={buffer:v,codec:R,container:T.container,levelCodec:T.levelCodec,id:T.id},C++}catch(p){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+p.message),this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,mimeType:A})}}C&&this.hls.trigger(I.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(l){var o=this.operationQueue,a=o.current(l);a.onStart()},d._onSBUpdateEnd=function(l){var o=this.operationQueue,a=o.current(l);a.onComplete(),o.shiftAndExecuteNext(l)},d._onSBUpdateError=function(l,o){k.logger.error("[buffer-controller]: "+l+" SourceBuffer error",o),this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(l);a&&a.onError(o)},d.removeExecutor=function(l,o,a){var C=this.media,w=this.mediaSource,T=this.operationQueue,R=this.sourceBuffer,A=R[l];if(!C||!w||!A){k.logger.warn("[buffer-controller]: Attempting to remove from the "+l+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(l);return}var v=Object(z.isFiniteNumber)(C.duration)?C.duration:Infinity,b=Object(z.isFiniteNumber)(w.duration)?w.duration:Infinity,p=Math.max(0,o),h=Math.min(a,v,b);h>p?(k.logger.log("[buffer-controller]: Removing ["+p+","+h+"] from the "+l+" SourceBuffer"),console.assert(!A.updating,l+" sourceBuffer must not be updating"),A.remove(p,h)):T.shiftAndExecuteNext(l)},d.appendExecutor=function(l,o){var a=this.operationQueue,C=this.sourceBuffer,w=C[o];if(!w){k.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(o);return}w.ended=!1,console.assert(!w.updating,o+" sourceBuffer must not be updating"),w.appendBuffer(l)},d.blockBuffers=function(l,o){var a=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(l);return}var C=this.operationQueue,w=o.map(function(T){return C.appendBlocker(T)});Promise.all(w).then(function(){l(),o.forEach(function(T){var R=a.sourceBuffer[T];(!R||!R.updating)&&C.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(l,o,a){var C=this.sourceBuffer[l];if(!C)return;var w=a.bind(this,l);this.listeners[l].push({event:o,listener:w}),C.addEventListener(o,w)},d.removeBufferListeners=function(l){var o=this.sourceBuffer[l];if(!o)return;this.listeners[l].forEach(function(a){o.removeEventListener(a.event,a.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return I});var z=P("./src/utils/logger.ts"),I=function(){function k(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var K=k.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(m){D=m}),g={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,n),y},K.executeNext=function(n){var D=this.buffers,y=this.queues,g=D[n],m=y[n];if(m.length){var c=m[0];try{c.execute()}catch(s){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(s),(!g||!g.updating)&&(m.shift(),this.executeNext(n))}}},K.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},K.current=function(n){return this.queues[n][0]},k}()},"./src/controller/cap-level-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/events.ts");function I(N,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(N,y.key,y)}}function k(N,n,D){return n&&I(N.prototype,n),D&&I(N,D),N}var K=function(){function N(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=N.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(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var y=this.hls;y.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(y,g){N.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},n.onMediaAttaching=function(y,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},n.onManifestParsed=function(y,g){var m=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,m.config.capLevelToPlayerSize&&g.video&&this.startCapping()},n.onBufferCodecs=function(y,g){var m=this.hls;m.config.capLevelToPlayerSize&&g.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 g=this.hls;g.autoLevelCapping=this.getMaxLevel(y.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},n.getMaxLevel=function(y){var g=this,m=this.hls.levels;if(!m.length)return-1;var c=m.filter(function(s,d){return N.isLevelAllowed(d,g.restrictedLevels)&&d<=y});return this.clientRect=null,N.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,g={width:0,height:0};if(y){var m=y.getBoundingClientRect();g.width=m.width,g.height=m.height,!g.width&&!g.height&&(g.width=m.right-m.left||y.width||0,g.height=m.bottom-m.top||y.height||0)}return this.clientRect=g,g},N.isLevelAllowed=function(y,g){return g===void 0&&(g=[]),g.indexOf(y)===-1},N.getMaxLevelByMediaSize=function(y,g,m){if(!y||!y.length)return-1;for(var c=function(o,a){return a?o.width!==a.width||o.height!==a.height:!0},s=y.length-1,d=0;d<y.length;d+=1){var u=y[d];if((u.width>=g||u.height>=m)&&c(u,y[d+1])){s=d;break}}return s},k(N,[{key:"mediaWidth",get:function(){return this.getDimensions().width*N.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*N.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(g){}return y}}]),N}();V.default=K},"./src/controller/cmcd-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return c});var z=P("./src/events.ts"),I=P("./src/types/cmcd.ts"),k=P("./src/utils/buffer-helper.ts"),K=P("./src/utils/logger.ts");function N(s,d){for(var u=0;u<d.length;u++){var l=d[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(s,l.key,l)}}function n(s,d,u){return d&&N(s.prototype,d),u&&N(s,u),s}function D(s,d){var u=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(u)return(u=u.call(s)).next.bind(u);if(Array.isArray(s)||(u=y(s))||d&&s&&typeof s.length=="number"){u&&(s=u);var l=0;return function(){return l>=s.length?{done:!0}:{done:!1,value:s[l++]}}}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(s,d){if(!s)return;if(typeof s=="string")return g(s,d);var u=Object.prototype.toString.call(s).slice(8,-1);if(u==="Object"&&s.constructor&&(u=s.constructor.name),u==="Map"||u==="Set")return Array.from(s);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return g(s,d)}function g(s,d){(d==null||d>s.length)&&(d=s.length);for(var u=0,l=new Array(d);u<d;u++)l[u]=s[u];return l}function m(){return m=Object.assign||function(s){for(var d=1;d<arguments.length;d++){var u=arguments[d];for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(s[l]=u[l])}return s},m.apply(this,arguments)}var c=function(){function s(u){var l=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(){l.initialized&&(l.starved=!0),l.buffering=!0},this.onPlaying=function(){l.initialized||(l.initialized=!0),l.buffering=!1},this.applyPlaylistData=function(C){try{l.apply(C,{ot:I.CMCDObjectType.MANIFEST,su:!l.initialized})}catch(w){K.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(C){try{var w=C.frag,T=l.hls.levels[w.level],R=l.getObjectType(w),A={d:w.duration*1e3,ot:R};(R===I.CMCDObjectType.VIDEO||R===I.CMCDObjectType.AUDIO||R==I.CMCDObjectType.MUXED)&&(A.br=T.bitrate/1e3,A.tb=l.getTopBandwidth(R),A.bl=l.getBufferLength(R)),l.apply(C,A)}catch(v){K.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=u;var o=this.config=u.config,a=o.cmcd;a!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||s.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var d=s.prototype;return d.registerListeners=function(){var l=this.hls;l.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.off(z.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(l,o){this.media=o.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(l,o){var a,C;this.audioBuffer=(a=o.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(C=o.tracks.video)===null||C===void 0?void 0:C.buffer},d.createData=function(){var l;return{v:I.CMCDVersion,sf:I.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(l=this.media)===null||l===void 0?void 0:l.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(l,o){o===void 0&&(o={}),m(o,this.createData());var a=o.ot===I.CMCDObjectType.INIT||o.ot===I.CMCDObjectType.VIDEO||o.ot===I.CMCDObjectType.MUXED;if(this.starved&&a&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var C=s.toHeaders(o);if(!Object.keys(C).length)return;l.headers||(l.headers={}),m(l.headers,C)}else{var w=s.toQuery(o);if(!w)return;l.url=s.appendQueryToUri(l.url,w)}},d.getObjectType=function(l){var o=l.type;return o==="subtitle"?I.CMCDObjectType.TIMED_TEXT:l.sn==="initSegment"?I.CMCDObjectType.INIT:o==="audio"?I.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?I.CMCDObjectType.VIDEO:I.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(l){for(var o=0,a=l===I.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,C=D(a),w;!(w=C()).done;){var T=w.value;T.bitrate>o&&(o=T.bitrate)}return o>0?o:NaN},d.getBufferLength=function(l){var o=this.hls.media,a=l===I.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!o)return NaN;var C=k.BufferHelper.bufferInfo(a,o.currentTime,this.config.maxBufferHole);return C.len*1e3},d.createPlaylistLoader=function(){var l=this.config.pLoader,o=this.applyPlaylistData,a=l||this.config.loader;return function(){function C(T){this.loader=void 0,this.loader=new a(T)}var w=C.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(R,A,v){o(R),this.loader.load(R,A,v)},n(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},d.createFragmentLoader=function(){var l=this.config.fLoader,o=this.applyFragmentData,a=l||this.config.loader;return function(){function C(T){this.loader=void 0,this.loader=new a(T)}var w=C.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(R,A,v){o(R),this.loader.load(R,A,v)},n(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},s.uuid=function(){var l=URL.createObjectURL(new Blob),o=l.toString();return URL.revokeObjectURL(l),o.substr(o.lastIndexOf("/")+1)},s.serialize=function(l){for(var o=[],a=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},C=function(B){return Math.round(B)},w=function(B){return C(B/100)*100},T=function(B){return encodeURIComponent(B)},R={br:C,d:C,bl:w,dl:w,mtp:w,nor:T,rtp:w,tb:C},A=Object.keys(l||{}).sort(),v=D(A),b;!(b=v()).done;){var p=b.value,h=l[p];if(!a(h))continue;if(p==="v"&&h===1)continue;if(p=="pr"&&h===1)continue;var _=R[p];_&&(h=_(h));var E=typeof h,x=void 0;p==="ot"||p==="sf"||p==="st"?x=p+"="+h:E==="boolean"?x=p:E==="number"?x=p+"="+h:x=p+"="+JSON.stringify(h),o.push(x)}return o.join(",")},s.toHeaders=function(l){for(var o=Object.keys(l),a={},C=["Object","Request","Session","Status"],w=[{},{},{},{}],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},R=0,A=o;R<A.length;R++){var v=A[R],b=T[v]!=null?T[v]:1;w[b][v]=l[v]}for(var p=0;p<w.length;p++){var h=s.serialize(w[p]);h&&(a["CMCD-"+C[p]]=h)}return a},s.toQuery=function(l){return"CMCD="+encodeURIComponent(s.serialize(l))},s.appendQueryToUri=function(l,o){if(!o)return l;var a=l.includes("?")?"&":"?";return""+l+a+o},s}()},"./src/controller/eme-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/events.ts"),I=P("./src/errors.ts"),k=P("./src/utils/logger.ts"),K=P("./src/utils/mediakeys-helper.ts");function N(c,s){for(var d=0;d<s.length;d++){var u=s[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}function n(c,s,d){return s&&N(c.prototype,s),d&&N(c,d),c}var D=3,y=function(s,d,u){var l={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(o){l.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:u.audioRobustness||""})}),d.forEach(function(o){l.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:u.videoRobustness||""})}),[l]},g=function(s,d,u,l){switch(s){case K.KeySystems.WIDEVINE:return y(d,u,l);default:throw new Error("Unknown key-system: "+s)}},m=function(){function c(d){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=d,this._config=d.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var s=c.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(u){switch(u){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},s._attemptKeySystemAccess=function(u,l,o){var a=this,C=g(u,l,o,this._drmSystemOptions);k.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(u,C);this.mediaKeysPromise=w.then(function(T){return a._onMediaKeySystemAccessObtained(u,T)}),w.catch(function(T){k.logger.error('Failed to obtain key-system "'+u+'" access:',T)})},s._onMediaKeySystemAccessObtained=function(u,l){var o=this;k.logger.log('Access for key-system "'+u+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:l,mediaKeySystemDomain:u};this._mediaKeysList.push(a);var C=Promise.resolve().then(function(){return l.createMediaKeys()}).then(function(w){return a.mediaKeys=w,k.logger.log('Media-keys created for key-system "'+u+'"'),o._onMediaKeysCreated(),w});return C.catch(function(w){k.logger.error("Failed to create media-keys:",w)}),C},s._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(l){l.mediaKeysSession||(l.mediaKeysSession=l.mediaKeys.createSession(),u._onNewMediaKeySession(l.mediaKeysSession))})},s._onNewMediaKeySession=function(u){var l=this;k.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(o){l._onKeySessionMessage(u,o.message)},!1)},s._onKeySessionMessage=function(u,l){k.logger.log("Got EME message event, creating license request"),this._requestLicense(l,function(o){k.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),u.update(o)})},s.onMediaEncrypted=function(u){var l=this;if(k.logger.log('Media is encrypted using "'+u.initDataType+'" init data type'),!this.mediaKeysPromise){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(C){if(!l._media)return;l._attemptSetMediaKeys(C),l._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(o).catch(o)},s._attemptSetMediaKeys=function(u){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var l=this._mediaKeysList[0];if(!l||!l.mediaKeys){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}k.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(l.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(u,l){var o=this,a=this._mediaKeysList[0];if(!a){k.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){k.logger.warn("Key-Session already initialized but requested again");return}var C=a.mediaKeysSession;if(!C){k.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!l){k.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}k.logger.log('Generating key-session request for "'+u+'" init data type'),a.mediaKeysSessionInitialized=!0,C.generateRequest(u,l).then(function(){k.logger.debug("Key-session generation succeeded")}).catch(function(w){k.logger.error("Error generating key-session request:",w),o.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(u,l,o){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,u,l,o);var C=this._licenseXhrSetup;if(C)try{C.call(this.hls,a,u),C=void 0}catch(w){k.logger.error(w)}try{a.readyState||a.open("POST",u,!0),C&&C.call(this.hls,a,u)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return a},s._onLicenseRequestReadyStageChange=function(u,l,o,a){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,k.logger.log("License request succeeded");var C=u.response,w=this._licenseResponseCallback;if(w)try{C=w.call(this.hls,u,l)}catch(R){k.logger.error(R)}a(C)}else{if(k.logger.error("License Request XHR failed ("+l+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=D-this._requestLicenseFailureCount+1;k.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(o,a)}break}},s._generateLicenseRequestChallenge=function(u,l){switch(u.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return l}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},s._requestLicense=function(u,l){k.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){k.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(o.mediaKeySystemDomain),C=this._createLicenseXhr(a,u,l);k.logger.log("Sending license request to URL: "+a);var w=this._generateLicenseRequestChallenge(o,u);C.send(w)}catch(T){k.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(u,l){if(!this._emeEnabled)return;var o=l.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var u=this._media,l=this._mediaKeysList;if(!u)return;u.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(l.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return u.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(u,l){if(!this._emeEnabled)return;var o=l.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),a=l.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,o,a)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();V.default=m},"./src/controller/fps-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/events.ts"),I=P("./src/utils/logger.ts"),k=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 N=K.prototype;return N.setStreamController=function(D){this.streamController=D},N.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(D,y){var g=this.hls.config;if(g.capLevelOnFPSDrop){var m=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(D,y,g){var m=performance.now();if(y){if(this.lastTime){var c=m-this.lastTime,s=g-this.lastDroppedFrames,d=y-this.lastDecodedFrames,u=1e3*s/c,l=this.hls;if(l.trigger(z.Events.FPS_DROP,{currentDropped:s,currentDecoded:d,totalDroppedFrames:g}),u>0&&s>l.config.fpsDroppedMonitoringThreshold*d){var o=l.currentLevel;I.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=o)&&(o=o-1,l.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:l.currentLevel}),l.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=g,this.lastDecodedFrames=y}},N.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}();V.default=k},"./src/controller/fragment-finders.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"findFragmentByPDT",function(){return k}),P.d(V,"findFragmentByPTS",function(){return K}),P.d(V,"fragmentWithinToleranceTest",function(){return N}),P.d(V,"pdtWithinToleranceTest",function(){return n}),P.d(V,"findFragWithCC",function(){return D});var z=P("./src/polyfills/number.ts"),I=P("./src/utils/binary-search.ts");function k(y,g,m){if(g===null||!Array.isArray(y)||!y.length||!Object(z.isFiniteNumber)(g))return null;var c=y[0].programDateTime;if(g<(c||0))return null;var s=y[y.length-1].endProgramDateTime;if(g>=(s||0))return null;m=m||0;for(var d=0;d<y.length;++d){var u=y[d];if(n(g,m,u))return u}return null}function K(y,g,m,c){m===void 0&&(m=0),c===void 0&&(c=0);var s=null;if(y?s=g[y.sn-g[0].sn+1]||null:m===0&&g[0].start===0&&(s=g[0]),s&&N(m,c,s)===0)return s;var d=I.default.search(g,N.bind(null,m,c));return d||s}function N(y,g,m){y===void 0&&(y=0),g===void 0&&(g=0);var c=Math.min(g,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-c<=y?1:m.start-c>y&&m.start?-1:0}function n(y,g,m){var c=Math.min(g,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,s=m.endProgramDateTime||0;return s-c>y}function D(y,g){return I.default.search(y,function(m){return m.cc<g?1:m.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"FragmentState",function(){return k}),P.d(V,"FragmentTracker",function(){return K});var z=P("./src/events.ts"),I=P("./src/types/loader.ts"),k;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(k||(k={}));var K=function(){function D(g){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=g,this._registerListeners()}var y=D.prototype;return y._registerListeners=function(){var m=this.hls;m.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var m=this.hls;m.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(m,c){if(c===I.PlaylistLevelType.MAIN){var s=this.activeFragment,d=this.activeParts;if(!s)return null;if(d)for(var u=d.length;u--;){var l=d[u],o=l?l.end:s.appendedPTS;if(l.start<=m&&o!==void 0&&m<=o)return u>9&&(this.activeParts=d.slice(u-9)),l}else if(s.start<=m&&s.appendedPTS!==void 0&&m<=s.appendedPTS)return s}return this.getBufferedFrag(m,c)},y.getBufferedFrag=function(m,c){for(var s=this.fragments,d=Object.keys(s),u=d.length;u--;){var l=s[d[u]];if((l==null?void 0:l.body.type)===c&&l.buffered){var o=l.body;if(o.start<=m&&m<=o.end)return o}}return null},y.detectEvictedFragments=function(m,c,s){var d=this;Object.keys(this.fragments).forEach(function(u){var l=d.fragments[u];if(!l)return;if(!l.buffered){l.body.type===s&&d.removeFragment(l.body);return}var o=l.range[m];if(!o)return;o.time.some(function(a){var C=!d.isTimeBuffered(a.startPTS,a.endPTS,c);return C&&d.removeFragment(l.body),C})})},y.detectPartialFragments=function(m){var c=this,s=this.timeRanges,d=m.frag,u=m.part;if(!s||d.sn==="initSegment")return;var l=n(d),o=this.fragments[l];if(!o)return;Object.keys(s).forEach(function(a){var C=d.elementaryStreams[a];if(!C)return;var w=s[a],T=u!==null||C.partial===!0;o.range[a]=c.getBufferedTimes(d,u,T,w)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},y.fragBuffered=function(m){var c=n(m),s=this.fragments[c];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},y.getBufferedTimes=function(m,c,s,d){for(var u={time:[],partial:s},l=c?c.start:m.start,o=c?c.end:m.end,a=m.minEndPTS||o,C=m.maxStartPTS||l,w=0;w<d.length;w++){var T=d.start(w)-this.bufferPadding,R=d.end(w)+this.bufferPadding;if(C>=T&&a<=R){u.time.push({startPTS:Math.max(l,d.start(w)),endPTS:Math.min(o,d.end(w))});break}else if(l<R&&o>T)u.partial=!0,u.time.push({startPTS:Math.max(l,d.start(w)),endPTS:Math.min(o,d.end(w))});else if(o<=T)break}return u},y.getPartialFragment=function(m){var c=null,s,d,u,l=0,o=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(C){var w=a[C];if(!w)return;N(w)&&(d=w.body.start-o,u=w.body.end+o,m>=d&&m<=u&&(s=Math.min(m-d,u-m),l<=s&&(c=w.body,l=s)))}),c},y.getState=function(m){var c=n(m),s=this.fragments[c];return s?s.buffered?N(s)?k.PARTIAL:k.OK:s.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},y.backtrack=function(m,c){var s=n(m),d=this.fragments[s];if(!d||d.backtrack)return null;var u=d.backtrack=c||d.loaded;return d.loaded=null,u},y.getBacktrackData=function(m){var c=n(m),s=this.fragments[c];if(s){var d,u=s.backtrack;if(u!=null&&(d=u.payload)!==null&&d!==void 0&&d.byteLength)return u;this.removeFragment(m)}return null},y.isTimeBuffered=function(m,c,s){for(var d,u,l=0;l<s.length;l++){if(d=s.start(l)-this.bufferPadding,u=s.end(l)+this.bufferPadding,m>=d&&c<=u)return!0;if(c<=d)return!1}return!1},y.onFragLoaded=function(m,c){var s=c.frag,d=c.part;if(s.sn==="initSegment"||s.bitrateTest||d)return;var u=n(s);this.fragments[u]={body:s,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(m,c){var s=this,d=c.frag,u=c.part,l=c.timeRanges;if(d.type===I.PlaylistLevelType.MAIN)if(this.activeFragment=d,u){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(u)}else this.activeParts=null;this.timeRanges=l,Object.keys(l).forEach(function(a){var C=l[a];if(s.detectEvictedFragments(a,C),!u)for(var w=0;w<C.length;w++)d.appendedPTS=Math.max(C.end(w),d.appendedPTS||0)})},y.onFragBuffered=function(m,c){this.detectPartialFragments(c)},y.hasFragment=function(m){var c=n(m);return!!this.fragments[c]},y.removeFragmentsInRange=function(m,c,s){var d=this;Object.keys(this.fragments).forEach(function(u){var l=d.fragments[u];if(!l)return;if(l.buffered){var o=l.body;o.type===s&&o.start<c&&o.end>m&&d.removeFragment(o)}})},y.removeFragment=function(m){var c=n(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[c]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function N(D){var y,g;return D.buffered&&(((y=D.range.video)===null||y===void 0?void 0:y.partial)||((g=D.range.audio)===null||g===void 0?void 0:g.partial))}function n(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"STALL_MINIMUM_DURATION_MS",function(){return N}),P.d(V,"MAX_START_GAP_JUMP",function(){return n}),P.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),P.d(V,"SKIP_BUFFER_RANGE_START",function(){return y}),P.d(V,"default",function(){return g});var z=P("./src/utils/buffer-helper.ts"),I=P("./src/errors.ts"),k=P("./src/events.ts"),K=P("./src/utils/logger.ts"),N=250,n=2,D=.1,y=.05,g=function(){function m(s,d,u,l){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=d,this.fragmentTracker=u,this.hls=l}var c=m.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(d){var u=this.config,l=this.media,o=this.stalled,a=l.currentTime,C=l.seeking,w=this.seeking&&!C,T=!this.seeking&&C;if(this.seeking=C,a!==d){if(this.moved=!0,o!==null){if(this.stallReported){var R=self.performance.now()-o;K.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||w)&&(this.stalled=null),l.paused||l.ended||l.playbackRate===0||!z.BufferHelper.getBuffered(l).length)return;var A=z.BufferHelper.bufferInfo(l,a,0),v=A.len>0,b=A.nextStart||0;if(!v&&!b)return;if(C){var p=A.len>n,h=!b||b-a>n&&!this.fragmentTracker.getPartialFragment(a);if(p||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,E=Math.max(b,A.start||0)-a,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=x==null||((_=x.details)===null||_===void 0)?void 0:_.live,B=U?x.details.targetduration*2:n;if(E>0&&E<=B){this._trySkipBufferHole(null);return}}var L=self.performance.now();if(o===null){this.stalled=L;return}var H=L-o;!C&&H>=N&&this._reportStall(A.len);var j=z.BufferHelper.bufferInfo(l,a,u.maxBufferHole);this._tryFixBufferStall(j,H)},c._tryFixBufferStall=function(d,u){var l=this.config,o=this.fragmentTracker,a=this.media,C=a.currentTime,w=o.getPartialFragment(C);if(w){var T=this._trySkipBufferHole(w);if(T)return}d.len>l.maxBufferHole&&u>l.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(d){var u=this.hls,l=this.media,o=this.stallReported;o||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+l.currentTime+" due to low buffer (buffer="+d+")"),u.trigger(k.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var u=this.config,l=this.hls,o=this.media,a=o.currentTime,C=0,w=z.BufferHelper.getBuffered(o),T=0;T<w.length;T++){var R=w.start(T);if(a+u.maxBufferHole>=C&&a<R){var A=Math.max(R+y,o.currentTime+D);return K.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+A),this.moved=!0,this.stalled=null,o.currentTime=A,d&&l.trigger(k.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+A,frag:d}),A}C=w.end(T)}return 0},c._tryNudgeBuffer=function(){var d=this.config,u=this.hls,l=this.media,o=l.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<d.nudgeMaxRetry){var C=o+a*d.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+o+" to "+C),l.currentTime=C,u.trigger(k.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+d.nudgeMaxRetry+" nudges"),u.trigger(k.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/events.ts"),I=P("./src/utils/texttrack-utils.ts"),k=P("./src/demux/id3.ts"),K=.25,N=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 g=this.hls;g.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var g=this.hls;g.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(g,m){this.media=m.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(I.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(g){if(!this.media)return;for(var m=0;m<g.length;m++){var c=g[m];if(c.kind==="metadata"&&c.label==="id3")return Object(I.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(g,m){if(!this.media)return;var c=m.frag,s=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<s.length;u++){var l=k.getID3Frames(s[u].data);if(l){var o=s[u].pts,a=u<s.length-1?s[u+1].pts:c.end,C=a-o;C<=0&&(a=o+K);for(var w=0;w<l.length;w++){var T=l[w];if(!k.isTimeStampFrame(T)){var R=new d(o,a,"");R.value=T,this.id3Track.addCue(R)}}}}},D.onBufferFlushing=function(g,m){var c=m.startOffset,s=m.endOffset,d=m.type;if(!d||d==="audio"){var u=this.id3Track;u&&Object(I.removeCuesInRange)(u,c,s)}},n}();V.default=N},"./src/controller/latency-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n});var z=P("./src/errors.ts"),I=P("./src/events.ts"),k=P("./src/utils/logger.ts");function K(D,y){for(var g=0;g<y.length;g++){var m=y[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function N(D,y,g){return y&&K(D.prototype,y),g&&K(D,g),D}var n=function(){function D(g){var m=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 m.timeupdate()},this.hls=g,this.config=g.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(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(I.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(I.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(I.Events.ERROR,this.onError)},y.onMediaAttached=function(m,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(m,c){var s=c.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(m,c){if(c.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,k.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var m=this.media,c=this.levelDetails;if(!m||!c)return;this.currentTime=m.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var d=this.config,u=d.lowLatencyMode,l=d.maxLiveSyncPlaybackRate;if(!u||l===1)return;var o=this.targetLatency;if(o===null)return;var a=s-o,C=Math.min(this.maxLatency,o+c.targetduration),w=a<C;if(c.live&&w&&a>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,l)),R=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;m.playbackRate=Math.min(T,Math.max(1,R))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},y.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},y.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},N(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,c=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:c?m.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var c=m.holdBack,s=m.partHoldBack,d=m.targetduration,u=this.config,l=u.liveSyncDuration,o=u.liveSyncDurationCount,a=u.lowLatencyMode,C=this.hls.userConfig,w=a&&s||c;(C.liveSyncDuration||C.liveSyncDurationCount||w===0)&&(w=l!==void 0?l:o*d);var T=d,R=1;return w+Math.min(this.stallCount*R,T)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),c=this.targetLatency,s=this.levelDetails;if(m===null||c===null||s===null)return null;var d=s.edge,u=m-c-this.edgeStalled,l=d-s.totalduration,o=d-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(l,u),o)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var c=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-c,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,c=this.levelDetails;if(!m||!c)return 0;var s=m.buffered.length;return s?m.buffered.end(s-1):c.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return u});var z=P("./src/types/level.ts"),I=P("./src/events.ts"),k=P("./src/errors.ts"),K=P("./src/utils/codecs.ts"),N=P("./src/controller/level-helper.ts"),n=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function y(){return y=Object.assign||function(l){for(var o=1;o<arguments.length;o++){var a=arguments[o];for(var C in a)Object.prototype.hasOwnProperty.call(a,C)&&(l[C]=a[C])}return l},y.apply(this,arguments)}function g(l,o){for(var a=0;a<o.length;a++){var C=o[a];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(l,C.key,C)}}function m(l,o,a){return o&&g(l.prototype,o),a&&g(l,a),l}function c(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,s(l,o)}function s(l,o){return s=Object.setPrototypeOf||function(C,w){return C.__proto__=w,C},s(l,o)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(l){c(o,l);function o(C){var w;return w=l.call(this,C,"[level-controller]")||this,w._levels=[],w._firstLevel=-1,w._startLevel=void 0,w.currentLevelIndex=-1,w.manualLevelIndex=-1,w.onParsedComplete=void 0,w._registerListeners(),w}var a=o.prototype;return a._registerListeners=function(){var w=this.hls;w.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(I.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var w=this.hls;w.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(I.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,l.prototype.destroy.call(this)},a.startLoad=function(){var w=this._levels;w.forEach(function(T){T.loadError=0}),l.prototype.startLoad.call(this)},a.onManifestLoaded=function(w,T){var R=[],A=[],v=[],b,p={},h,_=!1,E=!1,x=!1;if(T.levels.forEach(function(H){var j=H.attrs;_=_||!!(H.width&&H.height),E=E||!!H.videoCodec,x=x||!!H.audioCodec,d&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var S=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;h=p[S],h?h.url.push(H.url):(h=new z.Level(H),p[S]=h,R.push(h)),j&&(j.AUDIO&&Object(N.addGroupId)(h,"audio",j.AUDIO),j.SUBTITLES&&Object(N.addGroupId)(h,"text",j.SUBTITLES))}),(_||E)&&x&&(R=R.filter(function(H){var j=H.videoCodec,S=H.width,J=H.height;return!!j||!!(S&&J)})),R=R.filter(function(H){var j=H.audioCodec,S=H.videoCodec;return(!j||Object(K.isCodecSupportedInMp4)(j,"audio"))&&(!S||Object(K.isCodecSupportedInMp4)(S,"video"))}),T.audioTracks&&(A=T.audioTracks.filter(function(H){return!H.audioCodec||Object(K.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(A)),T.subtitles&&(v=T.subtitles,Object(N.assignTrackIdsByGroup)(v)),R.length>0){b=R[0].bitrate,R.sort(function(H,j){return H.bitrate-j.bitrate}),this._levels=R;for(var U=0;U<R.length;U++)if(R[U].bitrate===b){this._firstLevel=U,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+b);break}var B=x&&!E,L={levels:R,audioTracks:A,subtitleTracks:v,firstLevel:this._firstLevel,stats:T.stats,audio:x,video:E,altAudio:!B&&A.some(function(H){return!!H.url})};this.hls.trigger(I.Events.MANIFEST_PARSED,L),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(I.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(w,T){if(l.prototype.onError.call(this,w,T),T.fatal)return;var R=T.context,A=this._levels[this.currentLevelIndex];if(R&&(R.type===D.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&R.groupId===A.audioGroupIds[A.urlId]||R.type===D.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&R.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,b=!0,p;switch(T.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:case k.ErrorDetails.KEY_LOAD_ERROR:case k.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 k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(b=!1),p=R.level),v=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:p=T.level,v=!0;break}p!==void 0&&this.recoverLevel(T,p,v,b)},a.recoverLevel=function(w,T,R,A){var v=w.details,b=this._levels[T];if(b.loadError++,R){var p=this.retryLoadingOrFail(w);if(p)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var h=b.url.length;if(h>1&&b.loadError<h)w.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var _=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(v+": switch to "+_),w.levelRetry=!0,this.hls.nextAutoLevel=_)}}},a.redundantFailover=function(w){var T=this._levels[w],R=T.url.length;if(R>1){var A=(T.urlId+1)%R;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(v){v.urlId=A}),this.level=w}},a.onFragLoaded=function(w,T){var R=T.frag;if(R!==void 0&&R.type===D.PlaylistLevelType.MAIN){var A=this._levels[R.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},a.onLevelLoaded=function(w,T){var R,A=T.level,v=T.details,b=this._levels[A];if(!b){var p;this.warn("Invalid level index "+A),(p=T.deliveryDirectives)!==null&&p!==void 0&&p.skip&&(v.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(A,T,b.details)):(R=T.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(v.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(w,T){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var A=-1,v=this.hls.audioTracks[T.id].groupId,b=0;b<R.audioGroupIds.length;b++)if(R.audioGroupIds[b]===v){A=b;break}A!==R.urlId&&(R.urlId=A,this.startLoad())}},a.loadPlaylist=function(w){var T=this.currentLevelIndex,R=this._levels[T];if(this.canLoad&&R&&R.url.length>0){var A=R.urlId,v=R.url[A];if(w)try{v=w.addDirectives(v)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+T+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+A+" "+v),this.clearTimer(),this.hls.trigger(I.Events.LEVEL_LOADING,{url:v,level:T,id:A,deliveryDirectives:w||null})}},a.removeLevel=function(w,T){var R=function(b,p){return p!==T},A=this._levels.filter(function(v,b){return b!==w?!0:v.url.length>1&&T!==void 0?(v.url=v.url.filter(R),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(R)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(R)),v.urlId=0,!0):!1}).map(function(v,b){var p=v.details;return p!=null&&p.fragments&&p.fragments.forEach(function(h){h.level=b}),v});this._levels=A,this.hls.trigger(I.Events.LEVELS_UPDATED,{levels:A})},m(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var T,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===w&&(T=R[w])!==null&&T!==void 0&&T.details)return;if(w<0||w>=R.length){var A=w<0;if(this.hls.trigger(I.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:A,reason:"invalid level idx"}),A)return;w=Math.min(w,R.length-1)}this.clearTimer();var v=this.currentLevelIndex,b=R[v],p=R[w];this.log("switching to level "+w+" from "+v),this.currentLevelIndex=w;var h=y({},p,{level:w,maxBitrate:p.maxBitrate,uri:p.uri,urlId:p.urlId});delete h._urlId,this.hls.trigger(I.Events.LEVEL_SWITCHING,h);var _=p.details;if(!_||_.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(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),o}(n.default)},"./src/controller/level-helper.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"addGroupId",function(){return k}),P.d(V,"assignTrackIdsByGroup",function(){return K}),P.d(V,"updatePTS",function(){return N}),P.d(V,"updateFragPTSDTS",function(){return D}),P.d(V,"mergeDetails",function(){return y}),P.d(V,"mapPartIntersection",function(){return g}),P.d(V,"mapFragmentIntersection",function(){return m}),P.d(V,"adjustSliding",function(){return c}),P.d(V,"addSliding",function(){return s}),P.d(V,"computeReloadInterval",function(){return d}),P.d(V,"getFragmentWithSN",function(){return u}),P.d(V,"getPartWith",function(){return l});var z=P("./src/polyfills/number.ts"),I=P("./src/utils/logger.ts");function k(o,a,C){switch(a){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(C);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(C);break}}function K(o){var a={};o.forEach(function(C){var w=C.groupId||"";C.id=a[w]=a[w]||0,a[w]++})}function N(o,a,C){var w=o[a],T=o[C];n(w,T)}function n(o,a){var C=a.startPTS;if(Object(z.isFiniteNumber)(C)){var w=0,T;a.sn>o.sn?(w=C-o.start,T=o):(w=o.start-C,T=a),T.duration!==w&&(T.duration=w)}else if(a.sn>o.sn){var R=o.cc===a.cc;R&&o.minEndPTS?a.start=o.start+(o.minEndPTS-o.start):a.start=o.start+o.duration}else a.start=Math.max(o.start-a.duration,0)}function D(o,a,C,w,T,R){var A=w-C;A<=0&&(I.logger.warn("Fragment should have a positive duration",a),w=C+a.duration,R=T+a.duration);var v=C,b=w,p=a.startPTS,h=a.endPTS;if(Object(z.isFiniteNumber)(p)){var _=Math.abs(p-C);Object(z.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(_,a.deltaPTS):a.deltaPTS=_,v=Math.max(C,p),C=Math.min(C,p),T=Math.min(T,a.startDTS),b=Math.min(w,h),w=Math.max(w,h),R=Math.max(R,a.endDTS)}a.duration=w-C;var E=C-a.start;a.appendedPTS=w,a.start=a.startPTS=C,a.maxStartPTS=v,a.startDTS=T,a.endPTS=w,a.minEndPTS=b,a.endDTS=R;var x=a.sn;if(!o||x<o.startSN||x>o.endSN)return 0;var U,B=x-o.startSN,L=o.fragments;for(L[B]=a,U=B;U>0;U--)n(L[U],L[U-1]);for(U=B;U<L.length-1;U++)n(L[U],L[U+1]);return o.fragmentHint&&n(L[L.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,E}function y(o,a){for(var C=null,w=o.fragments,T=w.length-1;T>=0;T--){var R=w[T].initSegment;if(R){C=R;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var A=0,v;if(m(o,a,function(U,B){U.relurl&&(A=U.cc-B.cc),Object(z.isFiniteNumber)(U.startPTS)&&Object(z.isFiniteNumber)(U.endPTS)&&(B.start=B.startPTS=U.startPTS,B.startDTS=U.startDTS,B.appendedPTS=U.appendedPTS,B.maxStartPTS=U.maxStartPTS,B.endPTS=U.endPTS,B.endDTS=U.endDTS,B.minEndPTS=U.minEndPTS,B.duration=U.endPTS-U.startPTS,B.duration&&(v=B),a.PTSKnown=a.alignedSliding=!0),B.elementaryStreams=U.elementaryStreams,B.loader=U.loader,B.stats=U.stats,B.urlId=U.urlId,U.initSegment&&(B.initSegment=U.initSegment,C=U.initSegment)}),C){var b=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;b.forEach(function(U){var B;(!U.initSegment||U.initSegment.relurl===((B=C)===null||B===void 0?void 0:B.relurl))&&(U.initSegment=C)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(U){return!U}),a.deltaUpdateFailed)){I.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=a.skippedSegments;p--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var h=a.fragments;if(A){I.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<h.length;_++)h[_].cc+=A}a.skippedSegments&&(a.startCC=a.fragments[0].cc),g(o.partList,a.partList,function(U,B){B.elementaryStreams=U.elementaryStreams,B.stats=U.stats}),v?D(a,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):c(o,a),h.length&&(a.totalduration=a.edge-h[0].start),a.driftStartTime=o.driftStartTime,a.driftStart=o.driftStart;var E=a.advancedDateTime;if(a.advanced&&E){var x=a.edge;a.driftStart||(a.driftStartTime=E,a.driftStart=x),a.driftEndTime=E,a.driftEnd=x}else a.driftEndTime=o.driftEndTime,a.driftEnd=o.driftEnd,a.advancedDateTime=o.advancedDateTime}function g(o,a,C){if(o&&a)for(var w=0,T=0,R=o.length;T<=R;T++){var A=o[T],v=a[T+w];A&&v&&A.index===v.index&&A.fragment.sn===v.fragment.sn?C(A,v):w--}}function m(o,a,C){for(var w=a.skippedSegments,T=Math.max(o.startSN,a.startSN)-a.startSN,R=(o.fragmentHint?1:0)+(w?a.endSN:Math.min(o.endSN,a.endSN))-a.startSN,A=a.startSN-o.startSN,v=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,b=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,p=T;p<=R;p++){var h=b[A+p],_=v[p];w&&!_&&p<w&&(_=a.fragments[p]=h),h&&_&&C(h,_)}}function c(o,a){var C=a.startSN+a.skippedSegments-o.startSN,w=o.fragments;if(C<0||C>=w.length)return;s(a,w[C].start)}function s(o,a){if(a){for(var C=o.fragments,w=o.skippedSegments;w<C.length;w++)C[w].start+=a;o.fragmentHint&&(o.fragmentHint.start+=a)}}function d(o,a){var C=1e3*o.levelTargetDuration,w=C/2,T=o.age,R=T>0&&T<C*3,A=a.loading.end-a.loading.start,v,b=o.availabilityDelay;if(o.updated===!1)if(R){var p=333*o.misses;v=Math.max(Math.min(w,A*2),p),o.availabilityDelay=(o.availabilityDelay||0)+v}else v=w;else R?(b=Math.min(b||C/2,T),o.availabilityDelay=b,v=b+C-T):v=C-A;return Math.round(v)}function u(o,a,C){if(!o||!o.details)return null;var w=o.details,T=w.fragments[a-w.startSN];return T||(T=w.fragmentHint,T&&T.sn===a?T:a<w.startSN&&C&&C.sn===a?C:null)}function l(o,a,C){if(!o||!o.details)return null;var w=o.details.partList;if(w)for(var T=w.length;T--;){var R=w[T];if(R.index===C&&R.fragment.sn===a)return R}return null}},"./src/controller/stream-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return w});var z=P("./src/polyfills/number.ts"),I=P("./src/controller/base-stream-controller.ts"),k=P("./src/is-supported.ts"),K=P("./src/events.ts"),N=P("./src/utils/buffer-helper.ts"),n=P("./src/controller/fragment-tracker.ts"),D=P("./src/types/loader.ts"),y=P("./src/loader/fragment.ts"),g=P("./src/demux/transmuxer-interface.ts"),m=P("./src/types/transmuxer.ts"),c=P("./src/controller/gap-controller.ts"),s=P("./src/errors.ts"),d=P("./src/utils/logger.ts");function u(T,R){for(var A=0;A<R.length;A++){var v=R[A];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(T,v.key,v)}}function l(T,R,A){return R&&u(T.prototype,R),A&&u(T,A),T}function o(T,R){T.prototype=Object.create(R.prototype),T.prototype.constructor=T,a(T,R)}function a(T,R){return a=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v},a(T,R)}var C=100,w=function(T){o(R,T);function R(v,b){var p;return p=T.call(this,v,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 A=R.prototype;return A._registerListeners=function(){var b=this.hls;b.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(K.Events.ERROR,this.onError,this),b.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var b=this.hls;b.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(K.Events.ERROR,this.onError,this),b.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(b){if(this.levels){var p=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=h.startLevel;_===-1&&(h.config.testBandwidth?(_=0,this.bitrateTest=!0):_=h.nextAutoLevel),this.level=h.nextLoadLevel=_,this.loadedmetadata=!1}p>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),b=p),this.state=I.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=I.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_LEVEL:{var b,p=this.levels,h=this.level,_=p==null||((b=p[h])===null||b===void 0)?void 0:b.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=I.State.IDLE;break}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var E,x=self.performance.now(),U=this.retryDate;(!U||x>=U||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=I.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var b,p,h=this.hls,_=this.levelLastLoaded,E=this.levels,x=this.media,U=h.config,B=h.nextLoadLevel;if(_===null||!x&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[B])return;var L=E[B];this.level=h.nextLoadLevel=B;var H=L.details;if(!H||this.state===I.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==B){this.state=I.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:x,D.PlaylistLevelType.MAIN);if(j===null)return;var S=j.len,J=this.getMaxBufferLength(L.maxBitrate);if(S>=J)return;if(this._streamEnded(j,H)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,te),this.state=I.State.ENDED;return}var se=j.end,fe=this.getNextFragment(se,H);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var Fe=fe.sn-H.startSN;Fe>1&&(fe=H.fragments[Fe-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===n.FragmentState.OK&&this.nextLoadPosition>se){var Le=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,Le,D.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,H)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((b=fe.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((p=fe.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(fe,H):this.loadFragment(fe,H,se)},A.loadFragment=function(b,p,h){var _,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===n.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(b);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);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):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(b){var p=this.fragmentTracker.getAppendedFrag(b,D.PlaylistLevelType.MAIN);return p&&"fragment"in p?p.fragment:p},A.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,D.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var b=this.levels,p=this.media;if(p!=null&&p.readyState){var h,_=this.getAppendedFrag(p.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!p.paused&&b){var E=this.hls.nextLoadLevel,x=b[E],U=this.fragLastKbps;U&&this.fragCurrent?h=this.fragCurrent.duration*x.maxBitrate/(1e3*U)+1:h=0}else h=0;var B=this.getBufferedFrag(p.currentTime+h);if(B){var L=this.followingBufferedFrag(B);if(L){this.abortCurrentFrag();var H=L.maxStartPTS?L.maxStartPTS:L.start,j=L.duration,S=Math.max(B.end,H+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(S,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===I.State.KEY_LOADING&&(this.state=I.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(b,p){T.prototype.flushMainBuffer.call(this,b,p,this.altAudio?"video":null)},A.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)},A.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var b=this.media,p=b?b.currentTime:null;Object(z.isFiniteNumber)(p)&&this.log("Media seeked to "+p.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(b,p){var h=!1,_=!1,E;p.levels.forEach(function(x){E=x.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(h=!0),E.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=h&&_&&!Object(k.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},A.onLevelLoading=function(b,p){var h=this.levels;if(!h||this.state!==I.State.IDLE)return;var _=h[p.level];(!_.details||_.details.live&&this.levelLastLoaded!==p.level||this.waitForCdnTuneIn(_.details))&&(this.state=I.State.WAITING_LEVEL)},A.onLevelLoaded=function(b,p){var h,_=this.levels,E=p.level,x=p.details,U=x.totalduration;if(!_){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+U);var B=this.fragCurrent;B&&(this.state===I.State.FRAG_LOADING||this.state===I.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==p.level&&B.loader&&(this.state=I.State.IDLE,B.loader.abort()));var L=_[E],H=0;if(x.live||(h=L.details)!==null&&h!==void 0&&h.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;H=this.alignPlaylists(x,L.details)}if(L.details=x,this.levelLastLoaded=E,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:x,level:E}),this.state===I.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=I.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,H),this.tick()},A._handleFragmentLoadProgress=function(b){var p,h=b.frag,_=b.part,E=b.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var U=x[h.level],B=U.details;if(!B){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var L=U.videoCodec,H=B.PTSKnown||!B.live,j=(p=h.initSegment)===null||p===void 0?void 0:p.data,S=this._getAudioCodec(U),J=this.transmuxer=this.transmuxer||new g.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=_?_.index:-1,se=te!==-1,fe=new m.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,E.byteLength,te,se),Fe=this.initPTS[h.cc];J.push(E,j,S,L,h,_,B.totalduration,H,fe,Fe)},A.onAudioTrackSwitching=function(b,p){var h=this.altAudio,_=!!p.url,E=p.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;h&&U.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:E})}},A.onAudioTrackSwitched=function(b,p){var h=p.id,_=!!this.hls.audioTracks[h].url;if(_){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=_,this.tick()},A.onBufferCreated=function(b,p){var h=p.tracks,_,E,x=!1;for(var U in h){var B=h[U];if(B.id==="main"){if(E=U,_=B,U==="video"){var L=h[U];L&&(this.videoBuffer=L.buffer)}}else x=!0}x&&_?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(b,p){var h=p.frag,_=p.part;if(h&&h.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(_?" p: "+_.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===I.State.PARSED&&(this.state=I.State.IDLE);return}var E=_?_.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.onError=function(b,p){switch(p.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,p);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==I.State.ERROR&&(p.fatal?(this.warn(""+p.details),this.state=I.State.ERROR):!p.levelRetry&&this.state===I.State.WAITING_LEVEL&&(this.state=I.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="main"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var h=!0,_=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);_&&_.len>.5&&(h=!this.reduceMaxBufferLength(_.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var b=this.media,p=this.gapController;if(!b||!p||!b.readyState)return;var h=N.BufferHelper.getBuffered(b);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):p.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=I.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(b,p){var h=p.type;if(h!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(h===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,h,D.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(b,p){this.levels=p.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.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 _=N.BufferHelper.getBuffered(b),E=_.length?_.start(0):0,x=E-h;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+x+" to match buffer start"),h+=x,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+p),b.currentTime=h}},A._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},A._loadBitrateTestFrag=function(b){var p=this;this._doFragLoad(b).then(function(h){var _=p.hls;if(!h||_.nextLoadLevel||p.fragContextChanged(b))return;p.fragLoadError=0,p.state=I.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(),_.trigger(K.Events.FRAG_LOADED,h)})},A._handleTransmuxComplete=function(b){var p,h="main",_=this.hls,E=b.remuxResult,x=b.chunkMeta,U=this.getCurrentContext(x);if(!U){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var B=U.frag,L=U.part,H=U.level,j=E.video,S=E.text,J=E.id3,te=E.initSegment,se=this.altAudio?void 0:E.audio;if(this.fragContextChanged(B))return;if(this.state=I.State.PARSING,te){te.tracks&&(this._bufferInitSegment(H,te.tracks,B,x),_.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:h,tracks:te.tracks}));var fe=te.initPTS,Fe=te.timescale;Object(z.isFiniteNumber)(fe)&&(this.initPTS[B.cc]=fe,_.trigger(K.Events.INIT_PTS_FOUND,{frag:B,id:h,initPTS:fe,timescale:Fe}))}if(j&&E.independent!==!1){if(H.details){var Le=j.startPTS,De=j.endPTS,He=j.startDTS,We=j.endDTS;if(L)L.elementaryStreams[j.type]={startPTS:Le,endPTS:De,startDTS:He,endDTS:We};else if(j.firstKeyFrame&&j.independent&&(this.couldBacktrack=!0),j.dropped&&j.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<Le){this.backtrack(B);return}B.setElementaryStreamInfo(j.type,B.start,De,B.start,We,!0)}B.setElementaryStreamInfo(j.type,Le,De,He,We),this.bufferFragmentData(j,B,L,x)}}else if(E.independent===!1){this.backtrack(B);return}if(se){var ue=se.startPTS,Ye=se.endPTS,vt=se.startDTS,ct=se.endDTS;L&&(L.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:Ye,startDTS:vt,endDTS:ct}),B.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,ue,Ye,vt,ct),this.bufferFragmentData(se,B,L,x)}if(J!=null&&(p=J.samples)!==null&&p!==void 0&&p.length){var it={frag:B,id:h,samples:J.samples};_.trigger(K.Events.FRAG_PARSING_METADATA,it)}if(S){var ft={frag:B,id:h,samples:S.samples};_.trigger(K.Events.FRAG_PARSING_USERDATA,ft)}},A._bufferInitSegment=function(b,p,h,_){var E=this;if(this.state!==I.State.PARSING)return;this.audioOnly=!!p.audio&&!p.video,this.altAudio&&!this.audioOnly&&delete p.audio;var x=p.audio,U=p.video,B=p.audiovideo;if(x){var L=b.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(L&&(L.indexOf("mp4a.40.5")!==-1?L="mp4a.40.2":L="mp4a.40.5"),x.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(L="mp4a.40.5")),H.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(L="mp4a.40.2",this.log("Android: force audio codec to "+L)),b.audioCodec&&b.audioCodec!==L&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+L+'"'),x.levelCodec=L,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(L||"")+"/"+(b.audioCodec||"")+"/"+x.codec+"]")}U&&(U.levelCodec=b.videoCodec,U.id="main",this.log("Init video buffer, container:"+U.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+U.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,p),Object.keys(p).forEach(function(j){var S=p[j],J=S.initSegment;J!=null&&J.byteLength&&E.hls.trigger(K.Events.BUFFER_APPENDING,{type:j,data:J,frag:h,part:null,chunkMeta:_,parent:h.type})}),this.tick()},A.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=I.State.BACKTRACKING},A.checkFragmentChanged=function(){var b=this.media,p=null;if(b&&b.readyState>1&&b.seeking===!1){var h=b.currentTime;if(N.BufferHelper.isBuffered(b,h)?p=this.getAppendedFrag(h):N.BufferHelper.isBuffered(b,h+.1)&&(p=this.getAppendedFrag(h+.1)),p){var _=this.fragPlaying,E=p.level;(!_||p.sn!==_.sn||_.level!==E||p.urlId!==_.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:p}),(!_||_.level!==E)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=p)}}},l(R,[{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}}]),R}(I.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"SubtitleStreamController",function(){return o});var z=P("./src/events.ts"),I=P("./src/utils/logger.ts"),k=P("./src/utils/buffer-helper.ts"),K=P("./src/controller/fragment-finders.ts"),N=P("./src/utils/discontinuities.ts"),n=P("./src/controller/level-helper.ts"),D=P("./src/controller/fragment-tracker.ts"),y=P("./src/controller/base-stream-controller.ts"),g=P("./src/types/loader.ts"),m=P("./src/types/level.ts");function c(a,C){for(var w=0;w<C.length;w++){var T=C[w];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(a,T.key,T)}}function s(a,C,w){return C&&c(a.prototype,C),w&&c(a,w),a}function d(a,C){a.prototype=Object.create(C.prototype),a.prototype.constructor=a,u(a,C)}function u(a,C){return u=Object.setPrototypeOf||function(T,R){return T.__proto__=R,T},u(a,C)}var l=500,o=function(a){d(C,a);function C(T,R){var A;return A=a.call(this,T,R,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var w=C.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var R=this.hls;R.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(z.Events.ERROR,this.onError,this),R.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var R=this.hls;R.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(z.Events.ERROR,this.onError,this),R.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(l),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(R,A){this.mainDetails=A.details},w.onSubtitleFragProcessed=function(R,A){var v=A.frag,b=A.success;if(this.fragPrevious=v,this.state=y.State.IDLE,!b)return;var p=this.tracksBuffered[this.currentTrackId];if(!p)return;for(var h,_=v.start,E=0;E<p.length;E++)if(_>=p[E].start&&_<=p[E].end){h=p[E];break}var x=v.start+v.duration;h?h.end=x:(h={start:_,end:x},p.push(h)),this.fragmentTracker.fragBuffered(v)},w.onBufferFlushing=function(R,A){var v=A.startOffset,b=A.endOffset;if(v===0&&b!==Number.POSITIVE_INFINITY){var p=this.currentTrackId,h=this.levels;if(!h.length||!h[p]||!h[p].details)return;var _=h[p].details,E=_.targetduration,x=b-E;if(x<=0)return;A.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(U){for(var B=0;B<U.length;){if(U[B].end<=x){U.shift();continue}else if(U[B].start<x)U[B].start=x;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(v,x,g.PlaylistLevelType.SUBTITLE)}},w.onError=function(R,A){var v,b=A.frag;if(!b||b.type!==g.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},w.onSubtitleTracksUpdated=function(R,A){var v=this,b=A.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(p){return new m.Level(p)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(p){v.tracksBuffered[p.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(R,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var v=this.levels[this.currentTrackId];v!=null&&v.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,v&&this.setInterval(l)},w.onSubtitleTrackLoaded=function(R,A){var v,b=A.details,p=A.id,h=this.currentTrackId,_=this.levels;if(!_.length)return;var E=_[h];if(p>=_.length||p!==h||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(v=E.details)!==null&&v!==void 0&&v.live){var x=this.mainDetails;if(b.deltaUpdateFailed||!x)return;var U=x.fragments[0];if(!E.details)b.hasProgramDateTime&&x.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(b,x):U&&Object(n.addSliding)(b,U.start);else{var B=this.alignPlaylists(b,E.details);B===0&&U&&Object(n.addSliding)(b,U.start)}}if(E.details=b,this.levelLastLoaded=p,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var L=Object(K.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);L||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},w._handleFragmentLoadComplete=function(R){var A=R.frag,v=R.payload,b=A.decryptdata,p=this.hls;if(this.fragContextChanged(A))return;if(v&&v.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),b.key.buffer,b.iv.buffer).then(function(_){var E=performance.now();p.trigger(z.Events.FRAG_DECRYPTED,{frag:A,payload:_,stats:{tstart:h,tdecrypt:E}})})}},w.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var R,A=this.currentTrackId,v=this.levels;if(!v.length||!v[A]||!v[A].details)return;var b=v[A].details,p=b.targetduration,h=this.config,_=this.media,E=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-p,h.maxBufferHole),x=E.end,U=E.len,B=this.getMaxBufferLength()+p;if(U>B)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var L=b.fragments,H=L.length,j=b.edge,S,J=this.fragPrevious;if(x<j){var te=h.maxFragLookUpTolerance;J&&b.hasProgramDateTime&&(S=Object(K.findFragmentByPDT)(L,J.endProgramDateTime,te)),S||(S=Object(K.findFragmentByPTS)(J,L,x,te),!S&&J&&J.start<L[0].start&&(S=L[0]))}else S=L[H-1];(R=S)!==null&&R!==void 0&&R.encrypted?(I.logger.log("Loading key for "+S.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:S})):S&&this.fragmentTracker.getState(S)===D.FragmentState.NOT_LOADED&&this.loadFragment(S,b,x)}},w.loadFragment=function(R,A,v){this.fragCurrent=R,a.prototype.loadFragment.call(this,R,A,v)},s(C,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),C}(y.default)},"./src/controller/subtitle-track-controller.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/events.ts"),I=P("./src/utils/texttrack-utils.ts"),k=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function N(c,s){for(var d=0;d<s.length;d++){var u=s[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}function n(c,s,d){return s&&N(c.prototype,s),d&&N(c,d),c}function D(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,y(c,s)}function y(c,s){return y=Object.setPrototypeOf||function(u,l){return u.__proto__=l,u},y(c,s)}var g=function(c){D(s,c);function s(u){var l;return l=c.call(this,u,"[subtitle-track-controller]")||this,l.media=null,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.selectDefaultTrack=!0,l.queuedDefaultTrack=-1,l.trackChangeListener=function(){return l.onTextTracksChanged()},l.asyncPollTrackChange=function(){return l.pollTrackChange(0)},l.useTextTrackPolling=!1,l.subtitlePollingInterval=-1,l.subtitleDisplay=!0,l.registerListeners(),l}var d=s.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},d.registerListeners=function(){var l=this.hls;l.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.on(z.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.off(z.Events.ERROR,this.onError,this)},d.onMediaAttached=function(l,o){if(this.media=o.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(l){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,l)},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 l=m(this.media.textTracks);l.forEach(function(o){Object(I.clearCurrentCues)(o)}),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(l,o){this.tracks=o.subtitleTracks},d.onSubtitleTrackLoaded=function(l,o){var a=o.id,C=o.details,w=this.trackId,T=this.tracksInGroup[w];if(!T){this.warn("Invalid subtitle track id "+a);return}var R=T.details;T.details=o.details,this.log("subtitle track "+a+" loaded ["+C.startSN+"-"+C.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,o,R))},d.onLevelLoading=function(l,o){this.switchLevel(o.level)},d.onLevelSwitching=function(l,o){this.switchLevel(o.level)},d.switchLevel=function(l){var o=this.hls.levels[l];if(!(o!=null&&o.textGroupIds))return;var a=o.textGroupIds[o.urlId];if(this.groupId!==a){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(A){return!a||A.groupId===a});this.tracksInGroup=w;var T=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=a;var R={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,R),T!==-1&&this.setSubtitleTrack(T,C)}},d.findTrackId=function(l){for(var o=this.tracksInGroup,a=0;a<o.length;a++){var C=o[a];if((!this.selectDefaultTrack||C.default)&&(!l||l===C.name))return C.id}return-1},d.onError=function(l,o){if(c.prototype.onError.call(this,l,o),o.fatal||!o.context)return;o.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},d.loadPlaylist=function(l){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var a=o.id,C=o.groupId,w=o.url;if(l)try{w=l.addDirectives(w)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:w,id:a,groupId:C,deliveryDirectives:l||null})}},d.toggleTrackModes=function(l){var o=this,a=this.media,C=this.subtitleDisplay,w=this.trackId;if(!a)return;var T=m(a.textTracks),R=T.filter(function(b){return b.groupId===o.groupId});if(l===-1)[].slice.call(T).forEach(function(b){b.mode="disabled"});else{var A=R[w];A&&(A.mode="disabled")}var v=R[l];v&&(v.mode=C?"showing":"hidden")},d.setSubtitleTrack=function(l,o){var a,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=l;return}if(this.trackId!==l&&this.toggleTrackModes(l),this.trackId===l&&(l===-1||(a=C[l])!==null&&a!==void 0&&a.details)||l<-1||l>=C.length)return;this.clearTimer();var w=C[l];if(this.log("Switching to subtitle track "+l),this.trackId=l,w){var T=w.id,R=w.groupId,A=R===void 0?"":R,v=w.name,b=w.type,p=w.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:A,name:v,type:b,url:p});var h=this.switchParams(w.url,o==null?void 0:o.details);this.loadPlaylist(h)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:l})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var l=-1,o=m(this.media.textTracks),a=0;a<o.length;a++)if(o[a].mode==="hidden")l=a;else if(o[a].mode==="showing"){l=a;break}this.subtitleTrack!==l&&(this.subtitleTrack=l)},n(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(l,o)}}]),s}(k.default);function m(c){for(var s=[],d=0;d<c.length;d++){var u=c[d];u.kind==="subtitles"&&u.label&&s.push(c[d])}return s}V.default=g},"./src/controller/timeline-controller.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"TimelineController",function(){return m});var z=P("./src/polyfills/number.ts"),I=P("./src/events.ts"),k=P("./src/utils/cea-608-parser.ts"),K=P("./src/utils/output-filter.ts"),N=P("./src/utils/webvtt-parser.ts"),n=P("./src/utils/texttrack-utils.ts"),D=P("./src/utils/imsc1-ttml-parser.ts"),y=P("./src/types/loader.ts"),g=P("./src/utils/logger.ts"),m=function(){function u(o){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=o,this.config=o.config,this.Cues=o.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 a=new K.default(this,"textTrack1"),C=new K.default(this,"textTrack2"),w=new K.default(this,"textTrack3"),T=new K.default(this,"textTrack4");this.cea608Parser1=new k.default(1,a,C),this.cea608Parser2=new k.default(3,w,T)}o.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(I.Events.FRAG_LOADING,this.onFragLoading,this),o.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var l=u.prototype;return l.destroy=function(){var a=this.hls;a.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(I.Events.FRAG_LOADING,this.onFragLoading,this),a.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},l.addCues=function(a,C,w,T,R){for(var A=!1,v=R.length;v--;){var b=R[v],p=s(b[0],b[1],C,w);if(p>=0&&(b[0]=Math.min(b[0],C),b[1]=Math.max(b[1],w),A=!0,p/(w-C)>.5))return}if(A||R.push([C,w]),this.config.renderTextTracksNatively){var h=this.captionsTracks[a];this.Cues.newCue(h,C,w,T)}else{var _=this.Cues.newCue(null,C,w,T);this.hls.trigger(I.Events.CUES_PARSED,{type:"captions",cues:_,track:a})}},l.onInitPtsFound=function(a,C){var w=this,T=C.frag,R=C.id,A=C.initPTS,v=C.timescale,b=this.unparsedVttFrags;R==="main"&&(this.initPTS[T.cc]=A,this.timescale[T.cc]=v),b.length&&(this.unparsedVttFrags=[],b.forEach(function(p){w.onFragLoaded(I.Events.FRAG_LOADED,p)}))},l.getExistingTrack=function(a){var C=this.media;if(C)for(var w=0;w<C.textTracks.length;w++){var T=C.textTracks[w];if(T[a])return T}return null},l.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},l.createNativeTrack=function(a){if(this.captionsTracks[a])return;var C=this.captionsProperties,w=this.captionsTracks,T=this.media,R=C[a],A=R.label,v=R.languageCode,b=this.getExistingTrack(a);if(b)w[a]=b,Object(n.clearCurrentCues)(w[a]),Object(n.sendAddTrackEvent)(w[a],T);else{var p=this.createTextTrack("captions",A,v);p&&(p[a]=!0,w[a]=p)}},l.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var C=this.captionsProperties[a];if(!C)return;var w=C.label,T={_id:a,label:w,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[a]=T,this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},l.createTextTrack=function(a,C,w){var T=this.media;return T?T.addTextTrack(a,C,w):void 0},l.onMediaAttaching=function(a,C){this.media=C.media,this._cleanTracks()},l.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(C){Object(n.clearCurrentCues)(a[C]),delete a[C]}),this.nonNativeCaptionsTracks={}},l.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())},l._cleanTracks=function(){var a=this.media;if(!a)return;var C=a.textTracks;if(C)for(var w=0;w<C.length;w++)Object(n.clearCurrentCues)(C[w])},l.onSubtitleTracksUpdated=function(a,C){var w=this;this.textTracks=[];var T=C.subtitleTracks||[],R=T.some(function(p){return p.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var A=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(p,h){var _;if(h<v.length){for(var E=null,x=0;x<v.length;x++)if(c(v[x],p)){E=v[x];break}E&&(_=E)}_?Object(n.clearCurrentCues)(_):(_=w.createTextTrack("subtitles",p.name,p.lang),_&&(_.mode="disabled")),_&&(_.groupId=p.groupId,w.textTracks.push(_))})}else if(!A&&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(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},l.onManifestLoaded=function(a,C){var w=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(T){var R=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!R)return;var A="textTrack"+R[1],v=w.captionsProperties[A];if(!v)return;v.label=T.name,T.lang&&(v.languageCode=T.lang),v.media=T})},l.onFragLoading=function(a,C){var w=this.cea608Parser1,T=this.cea608Parser2,R=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(w&&T))return;if(C.frag.type===y.PlaylistLevelType.MAIN){var v,b,p=C.frag.sn,h=(v=C==null||((b=C.part)===null||b===void 0)?void 0:b.index)!=null?v:-1;p===R+1||p===R&&h===A+1||(w.reset(),T.reset()),this.lastSn=p,this.lastPartIndex=h}},l.onFragLoaded=function(a,C){var w=C.frag,T=C.payload,R=this.initPTS,A=this.unparsedVttFrags;if(w.type===y.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(z.isFiniteNumber)(R[w.cc])){A.push(C),R.length&&this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var v=w.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var b=this.tracks[w.level],p=this.vttCCs;p[w.cc]||(p[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),b&&b.textCodec===D.IMSC1_CODEC?this._parseIMSC1(w,T):this._parseVTTs(w,T,p)}}else this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},l._parseIMSC1=function(a,C){var w=this,T=this.hls;Object(D.parseIMSC1)(C,this.initPTS[a.cc],this.timescale[a.cc],function(R){w._appendCues(R,a.level),T.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(R){g.logger.log("Failed to parse IMSC1: "+R),T.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:R})})},l._parseVTTs=function(a,C,w){var T=this,R=this.hls;Object(N.parseWebVTT)(C,this.initPTS[a.cc],this.timescale[a.cc],w,a.cc,a.start,function(A){T._appendCues(A,a.level),R.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(A){T._fallbackToIMSC1(a,C),g.logger.log("Failed to parse VTT cue: "+A),R.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:A})})},l._fallbackToIMSC1=function(a,C){var w=this,T=this.tracks[a.level];T.textCodec||Object(D.parseIMSC1)(C,this.initPTS[a.cc],this.timescale[a.cc],function(){T.textCodec=D.IMSC1_CODEC,w._parseIMSC1(a,C)},function(){T.textCodec="wvtt"})},l._appendCues=function(a,C){var w=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[C];if(T.mode==="disabled")return;a.forEach(function(v){return Object(n.addCueToTrack)(T,v)})}else{var R=this.tracks[C],A=R.default?"default":"subtitles"+C;w.trigger(I.Events.CUES_PARSED,{type:"subtitles",cues:a,track:A})}},l.onFragDecrypted=function(a,C){var w=C.frag;if(w.type===y.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(I.Events.FRAG_LOADED,C)}},l.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},l.onFragParsingUserdata=function(a,C){var w=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(w&&T))return;for(var R=0;R<C.samples.length;R++){var A=C.samples[R].bytes;if(A){var v=this.extractCea608Data(A);w.addData(C.samples[R].pts,v[0]),T.addData(C.samples[R].pts,v[1])}}},l.onBufferFlushing=function(a,C){var w=C.startOffset,T=C.endOffset,R=C.endOffsetSubtitles,A=C.type,v=this.media;if(!v||v.currentTime<T)return;if(!A||A==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(h){return Object(n.removeCuesInRange)(b[h],w,T)})}if(this.config.renderTextTracksNatively&&(w===0&&R!==void 0)){var p=this.textTracks;Object.keys(p).forEach(function(h){return Object(n.removeCuesInRange)(p[h],w,R)})}},l.extractCea608Data=function(a){for(var C=a[0]&31,w=2,T=[[],[]],R=0;R<C;R++){var A=a[w++],v=127&a[w++],b=127&a[w++],p=(4&A)!==0,h=3&A;if(v===0&&b===0)continue;p&&((h===0||h===1)&&(T[h].push(v),T[h].push(b)))}return T},u}();function c(u,l){return u&&u.label===l.name&&!(u.textTrack1||u.textTrack2)}function s(u,l,o,a){return Math.min(l,a)-Math.max(u,o)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return z});var z=function(){function I(K,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=N}var k=I.prototype;return k.decrypt=function(N,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,N)},I}()},"./src/crypt/aes-decryptor.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"removePadding",function(){return I}),P.d(V,"default",function(){return k});var z=P("./src/utils/typed-array.ts");function I(K){var N=K.byteLength,n=N&&new DataView(K.buffer).getUint8(N-1);return n?Object(z.sliceUint8)(K,0,N-n):K}var k=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 N=K.prototype;return N.uint8ArrayToUint32Array_=function(D){for(var y=new DataView(D),g=new Uint32Array(4),m=0;m<4;m++)g[m]=y.getUint32(m*4);return g},N.initTable=function(){var D=this.sBox,y=this.invSBox,g=this.subMix,m=g[0],c=g[1],s=g[2],d=g[3],u=this.invSubMix,l=u[0],o=u[1],a=u[2],C=u[3],w=new Uint32Array(256),T=0,R=0,A=0;for(A=0;A<256;A++)A<128?w[A]=A<<1:w[A]=A<<1^283;for(A=0;A<256;A++){var v=R^R<<1^R<<2^R<<3^R<<4;v=v>>>8^v&255^99,D[T]=v,y[v]=T;var b=w[T],p=w[b],h=w[p],_=w[v]*257^v*16843008;m[T]=_<<24|_>>>8,c[T]=_<<16|_>>>16,s[T]=_<<8|_>>>24,d[T]=_,_=h*16843009^p*65537^b*257^T*16843008,l[v]=_<<24|_>>>8,o[v]=_<<16|_>>>16,a[v]=_<<8|_>>>24,C[v]=_,T?(T=b^w[w[w[h^b]]],R^=w[w[R]]):T=R=1}},N.expandKey=function(D){for(var y=this.uint8ArrayToUint32Array_(D),g=!0,m=0;m<y.length&&g;)g=y[m]===this.key[m],m++;if(g)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 s=this.ksRows=(c+6+1)*4,d,u,l=this.keySchedule=new Uint32Array(s),o=this.invKeySchedule=new Uint32Array(s),a=this.sBox,C=this.rcon,w=this.invSubMix,T=w[0],R=w[1],A=w[2],v=w[3],b,p;for(d=0;d<s;d++){if(d<c){b=l[d]=y[d];continue}p=b,d%c===0?(p=p<<8|p>>>24,p=a[p>>>24]<<24|a[p>>>16&255]<<16|a[p>>>8&255]<<8|a[p&255],p^=C[d/c|0]<<24):c>6&&d%c===4&&(p=a[p>>>24]<<24|a[p>>>16&255]<<16|a[p>>>8&255]<<8|a[p&255]),l[d]=b=(l[d-c]^p)>>>0}for(u=0;u<s;u++)d=s-u,u&3?p=l[d]:p=l[d-4],u<4||d<=4?o[u]=p:o[u]=T[a[p>>>24]]^R[a[p>>>16&255]]^A[a[p>>>8&255]]^v[a[p&255]],o[u]=o[u]>>>0},N.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},N.decrypt=function(D,y,g){for(var m=this.keySize+6,c=this.invKeySchedule,s=this.invSBox,d=this.invSubMix,u=d[0],l=d[1],o=d[2],a=d[3],C=this.uint8ArrayToUint32Array_(g),w=C[0],T=C[1],R=C[2],A=C[3],v=new Int32Array(D),b=new Int32Array(v.length),p,h,_,E,x,U,B,L,H,j,S,J,te,se,fe=this.networkToHostOrderSwap;y<v.length;){for(H=fe(v[y]),j=fe(v[y+1]),S=fe(v[y+2]),J=fe(v[y+3]),x=H^c[0],U=J^c[1],B=S^c[2],L=j^c[3],te=4,se=1;se<m;se++)p=u[x>>>24]^l[U>>16&255]^o[B>>8&255]^a[L&255]^c[te],h=u[U>>>24]^l[B>>16&255]^o[L>>8&255]^a[x&255]^c[te+1],_=u[B>>>24]^l[L>>16&255]^o[x>>8&255]^a[U&255]^c[te+2],E=u[L>>>24]^l[x>>16&255]^o[U>>8&255]^a[B&255]^c[te+3],x=p,U=h,B=_,L=E,te=te+4;p=s[x>>>24]<<24^s[U>>16&255]<<16^s[B>>8&255]<<8^s[L&255]^c[te],h=s[U>>>24]<<24^s[B>>16&255]<<16^s[L>>8&255]<<8^s[x&255]^c[te+1],_=s[B>>>24]<<24^s[L>>16&255]<<16^s[x>>8&255]<<8^s[U&255]^c[te+2],E=s[L>>>24]<<24^s[x>>16&255]<<16^s[U>>8&255]<<8^s[B&255]^c[te+3],b[y]=fe(p^w),b[y+1]=fe(E^T),b[y+2]=fe(_^R),b[y+3]=fe(h^A),w=H,T=j,R=S,A=J,y=y+4}return b.buffer},K}()},"./src/crypt/decrypter.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return y});var z=P("./src/crypt/aes-crypto.ts"),I=P("./src/crypt/fast-aes-key.ts"),k=P("./src/crypt/aes-decryptor.ts"),K=P("./src/utils/logger.ts"),N=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),D=16,y=function(){function g(c,s,d){var u=d===void 0?{}:d,l=u.removePKCS7Padding,o=l===void 0?!0:l;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=c,this.config=s,this.removePKCS7Padding=o,o)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(C){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=g.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var d=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(k.removePadding)(d):d},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(s,d,u,l){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),d,u);var o=this.flush();o&&l(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),d,u).then(l)},m.softwareDecrypt=function(s,d,u){var l=this.currentIV,o=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(s=Object(N.appendUint8Array)(a,s),this.remainderData=null);var C=this.getValidChunk(s);if(!C.length)return null;l&&(u=l);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new k.default),w.expandKey(d);var T=o;return this.currentResult=w.decrypt(C.buffer,0,u),this.currentIV=Object(n.sliceUint8)(C,-16).buffer,T||null},m.webCryptoDecrypt=function(s,d,u){var l=this,o=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new I.default(o,d)),this.fastAesKey.expandKey().then(function(a){if(!o)return Promise.reject(new Error("web crypto not initialized"));var C=new z.default(o,u);return C.decrypt(s.buffer,a)}).catch(function(a){return l.onWebCryptoError(a,s,d,u)})},m.onWebCryptoError=function(s,d,u,l){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,u,l)},m.getValidChunk=function(s){var d=s,u=s.length-s.length%D;return u!==s.length&&(d=Object(n.sliceUint8)(s,0,u),this.remainderData=Object(n.sliceUint8)(s,u)),d},m.logOnce=function(s){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return z});var z=function(){function I(K,N){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=N}var k=I.prototype;return k.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},I}()},"./src/demux/aacdemuxer.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/demux/base-audio-demuxer.ts"),I=P("./src/demux/adts.ts"),k=P("./src/utils/logger.ts"),K=P("./src/demux/id3.ts");function N(y,g){y.prototype=Object.create(g.prototype),y.prototype.constructor=y,n(y,g)}function n(y,g){return n=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},n(y,g)}var D=function(y){N(g,y);function g(c,s){var d;return d=y.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=c,d.config=s,d}var m=g.prototype;return m.resetInitSegment=function(s,d,u){y.prototype.resetInitSegment.call(this,s,d,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:u,inputTimeScale:9e4,dropped:0}},g.probe=function(s){if(!s)return!1;for(var d=K.getID3Data(s,0)||[],u=d.length,l=s.length;u<l;u++)if(I.probe(s,u))return k.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(s,d){return I.canParse(s,d)},m.appendFrame=function(s,d,u){I.initTrackConfig(s,this.observer,d,u,s.manifestCodec);var l=I.appendFrame(s,d,u,this.initPTS,this.frameIndex);if(l&&l.missing===0)return l},g}(z.default);D.minProbeByteLength=9,V.default=D},"./src/demux/adts.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"getAudioConfig",function(){return K}),P.d(V,"isHeaderPattern",function(){return N}),P.d(V,"getHeaderLength",function(){return n}),P.d(V,"getFullFrameLength",function(){return D}),P.d(V,"canGetFrameLength",function(){return y}),P.d(V,"isHeader",function(){return g}),P.d(V,"canParse",function(){return m}),P.d(V,"probe",function(){return c}),P.d(V,"initTrackConfig",function(){return s}),P.d(V,"getFrameDuration",function(){return d}),P.d(V,"parseFrameHeader",function(){return u}),P.d(V,"appendFrame",function(){return l});var z=P("./src/utils/logger.ts"),I=P("./src/errors.ts"),k=P("./src/events.ts");function K(o,a,C,w){var T,R,A,v,b=navigator.userAgent.toLowerCase(),p=w,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((a[C+2]&192)>>>6)+1;var _=(a[C+2]&60)>>>2;if(_>h.length-1){o.trigger(k.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return A=(a[C+2]&1)<<2,A|=(a[C+3]&192)>>>6,z.logger.log("manifest codec:"+w+", ADTS type:"+T+", samplingIndex:"+_),/firefox/i.test(b)?_>=6?(T=5,v=new Array(4),R=_-3):(T=2,v=new Array(2),R=_):b.indexOf("android")!==-1?(T=2,v=new Array(2),R=_):(T=5,v=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&_>=6?R=_-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(_>=6&&A===1||/vivaldi/i.test(b))||!w&&A===1)&&(T=2,v=new Array(2)),R=_)),v[0]=T<<3,v[0]|=(_&14)>>1,v[1]|=(_&1)<<7,v[1]|=A<<3,T===5&&(v[1]|=(R&14)>>1,v[2]=(R&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:h[_],channelCount:A,codec:"mp4a.40."+T,manifestCodec:p}}function N(o,a){return o[a]===255&&(o[a+1]&246)===240}function n(o,a){return o[a+1]&1?7:9}function D(o,a){return(o[a+3]&3)<<11|o[a+4]<<3|(o[a+5]&224)>>>5}function y(o,a){return a+5<o.length}function g(o,a){return a+1<o.length&&N(o,a)}function m(o,a){return y(o,a)&&N(o,a)&&D(o,a)<=o.length-a}function c(o,a){if(g(o,a)){var C=n(o,a);if(a+C>=o.length)return!1;var w=D(o,a);if(w<=C)return!1;var T=a+w;return T===o.length||g(o,T)}return!1}function s(o,a,C,w,T){if(!o.samplerate){var R=K(a,C,w,T);if(!R)return;o.config=R.config,o.samplerate=R.samplerate,o.channelCount=R.channelCount,o.codec=R.codec,o.manifestCodec=R.manifestCodec,z.logger.log("parsed codec:"+o.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function d(o){return 1024*9e4/o}function u(o,a,C,w,T){var R=n(o,a),A=D(o,a);if(A-=R,A>0){var v=C+w*T;return{headerLength:R,frameLength:A,stamp:v}}}function l(o,a,C,w,T){var R=d(o.samplerate),A=u(a,C,w,T,R);if(A){var v=A.frameLength,b=A.headerLength,p=A.stamp,h=b+v,_=Math.max(0,C+h-a.length),E;_?(E=new Uint8Array(h-b),E.set(a.subarray(C+b,a.length),0)):E=a.subarray(C+b,C+h);var x={unit:E,pts:p};return _||o.samples.push(x),{sample:x,length:h,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"initPTSFn",function(){return D});var z=P("./src/polyfills/number.ts"),I=P("./src/demux/id3.ts"),k=P("./src/demux/dummy-demuxed-track.ts"),K=P("./src/utils/mp4-tools.ts"),N=P("./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 g=y.prototype;return g.resetInitSegment=function(c,s,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(c,s){return!1},g.appendFrame=function(c,s,d){},g.demux=function(c,s){this.cachedData&&(c=Object(K.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=I.getID3Data(c,0),u=d?d.length:0,l,o,a=this._audioTrack,C=this._id3Track,w=d?I.getTimeStamp(d):void 0,T=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(w,s)),d&&d.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),o=this.initPTS;u<T;){if(this.canParse(c,u)){var R=this.appendFrame(a,c,u);R?(this.frameIndex++,o=R.sample.pts,u+=R.length,l=u):u=T}else I.canParse(c,u)?(d=I.getID3Data(c,u),C.samples.push({pts:o,dts:o,data:d}),u+=d.length,l=u):u++;if(u===T&&l!==T){var A=Object(N.sliceUint8)(c,l);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:a,avcTrack:Object(k.dummyTrack)(),id3Track:C,textTrack:Object(k.dummyTrack)()}},g.demuxSampleAes=function(c,s,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(c){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(k.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(k.dummyTrack)()}},g.destroy=function(){},y}(),D=function(g,m){return Object(z.isFiniteNumber)(g)?g*90:m*9e4};V.default=n},"./src/demux/chunk-cache.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return z});var z=function(){function k(){this.chunks=[],this.dataLength=0}var K=k.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=I(n,D);else return new Uint8Array(0);return this.reset(),y},K.reset=function(){this.chunks.length=0,this.dataLength=0},k}();function I(k,K){for(var N=new Uint8Array(K),n=0,D=0;D<k.length;D++){var y=k[D];N.set(y,n),n+=y.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"dummyTrack",function(){return z});function z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/utils/logger.ts"),I=function(){function k(N){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=N,this.bytesAvailable=N.byteLength,this.word=0,this.bitsAvailable=0}var K=k.prototype;return K.loadWord=function(){var n=this.data,D=this.bytesAvailable,y=n.byteLength-D,g=new Uint8Array(4),m=Math.min(4,D);if(m===0)throw new Error("no bytes available");g.set(n.subarray(y,y+m)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},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&&z.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,g,m=0;m<n;m++)y!==0&&(g=this.readEG(),y=(D+g+256)%256),D=y===0?D:y},K.readSPS=function(){var n=0,D=0,y=0,g=0,m,c,s,d=this.readUByte.bind(this),u=this.readBits.bind(this),l=this.readUEG.bind(this),o=this.readBoolean.bind(this),a=this.skipBits.bind(this),C=this.skipEG.bind(this),w=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);d();var R=d();if(u(5),a(3),d(),w(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var A=l();if(A===3&&a(1),w(),w(),a(1),o())for(c=A!==3?8:12,s=0;s<c;s++)o()&&(s<6?T(16):T(64))}w();var v=l();if(v===0)l();else if(v===1)for(a(1),C(),C(),m=l(),s=0;s<m;s++)C();w(),a(1);var b=l(),p=l(),h=u(1);h===0&&a(1),a(1),o()&&(n=l(),D=l(),y=l(),g=l());var _=[1,1];if(o()&&o()){var E=d();switch(E){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[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+g),pixelRatio:_}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},k}();V.default=I},"./src/demux/id3.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"isHeader",function(){return z}),P.d(V,"isFooter",function(){return I}),P.d(V,"getID3Data",function(){return k}),P.d(V,"canParse",function(){return N}),P.d(V,"getTimeStamp",function(){return n}),P.d(V,"isTimeStampFrame",function(){return D}),P.d(V,"getID3Frames",function(){return g}),P.d(V,"decodeFrame",function(){return m}),P.d(V,"utf8ArrayToStr",function(){return l}),P.d(V,"testables",function(){return o});var z=function(T,R){return R+10<=T.length&&(T[R]===73&&T[R+1]===68&&T[R+2]===51&&(T[R+3]<255&&T[R+4]<255&&(T[R+6]<128&&T[R+7]<128&&T[R+8]<128&&T[R+9]<128)))},I=function(T,R){return R+10<=T.length&&(T[R]===51&&T[R+1]===68&&T[R+2]===73&&(T[R+3]<255&&T[R+4]<255&&(T[R+6]<128&&T[R+7]<128&&T[R+8]<128&&T[R+9]<128)))},k=function(T,R){for(var A=R,v=0;z(T,R);){v+=10;var b=K(T,R+6);v+=b,I(T,R+10)&&(v+=10),R+=v}return v>0?T.subarray(A,A+v):void 0},K=function(T,R){var A=0;return A=(T[R]&127)<<21,A|=(T[R+1]&127)<<14,A|=(T[R+2]&127)<<7,A|=T[R+3]&127,A},N=function(T,R){return z(T,R)&&K(T,R+6)+10<=T.length-R},n=function(T){for(var R=g(T),A=0;A<R.length;A++){var v=R[A];if(D(v))return u(v)}return},D=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},y=function(T){var R=String.fromCharCode(T[0],T[1],T[2],T[3]),A=K(T,4),v=10;return{type:R,size:A,data:T.subarray(v,v+A)}},g=function(T){for(var R=0,A=[];z(T,R);){var v=K(T,R+6);R+=10;for(var b=R+v;R+8<b;){var p=y(T.subarray(R)),h=m(p);h&&A.push(h),R+=p.size+10}I(T,R)&&(R+=10)}return A},m=function(T){return T.type==="PRIV"?c(T):T.type[0]==="W"?d(T):s(T)},c=function(T){if(T.size<2)return;var R=l(T.data,!0),A=new Uint8Array(T.data.subarray(R.length+1));return{key:T.type,info:R,data:A.buffer}},s=function(T){if(T.size<2)return;if(T.type==="TXXX"){var R=1,A=l(T.data.subarray(R),!0);R+=A.length+1;var v=l(T.data.subarray(R));return{key:T.type,info:A,data:v}}var b=l(T.data.subarray(1));return{key:T.type,data:b}},d=function(T){if(T.type==="WXXX"){if(T.size<2)return;var R=1,A=l(T.data.subarray(R),!0);R+=A.length+1;var v=l(T.data.subarray(R));return{key:T.type,info:A,data:v}}var b=l(T.data);return{key:T.type,data:b}},u=function(T){if(T.data.byteLength===8){var R=new Uint8Array(T.data),A=R[3]&1,v=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return v/=45,A&&(v+=4772185884e-2),Math.round(v)}return},l=function(T,R){R===void 0&&(R=!1);var A=C();if(A){var v=A.decode(T);if(R){var b=v.indexOf("\0");return b!==-1?v.substring(0,b):v}return v.replace(/\0/g,"")}for(var p=T.length,h,_,E,x="",U=0;U<p;){if(h=T[U++],h===0&&R)return x;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:x+=String.fromCharCode(h);break;case 12:case 13:_=T[U++],x+=String.fromCharCode((h&31)<<6|_&63);break;case 14:_=T[U++],E=T[U++],x+=String.fromCharCode((h&15)<<12|(_&63)<<6|(E&63)<<0);break;default:}}return x},o={decodeTextFrame:s},a;function C(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/demux/base-audio-demuxer.ts"),I=P("./src/demux/id3.ts"),k=P("./src/utils/logger.ts"),K=P("./src/demux/mpegaudio.ts");function N(y,g){y.prototype=Object.create(g.prototype),y.prototype.constructor=y,n(y,g)}function n(y,g){return n=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},n(y,g)}var D=function(y){N(g,y);function g(){return y.apply(this,arguments)||this}var m=g.prototype;return m.resetInitSegment=function(s,d,u){y.prototype.resetInitSegment.call(this,s,d,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:u,inputTimeScale:9e4,dropped:0}},g.probe=function(s){if(!s)return!1;for(var d=I.getID3Data(s,0)||[],u=d.length,l=s.length;u<l;u++)if(K.probe(s,u))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(s,d){return K.canParse(s,d)},m.appendFrame=function(s,d,u){return this.initPTS===null?void 0:K.appendFrame(s,d,u,this.initPTS,this.frameIndex)},g}(z.default);D.minProbeByteLength=4,V.default=D},"./src/demux/mp4demuxer.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/utils/mp4-tools.ts"),I=P("./src/demux/dummy-demuxed-track.ts"),k=function(){function K(n,D){this.remainderData=null,this.config=void 0,this.config=D}var N=K.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},K.probe=function(D){return Object(z.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},N.demux=function(D){var y=D,g=Object(I.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(z.appendUint8Array)(this.remainderData,D));var m=Object(z.segmentValidRange)(y);this.remainderData=m.remainder,g.samples=m.valid||new Uint8Array}else g.samples=y;return{audioTrack:Object(I.dummyTrack)(),avcTrack:g,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},N.flush=function(){var D=Object(I.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(I.dummyTrack)(),avcTrack:D,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},N.demuxSampleAes=function(D,y,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},K}();k.minProbeByteLength=1024,V.default=k},"./src/demux/mpegaudio.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"appendFrame",function(){return n}),P.d(V,"parseHeader",function(){return D}),P.d(V,"isHeaderPattern",function(){return y}),P.d(V,"isHeader",function(){return g}),P.d(V,"canParse",function(){return m}),P.d(V,"probe",function(){return c});var z=null,I=[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],k=[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]],N=[0,1,1,4];function n(s,d,u,l,o){if(u+24>d.length)return;var a=D(d,u);if(a&&u+a.frameLength<=d.length){var C=a.samplesPerFrame*9e4/a.sampleRate,w=l+o*C,T={unit:d.subarray(u,u+a.frameLength),pts:w,dts:w};return s.config=[],s.channelCount=a.channelCount,s.samplerate=a.sampleRate,s.samples.push(T),{sample:T,length:a.frameLength,missing:0}}}function D(s,d){var u=s[d+1]>>3&3,l=s[d+1]>>1&3,o=s[d+2]>>4&15,a=s[d+2]>>2&3;if(u!==1&&o!==0&&o!==15&&a!==3){var C=s[d+2]>>1&1,w=s[d+3]>>6,T=u===3?3-l:l===3?3:4,R=I[T*14+o-1]*1e3,A=u===3?0:u===2?1:2,v=k[A*3+a],b=w===3?1:2,p=K[u][l],h=N[l],_=p*8*h,E=Math.floor(p*R/v+C)*h;if(z===null){var x=navigator.userAgent||"",U=x.match(/Chrome\/(\d+)/i);z=U?parseInt(U[1]):0}var B=!!z&&z<=87;return B&&l===2&&R>=224e3&&w===0&&(s[d+3]=s[d+3]|128),{sampleRate:v,channelCount:b,frameLength:E,samplesPerFrame:_}}}function y(s,d){return s[d]===255&&(s[d+1]&224)===224&&(s[d+1]&6)!==0}function g(s,d){return d+1<s.length&&y(s,d)}function m(s,d){var u=4;return y(s,d)&&u<=s.length-d}function c(s,d){if(d+1<s.length&&y(s,d)){var u=4,l=D(s,d),o=u;l!=null&&l.frameLength&&(o=l.frameLength);var a=d+o;return a===s.length||g(s,a)}return!1}},"./src/demux/sample-aes.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/crypt/decrypter.ts"),I=P("./src/demux/tsdemuxer.ts"),k=function(){function K(n,D,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new z.default(n,D,{removePKCS7Padding:!1})}var N=K.prototype;return N.decryptBuffer=function(D,y){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,y)},N.decryptAacSample=function(D,y,g,m){var c=D[y].unit,s=c.subarray(16,c.length-c.length%16),d=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),u=this;this.decryptBuffer(d,function(l){var o=new Uint8Array(l);c.set(o,16),m||u.decryptAacSamples(D,y+1,g)})},N.decryptAacSamples=function(D,y,g){for(;;y++){if(y>=D.length){g();return}if(D[y].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(D,y,g,m),!m)return}},N.getAvcEncryptedData=function(D){for(var y=Math.floor((D.length-48)/160)*16+16,g=new Int8Array(y),m=0,c=32;c<=D.length-16;c+=160,m+=16)g.set(D.subarray(c,c+16),m);return g},N.getAvcDecryptedUnit=function(D,y){for(var g=new Uint8Array(y),m=0,c=32;c<=D.length-16;c+=160,m+=16)D.set(g.subarray(m,m+16),c);return D},N.decryptAvcSample=function(D,y,g,m,c,s){var d=Object(I.discardEPB)(c.data),u=this.getAvcEncryptedData(d),l=this;this.decryptBuffer(u.buffer,function(o){c.data=l.getAvcDecryptedUnit(d,o),s||l.decryptAvcSamples(D,y,g+1,m)})},N.decryptAvcSamples=function(D,y,g,m){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,g=0){if(y>=D.length){m();return}for(var c=D[y].units;!(g>=c.length);g++){var s=c[g];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(D,y,g,m,s,d),!d)return}}},K}();V.default=k},"./src/demux/transmuxer-interface.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return c});var z=P("./node_modules/webworkify-webpack/index.js"),I=P.n(z),k=P("./src/events.ts"),K=P("./src/demux/transmuxer.ts"),N=P("./src/utils/logger.ts"),n=P("./src/errors.ts"),D=P("./src/utils/mediasource-helper.ts"),y=P("./node_modules/eventemitter3/index.js"),g=P.n(y),m=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function s(u,l,o,a){var C=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=u,this.id=l,this.onTransmuxComplete=o,this.onFlush=a;var w=u.config,T=function(p,h){h=h||{},h.frag=C.frag,h.id=C.id,u.trigger(p,h)};this.observer=new y.EventEmitter,this.observer.on(k.Events.FRAG_DECRYPTED,T),this.observer.on(k.Events.ERROR,T);var R={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var v;try{v=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(b){u.trigger(k.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+")")})},v.postMessage({cmd:"init",typeSupported:R,vendor:A,id:l,config:JSON.stringify(w)})}catch(b){N.logger.warn("Error in worker:",b),N.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new K.default(this.observer,R,w,A,l),this.worker=null}}else this.transmuxer=new K.default(this.observer,R,w,A,l)}var d=s.prototype;return d.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},d.push=function(l,o,a,C,w,T,R,A,v,b){var p=this;v.transmuxing.start=self.performance.now();var h=this.transmuxer,_=this.worker,E=T?T.start:w.start,x=w.decryptdata,U=this.frag,B=!(U&&w.cc===U.cc),L=!(U&&v.level===U.level),H=U?v.sn-U.sn:-1,j=this.part?v.part-this.part.index:1,S=!L&&(H===1||H===0&&j===1),J=self.performance.now();(L||H||w.stats.parsing.start===0)&&(w.stats.parsing.start=J),T&&(j||!S)&&(T.stats.parsing.start=J);var te=new K.TransmuxState(B,S,A,L,E);if(!S||B){N.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
|
|
discontinuity: `+B+`
|
|
trackSwitch: `+L+`
|
|
contiguous: `+S+`
|
|
accurateTimeOffset: `+A+`
|
|
timeOffset: `+E);var se=new K.TransmuxConfig(a,C,o,R,b);this.configureTransmuxer(se)}if(this.frag=w,this.part=T,_)_.postMessage({cmd:"demux",data:l,decryptdata:x,chunkMeta:v,state:te},l instanceof ArrayBuffer?[l]:[]);else if(h){var fe=h.push(l,x,v,te);Object(K.isPromise)(fe)?fe.then(function(Fe){p.handleTransmuxComplete(Fe)}):this.handleTransmuxComplete(fe)}},d.flush=function(l){var o=this;l.transmuxing.start=self.performance.now();var a=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:l});else if(a){var w=a.flush(l);Object(K.isPromise)(w)?w.then(function(T){o.handleFlushResult(T,l)}):this.handleFlushResult(w,l)}},d.handleFlushResult=function(l,o){var a=this;l.forEach(function(C){a.handleTransmuxComplete(C)}),this.onFlush(o)},d.onWorkerMessage=function(l){var o=l.data,a=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,a.trigger(o.event,o.data);break}}},d.configureTransmuxer=function(l){var o=this.worker,a=this.transmuxer;o?o.postMessage({cmd:"configure",config:l}):a&&a.configure(l)},d.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},s}()},"./src/demux/transmuxer-worker.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n});var z=P("./src/demux/transmuxer.ts"),I=P("./src/events.ts"),k=P("./src/utils/logger.ts"),K=P("./node_modules/eventemitter3/index.js"),N=P.n(K);function n(c){var s=new K.EventEmitter,d=function(l,o){c.postMessage({event:l,data:o})};s.on(I.Events.FRAG_DECRYPTED,d),s.on(I.Events.ERROR,d),c.addEventListener("message",function(u){var l=u.data;switch(l.cmd){case"init":{var o=JSON.parse(l.config);c.transmuxer=new z.default(s,l.typeSupported,o,l.vendor,l.id),Object(k.enableLogs)(o.debug),d("init",null);break}case"configure":{c.transmuxer.configure(l.config);break}case"demux":{var a=c.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);Object(z.isPromise)(a)?a.then(function(T){D(c,T)}):D(c,a);break}case"flush":{var C=l.chunkMeta,w=c.transmuxer.flush(C);Object(z.isPromise)(w)?w.then(function(T){g(c,T,C)}):g(c,w,C);break}default:break}})}function D(c,s){if(m(s.remuxResult))return;var d=[],u=s.remuxResult,l=u.audio,o=u.video;l&&y(d,l),o&&y(d,o),c.postMessage({event:"transmuxComplete",data:s},d)}function y(c,s){s.data1&&c.push(s.data1.buffer),s.data2&&c.push(s.data2.buffer)}function g(c,s,d){s.forEach(function(u){D(c,u)}),c.postMessage({event:"flush",data:d})}function m(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return o}),P.d(V,"isPromise",function(){return w}),P.d(V,"TransmuxConfig",function(){return T}),P.d(V,"TransmuxState",function(){return R});var z=P("./src/events.ts"),I=P("./src/errors.ts"),k=P("./src/crypt/decrypter.ts"),K=P("./src/demux/aacdemuxer.ts"),N=P("./src/demux/mp4demuxer.ts"),n=P("./src/demux/tsdemuxer.ts"),D=P("./src/demux/mp3demuxer.ts"),y=P("./src/remux/mp4-remuxer.ts"),g=P("./src/remux/passthrough-remuxer.ts"),m=P("./src/demux/chunk-cache.ts"),c=P("./src/utils/mp4-tools.ts"),s=P("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(A){s.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var u=[{demux:n.default,remux:y.default},{demux:N.default,remux:g.default},{demux:K.default,remux:y.default},{demux:D.default,remux:y.default}],l=1024;u.forEach(function(A){var v=A.demux;l=Math.max(l,v.minProbeByteLength)});var o=function(){function A(b,p,h,_,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 m.default,this.observer=b,this.typeSupported=p,this.config=h,this.vendor=_,this.id=E}var v=A.prototype;return v.configure=function(p){this.transmuxConfig=p,this.decrypter&&this.decrypter.reset()},v.push=function(p,h,_,E){var x=this,U=_.transmuxing;U.executeStart=d();var B=new Uint8Array(p),L=this.cache,H=this.config,j=this.currentTransmuxState,S=this.transmuxConfig;E&&(this.currentTransmuxState=E);var J=a(B,h);if(J&&J.method==="AES-128"){var te=this.getDecrypter();if(H.enableSoftwareAES){var se=te.softwareDecrypt(B,J.key.buffer,J.iv.buffer);if(!se)return U.executeEnd=d(),C(_);B=new Uint8Array(se)}else return this.decryptionPromise=te.webCryptoDecrypt(B,J.key.buffer,J.iv.buffer).then(function(qe){var ht=x.push(qe,null,_);return x.decryptionPromise=null,ht}),this.decryptionPromise}var fe=E||j,Fe=fe.contiguous,Le=fe.discontinuity,De=fe.trackSwitch,He=fe.accurateTimeOffset,We=fe.timeOffset,ye=S.audioCodec,ue=S.videoCodec,Ye=S.defaultInitPts,vt=S.duration,ct=S.initSegmentData;if((Le||De)&&this.resetInitSegment(ct,ye,ue,vt),Le&&this.resetInitialTimestamp(Ye),Fe||this.resetContiguity(),this.needsProbing(B,Le,De)){if(L.dataLength){var it=L.flush();B=Object(c.appendUint8Array)(it,B)}this.configureTransmuxer(B,S)}var ft=this.transmux(B,J,We,He,_),Qe=this.currentTransmuxState;return Qe.contiguous=!0,Qe.discontinuity=!1,Qe.trackSwitch=!1,U.executeEnd=d(),ft},v.flush=function(p){var h=this,_=p.transmuxing;_.executeStart=d();var E=this.decrypter,x=this.cache,U=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return h.flush(p)});var L=[],H=U.timeOffset;if(E){var j=E.flush();j&&L.push(this.push(j,null,p))}var S=x.dataLength;x.reset();var J=this.demuxer,te=this.remuxer;if(!J||!te)return S>=l&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=d(),[C(p)];var se=J.flush(H);return w(se)?se.then(function(fe){return h.flushRemux(L,fe,p),L}):(this.flushRemux(L,se,p),L)},v.flushRemux=function(p,h,_){var E=h.audioTrack,x=h.avcTrack,U=h.id3Track,B=h.textTrack,L=this.currentTransmuxState,H=L.accurateTimeOffset,j=L.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var S=this.remuxer.remux(E,x,U,B,j,H,!0,this.id);p.push({remuxResult:S,chunkMeta:_}),_.transmuxing.executeEnd=d()},v.resetInitialTimestamp=function(p){var h=this.demuxer,_=this.remuxer;if(!h||!_)return;h.resetTimeStamp(p),_.resetTimeStamp(p)},v.resetContiguity=function(){var p=this.demuxer,h=this.remuxer;if(!p||!h)return;p.resetContiguity(),h.resetNextTimestamp()},v.resetInitSegment=function(p,h,_,E){var x=this.demuxer,U=this.remuxer;if(!x||!U)return;x.resetInitSegment(h,_,E),U.resetInitSegment(p,h,_)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(p,h,_,E,x){var U;return h&&h.method==="SAMPLE-AES"?U=this.transmuxSampleAes(p,h,_,E,x):U=this.transmuxUnencrypted(p,_,E,x),U},v.transmuxUnencrypted=function(p,h,_,E){var x=this.demuxer.demux(p,h,!1,!this.config.progressive),U=x.audioTrack,B=x.avcTrack,L=x.id3Track,H=x.textTrack,j=this.remuxer.remux(U,B,L,H,h,_,!1,this.id);return{remuxResult:j,chunkMeta:E}},v.transmuxSampleAes=function(p,h,_,E,x){var U=this;return this.demuxer.demuxSampleAes(p,h,_).then(function(B){var L=U.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,_,E,!1,U.id);return{remuxResult:L,chunkMeta:x}})},v.configureTransmuxer=function(p,h){for(var _=this.config,E=this.observer,x=this.typeSupported,U=this.vendor,B=h.audioCodec,L=h.defaultInitPts,H=h.duration,j=h.initSegmentData,S=h.videoCodec,J,te=0,se=u.length;te<se;te++)if(u[te].demux.probe(p)){J=u[te];break}J||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),J={demux:N.default,remux:g.default});var fe=this.demuxer,Fe=this.remuxer,Le=J.remux,De=J.demux;(!Fe||!(Fe instanceof Le))&&(this.remuxer=new Le(E,_,x,U)),(!fe||!(fe instanceof De))&&(this.demuxer=new De(E,_,x),this.probe=De.probe),this.resetInitSegment(j,B,S,H),this.resetInitialTimestamp(L)},v.needsProbing=function(p,h,_){return!this.demuxer||!this.remuxer||h||_},v.getDecrypter=function(){var p=this.decrypter;return p||(p=this.decrypter=new k.default(this.observer,this.config)),p},A}();function a(A,v){var b=null;return A.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(b=v),b}var C=function(v){return{remuxResult:{},chunkMeta:v}};function w(A){return"then"in A&&A.then instanceof Function}var T=function(v,b,p,h,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=b,this.initSegmentData=p,this.duration=h,this.defaultInitPts=_},R=function(v,b,p,h,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=b,this.accurateTimeOffset=p,this.trackSwitch=h,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"discardEPB",function(){return C});var z=P("./src/demux/adts.ts"),I=P("./src/demux/mpegaudio.ts"),k=P("./src/demux/exp-golomb.ts"),K=P("./src/demux/id3.ts"),N=P("./src/demux/sample-aes.ts"),n=P("./src/events.ts"),D=P("./src/utils/mp4-tools.ts"),y=P("./src/utils/logger.ts"),g=P("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},c=function(){function w(R,A,v){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=R,this.config=A,this.typeSupported=v}w.probe=function(A){var v=w.syncOffset(A);return v<0?!1:(v&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},w.syncOffset=function(A){for(var v=Math.min(1e3,A.length-3*188),b=0;b<v;){if(A[b]===71&&A[b+188]===71&&A[b+2*188]===71)return b;b++}return-1},w.createTrack=function(A,v){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:m[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?v:void 0}};var T=w.prototype;return T.resetInitSegment=function(A,v,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",b),this._audioTrack=w.createTrack("audio",b),this._id3Track=w.createTrack("id3",b),this._txtTrack=w.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=v,this._duration=b},T.resetTimeStamp=function(){},T.resetContiguity=function(){var A=this._audioTrack,v=this._avcTrack,b=this._id3Track;A&&(A.pesData=null),v&&(v.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(A,v,b,p){b===void 0&&(b=!1),p===void 0&&(p=!1),b||(this.sampleAes=null);var h,_=this._avcTrack,E=this._audioTrack,x=this._id3Track,U=_.pid,B=_.pesData,L=E.pid,H=x.pid,j=E.pesData,S=x.pesData,J=!1,te=this.pmtParsed,se=this._pmtId,fe=A.length;if(this.remainderData&&(A=Object(D.appendUint8Array)(this.remainderData,A),fe=A.length,this.remainderData=null),fe<188&&!p)return this.remainderData=A,{audioTrack:E,avcTrack:_,id3Track:x,textTrack:this._txtTrack};var Fe=Math.max(0,w.syncOffset(A));fe-=(fe+Fe)%188,fe<A.byteLength&&!p&&(this.remainderData=new Uint8Array(A.buffer,fe,A.buffer.byteLength-fe));for(var Le=Fe;Le<fe;Le+=188)if(A[Le]===71){var De=!!(A[Le+1]&64),He=((A[Le+1]&31)<<8)+A[Le+2],We=(A[Le+3]&48)>>4,ye=void 0;if(We>1){if(ye=Le+5+A[Le+4],ye===Le+188)continue}else ye=Le+4;switch(He){case U:De&&(B&&(h=l(B))&&this.parseAVCPES(h,!1),B={data:[],size:0}),B&&(B.data.push(A.subarray(ye,Le+188)),B.size+=Le+188-ye);break;case L:De&&(j&&(h=l(j))&&(E.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),j={data:[],size:0}),j&&(j.data.push(A.subarray(ye,Le+188)),j.size+=Le+188-ye);break;case H:De&&(S&&(h=l(S))&&this.parseID3PES(h),S={data:[],size:0}),S&&(S.data.push(A.subarray(ye,Le+188)),S.size+=Le+188-ye);break;case 0:De&&(ye+=A[ye]+1),se=this._pmtId=d(A,ye);break;case se:{De&&(ye+=A[ye]+1);var ue=u(A,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);U=ue.avc,U>0&&(_.pid=U),L=ue.audio,L>0&&(E.pid=L,E.isAAC=ue.isAAC),H=ue.id3,H>0&&(x.pid=H),J&&!te&&(y.logger.log("reparse from beginning"),J=!1,Le=Fe-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=B,E.pesData=j,x.pesData=S;var Ye={audioTrack:E,avcTrack:_,id3Track:x,textTrack:this._txtTrack};return p&&this.extractRemainingSamples(Ye),Ye},T.flush=function(){var A=this.remainderData;this.remainderData=null;var v;return A?v=this.demux(A,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},T.extractRemainingSamples=function(A){var v=A.audioTrack,b=A.avcTrack,p=A.id3Track,h=b.pesData,_=v.pesData,E=p.pesData,x;h&&(x=l(h))?(this.parseAVCPES(x,!0),b.pesData=null):b.pesData=h,_&&(x=l(_))?(v.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),v.pesData=null):(_!=null&&_.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=_),E&&(x=l(E))?(this.parseID3PES(x),p.pesData=null):p.pesData=E},T.demuxSampleAes=function(A,v,b){var p=this.demux(A,b,!0,!this.config.progressive),h=this.sampleAes=new N.default(this.observer,this.config,v);return this.decrypt(p,h)},T.decrypt=function(A,v){return new Promise(function(b){var p=A.audioTrack,h=A.avcTrack;p.samples&&p.isAAC?v.decryptAacSamples(p.samples,0,function(){h.samples?v.decryptAvcSamples(h.samples,0,0,function(){b(A)}):b(A)}):h.samples&&v.decryptAvcSamples(h.samples,0,0,function(){b(A)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(A,v){var b=this,p=this._avcTrack,h=this.parseAVCNALu(A.data),_=!1,E=this.avcSample,x,U=!1;A.data=null,E&&h.length&&!p.audFound&&(o(E,p),E=this.avcSample=s(!1,A.pts,A.dts,"")),h.forEach(function(B){switch(B.type){case 1:{x=!0,E||(E=b.avcSample=s(!0,A.pts,A.dts,"")),_&&(E.debug+="NDR "),E.frame=!0;var L=B.data;if(U&&L.length>4){var H=new k.default(L).readSliceType();(H===2||H===4||H===7||H===9)&&(E.key=!0)}break}case 5:x=!0,E||(E=b.avcSample=s(!0,A.pts,A.dts,"")),_&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{x=!0,_&&E&&(E.debug+="SEI ");var j=new k.default(C(B.data));j.readUByte();for(var S=0,J=0,te=!1,se=0;!te&&j.bytesAvailable>1;){S=0;do se=j.readUByte(),S+=se;while(se===255);J=0;do se=j.readUByte(),J+=se;while(se===255);if(S===4&&j.bytesAvailable!==0){te=!0;var fe=j.readUByte();if(fe===181){var Fe=j.readUShort();if(Fe===49){var Le=j.readUInt();if(Le===1195456820){var De=j.readUByte();if(De===3){for(var He=j.readUByte(),We=j.readUByte(),ye=31&He,ue=[He,We],Ye=0;Ye<ye;Ye++)ue.push(j.readUByte()),ue.push(j.readUByte()),ue.push(j.readUByte());a(b._txtTrack.samples,{type:3,pts:A.pts,bytes:ue})}}}}}else if(S===5&&j.bytesAvailable!==0){if(te=!0,J>16){for(var vt=[],ct=0;ct<16;ct++)vt.push(j.readUByte().toString(16)),(ct===3||ct===5||ct===7||ct===9)&&vt.push("-");for(var it=J-16,ft=new Uint8Array(it),Qe=0;Qe<it;Qe++)ft[Qe]=j.readUByte();a(b._txtTrack.samples,{pts:A.pts,payloadType:S,uuid:vt.join(""),userData:Object(K.utf8ArrayToStr)(ft),userDataBytes:ft})}}else if(J<j.bytesAvailable)for(var qe=0;qe<J;qe++)j.readUByte()}break}case 7:if(x=!0,U=!0,_&&E&&(E.debug+="SPS "),!p.sps){var ht=new k.default(B.data),de=ht.readSPS();p.width=de.width,p.height=de.height,p.pixelRatio=de.pixelRatio,p.sps=[B.data],p.duration=b._duration;for(var Ie=B.data.subarray(1,4),Pe="avc1.",Ke=0;Ke<3;Ke++){var st=Ie[Ke].toString(16);st.length<2&&(st="0"+st),Pe+=st}p.codec=Pe}break;case 8:x=!0,_&&E&&(E.debug+="PPS "),p.pps||(p.pps=[B.data]);break;case 9:x=!1,p.audFound=!0,E&&o(E,p),E=b.avcSample=s(!1,A.pts,A.dts,_?"AUD ":"");break;case 12:x=!1;break;default:x=!1,E&&(E.debug+="unknown NAL "+B.type+" ");break}if(E&&x){var at=E.units;at.push(B)}}),v&&E&&(o(E,p),this.avcSample=null)},T.getLastNalUnit=function(){var A,v=this.avcSample,b;if(!v||v.units.length===0){var p=this._avcTrack.samples;v=p[p.length-1]}if((A=v)!==null&&A!==void 0&&A.units){var h=v.units;b=h[h.length-1]}return b},T.parseAVCNALu=function(A){var v=A.byteLength,b=this._avcTrack,p=b.naluState||0,h=p,_=[],E=0,x,U,B,L=-1,H=0;for(p===-1&&(L=0,H=A[0]&31,p=0,E=1);E<v;){if(x=A[E++],!p){p=x?0:1;continue}if(p===1){p=x?0:2;continue}if(!x)p=3;else if(x===1){if(L>=0){var j={data:A.subarray(L,E-p-1),type:H};_.push(j)}else{var S=this.getLastNalUnit();if(S&&(h&&E<=4-h&&(S.state&&(S.data=S.data.subarray(0,S.data.byteLength-h))),U=E-p-1,U>0)){var J=new Uint8Array(S.data.byteLength+U);J.set(S.data,0),J.set(A.subarray(0,U),S.data.byteLength),S.data=J,S.state=0}}E<v?(B=A[E]&31,L=E,H=B,p=0):p=-1}else p=0}if(L>=0&&p>=0){var te={data:A.subarray(L,v),type:H,state:p};_.push(te)}if(_.length===0){var se=this.getLastNalUnit();if(se){var fe=new Uint8Array(se.data.byteLength+A.byteLength);fe.set(se.data,0),fe.set(A,se.data.byteLength),se.data=fe}}return b.naluState=p,_},T.parseAACPES=function(A){var v=0,b=this._audioTrack,p=this.aacOverFlow,h=A.data;if(p){this.aacOverFlow=null;var _=p.sample.unit.byteLength,E=Math.min(p.missing,_),x=_-E;p.sample.unit.set(h.subarray(0,E),x),b.samples.push(p.sample),v=p.missing}var U,B;for(U=v,B=h.length;U<B-1&&!z.isHeader(h,U);U++);if(U!==v){var L,H;if(U<B-1?(L="AAC PES did not start with ADTS header,offset:"+U,H=!1):(L="no ADTS header found in AAC PES",H=!0),y.logger.warn("parsing error:"+L),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:L}),H)return}z.initTrackConfig(b,this.observer,h,U,this.audioCodec);var j;if(A.pts!==void 0)j=A.pts;else if(p){var S=z.getFrameDuration(b.samplerate);j=p.sample.pts+S}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0;U<B;)if(z.isHeader(h,U)){if(U+5<B){var te=z.appendFrame(b,h,U,j,J);if(te)if(te.missing)this.aacOverFlow=te;else{U+=te.length,J++;continue}}break}else U++},T.parseMPEGPES=function(A){var v=A.data,b=v.length,p=0,h=0,_=A.pts;if(_===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<b;)if(I.isHeader(v,h)){var E=I.appendFrame(this._audioTrack,v,h,_,p);if(E)h+=E.length,p++;else break}else h++},T.parseID3PES=function(A){if(A.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},w}();c.minProbeByteLength=188;function s(w,T,R,A){return{key:w,frame:!1,pts:T,dts:R,units:[],debug:A,length:0}}function d(w,T){return(w[T+10]&31)<<8|w[T+11]}function u(w,T,R,A){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(w[T+1]&15)<<8|w[T+2],p=T+3+b-4,h=(w[T+10]&15)<<8|w[T+11];for(T+=12+h;T<p;){var _=(w[T+1]&31)<<8|w[T+2];switch(w[T]){case 207:if(!A){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=_);break;case 21:v.id3===-1&&(v.id3=_);break;case 219:if(!A){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=_);break;case 3:case 4:R?v.audio===-1&&(v.audio=_,v.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+=((w[T+3]&15)<<8|w[T+4])+5}return v}function l(w){var T=0,R,A,v,b,p,h=w.data;if(!w||w.size===0)return null;for(;h[0].length<19&&h.length>1;){var _=new Uint8Array(h[0].length+h[1].length);_.set(h[0]),_.set(h[1],h[0].length),h[0]=_,h.splice(1,1)}R=h[0];var E=(R[0]<<16)+(R[1]<<8)+R[2];if(E===1){if(A=(R[4]<<8)+R[5],A&&A>w.size-6)return null;var x=R[7];x&192&&(b=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,x&64?(p=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[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),v=R[8];var U=v+9;if(w.size<=U)return null;w.size-=U;for(var B=new Uint8Array(w.size),L=0,H=h.length;L<H;L++){R=h[L];var j=R.byteLength;if(U)if(U>j){U-=j;continue}else R=R.subarray(U),j-=U,U=0;B.set(R,T),T+=j}return A&&(A-=v+3),{data:B,pts:b,dts:p,len:A}}return null}function o(w,T){if(w.units.length&&w.frame){if(w.pts===void 0){var R=T.samples,A=R.length;if(A){var v=R[A-1];w.pts=v.pts,w.dts=v.dts}else{T.dropped++;return}}T.samples.push(w)}w.debug.length&&y.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function a(w,T){var R=w.length;if(R>0){if(T.pts>=w[R-1].pts)w.push(T);else for(var A=R-1;A>=0;A--)if(T.pts<w[A].pts){w.splice(A,0,T);break}}else w.push(T)}function C(w){for(var T=w.byteLength,R=[],A=1;A<T-2;)w[A]===0&&w[A+1]===0&&w[A+2]===3?(R.push(A+2),A+=2):A++;if(R.length===0)return w;var v=T-R.length,b=new Uint8Array(v),p=0;for(A=0;A<v;p++,A++)p===R[0]&&(p++,R.shift()),b[A]=w[p];return b}V.default=c},"./src/errors.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"ErrorTypes",function(){return z}),P.d(V,"ErrorDetails",function(){return I});var z;(function(k){k.NETWORK_ERROR="networkError",k.MEDIA_ERROR="mediaError",k.KEY_SYSTEM_ERROR="keySystemError",k.MUX_ERROR="muxError",k.OTHER_ERROR="otherError"})(z||(z={}));var I;(function(k){k.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",k.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",k.KEY_SYSTEM_NO_SESSION="keySystemNoSession",k.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",k.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",k.MANIFEST_LOAD_ERROR="manifestLoadError",k.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",k.MANIFEST_PARSING_ERROR="manifestParsingError",k.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",k.LEVEL_EMPTY_ERROR="levelEmptyError",k.LEVEL_LOAD_ERROR="levelLoadError",k.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",k.LEVEL_SWITCH_ERROR="levelSwitchError",k.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",k.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",k.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",k.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",k.FRAG_LOAD_ERROR="fragLoadError",k.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",k.FRAG_DECRYPT_ERROR="fragDecryptError",k.FRAG_PARSING_ERROR="fragParsingError",k.REMUX_ALLOC_ERROR="remuxAllocError",k.KEY_LOAD_ERROR="keyLoadError",k.KEY_LOAD_TIMEOUT="keyLoadTimeOut",k.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",k.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",k.BUFFER_APPEND_ERROR="bufferAppendError",k.BUFFER_APPENDING_ERROR="bufferAppendingError",k.BUFFER_STALLED_ERROR="bufferStalledError",k.BUFFER_FULL_ERROR="bufferFullError",k.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",k.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",k.INTERNAL_EXCEPTION="internalException",k.INTERNAL_ABORTED="aborted",k.UNKNOWN="unknown"})(I||(I={}))},"./src/events.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"Events",function(){return z});var z;(function(I){I.MEDIA_ATTACHING="hlsMediaAttaching",I.MEDIA_ATTACHED="hlsMediaAttached",I.MEDIA_DETACHING="hlsMediaDetaching",I.MEDIA_DETACHED="hlsMediaDetached",I.BUFFER_RESET="hlsBufferReset",I.BUFFER_CODECS="hlsBufferCodecs",I.BUFFER_CREATED="hlsBufferCreated",I.BUFFER_APPENDING="hlsBufferAppending",I.BUFFER_APPENDED="hlsBufferAppended",I.BUFFER_EOS="hlsBufferEos",I.BUFFER_FLUSHING="hlsBufferFlushing",I.BUFFER_FLUSHED="hlsBufferFlushed",I.MANIFEST_LOADING="hlsManifestLoading",I.MANIFEST_LOADED="hlsManifestLoaded",I.MANIFEST_PARSED="hlsManifestParsed",I.LEVEL_SWITCHING="hlsLevelSwitching",I.LEVEL_SWITCHED="hlsLevelSwitched",I.LEVEL_LOADING="hlsLevelLoading",I.LEVEL_LOADED="hlsLevelLoaded",I.LEVEL_UPDATED="hlsLevelUpdated",I.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",I.LEVELS_UPDATED="hlsLevelsUpdated",I.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",I.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",I.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",I.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",I.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",I.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",I.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",I.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",I.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",I.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",I.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",I.CUES_PARSED="hlsCuesParsed",I.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",I.INIT_PTS_FOUND="hlsInitPtsFound",I.FRAG_LOADING="hlsFragLoading",I.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",I.FRAG_LOADED="hlsFragLoaded",I.FRAG_DECRYPTED="hlsFragDecrypted",I.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",I.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",I.FRAG_PARSING_METADATA="hlsFragParsingMetadata",I.FRAG_PARSED="hlsFragParsed",I.FRAG_BUFFERED="hlsFragBuffered",I.FRAG_CHANGED="hlsFragChanged",I.FPS_DROP="hlsFpsDrop",I.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",I.ERROR="hlsError",I.DESTROYING="hlsDestroying",I.KEY_LOADING="hlsKeyLoading",I.KEY_LOADED="hlsKeyLoaded",I.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",I.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return w});var z=P("./node_modules/url-toolkit/src/url-toolkit.js"),I=P.n(z),k=P("./src/loader/playlist-loader.ts"),K=P("./src/loader/key-loader.ts"),N=P("./src/controller/id3-track-controller.ts"),n=P("./src/controller/latency-controller.ts"),D=P("./src/controller/level-controller.ts"),y=P("./src/controller/fragment-tracker.ts"),g=P("./src/controller/stream-controller.ts"),m=P("./src/is-supported.ts"),c=P("./src/utils/logger.ts"),s=P("./src/config.ts"),d=P("./node_modules/eventemitter3/index.js"),u=P.n(d),l=P("./src/events.ts"),o=P("./src/errors.ts");function a(T,R){for(var A=0;A<R.length;A++){var v=R[A];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(T,v.key,v)}}function C(T,R,A){return R&&a(T.prototype,R),A&&a(T,A),T}var w=function(){T.isSupported=function(){return Object(m.isSupported)()};function T(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var v=this.config=Object(s.mergeConfig)(T.DefaultConfig,A);this.userConfig=A,Object(c.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(s.enableStreamingMode)(v);var b=v.abrController,p=v.bufferController,h=v.capLevelController,_=v.fpsController,E=this.abrController=new b(this),x=this.bufferController=new p(this),U=this.capLevelController=new h(this),B=new _(this),L=new k.default(this),H=new K.default(this),j=new N.default(this),S=this.levelController=new D.default(this),J=new y.FragmentTracker(this),te=this.streamController=new g.default(this,J);U.setStreamController(te),B.setStreamController(te);var se=[S,te];this.networkControllers=se;var fe=[L,H,E,x,U,B,j,J];this.audioTrackController=this.createController(v.audioTrackController,null,se),this.createController(v.audioStreamController,J,se),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,se),this.createController(v.subtitleStreamController,J,se),this.createController(v.timelineController,null,fe),this.emeController=this.createController(v.emeController,null,fe),this.cmcdController=this.createController(v.cmcdController,null,fe),this.latencyController=this.createController(n.default,null,fe),this.coreComponents=fe}var R=T.prototype;return R.createController=function(v,b,p){if(v){var h=b?new v(this,b):new v(this);return p&&p.push(h),h}return null},R.on=function(v,b,p){p===void 0&&(p=this),this._emitter.on(v,b,p)},R.once=function(v,b,p){p===void 0&&(p=this),this._emitter.once(v,b,p)},R.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},R.off=function(v,b,p,h){p===void 0&&(p=this),this._emitter.off(v,b,p,h)},R.listeners=function(v){return this._emitter.listeners(v)},R.emit=function(v,b,p){return this._emitter.emit(v,b,p)},R.trigger=function(v,b){if(this.config.debug)return this.emit(v,v,b);try{return this.emit(v,v,b)}catch(p){c.logger.error("An internal error happened while handling event "+v+'. Error message: "'+p.message+'". Here is a stacktrace:',p),this.trigger(l.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:p})}return!1},R.listenerCount=function(v){return this._emitter.listenerCount(v)},R.destroy=function(){c.logger.log("destroy"),this.trigger(l.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(v){return v.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(v){return v.destroy()}),this.coreComponents.length=0},R.attachMedia=function(v){c.logger.log("attachMedia"),this._media=v,this.trigger(l.Events.MEDIA_ATTACHING,{media:v})},R.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(l.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(v){this.stopLoad();var b=this.media,p=this.url,h=this.url=z.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});c.logger.log("loadSource:"+h),b&&p&&p!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(l.Events.MANIFEST_LOADING,{url:v})},R.startLoad=function(v){v===void 0&&(v=-1),c.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(b){b.startLoad(v)})},R.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},R.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){c.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},R.removeLevel=function(v,b){b===void 0&&(b=0),this.levelController.removeLevel(v,b)},C(T,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){c.logger.log("set currentLevel:"+v),this.loadLevel=v,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(v){c.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){c.logger.log("set loadLevel:"+v),this.levelController.manualLevel=v}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(v){this.levelController.nextLoadLevel=v}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(v){c.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){c.logger.log("set startLevel:"+v),v!==-1&&(v=Math.max(v,this.minAutoLevel)),this.levelController.startLevel=v}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(v){var b=!!v;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(v){this._autoLevelCapping!==v&&(c.logger.log("set autoLevelCapping:"+v),this._autoLevelCapping=v)}},{key:"bandwidthEstimate",get:function(){var v=this.abrController.bwEstimator;return v?v.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var v=this.levels,b=this.config.minAutoBitrate;if(!v)return 0;for(var p=v.length,h=0;h<p;h++)if(v[h].maxBitrate>b)return h;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,b=this.autoLevelCapping,p;return b===-1&&v&&v.length?p=v.length-1:p=b,p}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var b=this.audioTrackController;b&&(b.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{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 l.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:s.hlsDefaultConfig},set:function(v){T.defaultConfig=v}}]),T}();w.defaultConfig=void 0},"./src/is-supported.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"isSupported",function(){return k}),P.d(V,"changeTypeSupported",function(){return K});var z=P("./src/utils/mediasource-helper.ts");function I(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var N=Object(z.getMediaSource)();if(!N)return!1;var n=I(),D=N&&typeof N.isTypeSupported=="function"&&N.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 N,n=I();return typeof(n==null||((N=n.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return c}),P.d(V,"LoadError",function(){return d});var z=P("./src/polyfills/number.ts"),I=P("./src/errors.ts");function k(u,l){u.prototype=Object.create(l.prototype),u.prototype.constructor=u,y(u,l)}function K(u){var l=typeof Map=="function"?new Map:void 0;return K=function(a){if(a===null||!D(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l!="undefined"){if(l.has(a))return l.get(a);l.set(a,C)}function C(){return N(a,arguments,g(this).constructor)}return C.prototype=Object.create(a.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),y(C,a)},K(u)}function N(u,l,o){return n()?N=Reflect.construct:N=function(C,w,T){var R=[null];R.push.apply(R,w);var A=Function.bind.apply(C,R),v=new A;return T&&y(v,T.prototype),v},N.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(u){return!1}}function D(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function y(u,l){return y=Object.setPrototypeOf||function(a,C){return a.__proto__=C,a},y(u,l)}function g(u){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},g(u)}var m=Math.pow(2,17),c=function(){function u(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var l=u.prototype;return l.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},l.abort=function(){this.loader&&this.loader.abort()},l.load=function(a,C){var w=this,T=a.url;if(!T)return Promise.reject(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var R=this.config,A=R.fLoader,v=R.loader;return new Promise(function(b,p){w.loader&&w.loader.destroy();var h=w.loader=a.loader=A?new A(R):new v(R),_=s(a),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};a.stats=h.stats,h.load(_,E,{onSuccess:function(U,B,L,H){w.resetLoader(a,h),b({frag:a,part:null,payload:U.data,networkDetails:H})},onError:function(U,B,L){w.resetLoader(a,h),p(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:U,networkDetails:L}))},onAbort:function(U,B,L){w.resetLoader(a,h),p(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:L}))},onTimeout:function(U,B,L){w.resetLoader(a,h),p(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:L}))},onProgress:function(U,B,L,H){C&&C({frag:a,part:null,payload:L,networkDetails:H})}})})},l.loadPart=function(a,C,w){var T=this;this.abort();var R=this.config,A=R.fLoader,v=R.loader;return new Promise(function(b,p){T.loader&&T.loader.destroy();var h=T.loader=a.loader=A?new A(R):new v(R),_=s(a,C),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};C.stats=h.stats,h.load(_,E,{onSuccess:function(U,B,L,H){T.resetLoader(a,h),T.updateStatsFromPart(a,C);var j={frag:a,part:C,payload:U.data,networkDetails:H};w(j),b(j)},onError:function(U,B,L){T.resetLoader(a,h),p(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:C,response:U,networkDetails:L}))},onAbort:function(U,B,L){a.stats.aborted=C.stats.aborted,T.resetLoader(a,h),p(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:C,networkDetails:L}))},onTimeout:function(U,B,L){T.resetLoader(a,h),p(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:C,networkDetails:L}))}})})},l.updateStatsFromPart=function(a,C){var w=a.stats,T=C.stats,R=T.total;if(w.loaded+=T.loaded,R){var A=Math.round(a.duration/C.duration),v=Math.min(Math.round(w.loaded/R),A),b=A-v,p=b*Math.round(w.loaded/v);w.total=w.loaded+p}else w.total=Math.max(w.loaded,w.total);var h=w.loading,_=T.loading;h.start?h.first+=_.first-_.start:(h.start=_.start,h.first=_.first),h.end=_.end},l.resetLoader=function(a,C){a.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},u}();function s(u,l){l===void 0&&(l=null);var o=l||u,a={frag:u,part:l,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},C=o.byteRangeStartOffset,w=o.byteRangeEndOffset;return Object(z.isFiniteNumber)(C)&&Object(z.isFiniteNumber)(w)&&(a.rangeStart=C,a.rangeEnd=w),a}var d=function(u){k(l,u);function l(o){for(var a,C=arguments.length,w=new Array(C>1?C-1:0),T=1;T<C;T++)w[T-1]=arguments[T];return a=u.call.apply(u,[this].concat(w))||this,a.data=void 0,a.data=o,a}return l}(K(Error))},"./src/loader/fragment.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"ElementaryStreamTypes",function(){return c}),P.d(V,"BaseSegment",function(){return s}),P.d(V,"Fragment",function(){return d}),P.d(V,"Part",function(){return u});var z=P("./src/polyfills/number.ts"),I=P("./node_modules/url-toolkit/src/url-toolkit.js"),k=P.n(I),K=P("./src/utils/logger.ts"),N=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function D(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,y(l,o)}function y(l,o){return y=Object.setPrototypeOf||function(C,w){return C.__proto__=w,C},y(l,o)}function g(l,o){for(var a=0;a<o.length;a++){var C=o[a];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(l,C.key,C)}}function m(l,o,a){return o&&g(l.prototype,o),a&&g(l,a),l}var c;(function(l){l.AUDIO="audio",l.VIDEO="video",l.AUDIOVIDEO="audiovideo"})(c||(c={}));var s=function(){function l(a){var C;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(C={},C[c.AUDIO]=null,C[c.VIDEO]=null,C[c.AUDIOVIDEO]=null,C),this.baseurl=a}var o=l.prototype;return o.setByteRange=function(C,w){var T=C.split("@",2),R=[];T.length===1?R[0]=w?w.byteRangeEndOffset:0:R[0]=parseInt(T[1]),R[1]=parseInt(T[0])+R[0],this._byteRange=R},m(l,[{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(I.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(C){this._url=C}}]),l}(),d=function(l){D(o,l);function o(C,w){var T;return T=l.call(this,w)||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=C,T}var a=o.prototype;return a.createInitializationVector=function(w){for(var T=new Uint8Array(16),R=12;R<16;R++)T[R]=w>>8*(15-R)&255;return T},a.setDecryptDataFromLevelKey=function(w,T){var R=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(R=N.LevelKey.fromURI(w.uri),R.method=w.method,R.iv=this.createInitializationVector(T),R.keyFormat="identity"),R},a.setElementaryStreamInfo=function(w,T,R,A,v,b){b===void 0&&(b=!1);var p=this.elementaryStreams,h=p[w];if(!h){p[w]={startPTS:T,endPTS:R,startDTS:A,endDTS:v,partial:b};return}h.startPTS=Math.min(h.startPTS,T),h.endPTS=Math.max(h.endPTS,R),h.startDTS=Math.min(h.startDTS,A),h.endDTS=Math.max(h.endDTS,v)},a.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[c.AUDIO]=null,w[c.VIDEO]=null,w[c.AUDIOVIDEO]=null},m(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var w=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),o}(s),u=function(l){D(o,l);function o(a,C,w,T,R){var A;A=l.call(this,w)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new n.LoadStats,A.duration=a.decimalFloatingPoint("DURATION"),A.gap=a.bool("GAP"),A.independent=a.bool("INDEPENDENT"),A.relurl=a.enumeratedString("URI"),A.fragment=C,A.index=T;var v=a.enumeratedString("BYTERANGE");return v&&A.setByteRange(v,R),R&&(A.fragOffset=R.fragOffset+R.duration),A}return m(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),o}(s)},"./src/loader/key-loader.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return K});var z=P("./src/events.ts"),I=P("./src/errors.ts"),k=P("./src/utils/logger.ts"),K=function(){function N(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=N.prototype;return n._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var g=this.loaders[y];g&&g.destroy()}this.loaders={}},n.onKeyLoading=function(y,g){var m=g.frag,c=m.type,s=this.loaders[c];if(!m.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=m.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(s&&(k.logger.warn("abort previous key loader for type:"+c),s.abort()),!d){k.logger.warn("key uri is falsy");return}var l=u.loader,o=m.loader=this.loaders[c]=new l(u);this.decrypturl=d,this.decryptkey=null;var a={url:d,frag:m,responseType:"arraybuffer"},C={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(a,C,w)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:m}))},n.loadsuccess=function(y,g,m){var c=m.frag;if(!c.decryptdata){k.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(z.Events.KEY_LOADED,{frag:c})},n.loaderror=function(y,g){var m=g.frag,c=m.loader;c&&c.abort(),delete this.loaders[m.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:y})},n.loadtimeout=function(y,g){var m=g.frag,c=m.loader;c&&c.abort(),delete this.loaders[m.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},N}()},"./src/loader/level-details.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"LevelDetails",function(){return N});var z=P("./src/polyfills/number.ts");function I(n,D){for(var y=0;y<D.length;y++){var g=D[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(n,g.key,g)}}function k(n,D,y){return D&&I(n.prototype,D),y&&I(n,y),n}var K=10,N=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(g){if(!g){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-g.lastPartSn,c=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!c||!!m,this.advanced=this.endSN>g.endSN||m>0||m===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},k(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var m=this.driftEnd-this.driftStart;return m*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"LevelKey",function(){return N});var z=P("./node_modules/url-toolkit/src/url-toolkit.js"),I=P.n(z);function k(n,D){for(var y=0;y<D.length;y++){var g=D[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(n,g.key,g)}}function K(n,D,y){return D&&k(n.prototype,D),y&&k(n,y),n}var N=function(){n.fromURL=function(y,g){return new n(y,g)},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(z.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,V,P){"use strict";P.r(V),P.d(V,"LoadStats",function(){return z});var z=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,V,P){"use strict";P.r(V),P.d(V,"default",function(){return o});var z=P("./src/polyfills/number.ts"),I=P("./node_modules/url-toolkit/src/url-toolkit.js"),k=P.n(I),K=P("./src/loader/fragment.ts"),N=P("./src/loader/level-details.ts"),n=P("./src/loader/level-key.ts"),D=P("./src/utils/attr-list.ts"),y=P("./src/utils/logger.ts"),g=P("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function l(R){var A,v;return u.test((A=(v=I.parseURL(R))===null||v===void 0?void 0:v.path)!=null?A:"")}var o=function(){function R(){}return R.findGroup=function(v,b){for(var p=0;p<v.length;p++){var h=v[p];if(h.id===b)return h}},R.convertAVC1ToAVCOTI=function(v){var b=v.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 v},R.resolve=function(v,b){return I.buildAbsoluteURL(b,v,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(v,b){var p=[],h={},_=!1;m.lastIndex=0;for(var E;(E=m.exec(v))!=null;)if(E[1]){var x=new D.AttrList(E[1]),U={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:R.resolve(E[2],b)},B=x.decimalResolution("RESOLUTION");B&&(U.width=B.width,U.height=B.height),a((x.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=R.convertAVC1ToAVCOTI(U.videoCodec)),p.push(U)}else if(E[3]){var L=new D.AttrList(E[3]);L["DATA-ID"]&&(_=!0,h[L["DATA-ID"]]=L)}return{levels:p,sessionData:_?h:null}},R.parseMasterPlaylistMedia=function(v,b,p,h){h===void 0&&(h=[]);var _,E=[],x=0;for(c.lastIndex=0;(_=c.exec(v))!==null;){var U=new D.AttrList(_[1]);if(U.TYPE===p){var B={attrs:U,bitrate:0,id:x++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:p,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?R.resolve(U.URI,b):""};if(h.length){var L=R.findGroup(h,B.groupId)||h[0];C(B,L,"audioCodec"),C(B,L,"textCodec")}E.push(B)}}return E},R.parseLevelPlaylist=function(v,b,p,h,_){var E=new N.LevelDetails(b),x=E.fragments,U=null,B=0,L=0,H=0,j=0,S=null,J=new K.Fragment(h,b),te,se,fe,Fe=-1,Le=!1;for(s.lastIndex=0,E.m3u8=v;(te=s.exec(v))!==null;){Le&&(Le=!1,J=new K.Fragment(h,b),J.start=H,J.sn=B,J.cc=j,J.level=p,U&&(J.initSegment=U,J.rawProgramDateTime=U.rawProgramDateTime));var De=te[1];if(De){J.duration=parseFloat(De);var He=(" "+te[2]).slice(1);J.title=He||null,J.tagList.push(He?["INF",De,He]:["INF",De])}else if(te[3])Object(z.isFiniteNumber)(J.duration)&&(J.start=H,fe&&(J.levelkey=fe),J.sn=B,J.level=p,J.cc=j,J.urlId=_,x.push(J),J.relurl=(" "+te[3]).slice(1),T(J,S),S=J,H+=J.duration,B++,L=0,Le=!0);else if(te[4]){var We=(" "+te[4]).slice(1);S?J.setByteRange(We,S):J.setByteRange(We)}else if(te[5])J.rawProgramDateTime=(" "+te[5]).slice(1),J.tagList.push(["PROGRAM-DATE-TIME",J.rawProgramDateTime]),Fe===-1&&(Fe=x.length);else{if(te=te[0].match(d),!te){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<te.length&&!(typeof te[se]!="undefined");se++);var ye=(" "+te[se]).slice(1),ue=(" "+te[se+1]).slice(1),Ye=te[se+2]?(" "+te[se+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":E.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":B=E.startSN=parseInt(ue);break;case"SKIP":{var vt=new D.AttrList(ue),ct=vt.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(ct)){E.skippedSegments=ct;for(var it=ct;it--;)x.unshift(null);B+=ct}var ft=vt.enumeratedString("RECENTLY-REMOVED-DATERANGES");ft&&(E.recentlyRemovedDateranges=ft.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(ue);break;case"VERSION":E.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(ue||Ye)&&J.tagList.push(Ye?[ue,Ye]:[ue]);break;case"DIS":j++;case"GAP":J.tagList.push([ye]);break;case"BITRATE":J.tagList.push([ye,ue]);break;case"DISCONTINUITY-SEQ":j=parseInt(ue);break;case"KEY":{var Qe,qe=new D.AttrList(ue),ht=qe.enumeratedString("METHOD"),de=qe.URI,Ie=qe.hexadecimalInteger("IV"),Pe=qe.enumeratedString("KEYFORMATVERSIONS"),Ke=qe.enumeratedString("KEYID"),st=(Qe=qe.enumeratedString("KEYFORMAT"))!=null?Qe:"identity",at=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(at.indexOf(st)>-1){y.logger.warn("Keyformat "+st+" is not supported from the manifest");continue}else if(st!=="identity")continue;ht&&(fe=n.LevelKey.fromURL(b,de),de&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ht)>=0&&(fe.method=ht,fe.keyFormat=st,Ke&&(fe.keyID=Ke),Pe&&(fe.keyFormatVersions=Pe),fe.iv=Ie));break}case"START":{var et=new D.AttrList(ue),tt=et.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(tt)&&(E.startTimeOffset=tt);break}case"MAP":{var dt=new D.AttrList(ue);J.relurl=dt.URI,dt.BYTERANGE&&J.setByteRange(dt.BYTERANGE),J.level=p,J.sn="initSegment",fe&&(J.levelkey=fe),J.initSegment=null,U=J,Le=!0;break}case"SERVER-CONTROL":{var yt=new D.AttrList(ue);E.canBlockReload=yt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=yt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&yt.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=yt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=yt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ae=new D.AttrList(ue);E.partTarget=Ae.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Se=E.partList;Se||(Se=E.partList=[]);var Ve=L>0?Se[Se.length-1]:void 0,Je=L++,Ne=new K.Part(new D.AttrList(ue),J,b,Je,Ve);Se.push(Ne),J.duration+=Ne.duration;break}case"PRELOAD-HINT":{var je=new D.AttrList(ue);E.preloadHint=je;break}case"RENDITION-REPORT":{var Ee=new D.AttrList(ue);E.renditionReports=E.renditionReports||[],E.renditionReports.push(Ee);break}default:y.logger.warn("line parsed but not handled: "+te);break}}}S&&!S.relurl?(x.pop(),H-=S.duration,E.partList&&(E.fragmentHint=S)):E.partList&&(T(J,S),J.cc=j,E.fragmentHint=J);var he=x.length,pe=x[0],re=x[he-1];if(H+=E.skippedSegments*E.targetduration,H>0&&he&&re){E.averagetargetduration=H/he;var oe=re.sn;E.endSN=oe!=="initSegment"?oe:0,pe&&(E.startCC=pe.cc,pe.initSegment||E.fragments.every(function(le){return le.relurl&&l(le.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),J=new K.Fragment(h,b),J.relurl=re.relurl,J.level=p,J.sn="initSegment",pe.initSegment=J,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(H+=E.fragmentHint.duration),E.totalduration=H,E.endCC=j,Fe>0&&w(x,Fe),E},R}();function a(R,A){["video","audio","text"].forEach(function(v){var b=R.filter(function(h){return Object(g.isCodecType)(h,v)});if(b.length){var p=b.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});A[v+"Codec"]=p.length>0?p[0]:b[0],R=R.filter(function(h){return b.indexOf(h)===-1})}}),A.unknownCodecs=R}function C(R,A,v){var b=A[v];b&&(R[v]=b)}function w(R,A){for(var v=R[A],b=A;b--;){var p=R[b];if(!p)return;p.programDateTime=v.programDateTime-p.duration*1e3,v=p}}function T(R,A){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):A!=null&&A.programDateTime&&(R.programDateTime=A.endProgramDateTime),Object(z.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/polyfills/number.ts"),I=P("./src/events.ts"),k=P("./src/errors.ts"),K=P("./src/utils/logger.ts"),N=P("./src/utils/mp4-tools.ts"),n=P("./src/loader/m3u8-parser.ts"),D=P("./src/types/loader.ts"),y=P("./src/utils/attr-list.ts");function g(s){var d=s.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 m(s,d){var u=s.url;return(u===void 0||u.indexOf("data:")===0)&&(u=d.url),u}var c=function(){function s(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var d=s.prototype;return d.registerListeners=function(){var l=this.hls;l.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(I.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.on(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var l=this.hls;l.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(I.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.off(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(l){var o=this.hls.config,a=o.pLoader,C=o.loader,w=a||C,T=new w(o);return l.loader=T,this.loaders[l.type]=T,T},d.getInternalLoader=function(l){return this.loaders[l.type]},d.resetInternalLoader=function(l){this.loaders[l]&&delete this.loaders[l]},d.destroyInternalLoaders=function(){for(var l in this.loaders){var o=this.loaders[l];o&&o.destroy(),this.resetInternalLoader(l)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(l,o){var a=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},d.onLevelLoading=function(l,o){var a=o.id,C=o.level,w=o.url,T=o.deliveryDirectives;this.load({id:a,groupId:null,level:C,responseType:"text",type:D.PlaylistContextType.LEVEL,url:w,deliveryDirectives:T})},d.onAudioTrackLoading=function(l,o){var a=o.id,C=o.groupId,w=o.url,T=o.deliveryDirectives;this.load({id:a,groupId:C,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(l,o){var a=o.id,C=o.groupId,w=o.url,T=o.deliveryDirectives;this.load({id:a,groupId:C,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:T})},d.load=function(l){var o,a=this.hls.config,C=this.getInternalLoader(l);if(C){var w=C.context;if(w&&w.url===l.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+l.type),C.abort()}var T,R,A,v;switch(l.type){case D.PlaylistContextType.MANIFEST:T=a.manifestLoadingMaxRetry,R=a.manifestLoadingTimeOut,A=a.manifestLoadingRetryDelay,v=a.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:T=0,R=a.levelLoadingTimeOut;break;default:T=a.levelLoadingMaxRetry,R=a.levelLoadingTimeOut,A=a.levelLoadingRetryDelay,v=a.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(l),(o=l.deliveryDirectives)!==null&&o!==void 0&&o.part){var b;if(l.type===D.PlaylistContextType.LEVEL&&l.level!==null?b=this.hls.levels[l.level].details:l.type===D.PlaylistContextType.AUDIO_TRACK&&l.id!==null?b=this.hls.audioTracks[l.id].details:l.type===D.PlaylistContextType.SUBTITLE_TRACK&&l.id!==null&&(b=this.hls.subtitleTracks[l.id].details),b){var p=b.partTarget,h=b.targetduration;p&&h&&(R=Math.min(Math.max(p*3,h*.8)*1e3,R))}}var _={timeout:R,maxRetry:T,retryDelay:A,maxRetryDelay:v,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(l,_,E)},d.loadsuccess=function(l,o,a,C){if(C===void 0&&(C=null),a.isSidxRequest){this.handleSidxRequest(l,a),this.handlePlaylistLoaded(l,o,a,C);return}this.resetInternalLoader(a.type);var w=l.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,a,"no EXTM3U delimiter",C);return}o.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(l,o,a,C):this.handleMasterPlaylist(l,o,a,C)},d.loaderror=function(l,o,a){a===void 0&&(a=null),this.handleNetworkError(o,a,!1,l)},d.loadtimeout=function(l,o,a){a===void 0&&(a=null),this.handleNetworkError(o,a,!0)},d.handleMasterPlaylist=function(l,o,a,C){var w=this.hls,T=l.data,R=m(l,a),A=n.default.parseMasterPlaylist(T,R),v=A.levels,b=A.sessionData;if(!v.length){this.handleManifestParsingError(l,a,"no level found in manifest",C);return}var p=v.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),h=v.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),_=n.default.parseMasterPlaylistMedia(T,R,"AUDIO",p),E=n.default.parseMasterPlaylistMedia(T,R,"SUBTITLES",h),x=n.default.parseMasterPlaylistMedia(T,R,"CLOSED-CAPTIONS");if(_.length){var U=_.some(function(B){return!B.url});!U&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}w.trigger(I.Events.MANIFEST_LOADED,{levels:v,audioTracks:_,subtitles:E,captions:x,url:R,stats:o,networkDetails:C,sessionData:b})},d.handleTrackOrLevelPlaylist=function(l,o,a,C){var w=this.hls,T=a.id,R=a.level,A=a.type,v=m(l,a),b=Object(z.isFiniteNumber)(T)?T:0,p=Object(z.isFiniteNumber)(R)?R:b,h=g(a),_=n.default.parseLevelPlaylist(l.data,v,p,h,b);if(!_.fragments.length){w.trigger(I.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(A===D.PlaylistContextType.MANIFEST){var E={attrs:new y.AttrList({}),bitrate:0,details:_,name:"",url:v};w.trigger(I.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:v,stats:o,networkDetails:C,sessionData:null})}if(o.parsing.end=performance.now(),_.needSidxRanges){var x,U=(x=_.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:U,isSidxRequest:!0,type:A,level:R,levelDetails:_,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=_,this.handlePlaylistLoaded(l,o,a,C)},d.handleSidxRequest=function(l,o){var a=Object(N.parseSegmentIndex)(new Uint8Array(l.data));if(!a)return;var C=a.references,w=o.levelDetails;C.forEach(function(T,R){var A=T.info,v=w.fragments[R];v.byteRange.length===0&&v.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),v.initSegment&&v.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(l,o,a,C){this.hls.trigger(I.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===D.PlaylistContextType.MANIFEST,url:l.url,reason:a,response:l,context:o,networkDetails:C})},d.handleNetworkError=function(l,o,a,C){a===void 0&&(a=!1),K.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+l.type+" level: "+l.level+" id: "+l.id+' group-id: "'+l.groupId+'"');var w=k.ErrorDetails.UNKNOWN,T=!1,R=this.getInternalLoader(l);switch(l.type){case D.PlaylistContextType.MANIFEST:w=a?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case D.PlaylistContextType.LEVEL:w=a?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.AUDIO_TRACK:w=a?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:w=a?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}R&&this.resetInternalLoader(l.type);var A={type:k.ErrorTypes.NETWORK_ERROR,details:w,fatal:T,url:l.url,loader:R,context:l,networkDetails:o};C&&(A.response=C),this.hls.trigger(I.Events.ERROR,A)},d.handlePlaylistLoaded=function(l,o,a,C){var w=a.type,T=a.level,R=a.id,A=a.groupId,v=a.loader,b=a.levelDetails,p=a.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(l,a,"invalid target duration",C);return}if(!v)return;b.live&&(v.getCacheAge&&(b.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(w){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(I.Events.LEVEL_LOADED,{details:b,level:T||0,id:R||0,stats:o,networkDetails:C,deliveryDirectives:p});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(I.Events.AUDIO_TRACK_LOADED,{details:b,id:R||0,groupId:A||"",stats:o,networkDetails:C,deliveryDirectives:p});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(I.Events.SUBTITLE_TRACK_LOADED,{details:b,id:R||0,groupId:A||"",stats:o,networkDetails:C,deliveryDirectives:p});break}},s}();V.default=c},"./src/polyfills/number.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"isFiniteNumber",function(){return z}),P.d(V,"MAX_SAFE_INTEGER",function(){return I});var z=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},I=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,V,P){"use strict";P.r(V);var z=function(){function I(){}return I.getSilentFrame=function(K,N){switch(K){case"mp4a.40.2":if(N===1)return new Uint8Array([0,200,0,128,35,128]);if(N===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(N===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(N===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(N===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(N===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(N===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(N===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(N===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},I}();V.default=z},"./src/remux/mp4-generator.ts":function(Z,V,P){"use strict";P.r(V);var z=Math.pow(2,32)-1,I=function(){function k(){}return k.init=function(){k.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 N;for(N in k.types)k.types.hasOwnProperty(N)&&(k.types[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.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]);k.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]),g=new Uint8Array([0,0,0,0,0,0,0,0]);k.STTS=k.STSC=k.STCO=g,k.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),k.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),k.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),k.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,m,s,m,c),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,y))},k.box=function(N){for(var n=8,D=arguments.length,y=new Array(D>1?D-1:0),g=1;g<D;g++)y[g-1]=arguments[g];for(var m=y.length,c=m;m--;)n+=y[m].byteLength;var s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(N,4),m=0,n=8;m<c;m++)s.set(y[m],n),n+=y[m].byteLength;return s},k.hdlr=function(N){return k.box(k.types.hdlr,k.HDLR_TYPES[N])},k.mdat=function(N){return k.box(k.types.mdat,N)},k.mdhd=function(N,n){n*=N;var D=Math.floor(n/(z+1)),y=Math.floor(n%(z+1));return k.box(k.types.mdhd,new Uint8Array([1,0,0,0,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,D>>24,D>>16&255,D>>8&255,D&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},k.mdia=function(N){return k.box(k.types.mdia,k.mdhd(N.timescale,N.duration),k.hdlr(N.type),k.minf(N))},k.mfhd=function(N){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},k.minf=function(N){return N.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(N)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(N))},k.moof=function(N,n,D){return k.box(k.types.moof,k.mfhd(N),k.traf(D,n))},k.moov=function(N){for(var n=N.length,D=[];n--;)D[n]=k.trak(N[n]);return k.box.apply(null,[k.types.moov,k.mvhd(N[0].timescale,N[0].duration)].concat(D).concat(k.mvex(N)))},k.mvex=function(N){for(var n=N.length,D=[];n--;)D[n]=k.trex(N[n]);return k.box.apply(null,[k.types.mvex].concat(D))},k.mvhd=function(N,n){n*=N;var D=Math.floor(n/(z+1)),y=Math.floor(n%(z+1)),g=new Uint8Array([1,0,0,0,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,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 k.box(k.types.mvhd,g)},k.sdtp=function(N){var n=N.samples||[],D=new Uint8Array(4+n.length),y,g;for(y=0;y<n.length;y++)g=n[y].flags,D[y+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return k.box(k.types.sdtp,D)},k.stbl=function(N){return k.box(k.types.stbl,k.stsd(N),k.box(k.types.stts,k.STTS),k.box(k.types.stsc,k.STSC),k.box(k.types.stsz,k.STSZ),k.box(k.types.stco,k.STCO))},k.avc1=function(N){var n=[],D=[],y,g,m;for(y=0;y<N.sps.length;y++)g=N.sps[y],m=g.byteLength,n.push(m>>>8&255),n.push(m&255),n=n.concat(Array.prototype.slice.call(g));for(y=0;y<N.pps.length;y++)g=N.pps[y],m=g.byteLength,D.push(m>>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(g));var c=k.box(k.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|N.sps.length].concat(n).concat([N.pps.length]).concat(D))),s=N.width,d=N.height,u=N.pixelRatio[0],l=N.pixelRatio[1];return k.box(k.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,s&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,k.box(k.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),k.box(k.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,l>>24,l>>16&255,l>>8&255,l&255])))},k.esds=function(N){var n=N.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(N.config).concat([6,1,2]))},k.mp4a=function(N){var n=N.samplerate;return k.box(k.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),k.box(k.types.esds,k.esds(N)))},k.mp3=function(N){var n=N.samplerate;return k.box(k.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},k.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(N)):k.box(k.types.stsd,k.STSD,k.mp4a(N)):k.box(k.types.stsd,k.STSD,k.avc1(N))},k.tkhd=function(N){var n=N.id,D=N.duration*N.timescale,y=N.width,g=N.height,m=Math.floor(D/(z+1)),c=Math.floor(D%(z+1));return k.box(k.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,m>>24,m>>16&255,m>>8&255,m&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,g>>8&255,g&255,0,0]))},k.traf=function(N,n){var D=k.sdtp(N),y=N.id,g=Math.floor(n/(z+1)),m=Math.floor(n%(z+1));return k.box(k.types.traf,k.box(k.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),k.box(k.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,m>>24,m>>16&255,m>>8&255,m&255])),k.trun(N,D.length+16+20+8+16+8+8),D)},k.trak=function(N){return N.duration=N.duration||4294967295,k.box(k.types.trak,k.tkhd(N),k.mdia(N))},k.trex=function(N){var n=N.id;return k.box(k.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]))},k.trun=function(N,n){var D=N.samples||[],y=D.length,g=12+16*y,m=new Uint8Array(g),c,s,d,u,l,o;for(n+=8+g,m.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++)s=D[c],d=s.duration,u=s.size,l=s.flags,o=s.cts,m.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,l.degradPrio&240<<8,l.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*c);return k.box(k.types.trun,m)},k.initSegment=function(N){k.types||k.init();var n=k.moov(N),D=new Uint8Array(k.FTYP.byteLength+n.byteLength);return D.set(k.FTYP),D.set(n,k.FTYP.byteLength),D},k}();I.types=void 0,I.HDLR_TYPES=void 0,I.STTS=void 0,I.STSC=void 0,I.STCO=void 0,I.STSZ=void 0,I.VMHD=void 0,I.SMHD=void 0,I.STSD=void 0,I.FTYP=void 0,I.DINF=void 0,V.default=I},"./src/remux/mp4-remuxer.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return o}),P.d(V,"normalizePts",function(){return a});var z=P("./src/polyfills/number.ts"),I=P("./src/remux/aac-helper.ts"),k=P("./src/remux/mp4-generator.ts"),K=P("./src/events.ts"),N=P("./src/errors.ts"),n=P("./src/utils/logger.ts"),D=P("./src/types/loader.ts"),y=P("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(R){for(var A=1;A<arguments.length;A++){var v=arguments[A];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(R[b]=v[b])}return R},g.apply(this,arguments)}var m=10*1e3,c=1024,s=1152,d=null,u=null,l=!1,o=function(){function R(v,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=v,this.config=b,this.typeSupported=p,this.ISGenerated=!1,d===null){var _=navigator.userAgent||"",E=_.match(/Chrome\/(\d+)/i);d=E?parseInt(E[1]):0}if(u===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);u=x?parseInt(x[1]):0}l=!!d&&d<75||!!u&&u<600}var A=R.prototype;return A.destroy=function(){},A.resetTimeStamp=function(b){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},A.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(b){var p=!1,h=b.reduce(function(_,E){var x=E.pts-_;return x<-4294967296?(p=!0,a(_,E.pts)):x>0?_:E.pts},b[0].pts);return p&&n.logger.debug("PTS rollover detected"),h},A.remux=function(b,p,h,_,E,x,U,B){var L,H,j,S,J,te,se=E,fe=E,Fe=b.pid>-1,Le=p.pid>-1,De=p.samples.length,He=b.samples.length>0,We=De>1,ye=(!Fe||He)&&(!Le||We)||this.ISGenerated||U;if(ye){this.ISGenerated||(j=this.generateIS(b,p,E));var ue=this.isVideoContiguous,Ye=-1;if(We&&(Ye=C(p.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,Ye>0){n.logger.warn("[mp4-remuxer]: Dropped "+Ye+" out of "+De+" video samples due to a missing keyframe");var vt=this.getVideoStartPts(p.samples);p.samples=p.samples.slice(Ye),p.dropped+=Ye,fe+=(p.samples[0].pts-vt)/(p.timescale||9e4)}else Ye===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+De+" video samples"),te=!1);if(this.ISGenerated){if(He&&We){var ct=this.getVideoStartPts(p.samples),it=a(b.samples[0].pts,ct)-ct,ft=it/p.inputTimeScale;se+=Math.max(0,ft),fe+=Math.max(0,-ft)}if(He){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(b,p,E)),H=this.remuxAudio(b,se,this.isAudioContiguous,x,Le||We||B===D.PlaylistLevelType.AUDIO?fe:void 0),We){var Qe=H?H.endPTS-H.startPTS:0;p.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(b,p,E)),L=this.remuxVideo(p,fe,ue,Qe)}}else We&&(L=this.remuxVideo(p,fe,ue,0));L&&(L.firstKeyFrame=Ye,L.independent=Ye!==-1)}}return this.ISGenerated&&(h.samples.length&&(J=this.remuxID3(h,E)),_.samples.length&&(S=this.remuxText(_,E))),{audio:H,video:L,initSegment:j,independent:te,text:S,id3:J}},A.generateIS=function(b,p,h){var _=b.samples,E=p.samples,x=this.typeSupported,U={},B=!Object(z.isFiniteNumber)(this._initPTS),L="audio/mp4",H,j,S;if(B&&(H=j=Infinity),b.config&&_.length&&(b.timescale=b.samplerate,b.isAAC||(x.mpeg?(L="audio/mpeg",b.codec=""):x.mp3&&(b.codec="mp3")),U.audio={id:"audio",container:L,codec:b.codec,initSegment:!b.isAAC&&x.mpeg?new Uint8Array(0):k.default.initSegment([b]),metadata:{channelCount:b.channelCount}},B&&(S=b.inputTimeScale,H=j=_[0].pts-Math.round(S*h))),p.sps&&p.pps&&E.length&&(p.timescale=p.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:p.codec,initSegment:k.default.initSegment([p]),metadata:{width:p.width,height:p.height}},B)){S=p.inputTimeScale;var J=this.getVideoStartPts(E),te=Math.round(S*h);j=Math.min(j,a(E[0].dts,J)-te),H=Math.min(H,J-te)}if(Object.keys(U).length)return this.ISGenerated=!0,B&&(this._initPTS=H,this._initDTS=j),{tracks:U,initPTS:H,timescale:S}},A.remuxVideo=function(b,p,h,_){var E=b.inputTimeScale,x=b.samples,U=[],B=x.length,L=this._initPTS,H=this.nextAvcDts,j=8,S,J,te,se=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,Fe=0,Le=!1;if(!h||H===null){var De=p*E,He=x[0].pts-a(x[0].dts,x[0].pts);H=De-He}for(var We=0;We<B;We++){var ye=x[We];if(ye.pts=a(ye.pts-L,H),ye.dts=a(ye.dts-L,H),ye.dts>ye.pts){var ue=9e4*.2;Fe=Math.max(Math.min(Fe,ye.pts-ye.dts),-1*ue)}ye.dts<x[We>0?We-1:We].dts&&(Le=!0)}Le&&x.sort(function(Bt,Ut){var Tt=Bt.dts-Ut.dts,kt=Bt.pts-Ut.pts;return Tt||kt}),J=x[0].dts,te=x[x.length-1].dts;var Ye=Math.round((te-J)/(B-1));if(Fe<0){if(Fe<Ye*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-Ye,!0)+" ms");for(var vt=Fe,ct=0;ct<B;ct++)x[ct].dts=vt=Math.max(vt,x[ct].pts-Ye),x[ct].pts=Math.max(vt,x[ct].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 it=0;it<B;it++)x[it].dts=x[it].dts+Fe}J=x[0].dts}if(h){var ft=J-H,Qe=ft>Ye,qe=ft<-1;if(Qe||qe){Qe?n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(ft,!0)+" ms ("+ft+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-ft,!0)+" ms ("+ft+"dts) overlapping between fragments detected"),J=H;var ht=x[0].pts-ft;x[0].dts=J,x[0].pts=ht,n.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(ht,!0)+"/"+Object(y.toMsFromMpegTsClock)(J,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(ft,!0)+" ms")}}l&&(J=Math.max(0,J));for(var de=0,Ie=0,Pe=0;Pe<B;Pe++){for(var Ke=x[Pe],st=Ke.units,at=st.length,et=0,tt=0;tt<at;tt++)et+=st[tt].data.length;Ie+=et,de+=at,Ke.length=et,Ke.dts=Math.max(Ke.dts,J),Ke.pts=Math.max(Ke.pts,Ke.dts,0),se=Math.min(Ke.pts,se),fe=Math.max(Ke.pts,fe)}te=x[B-1].dts;var dt=Ie+4*de+8,yt;try{yt=new Uint8Array(dt)}catch(Bt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:dt,reason:"fail allocating video mdat "+dt});return}var Ae=new DataView(yt.buffer);Ae.setUint32(0,dt),yt.set(k.default.types.mdat,4);for(var Se=0;Se<B;Se++){for(var Ve=x[Se],Je=Ve.units,Ne=0,je=0,Ee=Je.length;je<Ee;je++){var he=Je[je],pe=he.data,re=he.data.byteLength;Ae.setUint32(j,re),j+=4,yt.set(pe,j),j+=re,Ne+=4+re}if(Se<B-1)S=x[Se+1].dts-Ve.dts;else{var oe=this.config,le=Ve.dts-x[Se>0?Se-1:Se].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(oe.maxBufferHole*E),be=(_?se+_*E:this.nextAudioPts)-Ve.pts;be>me?(S=be-le,S<0&&(S=le),n.logger.log("[mp4-remuxer]: It is approximately "+be/90+" ms to the next segment; using duration "+S/90+" ms for the last video frame.")):S=le}else S=le}var Be=Math.round(Ve.pts-Ve.dts);U.push(new w(Ve.key,S,Ne,Be))}if(U.length&&d&&d<70){var $e=U[0].flags;$e.dependsOn=2,$e.isNonSync=0}console.assert(S!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=te+S,this.isVideoContiguous=!0;var ut=k.default.moof(b.sequenceNumber++,J,g({},b,{samples:U})),Et="video",mt={data1:ut,data2:yt,startPTS:se/E,endPTS:(fe+S)/E,startDTS:J/E,endDTS:H/E,type:Et,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(yt.length,"MDAT length must not be zero"),mt},A.remuxAudio=function(b,p,h,_,E){var x=b.inputTimeScale,U=b.samplerate?b.samplerate:x,B=x/U,L=b.isAAC?c:s,H=L*B,j=this._initPTS,S=!b.isAAC&&this.typeSupported.mpeg,J=[],te=b.samples,se=S?0:8,fe=this.nextAudioPts||-1,Fe=p*x;if(this.isAudioContiguous=h=h||te.length&&fe>0&&(_&&Math.abs(Fe-fe)<9e3||Math.abs(a(te[0].pts-j,Fe)-fe)<20*H),te.forEach(function(pe){pe.pts=a(pe.pts-j,Fe)}),!h||fe<0){if(te=te.filter(function(pe){return pe.pts>=0}),!te.length)return;E===0?fe=0:_?fe=Math.max(0,Fe):fe=te[0].pts}if(b.isAAC)for(var Le=E!==void 0,De=this.config.maxAudioFramesDrift,He=0,We=fe;He<te.length;He++){var ye=te[He],ue=ye.pts,Ye=ue-We,vt=Math.abs(1e3*Ye/x);if(Ye<=-De*H&&Le)He===0&&(n.logger.warn("Audio frame @ "+(ue/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ye/x)+" ms."),this.nextAudioPts=fe=We=ue);else if(Ye>=De*H&&vt<m&&Le){var ct=Math.round(Ye/H);We=ue-ct*H,We<0&&(ct--,We+=H),He===0&&(this.nextAudioPts=fe=We),n.logger.warn("[mp4-remuxer]: Injecting "+ct+" audio frame @ "+(We/x).toFixed(3)+"s due to "+Math.round(1e3*Ye/x)+" ms gap.");for(var it=0;it<ct;it++){var ft=Math.max(We,0),Qe=I.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);Qe||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Qe=ye.unit.subarray()),te.splice(He,0,{unit:Qe,pts:ft}),We+=H,He++}}ye.pts=We,We+=H}for(var qe=null,ht=null,de,Ie=0,Pe=te.length;Pe--;)Ie+=te[Pe].unit.byteLength;for(var Ke=0,st=te.length;Ke<st;Ke++){var at=te[Ke],et=at.unit,tt=at.pts;if(ht!==null){var dt=J[Ke-1];dt.duration=Math.round((tt-ht)/B)}else if(h&&b.isAAC&&(tt=fe),qe=tt,Ie>0){Ie+=se;try{de=new Uint8Array(Ie)}catch(pe){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ie,reason:"fail allocating audio mdat "+Ie});return}if(!S){var yt=new DataView(de.buffer);yt.setUint32(0,Ie),de.set(k.default.types.mdat,4)}}else return;de.set(et,se);var Ae=et.byteLength;se+=Ae,J.push(new w(!0,L,Ae,0)),ht=tt}var Se=J.length;if(!Se)return;var Ve=J[J.length-1];this.nextAudioPts=fe=ht+B*Ve.duration;var Je=S?new Uint8Array(0):k.default.moof(b.sequenceNumber++,qe/B,g({},b,{samples:J}));b.samples=[];var Ne=qe/x,je=fe/x,Ee="audio",he={data1:Je,data2:de,startPTS:Ne,endPTS:je,startDTS:Ne,endDTS:je,type:Ee,hasAudio:!0,hasVideo:!1,nb:Se};return this.isAudioContiguous=!0,console.assert(de.length,"MDAT length must not be zero"),he},A.remuxEmptyAudio=function(b,p,h,_){var E=b.inputTimeScale,x=b.samplerate?b.samplerate:E,U=E/x,B=this.nextAudioPts,L=(B!==null?B:_.startDTS*E)+this._initDTS,H=_.endDTS*E+this._initDTS,j=U*c,S=Math.ceil((H-L)/j),J=I.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!J){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],se=0;se<S;se++){var fe=L+se*j;te.push({unit:J,pts:fe,dts:fe})}return b.samples=te,this.remuxAudio(b,p,h,!1)},A.remuxID3=function(b,p){var h=b.samples.length;if(!h)return;for(var _=b.inputTimeScale,E=this._initPTS,x=this._initDTS,U=0;U<h;U++){var B=b.samples[U];B.pts=a(B.pts-E,p*_)/_,B.dts=a(B.dts-x,p*_)/_}var L=b.samples;return b.samples=[],{samples:L}},A.remuxText=function(b,p){var h=b.samples.length;if(!h)return;for(var _=b.inputTimeScale,E=this._initPTS,x=0;x<h;x++){var U=b.samples[x];U.pts=a(U.pts-E,p*_)/_}b.samples.sort(function(L,H){return L.pts-H.pts});var B=b.samples;return b.samples=[],{samples:B}},R}();function a(R,A){var v;if(A===null)return R;for(A<R?v=-8589934592:v=8589934592;Math.abs(R-A)>4294967296;)R+=v;return R}function C(R){for(var A=0;A<R.length;A++)if(R[A].key)return A;return-1}var w=function(A,v,b,p){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=b,this.cts=p,this.flags=new T(A)},T=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/polyfills/number.ts"),I=P("./src/utils/mp4-tools.ts"),k=P("./src/loader/fragment.ts"),K=P("./src/utils/logger.ts"),N=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 g=y.prototype;return g.destroy=function(){},g.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(c,s,d){this.audioCodec=s,this.videoCodec=d,this.generateInitSegment(c),this.emitInitSegment=!0},g.generateInitSegment=function(c){var s=this.audioCodec,d=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(I.parseInitSegment)(c);s||(s=D(u.audio,k.ElementaryStreamTypes.AUDIO)),d||(d=D(u.video,k.ElementaryStreamTypes.VIDEO));var l={};u.audio&&u.video?l.audiovideo={container:"video/mp4",codec:s+","+d,initSegment:c,id:"main"}:u.audio?l.audio={container:"audio/mp4",codec:s,initSegment:c,id:"audio"}:u.video?l.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=l},g.remux=function(c,s,d,u,l){var o=this.initPTS,a=this.lastEndDTS,C={audio:void 0,video:void 0,text:u,id3:d,initSegment:void 0};Object(z.isFiniteNumber)(a)||(a=this.lastEndDTS=l||0);var w=s.samples;if(!w||!w.length)return C;var T={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(w),R=this.initData),!R||!R.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),C;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(o)||(this.initPTS=T.initPTS=o=n(R,w,a));var A=Object(I.getDuration)(w,R),v=a,b=A+v;Object(I.offsetStartDTS)(R,w,o),A>0?this.lastEndDTS=b:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var p=!!R.audio,h=!!R.video,_="";p&&(_+="audio"),h&&(_+="video");var E={data1:w,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:_,hasAudio:p,hasVideo:h,nb:1,dropped:0};return C.audio=E.type==="audio"?E:void 0,C.video=E.type!=="audio"?E:void 0,C.text=u,C.id3=d,C.initSegment=T,C},y}(),n=function(g,m,c){return Object(I.getStartDTS)(g,m)-c};function D(y,g){var m=y==null?void 0:y.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||g===k.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=N},"./src/task-loop.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return z});var z=function(){function I(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var k=I.prototype;return k.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},k.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},k.onHandlerDestroyed=function(){},k.hasInterval=function(){return!!this._tickInterval},k.hasNextTick=function(){return!!this._tickTimer},k.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},k.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},k.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},k.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},k.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},k.doTick=function(){},I}()},"./src/types/cmcd.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"CMCDVersion",function(){return z}),P.d(V,"CMCDObjectType",function(){return I}),P.d(V,"CMCDStreamingFormat",function(){return k}),P.d(V,"CMCDStreamType",function(){return K});var z=1,I;(function(N){N.MANIFEST="m",N.AUDIO="a",N.VIDEO="v",N.MUXED="av",N.INIT="i",N.CAPTION="c",N.TIMED_TEXT="tt",N.KEY="k",N.OTHER="o"})(I||(I={}));var k;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(k||(k={}));var K;(function(N){N.VOD="v",N.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"HlsSkip",function(){return k}),P.d(V,"getSkipValue",function(){return K}),P.d(V,"HlsUrlParameters",function(){return N}),P.d(V,"Level",function(){return n});function z(D,y){for(var g=0;g<y.length;g++){var m=y[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function I(D,y,g){return y&&z(D.prototype,y),g&&z(D,g),D}var k;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(k||(k={}));function K(D,y){var g=D.canSkipUntil,m=D.canSkipDateRanges,c=D.endSN,s=y!==void 0?y-c:0;return g&&s<g?m?k.v2:k.Yes:k.No}var N=function(){function D(g,m,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=m,this.skip=c}var y=D.prototype;return y.addDirectives=function(m){var c=new self.URL(m);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(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return I(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(g){var m=g%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),D}()},"./src/types/loader.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"PlaylistContextType",function(){return z}),P.d(V,"PlaylistLevelType",function(){return I});var z;(function(k){k.MANIFEST="manifest",k.LEVEL="level",k.AUDIO_TRACK="audioTrack",k.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var I;(function(k){k.MAIN="main",k.AUDIO="audio",k.SUBTITLE="subtitle"})(I||(I={}))},"./src/types/transmuxer.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"ChunkMetadata",function(){return z});var z=function(K,N,n,D,y,g){D===void 0&&(D=0),y===void 0&&(y=-1),g===void 0&&(g=!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=I(),this.buffering={audio:I(),video:I(),audiovideo:I()},this.level=K,this.sn=N,this.id=n,this.size=D,this.part=y,this.partial=g};function I(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"AttrList",function(){return k});var z=/^(\d+)x(\d+)$/,I=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,k=function(){function K(n){typeof n=="string"&&(n=K.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var N=K.prototype;return N.decimalInteger=function(D){var y=parseInt(this[D],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},N.hexadecimalInteger=function(D){if(this[D]){var y=(this[D]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var g=new Uint8Array(y.length/2),m=0;m<y.length/2;m++)g[m]=parseInt(y.slice(m*2,m*2+2),16);return g}else return null},N.hexadecimalIntegerAsNumber=function(D){var y=parseInt(this[D],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},N.decimalFloatingPoint=function(D){return parseFloat(this[D])},N.optionalFloat=function(D,y){var g=this[D];return g?parseFloat(g):y},N.enumeratedString=function(D){return this[D]},N.bool=function(D){return this[D]==="YES"},N.decimalResolution=function(D){var y=z.exec(this[D]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},K.parseAttrList=function(D){var y,g={},m='"';for(I.lastIndex=0;(y=I.exec(D))!==null;){var c=y[2];c.indexOf(m)===0&&c.lastIndexOf(m)===c.length-1&&(c=c.slice(1,-1)),g[y[1]]=c}return g},K}()},"./src/utils/binary-search.ts":function(Z,V,P){"use strict";P.r(V);var z={search:function(k,K){for(var N=0,n=k.length-1,D=null,y=null;N<=n;){D=(N+n)/2|0,y=k[D];var g=K(y);if(g>0)N=D+1;else if(g<0)n=D-1;else return y}return null}};V.default=z},"./src/utils/buffer-helper.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"BufferHelper",function(){return k});var z=P("./src/utils/logger.ts"),I={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function K(){}return K.isBuffered=function(n,D){try{if(n){for(var y=K.getBuffered(n),g=0;g<y.length;g++)if(D>=y.start(g)&&D<=y.end(g))return!0}}catch(m){}return!1},K.bufferInfo=function(n,D,y){try{if(n){var g=K.getBuffered(n),m=[],c;for(c=0;c<g.length;c++)m.push({start:g.start(c),end:g.end(c)});return this.bufferedInfo(m,D,y)}}catch(s){}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,R){var A=T.start-R.start;return A||R.end-T.end});var g=[];if(y)for(var m=0;m<n.length;m++){var c=g.length;if(c){var s=g[c-1].end;n[m].start-s<y?n[m].end>s&&(g[c-1].end=n[m].end):g.push(n[m])}else g.push(n[m])}else g=n;for(var d=0,u,l=D,o=D,a=0;a<g.length;a++){var C=g[a].start,w=g[a].end;if(D+y>=C&&D<w)l=C,o=w,d=o-D;else if(D+y<C){u=C;break}}return{len:d,start:l||0,end:o||0,nextStart:u}},K.getBuffered=function(n){try{return n.buffered}catch(D){return z.logger.log("failed to get media.buffered",D),I}},K}()},"./src/utils/cea-608-parser.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"Row",function(){return o}),P.d(V,"CaptionScreen",function(){return a});var z=P("./src/utils/logger.ts"),I={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},k=function(b){var p=b;return I.hasOwnProperty(b)&&(p=I[b]),String.fromCharCode(p)},K=15,N=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},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(c||(c={}));var s=function(){function v(){this.time=null,this.verboseLevel=c.ERROR}var b=v.prototype;return b.log=function(h,_){this.verboseLevel>=h&&z.logger.log(this.time+" ["+h+"] "+_)},v}(),d=function(b){for(var p=[],h=0;h<b.length;h++)p.push(b[h].toString(16));return p},u=function(){function v(p,h,_,E,x){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=_||!1,this.background=E||"black",this.flash=x||!1}var b=v.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 _=["foreground","underline","italics","background","flash"],E=0;E<_.length;E++){var x=_[E];h.hasOwnProperty(x)&&(this[x]=h[x])}},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},v}(),l=function(){function v(p,h,_,E,x,U){this.uchar=void 0,this.penState=void 0,this.uchar=p||" ",this.penState=new u(h,_,E,x,U)}var b=v.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(h,_){this.uchar=h,this.penState.copy(_)},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()},v}(),o=function(){function v(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<N;h++)this.chars.push(new l);this.logger=p,this.pos=0,this.currPenState=new u}var b=v.prototype;return b.equals=function(h){for(var _=!0,E=0;E<N;E++)if(!this.chars[E].equals(h.chars[E])){_=!1;break}return _},b.copy=function(h){for(var _=0;_<N;_++)this.chars[_].copy(h.chars[_])},b.isEmpty=function(){for(var h=!0,_=0;_<N;_++)if(!this.chars[_].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>N&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},b.moveCursor=function(h){var _=this.pos+h;if(h>1)for(var E=this.pos+1;E<_+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(_)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(h){h>=144&&this.backSpace();var _=k(h);if(this.pos>=N){this.logger.log(c.ERROR,"Cannot insert "+h.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(h){var _;for(_=h;_<N;_++)this.chars[_].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=[],_=!0,E=0;E<N;E++){var x=this.chars[E].uchar;x!==" "&&(_=!1),h.push(x)}return _?"":h.join("")},b.setPenStyles=function(h){this.currPenState.setStyles(h);var _=this.chars[this.pos];_.setPenState(this.currPenState)},v}(),a=function(){function v(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 o(p));this.logger=p,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=v.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 _=!0,E=0;E<K;E++)if(!this.rows[E].equals(h.rows[E])){_=!1;break}return _},b.copy=function(h){for(var _=0;_<K;_++)this.rows[_].copy(h.rows[_])},b.isEmpty=function(){for(var h=!0,_=0;_<K;_++)if(!this.rows[_].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 _=this.rows[this.currRow];_.insertChar(h)},b.setPen=function(h){var _=this.rows[this.currRow];_.setPenStyles(h)},b.moveCursor=function(h){var _=this.rows[this.currRow];_.moveCursor(h)},b.setCursor=function(h){this.logger.log(c.INFO,"setCursor: "+h);var _=this.rows[this.currRow];_.setCursor(h)},b.setPAC=function(h){this.logger.log(c.INFO,"pacData = "+JSON.stringify(h));var _=h.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var E=0;E<K;E++)this.rows[E].clear();var x=this.currRow+1-this.nrRollUpRows,U=this.lastOutputScreen;if(U){var B=U.rows[x].cueStartTime,L=this.logger.time;if(B&&L!==null&&B<L)for(var H=0;H<this.nrRollUpRows;H++)this.rows[_-this.nrRollUpRows+H+1].copy(U.rows[x+H])}}this.currRow=_;var j=this.rows[this.currRow];if(h.indent!==null){var S=h.indent,J=Math.max(S-1,0);j.setCursor(h.indent),h.color=j.chars[J].penState.foreground}var te={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(te)},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,_=this.rows.splice(h,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(c.INFO,"Rolling up")},b.getDisplayText=function(h){h=h||!1;for(var _=[],E="",x=-1,U=0;U<K;U++){var B=this.rows[U].getTextString();B&&(x=U+1,h?_.push("Row "+x+": '"+B+"'"):_.push(B.trim()))}return _.length>0&&(h?E="["+_.join(" | ")+"]":E=_.join(`
|
|
`)),E},b.getTextAndFormat=function(){return this.rows},v}(),C=function(){function v(p,h,_){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 a(_),this.nonDisplayedMemory=new a(_),this.lastOutputScreen=new a(_),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var b=v.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 _=0;_<h.length;_++)this.writeScreen.insertChar(h[_]);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 _={flash:!1};if(_.underline=h%2===1,_.italics=h>=46,_.italics)_.foreground="white";else{var E=Math.floor(h/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=x[E]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},b.outputDataUpdate=function(h){h===void 0&&(h=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),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))},v}(),w=function(){function v(p,h,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new s;this.channels=[null,new C(p,h,E),new C(p+1,_,E)],this.cmdHistory=A(),this.logger=E}var b=v.prototype;return b.getHandler=function(h){return this.channels[h].getHandler()},b.setHandler=function(h,_){this.channels[h].setHandler(_)},b.addData=function(h,_){var E,x,U,B=!1;this.logger.time=h;for(var L=0;L<_.length;L+=2){if(x=_[L]&127,U=_[L+1]&127,x===0&&U===0)continue;if(this.logger.log(c.DATA,"["+d([_[L],_[L+1]])+"] -> ("+d([x,U])+")"),E=this.parseCmd(x,U),E||(E=this.parseMidrow(x,U)),E||(E=this.parsePAC(x,U)),E||(E=this.parseBackgroundAttributes(x,U)),!E&&(B=this.parseChars(x,U),B)){var H=this.currentChannel;if(H&&H>0){var j=this.channels[H];j.insertChars(B)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!B&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+d([x,U])+" orig: "+d([_[L],_[L+1]]))}},b.parseCmd=function(h,_){var E=this.cmdHistory,x=(h===20||h===28||h===21||h===29)&&_>=32&&_<=47,U=(h===23||h===31)&&_>=33&&_<=35;if(!(x||U))return!1;if(R(h,_,E))return T(null,null,E),this.logger.log(c.DEBUG,"Repeated command ("+d([h,_])+") is dropped"),!0;var B=h===20||h===21||h===23?1:2,L=this.channels[B];return h===20||h===21||h===28||h===29?_===32?L.ccRCL():_===33?L.ccBS():_===34?L.ccAOF():_===35?L.ccAON():_===36?L.ccDER():_===37?L.ccRU(2):_===38?L.ccRU(3):_===39?L.ccRU(4):_===40?L.ccFON():_===41?L.ccRDC():_===42?L.ccTR():_===43?L.ccRTD():_===44?L.ccEDM():_===45?L.ccCR():_===46?L.ccENM():_===47&&L.ccEOC():L.ccTO(_-32),T(h,_,E),this.currentChannel=B,!0},b.parseMidrow=function(h,_){var E=0;if((h===17||h===25)&&_>=32&&_<=47){if(h===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[E];return x?(x.ccMIDROW(_),this.logger.log(c.DEBUG,"MIDROW ("+d([h,_])+")"),!0):!1}return!1},b.parsePAC=function(h,_){var E,x=this.cmdHistory,U=(h>=17&&h<=23||h>=25&&h<=31)&&_>=64&&_<=127,B=(h===16||h===24)&&_>=64&&_<=95;if(!(U||B))return!1;if(R(h,_,x))return T(null,null,x),!0;var L=h<=23?1:2;_>=64&&_<=95?E=L===1?n[h]:y[h]:E=L===1?D[h]:g[h];var H=this.channels[L];return H?(H.setPAC(this.interpretPAC(E,_)),T(h,_,x),this.currentChannel=L,!0):!1},b.interpretPAC=function(h,_){var E,x={color:null,italics:!1,indent:null,underline:!1,row:h};return _>95?E=_-96:E=_-64,x.underline=(E&1)===1,E<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((E-16)/2)*4,x},b.parseChars=function(h,_){var E,x=null,U=null;if(h>=25?(E=2,U=h-8):(E=1,U=h),U>=17&&U<=19){var B;U===17?B=_+80:U===18?B=_+112:B=_+144,this.logger.log(c.INFO,"Special char '"+k(B)+"' in channel "+E),x=[B]}else h>=32&&h<=127&&(x=_===0?[h]:[h,_]);if(x){var L=d(x);this.logger.log(c.DEBUG,"Char codes = "+L.join(",")),T(h,_,this.cmdHistory)}return x},b.parseBackgroundAttributes=function(h,_){var E=(h===16||h===24)&&_>=32&&_<=47,x=(h===23||h===31)&&_>=45&&_<=47;if(!(E||x))return!1;var U,B={};h===16||h===24?(U=Math.floor((_-32)/2),B.background=m[U],_%2===1&&(B.background=B.background+"_semi")):_===45?B.background="transparent":(B.foreground="black",_===47&&(B.underline=!0));var L=h<=23?1:2,H=this.channels[L];return H.setBkgData(B),T(h,_,this.cmdHistory),!0},b.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var _=this.channels[h];_&&_.reset()}this.cmdHistory=A()},b.cueSplitAtTime=function(h){for(var _=0;_<this.channels.length;_++){var E=this.channels[_];E&&E.cueSplitAtTime(h)}},v}();function T(v,b,p){p.a=v,p.b=b}function R(v,b,p){return p.a===v&&p.b===b}function A(){return{a:null,b:null}}V.default=w},"./src/utils/codecs.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"isCodecType",function(){return I}),P.d(V,"isCodecSupportedInMp4",function(){return k});var z={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 I(K,N){var n=z[N];return!!n&&n[K.slice(0,4)]===!0}function k(K,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/utils/vttparser.ts"),I=P("./src/utils/webvtt-parser.ts"),k=P("./src/utils/texttrack-utils.ts"),K=/\s/,N={newCue:function(D,y,g,m){for(var c=[],s,d,u,l,o,a=self.VTTCue||self.TextTrackCue,C=0;C<m.rows.length;C++)if(s=m.rows[C],u=!0,l=0,o="",!s.isEmpty()){for(var w=0;w<s.chars.length;w++)K.test(s.chars[w].uchar)&&u?l++:(o+=s.chars[w].uchar,u=!1);s.cueStartTime=y,y===g&&(g+=1e-4),l>=16?l--:l++;var T=Object(z.fixLineBreaks)(o.trim()),R=Object(I.generateCueId)(y,g,T);(!D||!D.cues||!D.cues.getCueById(R))&&(d=new a(y,g,T),d.id=R,d.line=C+1,d.align="left",d.position=10+Math.min(80,Math.floor(l*8/32)*10),c.push(d))}return D&&c.length&&(c.sort(function(A,v){return A.line==="auto"||v.line==="auto"?0:A.line>8&&v.line>8?v.line-A.line:A.line-v.line}),c.forEach(function(A){return Object(k.addCueToTrack)(D,A)})),c}};V.default=N},"./src/utils/discontinuities.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"findFirstFragWithCC",function(){return K}),P.d(V,"shouldAlignOnDiscontinuities",function(){return N}),P.d(V,"findDiscontinuousReferenceFrag",function(){return n}),P.d(V,"adjustSlidingStart",function(){return y}),P.d(V,"alignStream",function(){return g}),P.d(V,"alignPDT",function(){return c}),P.d(V,"alignFragmentByPDTDelta",function(){return s}),P.d(V,"alignMediaPlaylistByPDT",function(){return d});var z=P("./src/polyfills/number.ts"),I=P("./src/utils/logger.ts"),k=P("./src/controller/level-helper.ts");function K(u,l){for(var o=null,a=0,C=u.length;a<C;a++){var w=u[a];if(w&&w.cc===l){o=w;break}}return o}function N(u,l,o){return!!(l.details&&(o.endCC>o.startCC||u&&u.cc<o.startCC))}function n(u,l){var o=u.fragments,a=l.fragments;if(!a.length||!o.length){I.logger.log("No fragments to align");return}var C=K(o,a[0].cc);if(!C||C&&!C.startPTS){I.logger.log("No frag in previous level to align on");return}return C}function D(u,l){if(u){var o=u.start+l;u.start=u.startPTS=o,u.endPTS=o+u.duration}}function y(u,l){for(var o=l.fragments,a=0,C=o.length;a<C;a++)D(o[a],u);l.fragmentHint&&D(l.fragmentHint,u),l.alignedSliding=!0}function g(u,l,o){if(!l)return;m(u,o,l),!o.alignedSliding&&l.details&&c(o,l.details),!o.alignedSliding&&l.details&&!o.skippedSegments&&Object(k.adjustSliding)(l.details,o)}function m(u,l,o){if(N(u,o,l)){var a=n(o.details,l);a&&Object(z.isFiniteNumber)(a.start)&&(I.logger.log("Adjusting PTS using last level due to CC increase within current level "+l.url),y(a.start,l))}}function c(u,l){if(!l.fragments.length||!u.hasProgramDateTime||!l.hasProgramDateTime)return;var o=l.fragments[0].programDateTime,a=u.fragments[0].programDateTime,C=(a-o)/1e3+l.fragments[0].start;C&&Object(z.isFiniteNumber)(C)&&(I.logger.log("Adjusting PTS using programDateTime delta "+(a-o)+"ms, sliding:"+C.toFixed(3)+" "+u.url+" "),y(C,u))}function s(u,l){var o=u.programDateTime;if(!o)return;var a=(o-l)/1e3;u.start=u.startPTS=a,u.endPTS=a+u.duration}function d(u,l){if(!l.fragments.length||!u.hasProgramDateTime||!l.hasProgramDateTime)return;var o=l.fragments[0].programDateTime,a=l.fragments[0].start,C=o-a*1e3;u.fragments.forEach(function(w){s(w,C)}),u.fragmentHint&&s(u.fragmentHint,C),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/utils/ewma.ts"),I=function(){function k(N,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 z.default(N),this.fast_=new z.default(n)}var K=k.prototype;return K.update=function(n,D){var y=this.slow_,g=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new z.default(n,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new z.default(D,g.getEstimate(),g.getTotalWeight()))},K.sample=function(n,D){n=Math.max(n,this.minDelayMs_);var y=8*D,g=n/1e3,m=y/g;this.fast_.sample(g,m),this.slow_.sample(g,m)},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(){},k}();V.default=I},"./src/utils/ewma.ts":function(Z,V,P){"use strict";P.r(V);var z=function(){function I(K,N,n){N===void 0&&(N=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_=N,this.totalWeight_=n}var k=I.prototype;return k.sample=function(N,n){var D=Math.pow(this.alpha_,N);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=N},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},I}();V.default=z},"./src/utils/fetch-loader.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"fetchSupported",function(){return s});var z=P("./src/polyfills/number.ts"),I=P("./src/loader/load-stats.ts"),k=P("./src/demux/chunk-cache.ts");function K(a,C){a.prototype=Object.create(C.prototype),a.prototype.constructor=a,g(a,C)}function N(a){var C=typeof Map=="function"?new Map:void 0;return N=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 C!="undefined"){if(C.has(T))return C.get(T);C.set(T,R)}function R(){return n(T,arguments,m(this).constructor)}return R.prototype=Object.create(T.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),g(R,T)},N(a)}function n(a,C,w){return D()?n=Reflect.construct:n=function(R,A,v){var b=[null];b.push.apply(b,A);var p=Function.bind.apply(R,b),h=new p;return v&&g(h,v.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(a){return!1}}function y(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function g(a,C){return g=Object.setPrototypeOf||function(T,R){return T.__proto__=R,T},g(a,C)}function m(a){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},m(a)}function c(){return c=Object.assign||function(a){for(var C=1;C<arguments.length;C++){var w=arguments[C];for(var T in w)Object.prototype.hasOwnProperty.call(w,T)&&(a[T]=w[T])}return a},c.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var d=function(){function a(w){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=w.fetchSetup||l,this.controller=new self.AbortController,this.stats=new I.LoadStats}var C=a.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(T,R,A){var v=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=u(T,this.controller.signal),h=A.onProgress,_=T.responseType==="arraybuffer",E=_?"byteLength":"length";this.context=T,this.config=R,this.callbacks=A,this.request=this.fetchSetup(T,p),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),A.onTimeout(b,T,v.response)},R.timeout),self.fetch(this.request).then(function(x){if(v.response=v.loader=x,!x.ok){var U=x.status,B=x.statusText;throw new o(B||"fetch, bad network response",U,x)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(x.headers.get("Content-Length")||"0"),h&&Object(z.isFiniteNumber)(R.highWaterMark)?v.loadProgressively(x,b,T,R.highWaterMark,h):_?x.arrayBuffer():x.text()}).then(function(x){var U=v.response;self.clearTimeout(v.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=x[E];var B={url:U.url,data:x};h&&!Object(z.isFiniteNumber)(R.highWaterMark)&&h(b,T,x,U),A.onSuccess(B,b,T,U)}).catch(function(x){if(self.clearTimeout(v.requestTimeout),b.aborted)return;var U=x.code||0;A.onError({code:U,text:x.message},T,x.details)})},C.getCacheAge=function(){var T=null;if(this.response){var R=this.response.headers.get("age");T=R?parseFloat(R):null}return T},C.loadProgressively=function(T,R,A,v,b){v===void 0&&(v=0);var p=new k.default,h=T.body.getReader(),_=function E(){return h.read().then(function(x){if(x.done)return p.dataLength&&b(R,A,p.flush(),T),Promise.resolve(new ArrayBuffer(0));var U=x.value,B=U.length;return R.loaded+=B,B<v||p.dataLength?(p.push(U),p.dataLength>=v&&b(R,A,p.flush(),T)):b(R,A,U,T),E()}).catch(function(){return Promise.reject()})};return _()},a}();function u(a,C){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(c({},a.headers))};return a.rangeEnd&&w.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),w}function l(a,C){return new self.Request(a.url,C)}var o=function(a){K(C,a);function C(w,T,R){var A;return A=a.call(this,w)||this,A.code=void 0,A.details=void 0,A.code=T,A.details=R,A}return C}(N(Error));V.default=d},"./src/utils/imsc1-ttml-parser.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"IMSC1_CODEC",function(){return y}),P.d(V,"parseIMSC1",function(){return s});var z=P("./src/utils/mp4-tools.ts"),I=P("./src/utils/vttparser.ts"),k=P("./src/utils/vttcue.ts"),K=P("./src/demux/id3.ts"),N=P("./src/utils/timescale-conversion.ts"),n=P("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(v){for(var b=1;b<arguments.length;b++){var p=arguments[b];for(var h in p)Object.prototype.hasOwnProperty.call(p,h)&&(v[h]=p[h])}return v},D.apply(this,arguments)}var y="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(v,b,p,h,_){var E=Object(z.findBox)(new Uint8Array(v),["mdat"]);if(E.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var x=E[0],U=Object(K.utf8ArrayToStr)(new Uint8Array(v,x.start,x.end-x.start)),B=Object(N.toTimescaleFromScale)(b,1,p);try{h(d(U,B))}catch(L){_(L)}}function d(v,b){var p=new DOMParser,h=p.parseFromString(v,"text/xml"),_=h.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(E).reduce(function(j,S){return j[S]=_.getAttribute("ttp:"+S)||E[S],j},{}),U=_.getAttribute("xml:space")!=="preserve",B=l(u(_,"styling","style")),L=l(u(_,"layout","region")),H=u(_,"body","[begin]");return[].map.call(H,function(j){var S=o(j,U);if(!S||!j.hasAttribute("begin"))return null;var J=T(j.getAttribute("begin"),x),te=T(j.getAttribute("dur"),x),se=T(j.getAttribute("end"),x);if(J===null)throw w(j);if(se===null){if(te===null)throw w(j);se=J+te}var fe=new k.default(J-b,se-b,S);fe.id=Object(n.generateCueId)(fe.startTime,fe.endTime,fe.text);var Fe=L[j.getAttribute("region")],Le=B[j.getAttribute("style")];fe.position=10,fe.size=80;var De=a(Fe,Le),He=De.textAlign;if(He){var We=c[He];We&&(fe.lineAlign=We),fe.align=He}return D(fe,De),fe}).filter(function(j){return j!==null})}function u(v,b,p){var h=v.getElementsByTagName(b)[0];return h?[].slice.call(h.querySelectorAll(p)):[]}function l(v){return v.reduce(function(b,p){var h=p.getAttribute("xml:id");return h&&(b[h]=p),b},{})}function o(v,b){return[].slice.call(v.childNodes).reduce(function(p,h,_){var E;return h.nodeName==="br"&&_?p+`
|
|
`:(E=h.childNodes)!==null&&E!==void 0&&E.length?o(h,b):b?p+h.textContent.trim().replace(/\s+/g," "):p+h.textContent},"")}function a(v,b){var p="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(_,E){var x=C(b,p,E)||C(v,p,E);return x&&(_[E]=x),_},{})}function C(v,b,p){return v.hasAttributeNS(b,p)?v.getAttributeNS(b,p):null}function w(v){return new Error("Could not parse ttml timestamp "+v)}function T(v,b){if(!v)return null;var p=Object(I.parseTimeStamp)(v);return p===null&&(g.test(v)?p=R(v,b):m.test(v)&&(p=A(v,b))),p}function R(v,b){var p=g.exec(v),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 A(v,b){var p=m.exec(v),h=Number(p[1]),_=p[2];switch(_){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,V,P){"use strict";P.r(V),P.d(V,"enableLogs",function(){return n}),P.d(V,"logger",function(){return D});var z=function(){},I={trace:z,debug:z,log:z,warn:z,info:z,error:z},k=I;function K(y){var g=self.console[y];return g?g.bind(self.console,"["+y+"] >"):z}function N(y){for(var g=arguments.length,m=new Array(g>1?g-1:0),c=1;c<g;c++)m[c-1]=arguments[c];m.forEach(function(s){k[s]=y[s]?y[s].bind(y):K(s)})}function n(y){if(self.console&&y===!0||typeof y=="object"){N(y,"debug","log","info","warn","error");try{k.log()}catch(g){k=I}}else k=I}var D=k},"./src/utils/mediakeys-helper.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"KeySystems",function(){return z}),P.d(V,"requestMediaKeySystemAccess",function(){return I});var z;(function(k){k.WIDEVINE="com.widevine.alpha",k.PLAYREADY="com.microsoft.playready"})(z||(z={}));var I=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"bin2str",function(){return N}),P.d(V,"readUint16",function(){return n}),P.d(V,"readUint32",function(){return D}),P.d(V,"writeUint32",function(){return y}),P.d(V,"findBox",function(){return g}),P.d(V,"parseSegmentIndex",function(){return m}),P.d(V,"parseInitSegment",function(){return c}),P.d(V,"getStartDTS",function(){return s}),P.d(V,"getDuration",function(){return d}),P.d(V,"computeRawDurationFromSamples",function(){return u}),P.d(V,"offsetStartDTS",function(){return l}),P.d(V,"segmentValidRange",function(){return o}),P.d(V,"appendUint8Array",function(){return a});var z=P("./src/utils/typed-array.ts"),I=P("./src/loader/fragment.ts"),k=Math.pow(2,32)-1,K=[].push;function N(C){return String.fromCharCode.apply(null,C)}function n(C,w){"data"in C&&(w+=C.start,C=C.data);var T=C[w]<<8|C[w+1];return T<0?65536+T:T}function D(C,w){"data"in C&&(w+=C.start,C=C.data);var T=C[w]<<24|C[w+1]<<16|C[w+2]<<8|C[w+3];return T<0?4294967296+T:T}function y(C,w,T){"data"in C&&(w+=C.start,C=C.data),C[w]=T>>24,C[w+1]=T>>16&255,C[w+2]=T>>8&255,C[w+3]=T&255}function g(C,w){var T=[];if(!w.length)return T;var R,A,v;"data"in C?(R=C.data,A=C.start,v=C.end):(R=C,A=0,v=R.byteLength);for(var b=A;b<v;){var p=D(R,b),h=N(R.subarray(b+4,b+8)),_=p>1?b+p:v;if(h===w[0])if(w.length===1)T.push({data:R,start:b+8,end:_});else{var E=g({data:R,start:b+8,end:_},w.slice(1));E.length&&K.apply(T,E)}b=_}return T}function m(C){var w=g(C,["moov"]),T=w[0],R=T?T.end:null,A=g(C,["sidx"]);if(!A||!A[0])return null;var v=[],b=A[0],p=b.data[0],h=p===0?8:16,_=D(b,h);h+=4;var E=0,x=0;p===0?h+=8:h+=16,h+=2;var U=b.end+x,B=n(b,h);h+=2;for(var L=0;L<B;L++){var H=h,j=D(b,H);H+=4;var S=j&2147483647,J=(j&2147483648)>>>31;if(J===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=D(b,H);H+=4,v.push({referenceSize:S,subsegmentDuration:te,info:{duration:te/_,start:U,end:U+S-1}}),U+=S,H+=4,h=H}return{earliestPresentationTime:E,timescale:_,version:p,referencesCount:B,references:v,moovEndOffset:R}}function c(C){for(var w=[],T=g(C,["moov","trak"]),R=0;R<T.length;R++){var A=T[R],v=g(A,["tkhd"])[0];if(v){var b=v.data[v.start],p=b===0?12:20,h=D(v,p),_=g(A,["mdia","mdhd"])[0];if(_){b=_.data[_.start],p=b===0?12:20;var E=D(_,p),x=g(A,["mdia","hdlr"])[0];if(x){var U=N(x.data.subarray(x.start+8,x.start+12)),B={soun:I.ElementaryStreamTypes.AUDIO,vide:I.ElementaryStreamTypes.VIDEO}[U];if(B){var L=g(A,["mdia","minf","stbl","stsd"])[0],H=void 0;L&&(H=N(L.data.subarray(L.start+12,L.start+16))),w[h]={timescale:E,type:B},w[B]={timescale:E,id:h,codec:H}}}}}}var j=g(C,["moov","mvex","trex"]);return j.forEach(function(S){var J=D(S,4),te=w[J];te&&(te.default={duration:D(S,12),flags:D(S,20)})}),w}function s(C,w){return g(w,["moof","traf"]).reduce(function(T,R){var A=g(R,["tfdt"])[0],v=A.data[A.start],b=g(R,["tfhd"]).reduce(function(p,h){var _=D(h,4),E=C[_];if(E){var x=D(A,4);v===1&&(x*=Math.pow(2,32),x+=D(A,8));var U=E.timescale||9e4,B=x/U;if(isFinite(B)&&(p===null||B<p))return B}return p},null);return b!==null&&isFinite(b)&&(T===null||b<T)?b:T},null)||0}function d(C,w){for(var T=0,R=0,A=0,v=g(C,["moof","traf"]),b=0;b<v.length;b++){var p=v[b],h=g(p,["tfhd"])[0],_=D(h,4),E=w[_];if(!E)continue;var x=E.default,U=D(h,0)|(x==null?void 0:x.flags),B=x==null?void 0:x.duration;U&8&&(U&2?B=D(h,12):B=D(h,8));for(var L=E.timescale||9e4,H=g(p,["trun"]),j=0;j<H.length;j++){if(B){var S=D(H[j],4);T=B*S}else T=u(H[j]);E.type===I.ElementaryStreamTypes.VIDEO?R+=T/L:E.type===I.ElementaryStreamTypes.AUDIO&&(A+=T/L)}}if(R===0&&A===0){var J=m(C);if(J!=null&&J.references)return J.references.reduce(function(te,se){return te+se.info.duration||0},0)}return R||A}function u(C){var w=D(C,0),T=8;w&1&&(T+=4),w&4&&(T+=4);for(var R=0,A=D(C,4),v=0;v<A;v++){if(w&256){var b=D(C,T);R+=b,T+=4}w&512&&(T+=4),w&1024&&(T+=4),w&2048&&(T+=4)}return R}function l(C,w,T){g(w,["moof","traf"]).forEach(function(R){g(R,["tfhd"]).forEach(function(A){var v=D(A,4),b=C[v];if(!b)return;var p=b.timescale||9e4;g(R,["tfdt"]).forEach(function(h){var _=h.data[h.start],E=D(h,4);if(_===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 x=Math.floor(E/(k+1)),U=Math.floor(E%(k+1));y(h,4,x),y(h,8,U)}})})})}function o(C){var w={valid:null,remainder:null},T=g(C,["moof"]);if(T){if(T.length<2)return w.remainder=C,w}else return w;var R=T[T.length-1];return w.valid=Object(z.sliceUint8)(C,0,R.start-8),w.remainder=Object(z.sliceUint8)(C,R.start-8),w}function a(C,w){var T=new Uint8Array(C.length+w.length);return T.set(C),T.set(w,C.length),T}},"./src/utils/output-filter.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"default",function(){return z});var z=function(){function I(K,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=N}var k=I.prototype;return k.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},k.newCue=function(N,n,D){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[]},I}()},"./src/utils/texttrack-utils.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"sendAddTrackEvent",function(){return I}),P.d(V,"addCueToTrack",function(){return k}),P.d(V,"clearCurrentCues",function(){return K}),P.d(V,"removeCuesInRange",function(){return N}),P.d(V,"getCuesInRange",function(){return D});var z=P("./src/utils/logger.ts");function I(y,g){var m;try{m=new Event("addtrack")}catch(c){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=y,g.dispatchEvent(m)}function k(y,g){var m=y.mode;if(m==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(g.id))try{if(y.addCue(g),!y.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(s){z.logger.debug("[texttrack-utils]: "+s);var c=new self.TextTrackCue(g.startTime,g.endTime,g.text);c.id=g.id,y.addCue(c)}m==="disabled"&&(y.mode=m)}function K(y){var g=y.mode;if(g==="disabled"&&(y.mode="hidden"),y.cues)for(var m=y.cues.length;m--;)y.removeCue(y.cues[m]);g==="disabled"&&(y.mode=g)}function N(y,g,m){var c=y.mode;if(c==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var s=D(y.cues,g,m),d=0;d<s.length;d++)y.removeCue(s[d]);c==="disabled"&&(y.mode=c)}function n(y,g){if(g<y[0].startTime)return 0;var m=y.length-1;if(g>y[m].endTime)return-1;for(var c=0,s=m;c<=s;){var d=Math.floor((s+c)/2);if(g<y[d].startTime)s=d-1;else if(g>y[d].startTime&&c<m)c=d+1;else return d}return y[c].startTime-g<g-y[s].startTime?c:s}function D(y,g,m){var c=[],s=n(y,g);if(s>-1)for(var d=s,u=y.length;d<u;d++){var l=y[d];if(l.startTime>=g&&l.endTime<=m)c.push(l);else if(l.startTime>m)return c}return c}},"./src/utils/time-ranges.ts":function(Z,V,P){"use strict";P.r(V);var z={toString:function(k){for(var K="",N=k.length,n=0;n<N;n++)K+="["+k.start(n).toFixed(3)+","+k.end(n).toFixed(3)+"]";return K}};V.default=z},"./src/utils/timescale-conversion.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"toTimescaleFromBase",function(){return I}),P.d(V,"toTimescaleFromScale",function(){return k}),P.d(V,"toMsFromMpegTsClock",function(){return K}),P.d(V,"toMpegTsClockFromTimescale",function(){return N});var z=9e4;function I(n,D,y,g){y===void 0&&(y=1),g===void 0&&(g=!1);var m=n*D*y;return g?Math.round(m):m}function k(n,D,y,g){return y===void 0&&(y=1),g===void 0&&(g=!1),I(n,D,1/y,g)}function K(n,D){return D===void 0&&(D=!1),I(n,1e3,1/z,D)}function N(n,D){return D===void 0&&(D=1),I(n,z,1/D)}},"./src/utils/typed-array.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"sliceUint8",function(){return z});function z(I,k,K){return Uint8Array.prototype.slice?I.slice(k,K):new Uint8Array(Array.prototype.slice.call(I,k,K))}},"./src/utils/vttcue.ts":function(Z,V,P){"use strict";P.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],I=["start","middle","end","left","right"];function k(y,g){if(typeof g!="string")return!1;if(!Array.isArray(y))return!1;var m=g.toLowerCase();return~y.indexOf(m)?m:!1}function K(y){return k(z,y)}function N(y){return k(I,y)}function n(y){for(var g=arguments.length,m=new Array(g>1?g-1:0),c=1;c<g;c++)m[c-1]=arguments[c];for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var u in d)y[u]=d[u]}return y}function D(y,g,m){var c=this,s={enumerable:!0};c.hasBeenReset=!1;var d="",u=!1,l=y,o=g,a=m,C=null,w="",T=!0,R="auto",A="start",v=50,b="middle",p=50,h="middle";Object.defineProperty(c,"id",n({},s,{get:function(){return d},set:function(E){d=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},s,{get:function(){return u},set:function(E){u=!!E}})),Object.defineProperty(c,"startTime",n({},s,{get:function(){return l},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");l=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},s,{get:function(){return o},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");o=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},s,{get:function(){return a},set:function(E){a=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},s,{get:function(){return C},set:function(E){C=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},s,{get:function(){return w},set:function(E){var x=K(E);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},s,{get:function(){return T},set:function(E){T=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},s,{get:function(){return R},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},s,{get:function(){return A},set:function(E){var x=N(E);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");A=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},s,{get:function(){return v},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");v=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},s,{get:function(){return b},set:function(E){var x=N(E);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");b=x,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},s,{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({},s,{get:function(){return h},set:function(E){var x=N(E);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");h=x,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,V,P){"use strict";P.r(V),P.d(V,"parseTimeStamp",function(){return k}),P.d(V,"fixLineBreaks",function(){return g}),P.d(V,"VTTParser",function(){return m});var z=P("./src/utils/vttcue.ts"),I=function(){function c(){}var s=c.prototype;return s.decode=function(u,l){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},c}();function k(c){function s(u,l,o,a){return(u|0)*3600+(l|0)*60+(o|0)+parseFloat(a||0)}var d=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?s(d[2],d[3],0,d[4]):s(d[1],d[2],d[3],d[4]):null}var K=function(){function c(){this.values=Object.create(null)}var s=c.prototype;return s.set=function(u,l){!this.get(u)&&l!==""&&(this.values[u]=l)},s.get=function(u,l,o){return o?this.has(u)?this.values[u]:l[o]:this.has(u)?this.values[u]:l},s.has=function(u){return u in this.values},s.alt=function(u,l,o){for(var a=0;a<o.length;++a)if(l===o[a]){this.set(u,l);break}},s.integer=function(u,l){/^-?\d+$/.test(l)&&this.set(u,parseInt(l,10))},s.percent=function(u,l){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(l)){var o=parseFloat(l);if(o>=0&&o<=100)return this.set(u,o),!0}return!1},c}();function N(c,s,d,u){var l=u?c.split(u):[c];for(var o in l){if(typeof l[o]!="string")continue;var a=l[o].split(d);if(a.length!==2)continue;var C=a[0],w=a[1];s(C,w)}}var n=new z.default(0,0,""),D=n.align==="middle"?"middle":"center";function y(c,s,d){var u=c;function l(){var C=k(c);if(C===null)throw new Error("Malformed timestamp: "+u);return c=c.replace(/^[^\sa-zA-Z-]+/,""),C}function o(C,w){var T=new K;N(C,function(v,b){var p;switch(v){case"region":for(var h=d.length-1;h>=0;h--)if(d[h].id===b){T.set(v,d[h].region);break}break;case"vertical":T.alt(v,b,["rl","lr"]);break;case"line":p=b.split(","),T.integer(v,p[0]),T.percent(v,p[0])&&T.set("snapToLines",!1),T.alt(v,p[0],["auto"]),p.length===2&&T.alt("lineAlign",p[1],["start",D,"end"]);break;case"position":p=b.split(","),T.percent(v,p[0]),p.length===2&&T.alt("positionAlign",p[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":T.percent(v,b);break;case"align":T.alt(v,b,["start",D,"end","left","right"]);break}},/:/,/\s/),w.region=T.get("region",null),w.vertical=T.get("vertical","");var R=T.get("line","auto");R==="auto"&&n.line===-1&&(R=-1),w.line=R,w.lineAlign=T.get("lineAlign","start"),w.snapToLines=T.get("snapToLines",!0),w.size=T.get("size",100),w.align=T.get("align",D);var A=T.get("position","auto");A==="auto"&&n.position===50&&(A=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=A}function a(){c=c.replace(/^\s+/,"")}if(a(),s.startTime=l(),a(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);c=c.substr(3),a(),s.endTime=l(),a(),o(c,s)}function g(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new I,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=c.prototype;return s.parse=function(u){var l=this;u&&(l.buffer+=l.decoder.decode(u,{stream:!0}));function o(){var A=l.buffer,v=0;for(A=g(A);v<A.length&&A[v]!=="\r"&&A[v]!==`
|
|
`;)++v;var b=A.substr(0,v);return A[v]==="\r"&&++v,A[v]===`
|
|
`&&++v,l.buffer=A.substr(v),b}function a(A){N(A,function(v,b){},/:/)}try{var C="";if(l.state==="INITIAL"){if(!/\r\n|\n/.test(l.buffer))return this;C=o();var w=C.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");l.state="HEADER"}for(var T=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;T?T=!1:C=o();switch(l.state){case"HEADER":/:/.test(C)?a(C):C||(l.state="ID");continue;case"NOTE":C||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){l.state="NOTE";break}if(!C)continue;if(l.cue=new z.default(0,0,""),l.state="CUE",C.indexOf("-->")===-1){l.cue.id=C;continue}case"CUE":if(!l.cue){l.state="BADCUE";continue}try{y(C,l.cue,l.regionList)}catch(A){l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":{var R=C.indexOf("-->")!==-1;if(!C||R&&(T=!0)){l.oncue&&l.cue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}if(l.cue===null)continue;l.cue.text&&(l.cue.text+=`
|
|
`),l.cue.text+=C}continue;case"BADCUE":C||(l.state="ID")}}}catch(A){l.state==="CUETEXT"&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state=l.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
|
|
|
|
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(l){u.onparsingerror&&u.onparsingerror(l)}return u.onflush&&u.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(Z,V,P){"use strict";P.r(V),P.d(V,"generateCueId",function(){return m}),P.d(V,"parseWebVTT",function(){return s});var z=P("./src/polyfills/number.ts"),I=P("./src/utils/vttparser.ts"),k=P("./src/demux/id3.ts"),K=P("./src/utils/timescale-conversion.ts"),N=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(u,l,o){return o===void 0&&(o=0),u.substr(o,l.length)===l},y=function(u){var l=parseInt(u.substr(-3)),o=parseInt(u.substr(-6,2)),a=parseInt(u.substr(-9,2)),C=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(l)||!Object(z.isFiniteNumber)(o)||!Object(z.isFiniteNumber)(a)||!Object(z.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return l+=1e3*o,l+=60*1e3*a,l+=60*60*1e3*C,l},g=function(u){for(var l=5381,o=u.length;o;)l=l*33^u.charCodeAt(--o);return(l>>>0).toString()};function m(d,u,l){return g(d.toString())+g(u.toString())+g(l)}var c=function(u,l,o){var a=u[l],C=u[a.prevCC];if(!C||!C.new&&a.new){u.ccOffset=u.presentationOffset=a.start,a.new=!1;return}for(;(w=C)!==null&&w!==void 0&&w.new;){var w;u.ccOffset+=a.start-C.start,a.new=!1,a=C,C=u[a.prevCC]}u.presentationOffset=o};function s(d,u,l,o,a,C,w,T){var R=new I.VTTParser,A=Object(k.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),v=[],b=Object(K.toMpegTsClockFromTimescale)(u,l),p="00:00.000",h=0,_=0,E,x=!0,U=!1;R.oncue=function(B){var L=o[a],H=o.ccOffset,j=(h-b)/9e4;if(L!=null&&L.new&&(_!==void 0?H=o.ccOffset=L.start:c(o,a,j)),j&&(H=j-o.presentationOffset),U){var S=B.endTime-B.startTime,J=Object(N.normalizePts)((B.startTime+H-_)*9e4,C*9e4)/9e4;B.startTime=J,B.endTime=J+S}var te=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(te)),B.id||(B.id=m(B.startTime,B.endTime,te)),B.endTime>0&&v.push(B)},R.onparsingerror=function(B){E=B},R.onflush=function(){if(E){T(E);return}w(v)},A.forEach(function(B){if(x)if(D(B,"X-TIMESTAMP-MAP=")){x=!1,U=!0,B.substr(16).split(",").forEach(function(L){D(L,"LOCAL:")?p=L.substr(6):D(L,"MPEGTS:")&&(h=parseInt(L.substr(7)))});try{_=y(p)/1e3}catch(L){U=!1,E=L}return}else B===""&&(x=!1);R.parse(B+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(Z,V,P){"use strict";P.r(V);var z=P("./src/utils/logger.ts"),I=P("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,K=function(){function N(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 I.LoadStats,this.retryDelay=0}var n=N.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,g,m){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=g,this.callbacks=m,this.retryDelay=g.retryDelay,this.loadInternal()},n.loadInternal=function(){var y=this.config,g=this.context;if(!y)return;var m=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var s=this.xhrSetup;try{if(s)try{s(m,g.url)}catch(l){m.open("GET",g.url,!0),s(m,g.url)}m.readyState||m.open("GET",g.url,!0);var d=this.context.headers;if(d)for(var u in d)m.setRequestHeader(u,d[u])}catch(l){this.callbacks.onError({code:m.status,text:l.message},g,m);return}g.rangeEnd&&m.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),m.send()},n.readystatechange=function(){var y=this.context,g=this.loader,m=this.stats;if(!y||!g)return;var c=g.readyState,s=this.config;if(m.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),c===4){g.onreadystatechange=null,g.onprogress=null;var d=g.status;if(d>=200&&d<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var u,l;if(y.responseType==="arraybuffer"?(u=g.response,l=u.byteLength):(u=g.responseText,l=u.length),m.loaded=m.total=l,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(m,y,u,g),!this.callbacks)return;var a={url:g.responseURL,data:u};this.callbacks.onSuccess(a,m,y,g)}else m.retry>=s.maxRetry||d>=400&&d<499?(z.logger.error(d+" while loading "+y.url),this.callbacks.onError({code:d,text:g.statusText},y,g)):(z.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,s.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},n.loadtimeout=function(){z.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 g=this.stats;g.loaded=y.loaded,y.lengthComputable&&(g.total=y.total)},n.getCacheAge=function(){var y=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");y=g?parseFloat(g):null}return y},N}();V.default=K}}).default})},vHTk:function(xt,ve,G){xt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return et});var Z=G("rePB"),V=G("VTBJ"),P=G("KQm4"),z=G("U8pU"),I=G("ODXe"),k=G("q1tI"),K=G("TSYQ"),N=G.n(K),n=G("Gytx"),D=G.n(n),y=G("Kwbf"),g=G("t23M"),m=G("qx4F"),c=G("6eGT"),s=G("IBYe"),d=G("Ff2n"),u=G("c+Xe"),l=G("fyJ8"),o=G("biw7");function a(Ae,Se,Ve,Je,Ne){var je=Ve[Ae]||{},Ee=Ve[Se]||{},he,pe;je.fixed==="left"?he=Je.left[Ae]:Ee.fixed==="right"&&(pe=Je.right[Se]);var re=!1,oe=!1,le=!1,me=!1,be=Ve[Se+1],Be=Ve[Ae-1];if(Ne==="rtl"){if(he!==void 0){var $e=Be&&Be.fixed==="left";me=!$e}else if(pe!==void 0){var ut=be&&be.fixed==="right";le=!ut}}else if(he!==void 0){var Et=be&&be.fixed==="left";re=!Et}else if(pe!==void 0){var mt=Be&&Be.fixed==="right";oe=!mt}return{fixLeft:he,fixRight:pe,lastFixLeft:re,firstFixRight:oe,lastFixRight:le,firstFixLeft:me,isSticky:Je.isSticky}}var C=G("sR1s");function w(Ae){var Se=Ae.cells,Ve=Ae.stickyOffsets,Je=Ae.flattenColumns,Ne=Ae.rowComponent,je=Ae.cellComponent,Ee=Ae.onHeaderRow,he=Ae.index,pe=k.useContext(o.a),re=pe.prefixCls,oe=pe.direction,le;Ee&&(le=Ee(Se.map(function(be){return be.column}),he));var me=Object(C.a)(Se.map(function(be){return be.column}));return k.createElement(Ne,Object.assign({},le),Se.map(function(be,Be){var $e=be.column,ut=a(be.colStart,be.colEnd,Je,Ve,oe),Et;return $e&&$e.onHeaderCell&&(Et=be.column.onHeaderCell($e)),k.createElement(l.a,Object.assign({},be,{ellipsis:$e.ellipsis,align:$e.align,component:je,prefixCls:re,key:me[Be]},ut,{additionalProps:Et,rowType:"header"}))}))}w.displayName="HeaderRow";var T=w;function R(Ae){var Se=[];function Ve(Ee,he){var pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Se[pe]=Se[pe]||[];var re=he,oe=Ee.filter(Boolean).map(function(le){var me={key:le.key,className:le.className||"",children:le.title,column:le,colStart:re},be=1,Be=le.children;return Be&&Be.length>0&&(be=Ve(Be,re,pe+1).reduce(function($e,ut){return $e+ut},0),me.hasSubColumns=!0),"colSpan"in le&&(be=le.colSpan),"rowSpan"in le&&(me.rowSpan=le.rowSpan),me.colSpan=be,me.colEnd=me.colStart+be-1,Se[pe].push(me),re+=be,be});return oe}Ve(Ae,0);for(var Je=Se.length,Ne=function(he){Se[he].forEach(function(pe){!("rowSpan"in pe)&&!pe.hasSubColumns&&(pe.rowSpan=Je-he)})},je=0;je<Je;je+=1)Ne(je);return Se}function A(Ae){var Se=Ae.stickyOffsets,Ve=Ae.columns,Je=Ae.flattenColumns,Ne=Ae.onHeaderRow,je=k.useContext(o.a),Ee=je.prefixCls,he=je.getComponent,pe=k.useMemo(function(){return R(Ve)},[Ve]),re=he(["header","wrapper"],"thead"),oe=he(["header","row"],"tr"),le=he(["header","cell"],"th");return k.createElement(re,{className:"".concat(Ee,"-thead")},pe.map(function(me,be){var Be=k.createElement(T,{key:be,flattenColumns:Je,cells:me,stickyOffsets:Se,rowComponent:oe,cellComponent:le,onHeaderRow:Ne,index:be});return Be}))}var v=A,b=G("hW8S");function p(Ae){for(var Se=Ae.colWidths,Ve=Ae.columns,Je=Ae.columCount,Ne=[],je=Je||Ve.length,Ee=!1,he=je-1;he>=0;he-=1){var pe=Se[he],re=Ve&&Ve[he],oe=re&&re[b.a];(pe||oe||Ee)&&(Ne.unshift(k.createElement("col",Object.assign({key:he,style:{width:pe,minWidth:pe}},oe))),Ee=!0)}return k.createElement("colgroup",null,Ne)}var h=p;function _(Ae,Se){return Object(k.useMemo)(function(){for(var Ve=[],Je=0;Je<Se;Je+=1){var Ne=Ae[Je];if(Ne!==void 0)Ve[Je]=Ne;else return null}return Ve},[Ae.join("_"),Se])}var E=k.forwardRef(function(Ae,Se){var Ve=Ae.noData,Je=Ae.columns,Ne=Ae.flattenColumns,je=Ae.colWidths,Ee=Ae.columCount,he=Ae.stickyOffsets,pe=Ae.direction,re=Ae.fixHeader,oe=Ae.offsetHeader,le=Ae.stickyClassName,me=Ae.onScroll,be=Object(d.a)(Ae,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Be=k.useContext(o.a),$e=Be.prefixCls,ut=Be.scrollbarSize,Et=Be.isSticky,mt=Et&&!re?0:ut,Bt=k.useRef(null),Ut=k.useCallback(function(an){Object(u.b)(Se,an),Object(u.b)(Bt,an)},[]);k.useEffect(function(){var an;function nn(ot){var en=ot.currentTarget,It=ot.deltaX;It&&(me({currentTarget:en,scrollLeft:en.scrollLeft+It}),ot.preventDefault())}return(an=Bt.current)===null||an===void 0||an.addEventListener("wheel",nn),function(){var ot;(ot=Bt.current)===null||ot===void 0||ot.removeEventListener("wheel",nn)}},[]);var Tt=Ne[Ne.length-1],kt={fixed:Tt?Tt.fixed:null,onHeaderCell:function(){return{className:"".concat($e,"-cell-scrollbar")}}},zt=Object(k.useMemo)(function(){return mt?[].concat(Object(P.a)(Je),[kt]):Je},[mt,Je]),$t=Object(k.useMemo)(function(){return mt?[].concat(Object(P.a)(Ne),[kt]):Ne},[mt,Ne]),vn=Object(k.useMemo)(function(){var an=he.right,nn=he.left;return Object(V.a)(Object(V.a)({},he),{},{left:pe==="rtl"?[].concat(Object(P.a)(nn.map(function(ot){return ot+mt})),[0]):nn,right:pe==="rtl"?an:[].concat(Object(P.a)(an.map(function(ot){return ot+mt})),[0]),isSticky:Et})},[mt,he,Et]),Ft=_(je,Ee);return k.createElement("div",{style:Object(V.a)({overflow:"hidden"},Et?{top:oe}:{}),ref:Ut,className:N()("".concat($e,"-header"),Object(Z.a)({},le,!!le))},k.createElement("table",{style:{tableLayout:"fixed",visibility:Ve||Ft?null:"hidden"}},k.createElement(h,{colWidths:Ft?[].concat(Object(P.a)(Ft),[mt]):[],columCount:Ee+1,columns:$t}),k.createElement(v,Object.assign({},be,{stickyOffsets:vn,columns:zt,flattenColumns:$t}))))});E.displayName="FixedHeader";var x=E,U=k.createContext(null),B=U;function L(Ae){var Se=Ae.prefixCls,Ve=Ae.children,Je=Ae.component,Ne=Ae.cellComponent,je=Ae.fixHeader,Ee=Ae.fixColumn,he=Ae.horizonScroll,pe=Ae.className,re=Ae.expanded,oe=Ae.componentWidth,le=Ae.colSpan,me=k.useContext(o.a),be=me.scrollbarSize;return k.useMemo(function(){var Be=Ve;return Ee&&(Be=k.createElement("div",{style:{width:oe-(je?be:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Se,"-expanded-row-fixed")},Be)),k.createElement(Je,{className:pe,style:{display:re?null:"none"}},k.createElement(l.a,{component:Ne,prefixCls:Se,colSpan:le},Be))},[Ve,Je,je,he,pe,re,oe,le,be])}var H=L;function j(Ae){var Se=Ae.className,Ve=Ae.style,Je=Ae.record,Ne=Ae.index,je=Ae.rowKey,Ee=Ae.getRowKey,he=Ae.rowExpandable,pe=Ae.expandedKeys,re=Ae.onRow,oe=Ae.indent,le=oe===void 0?0:oe,me=Ae.rowComponent,be=Ae.cellComponent,Be=Ae.childrenColumnName,$e=k.useContext(o.a),ut=$e.prefixCls,Et=$e.fixedInfoList,mt=k.useContext(B),Bt=mt.fixHeader,Ut=mt.fixColumn,Tt=mt.horizonScroll,kt=mt.componentWidth,zt=mt.flattenColumns,$t=mt.expandableType,vn=mt.expandRowByClick,Ft=mt.onTriggerExpand,an=mt.rowClassName,nn=mt.expandedRowClassName,ot=mt.indentSize,en=mt.expandIcon,It=mt.expandedRowRender,Rt=mt.expandIconColumnIndex,Mt=k.useState(!1),On=Object(I.a)(Mt,2),ln=On[0],un=On[1],Lt=pe&&pe.has(Ae.recordKey);k.useEffect(function(){Lt&&un(!0)},[Lt]);var ar=$t==="row"&&(!he||he(Je)),In=$t==="nest",Nn=Be&&Je&&Je[Be],tn=ar||In,Fn;re&&(Fn=re(Je,Ne));var dr=function(O){if(vn&&tn&&Ft(Je,O),Fn&&Fn.onClick){for(var M,W=arguments.length,ee=new Array(W>1?W-1:0),Y=1;Y<W;Y++)ee[Y-1]=arguments[Y];(M=Fn).onClick.apply(M,[O].concat(ee))}},gr;typeof an=="string"?gr=an:typeof an=="function"&&(gr=an(Je,Ne,le));var pt=Object(C.a)(zt),Gt=k.createElement(me,Object.assign({},Fn,{"data-row-key":je,className:N()(Se,"".concat(ut,"-row"),"".concat(ut,"-row-level-").concat(le),gr,Fn&&Fn.className),style:Object(V.a)(Object(V.a)({},Ve),Fn?Fn.style:null),onClick:dr}),zt.map(function($,O){var M=$.render,W=$.dataIndex,ee=$.className,Y=pt[O],Ce=Et[O],rt;O===(Rt||0)&&In&&(rt=k.createElement(k.Fragment,null,k.createElement("span",{style:{paddingLeft:"".concat(ot*le,"px")},className:"".concat(ut,"-row-indent indent-level-").concat(le)}),en({prefixCls:ut,expanded:Lt,expandable:Nn,record:Je,onExpand:Ft})));var wt;return $.onCell&&(wt=$.onCell(Je,Ne)),k.createElement(l.a,Object.assign({className:ee,ellipsis:$.ellipsis,align:$.align,component:be,prefixCls:ut,key:Y,record:Je,index:Ne,dataIndex:W,render:M,shouldCellUpdate:$.shouldCellUpdate},Ce,{appendNode:rt,additionalProps:wt}))})),kr;if(ar&&(ln||Lt)){var Hr=It(Je,Ne,le+1,Lt),ri=nn&&nn(Je,Ne,le);kr=k.createElement(H,{expanded:Lt,className:N()("".concat(ut,"-expanded-row"),"".concat(ut,"-expanded-row-level-").concat(le+1),ri),prefixCls:ut,fixHeader:Bt,fixColumn:Ut,horizonScroll:Tt,component:me,componentWidth:kt,cellComponent:be,colSpan:zt.length},Hr)}var Wr;return Nn&&Lt&&(Wr=(Je[Be]||[]).map(function($,O){var M=Ee($,O);return k.createElement(j,Object.assign({},Ae,{key:M,rowKey:M,record:$,recordKey:M,index:O,indent:le+1}))})),k.createElement(k.Fragment,null,Gt,kr,Wr)}j.displayName="BodyRow";var S=j,J=k.createContext(null),te=J;function se(Ae){var Se=Ae.columnKey,Ve=Ae.onColumnResize,Je=k.useRef();return k.useEffect(function(){Je.current&&Ve(Se,Je.current.offsetWidth)},[]),k.createElement(g.a,{onResize:function(je){var Ee=je.offsetWidth;Ve(Se,Ee)}},k.createElement("td",{ref:Je,style:{padding:0,border:0,height:0}},k.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function fe(Ae){var Se=Ae.data,Ve=Ae.getRowKey,Je=Ae.measureColumnWidth,Ne=Ae.expandedKeys,je=Ae.onRow,Ee=Ae.rowExpandable,he=Ae.emptyNode,pe=Ae.childrenColumnName,re=k.useContext(te),oe=re.onColumnResize,le=k.useContext(o.a),me=le.prefixCls,be=le.getComponent,Be=k.useContext(B),$e=Be.fixHeader,ut=Be.horizonScroll,Et=Be.flattenColumns,mt=Be.componentWidth;return k.useMemo(function(){var Bt=be(["body","wrapper"],"tbody"),Ut=be(["body","row"],"tr"),Tt=be(["body","cell"],"td"),kt;Se.length?kt=Se.map(function($t,vn){var Ft=Ve($t,vn);return k.createElement(S,{key:Ft,rowKey:Ft,record:$t,recordKey:Ft,index:vn,rowComponent:Ut,cellComponent:Tt,expandedKeys:Ne,onRow:je,getRowKey:Ve,rowExpandable:Ee,childrenColumnName:pe})}):kt=k.createElement(H,{expanded:!0,className:"".concat(me,"-placeholder"),prefixCls:me,fixHeader:$e,fixColumn:ut,horizonScroll:ut,component:Ut,componentWidth:mt,cellComponent:Tt,colSpan:Et.length},he);var zt=Object(C.a)(Et);return k.createElement(Bt,{className:"".concat(me,"-tbody")},Je&&k.createElement("tr",{"aria-hidden":"true",className:"".concat(me,"-measure-row"),style:{height:0}},zt.map(function($t){return k.createElement(se,{key:$t,columnKey:$t,onColumnResize:oe})})),kt)},[Se,me,je,Je,Ne,Ve,be,mt,he,Et])}var Fe=k.memo(fe);Fe.displayName="Body";var Le=Fe,De=G("wRmb"),He=G("xEkU"),We=G.n(He);function ye(Ae){var Se=Object(k.useRef)(Ae),Ve=Object(k.useState)({}),Je=Object(I.a)(Ve,2),Ne=Je[1],je=Object(k.useRef)(null),Ee=Object(k.useRef)([]);function he(pe){je.current===null&&(Ee.current=[],je.current=We()(function(){Ee.current.forEach(function(re){Se.current=re(Se.current)}),je.current=null,Ne({})})),Ee.current.push(pe)}return Object(k.useEffect)(function(){return function(){We.a.cancel(je.current)}},[]),[Se.current,he]}function ue(Ae){var Se=Object(k.useRef)(Ae),Ve=Object(k.useRef)(null);function Je(){window.clearTimeout(Ve.current)}function Ne(Ee){Se.current=Ee,Je(),Ve.current=window.setTimeout(function(){Se.current=null,Ve.current=null},100)}function je(){return Se.current}return Object(k.useEffect)(function(){return Je},[]),[Ne,je]}function Ye(Ae,Se,Ve){var Je=Object(k.useMemo)(function(){for(var Ne=[],je=[],Ee=0,he=0,pe=0;pe<Se;pe+=1)if(Ve==="rtl"){je[pe]=he,he+=Ae[pe]||0;var re=Se-pe-1;Ne[re]=Ee,Ee+=Ae[re]||0}else{Ne[pe]=Ee,Ee+=Ae[pe]||0;var oe=Se-pe-1;je[oe]=he,he+=Ae[oe]||0}return{left:Ne,right:je}},[Ae,Se,Ve]);return Je}var vt=Ye;function ct(Ae){var Se=Ae.className,Ve=Ae.children;return k.createElement("div",{className:Se},Ve)}var it=ct,ft=G("n6Qo");function Qe(Ae){var Se,Ve=Ae.prefixCls,Je=Ae.record,Ne=Ae.onExpand,je=Ae.expanded,Ee=Ae.expandable,he="".concat(Ve,"-row-expand-icon");if(!Ee)return k.createElement("span",{className:N()(he,"".concat(Ve,"-row-spaced"))});var pe=function(oe){Ne(Je,oe),oe.stopPropagation()};return k.createElement("span",{className:N()(he,(Se={},Object(Z.a)(Se,"".concat(Ve,"-row-expanded"),je),Object(Z.a)(Se,"".concat(Ve,"-row-collapsed"),!je),Se)),onClick:pe})}function qe(Ae,Se,Ve){var Je=[];function Ne(je){(je||[]).forEach(function(Ee,he){Je.push(Se(Ee,he)),Ne(Ee[Ve])})}return Ne(Ae),Je}var ht=G("zT1h"),de=G("y0+3"),Ie=function(Se,Ve){var Je,Ne,je=Se.scrollBodyRef,Ee=Se.onScroll,he=Se.offsetScroll,pe=k.useContext(o.a),re=pe.prefixCls,oe=((Je=je.current)===null||Je===void 0?void 0:Je.scrollWidth)||0,le=((Ne=je.current)===null||Ne===void 0?void 0:Ne.clientWidth)||0,me=oe&&le*(le/oe),be=k.useRef(),Be=ye({scrollLeft:0,isHiddenScrollBar:!1}),$e=Object(I.a)(Be,2),ut=$e[0],Et=$e[1],mt=k.useRef({delta:0,x:0}),Bt=k.useState(!1),Ut=Object(I.a)(Bt,2),Tt=Ut[0],kt=Ut[1],zt=function(){kt(!1)},$t=function(ot){ot.persist(),mt.current.delta=ot.pageX-ut.scrollLeft,mt.current.x=0,kt(!0),ot.preventDefault()},vn=function(ot){var en,It=ot||((en=window)===null||en===void 0?void 0:en.event),Rt=It.buttons;if(!Tt||Rt===0){Tt&&kt(!1);return}var Mt=mt.current.x+ot.pageX-mt.current.x-mt.current.delta;Mt<=0&&(Mt=0),Mt+me>=le&&(Mt=le-me),Ee({scrollLeft:Mt/le*(oe+2)}),mt.current.x=ot.pageX},Ft=function(){var ot=Object(de.b)(je.current).top,en=ot+je.current.offsetHeight,It=document.documentElement.scrollTop+window.innerHeight;en-Object(m.a)()<=It||ot>=It-he?Et(function(Rt){return Object(V.a)(Object(V.a)({},Rt),{},{isHiddenScrollBar:!0})}):Et(function(Rt){return Object(V.a)(Object(V.a)({},Rt),{},{isHiddenScrollBar:!1})})},an=function(ot){Et(function(en){return Object(V.a)(Object(V.a)({},en),{},{scrollLeft:ot/oe*le||0})})};return k.useImperativeHandle(Ve,function(){return{setScrollLeft:an}}),k.useEffect(function(){var nn=Object(ht.a)(document.body,"mouseup",zt,!1),ot=Object(ht.a)(document.body,"mousemove",vn,!1);return Ft(),function(){nn.remove(),ot.remove()}},[me,Tt]),k.useEffect(function(){var nn=Object(ht.a)(window,"scroll",Ft,!1),ot=Object(ht.a)(window,"resize",Ft,!1);return function(){nn.remove(),ot.remove()}},[]),k.useEffect(function(){ut.isHiddenScrollBar||Et(function(nn){var ot,en;return Object(V.a)(Object(V.a)({},nn),{},{scrollLeft:je.current.scrollLeft/((ot=je.current)===null||ot===void 0?void 0:ot.scrollWidth)*((en=je.current)===null||en===void 0?void 0:en.clientWidth)})})},[ut.isHiddenScrollBar]),oe<=le||!me||ut.isHiddenScrollBar?null:k.createElement("div",{style:{height:Object(m.a)(),width:le,bottom:he},className:"".concat(re,"-sticky-scroll")},k.createElement("div",{onMouseDown:$t,ref:be,className:N()("".concat(re,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(re,"-sticky-scroll-bar-active"),Tt)),style:{width:"".concat(me,"px"),transform:"translate3d(".concat(ut.scrollLeft,"px, 0, 0)")}}))},Pe=k.forwardRef(Ie);function Ke(Ae,Se){return k.useMemo(function(){var Ve=!!Ae;return{isSticky:Ve,stickyClassName:Ve?"".concat(Se,"-sticky-header"):"",offsetHeader:Object(z.a)(Ae)==="object"&&Ae.offsetHeader||0,offsetScroll:Object(z.a)(Ae)==="object"&&Ae.offsetScroll||0}},[Ae,Se])}var st=[],at={},et="rc-table-internal-hook",tt=k.memo(function(Ae){var Se=Ae.children;return Se},function(Ae,Se){return D()(Ae.props,Se.props)?Ae.pingLeft!==Se.pingLeft||Ae.pingRight!==Se.pingRight:!1});function dt(Ae){var Se,Ve=Ae.prefixCls,Je=Ae.className,Ne=Ae.rowClassName,je=Ae.style,Ee=Ae.data,he=Ae.rowKey,pe=Ae.scroll,re=Ae.tableLayout,oe=Ae.direction,le=Ae.title,me=Ae.footer,be=Ae.summary,Be=Ae.id,$e=Ae.showHeader,ut=Ae.components,Et=Ae.emptyText,mt=Ae.onRow,Bt=Ae.onHeaderRow,Ut=Ae.internalHooks,Tt=Ae.transformColumns,kt=Ae.internalRefs,zt=Ae.sticky,$t=Ee||st,vn=!!$t.length,Ft=k.useState(0),an=Object(I.a)(Ft,2),nn=an[0],ot=an[1];k.useEffect(function(){ot(Object(m.a)())});var en=k.useMemo(function(){return Object(C.c)(ut,{})},[ut]),It=k.useCallback(function(Pn,wn){return Object(C.b)(en,Pn)||wn},[en]),Rt=k.useMemo(function(){return typeof he=="function"?he:function(Pn){var wn=Pn&&Pn[he];return wn}},[he]),Mt=Object(b.c)(Ae),On=Mt.expandIcon,ln=Mt.expandedRowKeys,un=Mt.defaultExpandedRowKeys,Lt=Mt.defaultExpandAllRows,ar=Mt.expandedRowRender,In=Mt.onExpand,Nn=Mt.onExpandedRowsChange,tn=Mt.expandRowByClick,Fn=Mt.rowExpandable,dr=Mt.expandIconColumnIndex,gr=Mt.expandedRowClassName,pt=Mt.childrenColumnName,Gt=Mt.indentSize,kr=On||Qe,Hr=pt||"children",ri=k.useMemo(function(){return ar?"row":Ae.expandable&&Ut===et&&Ae.expandable.__PARENT_RENDER_ICON__||$t.some(function(Pn){return Pn&&Object(z.a)(Pn)==="object"&&Pn[Hr]})?"nest":!1},[!!ar,$t]),Wr=k.useState(function(){return un||(Lt?qe($t,Rt,Hr):[])}),$=Object(I.a)(Wr,2),O=$[0],M=$[1],W=k.useMemo(function(){return new Set(ln||O||[])},[ln,O]),ee=k.useCallback(function(Pn){var wn=Rt(Pn,$t.indexOf(Pn)),_n,zr=W.has(wn);zr?(W.delete(wn),_n=Object(P.a)(W)):_n=[].concat(Object(P.a)(W),[wn]),M(_n),In&&In(!zr,Pn),Nn&&Nn(_n)},[Rt,W,$t,In,Nn]),Y=k.useState(0),Ce=Object(I.a)(Y,2),rt=Ce[0],wt=Ce[1],Pt=Object(De.b)(Object(V.a)(Object(V.a)(Object(V.a)({},Ae),Mt),{},{expandable:!!ar,expandedKeys:W,getRowKey:Rt,onTriggerExpand:ee,expandIcon:kr,expandIconColumnIndex:dr,direction:oe}),Ut===et?Tt:null),lt=Object(I.a)(Pt,2),Kt=lt[0],Jt=lt[1],jn=k.useMemo(function(){return{columns:Kt,flattenColumns:Jt}},[Kt,Jt]),xr=k.useRef(),vr=k.useRef(),Jn=k.useRef(),ii=k.useState(!1),wi=Object(I.a)(ii,2),or=wi[0],Kr=wi[1],yi=k.useState(!1),ai=Object(I.a)(yi,2),Tr=ai[0],Ai=ai[1],Si=ye(new Map),Ri=Object(I.a)(Si,2),Ni=Ri[0],oi=Ri[1],hr=Object(C.a)(Jt),pi=hr.map(function(Pn){return Ni.get(Pn)}),Ui=k.useMemo(function(){return pi},[pi.join("_")]),mi=vt(Ui,Jt.length,oe),Mn=pe&&Object(C.d)(pe.y),on=pe&&Object(C.d)(pe.x),Vn=on&&Jt.some(function(Pn){var wn=Pn.fixed;return wn}),cn=k.useRef(),Qn=Ke(zt,Ve),An=Qn.isSticky,si=Qn.offsetHeader,fr=Qn.offsetScroll,wr=Qn.stickyClassName,Ci,li,gi;Mn&&(li={overflowY:"scroll",maxHeight:pe.y}),on&&(Ci={overflowX:"auto"},Mn||(li={overflowY:"hidden"}),gi={width:pe.x===!0?"auto":pe.x,minWidth:"100%"});var Fr=k.useCallback(function(Pn,wn){oi(function(_n){var zr=new Map(_n);return zr.set(Pn,wn),zr})},[]),Gr=ue(null),Fi=Object(I.a)(Gr,2),$r=Fi[0],ji=Fi[1];function Li(Pn,wn){if(!wn)return;typeof wn=="function"?wn(Pn):wn.scrollLeft!==Pn&&(wn.scrollLeft=Pn)}var Jr=function(wn){var _n=wn.currentTarget,zr=wn.scrollLeft,Bi=typeof zr=="number"?zr:_n.scrollLeft,Hi=_n||at;if(!ji()||ji()===Hi){var ga;$r(Hi),Li(Bi,vr.current),Li(Bi,Jn.current),Li(Bi,(ga=cn.current)===null||ga===void 0?void 0:ga.setScrollLeft)}if(_n){var va=_n.scrollWidth,Sa=_n.clientWidth;Kr(Bi>0),Ai(Bi<va-Sa)}},Ji=function(){Jn.current&&Jr({currentTarget:Jn.current})},jt=function(wn){var _n=wn.width;Ji(),wt(xr.current?xr.current.offsetWidth:_n)};k.useEffect(function(){return Ji},[]),k.useEffect(function(){on&&Ji()},[on]),k.useEffect(function(){Ut===et&&kt&&(kt.body.current=Jn.current)});var Qt=It(["table"],"table"),Wt=k.useMemo(function(){return re||(Vn?pe.x==="max-content"?"auto":"fixed":Mn||Jt.some(function(Pn){var wn=Pn.ellipsis;return wn})?"fixed":"auto")},[Mn,Vn,Jt,re]),sn,bn={colWidths:Ui,columCount:Jt.length,stickyOffsets:mi,onHeaderRow:Bt,fixHeader:Mn},Bn=k.useMemo(function(){return vn?null:typeof Et=="function"?Et():Et},[vn,Et]),En=k.createElement(Le,{data:$t,measureColumnWidth:Mn||on||An,expandedKeys:W,rowExpandable:Fn,getRowKey:Rt,onRow:mt,emptyNode:Bn,childrenColumnName:Hr}),tr=k.createElement(h,{colWidths:Jt.map(function(Pn){var wn=Pn.width;return wn}),columns:Jt}),Pr=be&&k.createElement(ft.b,null,be($t)),fn=It(["body"]);if(Mn||An){var ui;typeof fn=="function"?(ui=fn($t,{scrollbarSize:nn,ref:Jn,onScroll:Jr}),bn.colWidths=Jt.map(function(Pn,wn){var _n=Pn.width,zr=wn===Kt.length-1?_n-nn:_n;return typeof zr=="number"&&!Number.isNaN(zr)?zr:(Object(y.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):ui=k.createElement("div",{style:Object(V.a)(Object(V.a)({},Ci),li),onScroll:Jr,ref:Jn,className:N()("".concat(Ve,"-body"))},k.createElement(Qt,{style:Object(V.a)(Object(V.a)({},gi),{},{tableLayout:Wt})},tr,En,Pr),An&&k.createElement(Pe,{ref:cn,offsetScroll:fr,scrollBodyRef:Jn,onScroll:Jr})),sn=k.createElement(k.Fragment,null,$e!==!1&&k.createElement(x,Object.assign({noData:!$t.length},bn,jn,{direction:oe,offsetHeader:si,stickyClassName:wr,ref:vr,onScroll:Jr})),ui)}else sn=k.createElement("div",{style:Object(V.a)(Object(V.a)({},Ci),li),className:N()("".concat(Ve,"-content")),onScroll:Jr,ref:Jn},k.createElement(Qt,{style:Object(V.a)(Object(V.a)({},gi),{},{tableLayout:Wt})},tr,$e!==!1&&k.createElement(v,Object.assign({},bn,jn)),En,Pr));var kn=Object(b.b)(Ae),yr=k.createElement("div",Object.assign({className:N()(Ve,Je,(Se={},Object(Z.a)(Se,"".concat(Ve,"-rtl"),oe==="rtl"),Object(Z.a)(Se,"".concat(Ve,"-ping-left"),or),Object(Z.a)(Se,"".concat(Ve,"-ping-right"),Tr),Object(Z.a)(Se,"".concat(Ve,"-layout-fixed"),re==="fixed"),Object(Z.a)(Se,"".concat(Ve,"-fixed-header"),Mn),Object(Z.a)(Se,"".concat(Ve,"-fixed-column"),Vn),Object(Z.a)(Se,"".concat(Ve,"-scroll-horizontal"),on),Object(Z.a)(Se,"".concat(Ve,"-has-fix-left"),Jt[0]&&Jt[0].fixed),Object(Z.a)(Se,"".concat(Ve,"-has-fix-right"),Jt[Jt.length-1]&&Jt[Jt.length-1].fixed==="right"),Se)),style:je,id:Be,ref:xr},kn),k.createElement(tt,{pingLeft:or,pingRight:Tr,props:Object(V.a)(Object(V.a)({},Ae),{},{stickyOffsets:mi,mergedExpandedKeys:W})},le&&k.createElement(it,{className:"".concat(Ve,"-title")},le($t)),k.createElement("div",{className:"".concat(Ve,"-container")},sn),me&&k.createElement(it,{className:"".concat(Ve,"-footer")},me($t))));on&&(yr=k.createElement(g.a,{onResize:jt},yr));var Sr=k.useMemo(function(){return{prefixCls:Ve,getComponent:It,scrollbarSize:nn,direction:oe,fixedInfoList:Jt.map(function(Pn,wn){return a(wn,wn,Jt,mi,oe)}),isSticky:An}},[Ve,It,nn,oe,Jt,mi,oe,An]),Qr=k.useMemo(function(){return Object(V.a)(Object(V.a)({},jn),{},{tableLayout:Wt,rowClassName:Ne,expandedRowClassName:gr,componentWidth:rt,fixHeader:Mn,fixColumn:Vn,horizonScroll:on,expandIcon:kr,expandableType:ri,expandRowByClick:tn,expandedRowRender:ar,onTriggerExpand:ee,expandIconColumnIndex:dr,indentSize:Gt})},[jn,Wt,Ne,gr,rt,Mn,Vn,on,kr,ri,tn,ar,ee,dr,Gt]),ma=k.useMemo(function(){return{onColumnResize:Fr}},[Fr]);return k.createElement(o.a.Provider,{value:Sr},k.createElement(B.Provider,{value:Qr},k.createElement(te.Provider,{value:ma},yr)))}dt.Column=s.a,dt.ColumnGroup=c.a,dt.Summary=ft.a,dt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var yt=ve.b=dt},wRmb:function(xt,ve,G){"use strict";G.d(ve,"a",function(){return D});var Z=G("rePB"),V=G("KQm4"),P=G("VTBJ"),z=G("Ff2n"),I=G("q1tI"),k=G.n(I),K=G("Kwbf"),N=G("Zm9Q"),n=G("hW8S");function D(s){return Object(N.a)(s).filter(function(d){return I.isValidElement(d)}).map(function(d){var u=d.key,l=d.props,o=l.children,a=Object(z.a)(l,["children"]),C=Object(P.a)({key:u},a);return o&&(C.children=D(o)),C})}function y(s){return s.reduce(function(d,u){var l=u.fixed,o=l===!0?"left":l,a=u.children;return a&&a.length>0?[].concat(Object(V.a)(d),Object(V.a)(y(a).map(function(C){return Object(P.a)({fixed:o},C)}))):[].concat(Object(V.a)(d),[Object(P.a)(Object(P.a)({},u),{},{fixed:o})])},[])}function g(s){for(var d=!0,u=0;u<s.length;u+=1){var l=s[u];if(d&&l.fixed!=="left")d=!1;else if(!d&&l.fixed==="left"){Object(K.a)(!1,"Index ".concat(u-1," of `columns` missing `fixed='left'` prop."));break}}for(var o=!0,a=s.length-1;a>=0;a-=1){var C=s[a];if(o&&C.fixed!=="right")o=!1;else if(!o&&C.fixed==="right"){Object(K.a)(!1,"Index ".concat(a+1," of `columns` missing `fixed='right'` prop."));break}}}function m(s){return s.map(function(d){var u=d.fixed,l=Object(z.a)(d,["fixed"]),o=u;return u==="left"?o="right":u==="right"&&(o="left"),Object(P.a)({fixed:o},l)})}function c(s,d){var u=s.prefixCls,l=s.columns,o=s.children,a=s.expandable,C=s.expandedKeys,w=s.getRowKey,T=s.onTriggerExpand,R=s.expandIcon,A=s.rowExpandable,v=s.expandIconColumnIndex,b=s.direction,p=s.expandRowByClick,h=I.useMemo(function(){return l||D(o)},[l,o]),_=I.useMemo(function(){if(a){var U,B=v||0,L=h[B],H=(U={},Object(Z.a)(U,n.a,{className:"".concat(u,"-expand-icon-col")}),Object(Z.a)(U,"title",""),Object(Z.a)(U,"fixed",L?L.fixed:null),Object(Z.a)(U,"className","".concat(u,"-row-expand-icon-cell")),Object(Z.a)(U,"render",function(J,te,se){var fe=w(te,se),Fe=C.has(fe),Le=A?A(te):!0,De=R({prefixCls:u,expanded:Fe,expandable:Le,record:te,onExpand:T});return p?I.createElement("span",{onClick:function(We){return We.stopPropagation()}},De):De}),U),j=h.slice();return B>=0&&j.splice(B,0,H),j}return h},[a,h,w,C,R,b]),E=I.useMemo(function(){var U=_;return d&&(U=d(U)),U.length||(U=[{render:function(){return null}}]),U},[d,_,b]),x=I.useMemo(function(){return b==="rtl"?m(y(E)):y(E)},[E,b]);return[E,x]}ve.b=c},"y0+3":function(xt,ve,G){"use strict";G.d(ve,"a",function(){return y}),G.d(ve,"b",function(){return m});var Z=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function z(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function I(c,s,d){if(s=s.toLowerCase(),d==="auto"){if(s==="height")return c.offsetHeight;if(s==="width")return c.offsetWidth}return s in V||(V[s]=Z.test(s)),V[s]?parseFloat(d)||0:d}function k(c,s){var d=arguments.length,u=z(c);return s=P[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,d===1?u:I(c,s,u[s]||c.style[s])}function K(c,s,d){var u=arguments.length;if(s=P[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,u===3)return typeof d=="number"&&Z.test(s)&&(d="".concat(d,"px")),c.style[s]=d,d;for(var l in s)s.hasOwnProperty(l)&&K(c,l,s[l]);return z(c)}function N(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),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:s}}function y(){var c=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:s}}function g(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(c){var s=c.getBoundingClientRect(),d=document.documentElement;return{left:s.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||document.body.clientTop||0)}}}}]);
|