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.2 MiB
440 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[275,5,7,8],{"+NIl":function(dt,be,$){(function(ie){ie($("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(J,k){"use strict";function Y(c,d){c.cmdState.push(d)}function j(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function B(c){var d=c.cmdState.pop();d&&d.closeBracket()}function z(c){for(var d=c.cmdState,p=d.length-1;p>=0;p--){var l=d[p];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function G(c,d,p){return function(){this.name=c,this.bracketNo=0,this.style=d,this.styles=p,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=G("importmodule","tag",["string","builtin"]),n.documentclass=G("documentclass","tag",["","atom"]),n.usepackage=G("usepackage","tag",["atom"]),n.begin=G("begin","tag",["atom"]),n.end=G("end","tag",["atom"]),n.label=G("label","tag",["atom"]),n.ref=G("ref","tag",["atom"]),n.eqref=G("eqref","tag",["atom"]),n.cite=G("cite","tag",["atom"]),n.bibitem=G("bibitem","tag",["atom"]),n.Bibitem=G("Bibitem","tag",["atom"]),n.RBibitem=G("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(c,d){c.f=d}function y(c,d){var p;if(c.match(/^\\[a-zA-Z@]+/)){var l=c.current().slice(1);return p=n.hasOwnProperty(l)?n[l]:n.DEFAULT,p=new p,Y(d,p),D(d,m),p.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return D(d,function(o,s){return g(o,s,"\\]")}),"keyword";if(c.match("\\("))return D(d,function(o,s){return g(o,s,"\\)")}),"keyword";if(c.match("$$"))return D(d,function(o,s){return g(o,s,"$$")}),"keyword";if(c.match("$"))return D(d,function(o,s){return g(o,s,"$")}),"keyword";var h=c.next();if(h=="%")return c.skipToEnd(),"comment";if(h=="}"||h=="]"){if(p=j(d),p)p.closeBracket(h),D(d,m);else return"error";return"bracket"}else return h=="{"||h=="["?(p=n.DEFAULT,p=new p,Y(d,p),"bracket"):/\d/.test(h)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),p=z(d),p.name=="begin"&&(p.argument=c.current()),p.styleIdentifier())}function g(c,d,p){if(c.eatSpace())return null;if(p&&c.match(p))return D(d,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 l=c.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(c.skipToEnd(),"comment"):"error"}function m(c,d){var p=c.peek(),l;return p=="{"||p=="["?(l=j(d),l.openBracket(p),c.eat(p),D(d,y),"bracket"):/[ \t\r]/.test(p)?(c.eat(p),null):(D(d,y),B(d),y(c,d))}return{startState:function(){var c=k.inMathMode?function(d,p){return g(d,p)}:y;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,d){return d.f(c,d)},blankLine:function(c){c.f=y,c.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(dt,be,$){},"/cxE":function(dt,be,$){"use strict";$.d(be,"f",function(){return k}),$.d(be,"g",function(){return Y}),$.d(be,"h",function(){return j}),$.d(be,"e",function(){return z}),$.d(be,"b",function(){return G}),$.d(be,"c",function(){return n}),$.d(be,"d",function(){return D}),$.d(be,"a",function(){return y});class ie{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 J=new ie;function k(g){z(g)||J.onUnexpectedError(g);return}function Y(g){z(g)||J.onUnexpectedExternalError(g);return}function j(g){if(g instanceof Error){let{name:m,message:c}=g;const d=g.stacktrace||g.stack;return{$isError:!0,name:m,message:c,stack:d}}return g}const B="Canceled";function z(g){return g instanceof Error&&g.name===B&&g.message===B}function G(){const g=new Error(B);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)}}},"19Vz":function(dt,be,$){(function(ie){ie($("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(G,n,D){var y=D&&D!=ie.Init;if(n&&!y)G.on("blur",j),G.on("change",B),G.on("swapDoc",B),ie.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){Y(G)}),B(G);else if(!n&&y){G.off("blur",j),G.off("change",B),G.off("swapDoc",B),ie.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),J(G);var g=G.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}n&&!G.hasFocus()&&j(G)});function J(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function k(G){J(G);var n=G.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=G.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=G.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),G.display.lineSpace.insertBefore(n,G.display.lineSpace.firstChild)}function Y(G){setTimeout(function(){var n=!1,D=G.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:G.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?k(G):J(G)},20)}function j(G){z(G)&&k(G)}function B(G){var n=G.getWrapperElement(),D=z(G);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?k(G):J(G)}function z(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(dt,be,$){(function(ie){ie($("VrN/"))})(function(ie){"use strict";var J={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},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Y,j){var B=Y.indentUnit,z={},G=j.htmlMode?J:k;for(var n in G)z[n]=G[n];for(var n in j)z[n]=j[n];var D,y;function g(u,v){function a(F){return v.tokenize=F,F(u,v)}var _=u.next();if(_=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?a(d("atom","]]>")):null:u.match("--")?a(d("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),a(p(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),v.tokenize=d("meta","?>"),"meta"):(D=u.eat("/")?"closeTag":"openTag",v.tokenize=m,"tag bracket");if(_=="&"){var N;return u.eat("#")?u.eat("x")?N=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):N=u.eatWhile(/[\d]/)&&u.eat(";"):N=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),N?"atom":"error"}else return u.eatWhile(/[^&<]/),null}g.isInText=!0;function m(u,v){var a=u.next();if(a==">"||a=="/"&&u.eat(">"))return v.tokenize=g,D=a==">"?"endTag":"selfcloseTag","tag bracket";if(a=="=")return D="equals",null;if(a=="<"){v.tokenize=g,v.state=s,v.tagName=v.tagStart=null;var _=v.tokenize(u,v);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(a)?(v.tokenize=c(a),v.stringStartCol=u.column(),v.tokenize(u,v)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(u){var v=function(a,_){for(;!a.eol();)if(a.next()==u){_.tokenize=m;break}return"string"};return v.isInAttribute=!0,v}function d(u,v){return function(a,_){for(;!a.eol();){if(a.match(v)){_.tokenize=g;break}a.next()}return u}}function p(u){return function(v,a){for(var _;(_=v.next())!=null;){if(_=="<")return a.tokenize=p(u+1),a.tokenize(v,a);if(_==">")if(u==1){a.tokenize=g;break}else return a.tokenize=p(u-1),a.tokenize(v,a)}return"meta"}}function l(u,v,a){this.prev=u.context,this.tagName=v,this.indent=u.indented,this.startOfLine=a,(z.doNotIndent.hasOwnProperty(v)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function h(u){u.context&&(u.context=u.context.prev)}function o(u,v){for(var a;;){if(!u.context)return;if(a=u.context.tagName,!z.contextGrabbers.hasOwnProperty(a)||!z.contextGrabbers[a].hasOwnProperty(v))return;h(u)}}function s(u,v,a){return u=="openTag"?(a.tagStart=v.column(),R):u=="closeTag"?x:s}function R(u,v,a){return u=="word"?(a.tagName=v.current(),y="tag",O):z.allowMissingTagName&&u=="endTag"?(y="tag bracket",O(u,v,a)):(y="error",R)}function x(u,v,a){if(u=="word"){var _=v.current();return a.context&&a.context.tagName!=_&&z.implicitlyClosed.hasOwnProperty(a.context.tagName)&&h(a),a.context&&a.context.tagName==_||z.matchClosing===!1?(y="tag",C):(y="tag error",L)}else return z.allowMissingTagName&&u=="endTag"?(y="tag bracket",C(u,v,a)):(y="error",L)}function C(u,v,a){return u!="endTag"?(y="error",C):(h(a),s)}function L(u,v,a){return y="error",C(u,v,a)}function O(u,v,a){if(u=="word")return y="attribute",A;if(u=="endTag"||u=="selfcloseTag"){var _=a.tagName,N=a.tagStart;return a.tagName=a.tagStart=null,u=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(_)?o(a,_):(o(a,_),a.context=new l(a,_,N==a.indented)),s}return y="error",O}function A(u,v,a){return u=="equals"?w:(z.allowMissing||(y="error"),O(u,v,a))}function w(u,v,a){return u=="string"?b:u=="word"&&z.allowUnquoted?(y="string",O):(y="error",O(u,v,a))}function b(u,v,a){return u=="string"?b:O(u,v,a)}return{startState:function(u){var v={tokenize:g,state:s,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(v.baseIndent=u),v},token:function(u,v){if(!v.tagName&&u.sol()&&(v.indented=u.indentation()),u.eatSpace())return null;D=null;var a=v.tokenize(u,v);return(a||D)&&a!="comment"&&(y=null,v.state=v.state(D||a,u,v),y&&(a=y=="error"?a+" error":y)),a},indent:function(u,v,a){var _=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+B;if(_&&_.noIndent)return ie.Pass;if(u.tokenize!=m&&u.tokenize!=g)return a?a.match(/^(\s*)/)[0].length:0;if(u.tagName)return z.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+B*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/<!\[CDATA\[/.test(v))return 0;var N=v&&/^<(\/)?([\w_:\.-]*)/.exec(v);if(N&&N[1])for(;_;)if(_.tagName==N[2]){_=_.prev;break}else if(z.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(N)for(;_;){var F=z.contextGrabbers[_.tagName];if(F&&F.hasOwnProperty(N[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+B:u.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(u){u.state==w&&(u.state=O)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var v=[],a=u.context;a;a=a.prev)a.tagName&&v.push(a.tagName);return v.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(dt,be,$){"use strict";$.d(be,"a",function(){return J});class ie{constructor(k){this.element=k,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class J{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let k=this._first;for(;k!==ie.Undefined;){const Y=k.next;k.prev=ie.Undefined,k.next=ie.Undefined,k=Y}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(k){return this._insert(k,!1)}push(k){return this._insert(k,!0)}_insert(k,Y){const j=new ie(k);if(this._first===ie.Undefined)this._first=j,this._last=j;else if(Y){const z=this._last;this._last=j,j.prev=z,z.next=j}else{const z=this._first;this._first=j,j.next=z,z.prev=j}this._size+=1;let B=!1;return()=>{B||(B=!0,this._remove(j))}}shift(){if(this._first===ie.Undefined)return;{const k=this._first.element;return this._remove(this._first),k}}pop(){if(this._last===ie.Undefined)return;{const k=this._last.element;return this._remove(this._last),k}}_remove(k){if(k.prev!==ie.Undefined&&k.next!==ie.Undefined){const Y=k.prev;Y.next=k.next,k.next.prev=Y}else k.prev===ie.Undefined&&k.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):k.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):k.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let k=this._first;for(;k!==ie.Undefined;)yield k.element,k=k.next}}},"3/fG":function(dt,be,$){"use strict";$.d(be,"a",function(){return J});function ie(k,Y){let j;return Y.length===0?j=k:j=k.replace(/\{(\d+)\}/g,function(B,z){const G=z[0];return typeof Y[G]!="undefined"?Y[G]:B}),j}function J(k,Y,...j){return ie(Y,j)}},"55Ip":function(dt,be,$){"use strict";$.d(be,"a",function(){return o});var ie=$("Ty5D"),J=$("dI71"),k=$("q1tI"),Y=$.n(k),j=$("YS25"),B=$("17x9"),z=$.n(B),G=$("wx14"),n=$("zLVn"),D=$("9R94"),y=function(w){Object(J.a)(b,w);function b(){for(var v,a=arguments.length,_=new Array(a),N=0;N<a;N++)_[N]=arguments[N];return v=w.call.apply(w,[this].concat(_))||this,v.history=Object(j.a)(v.props),v}var u=b.prototype;return u.render=function(){return Y.a.createElement(ie.c,{history:this.history,children:this.props.children})},b}(Y.a.Component),g=function(w){Object(J.a)(b,w);function b(){for(var v,a=arguments.length,_=new Array(a),N=0;N<a;N++)_[N]=arguments[N];return v=w.call.apply(w,[this].concat(_))||this,v.history=Object(j.b)(v.props),v}var u=b.prototype;return u.render=function(){return Y.a.createElement(ie.c,{history:this.history,children:this.props.children})},b}(Y.a.Component),m=function(b,u){return typeof b=="function"?b(u):b},c=function(b,u){return typeof b=="string"?Object(j.c)(b,null,null,u):b},d=function(b){return b},p=Y.a.forwardRef;typeof p=="undefined"&&(p=d);function l(w){return!!(w.metaKey||w.altKey||w.ctrlKey||w.shiftKey)}var h=p(function(w,b){var u=w.innerRef,v=w.navigate,a=w.onClick,_=Object(n.a)(w,["innerRef","navigate","onClick"]),N=_.target,F=Object(G.a)({},_,{onClick:function(U){try{a&&a(U)}catch(M){throw U.preventDefault(),M}!U.defaultPrevented&&U.button===0&&(!N||N==="_self")&&!l(U)&&(U.preventDefault(),v())}});return d!==p?F.ref=b||u:F.ref=u,Y.a.createElement("a",F)}),o=p(function(w,b){var u=w.component,v=u===void 0?h:u,a=w.replace,_=w.to,N=w.innerRef,F=Object(n.a)(w,["component","replace","to","innerRef"]);return Y.a.createElement(ie.e.Consumer,null,function(S){S||Object(D.a)(!1);var U=S.history,M=c(m(_,S.location),S.location),E=M?U.createHref(M):"",W=Object(G.a)({},F,{href:E,navigate:function(){var ne=m(_,S.location),ae=a?U.replace:U.push;ae(ne)}});return d!==p?W.ref=b||N:W.innerRef=N,Y.a.createElement(v,W)})});if(!1)var s,R;var x=function(b){return b},C=Y.a.forwardRef;typeof C=="undefined"&&(C=x);function L(){for(var w=arguments.length,b=new Array(w),u=0;u<w;u++)b[u]=arguments[u];return b.filter(function(v){return v}).join(" ")}var O=C(function(w,b){var u=w["aria-current"],v=u===void 0?"page":u,a=w.activeClassName,_=a===void 0?"active":a,N=w.activeStyle,F=w.className,S=w.exact,U=w.isActive,M=w.location,E=w.sensitive,W=w.strict,Z=w.style,ne=w.to,ae=w.innerRef,we=Object(n.a)(w,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Y.a.createElement(ie.e.Consumer,null,function(fe){fe||Object(D.a)(!1);var _e=M||fe.location,Se=c(m(ne,_e),_e),ve=Se.pathname,ue=ve&&ve.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),le=ue?Object(ie.f)(_e.pathname,{path:ue,exact:S,sensitive:E,strict:W}):null,Oe=!!(U?U(le,_e):le),Ye=Oe?L(F,_):F,Ve=Oe?Object(G.a)({},Z,{},N):Z,$e=Object(G.a)({"aria-current":Oe&&v||null,className:Ye,style:Ve,to:Se},we);return x!==C?$e.ref=b||ae:$e.innerRef=ae,Y.a.createElement(o,$e)})});if(!1)var A},"5VLF":function(dt,be,$){"use strict";var ie,J;function k(Y,j,B){var z=function(G,n){return Y.js_beautify(G,n)};return z.js=Y.js_beautify,z.css=j.css_beautify,z.html=B.html_beautify,z.js_beautify=Y.js_beautify,z.css_beautify=j.css_beautify,z.html_beautify=B.html_beautify,z}!(ie=[$("6UM0"),$("TXwP"),$("psGv")],J=function(Y,j,B){return k(Y,j,B)}.apply(be,ie),J!==void 0&&(dt.exports=J))},"5Y4S":function(dt,be,$){"use strict";$.d(be,"a",function(){return k});var ie=$("MNsG");const J=ie.b.performance&&typeof ie.b.performance.now=="function";class k{constructor(Y){this._highResolution=J&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new k(Y)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ie.b.performance.now():Date.now()}}},"6+eU":function(dt,be,$){"use strict";$.d(be,"a",function(){return C});var ie=$("wx14"),J=$("rePB"),k=$("VTBJ"),Y=$("1OyB"),j=$("vuIU"),B=$("Ji7U"),z=$("LK+K"),G=$("q1tI"),n=$.n(G),D=$("TSYQ"),y=$.n(D),g=function(O){var A,w="".concat(O.rootPrefixCls,"-item"),b=y()(w,"".concat(w,"-").concat(O.page),(A={},Object(J.a)(A,"".concat(w,"-active"),O.active),Object(J.a)(A,O.className,!!O.className),Object(J.a)(A,"".concat(w,"-disabled"),!O.page),A)),u=function(){O.onClick(O.page)},v=function(_){O.onKeyPress(_,O.onClick,O.page)};return n.a.createElement("li",{title:O.showTitle?O.page:null,className:b,onClick:u,onKeyPress:v,tabIndex:"0"},O.itemRender(O.page,"page",n.a.createElement("a",{rel:"nofollow"},O.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},d=function(L){Object(B.a)(A,L);var O=Object(z.a)(A);function A(){var w;Object(Y.a)(this,A);for(var b=arguments.length,u=new Array(b),v=0;v<b;v++)u[v]=arguments[v];return w=O.call.apply(O,[this].concat(u)),w.state={goInputText:""},w.buildOptionText=function(a){return"".concat(a," ").concat(w.props.locale.items_per_page)},w.changeSize=function(a){w.props.changeSize(Number(a))},w.handleChange=function(a){w.setState({goInputText:a.target.value})},w.handleBlur=function(a){var _=w.props,N=_.goButton,F=_.quickGo,S=_.rootPrefixCls,U=w.state.goInputText;if(N||U==="")return;if(a.relatedTarget&&(a.relatedTarget.className.indexOf("".concat(S,"-prev"))>=0||a.relatedTarget.className.indexOf("".concat(S,"-next"))>=0))return;w.setState({goInputText:""}),F(w.getValidValue())},w.go=function(a){var _=w.state.goInputText;if(_==="")return;(a.keyCode===c.ENTER||a.type==="click")&&(w.setState({goInputText:""}),w.props.quickGo(w.getValidValue()))},w}return Object(j.a)(A,[{key:"getValidValue",value:function(){var b=this.state,u=b.goInputText,v=b.current;return!u||isNaN(u)?v:Number(u)}},{key:"getPageSizeOptions",value:function(){var b=this.props,u=b.pageSize,v=b.pageSizeOptions;return v.some(function(a){return a.toString()===u.toString()})?v:v.concat([u.toString()]).sort(function(a,_){var N=isNaN(Number(a))?0:Number(a),F=isNaN(Number(_))?0:Number(_);return N-F})}},{key:"render",value:function(){var b=this,u=this.props,v=u.pageSize,a=u.locale,_=u.rootPrefixCls,N=u.changeSize,F=u.quickGo,S=u.goButton,U=u.selectComponentClass,M=u.buildOptionText,E=u.selectPrefixCls,W=u.disabled,Z=this.state.goInputText,ne="".concat(_,"-options"),ae=U,we=null,fe=null,_e=null;if(!N&&!F)return null;var Se=this.getPageSizeOptions();if(N&&ae){var ve=Se.map(function(ue,le){return n.a.createElement(ae.Option,{key:le,value:ue.toString()},(M||b.buildOptionText)(ue))});we=n.a.createElement(ae,{disabled:W,prefixCls:E,showSearch:!1,className:"".concat(ne,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||Se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(le){return le.parentNode}},ve)}return F&&(S&&(_e=typeof S=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:W,className:"".concat(ne,"-quick-jumper-button")},a.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},S)),fe=n.a.createElement("div",{className:"".concat(ne,"-quick-jumper")},a.jump_to,n.a.createElement("input",{disabled:W,type:"text",value:Z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),a.page,_e)),n.a.createElement("li",{className:"".concat(ne)},we,fe)}}]),A}(n.a.Component);d.defaultProps={pageSizeOptions:["10","20","50","100"]};var p=d,l=$("N2Kk");function h(){}function o(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function s(L,O,A){return A}function R(L,O,A){var w=typeof L=="undefined"?O.pageSize:L;return Math.floor((A.total-1)/w)+1}var x=function(L){Object(B.a)(A,L);var O=Object(z.a)(A);function A(w){var b;Object(Y.a)(this,A),b=O.call(this,w),b.getJumpPrevPage=function(){return Math.max(1,b.state.current-(b.props.showLessItems?3:5))},b.getJumpNextPage=function(){return Math.min(R(void 0,b.state,b.props),b.state.current+(b.props.showLessItems?3:5))},b.getItemIcon=function(N,F){var S=b.props.prefixCls,U=N||n.a.createElement("button",{type:"button","aria-label":F,className:"".concat(S,"-item-link")});return typeof N=="function"&&(U=n.a.createElement(N,Object(k.a)({},b.props))),U},b.savePaginationNode=function(N){b.paginationNode=N},b.isValid=function(N){return o(N)&&N!==b.state.current},b.shouldDisplayQuickJumper=function(){var N=b.props,F=N.showQuickJumper,S=N.pageSize,U=N.total;return U<=S?!1:F},b.handleKeyDown=function(N){(N.keyCode===c.ARROW_UP||N.keyCode===c.ARROW_DOWN)&&N.preventDefault()},b.handleKeyUp=function(N){var F=b.getValidValue(N),S=b.state.currentInputValue;F!==S&&b.setState({currentInputValue:F}),N.keyCode===c.ENTER?b.handleChange(F):N.keyCode===c.ARROW_UP?b.handleChange(F-1):N.keyCode===c.ARROW_DOWN&&b.handleChange(F+1)},b.changePageSize=function(N){var F=b.state.current,S=R(N,b.state,b.props);F=F>S?S:F,S===0&&(F=b.state.current),typeof N=="number"&&("pageSize"in b.props||b.setState({pageSize:N}),"current"in b.props||b.setState({current:F,currentInputValue:F})),b.props.onShowSizeChange(F,N),"onChange"in b.props&&b.props.onChange&&b.props.onChange(F,N)},b.handleChange=function(N){var F=b.props.disabled,S=N;if(b.isValid(S)&&!F){var U=R(void 0,b.state,b.props);S>U?S=U:S<1&&(S=1),"current"in b.props||b.setState({current:S,currentInputValue:S});var M=b.state.pageSize;return b.props.onChange(S,M),S}return b.state.current},b.prev=function(){b.hasPrev()&&b.handleChange(b.state.current-1)},b.next=function(){b.hasNext()&&b.handleChange(b.state.current+1)},b.jumpPrev=function(){b.handleChange(b.getJumpPrevPage())},b.jumpNext=function(){b.handleChange(b.getJumpNextPage())},b.hasPrev=function(){return b.state.current>1},b.hasNext=function(){return b.state.current<R(void 0,b.state,b.props)},b.runIfEnter=function(N,F){if(N.key==="Enter"||N.charCode===13){for(var S=arguments.length,U=new Array(S>2?S-2:0),M=2;M<S;M++)U[M-2]=arguments[M];F.apply(void 0,U)}},b.runIfEnterPrev=function(N){b.runIfEnter(N,b.prev)},b.runIfEnterNext=function(N){b.runIfEnter(N,b.next)},b.runIfEnterJumpPrev=function(N){b.runIfEnter(N,b.jumpPrev)},b.runIfEnterJumpNext=function(N){b.runIfEnter(N,b.jumpNext)},b.handleGoTO=function(N){(N.keyCode===c.ENTER||N.type==="click")&&b.handleChange(b.state.currentInputValue)};var u=w.onChange!==h,v="current"in w;v&&!u&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var a=w.defaultCurrent;"current"in w&&(a=w.current);var _=w.defaultPageSize;return"pageSize"in w&&(_=w.pageSize),a=Math.min(a,R(_,void 0,w)),b.state={current:a,currentInputValue:a,pageSize:_},b}return Object(j.a)(A,[{key:"componentDidUpdate",value:function(b,u){var v=this.props.prefixCls;if(u.current!==this.state.current&&this.paginationNode){var a=this.paginationNode.querySelector(".".concat(v,"-item-").concat(u.current));a&&document.activeElement===a&&a.blur()}}},{key:"getValidValue",value:function(b){var u=b.target.value,v=R(void 0,this.state,this.props),a=this.state.currentInputValue,_;return u===""?_=u:isNaN(Number(u))?_=a:u>=v?_=v:_=Number(u),_}},{key:"getShowSizeChanger",value:function(){var b=this.props,u=b.showSizeChanger,v=b.total,a=b.totalBoundaryShowSizeChanger;return typeof u!="undefined"?u:v>a}},{key:"renderPrev",value:function(b){var u=this.props,v=u.prevIcon,a=u.itemRender,_=a(b,"prev",this.getItemIcon(v,"prev page")),N=!this.hasPrev();return Object(G.isValidElement)(_)?Object(G.cloneElement)(_,{disabled:N}):_}},{key:"renderNext",value:function(b){var u=this.props,v=u.nextIcon,a=u.itemRender,_=a(b,"next",this.getItemIcon(v,"next page")),N=!this.hasNext();return Object(G.isValidElement)(_)?Object(G.cloneElement)(_,{disabled:N}):_}},{key:"render",value:function(){var b=this,u=this.props,v=u.prefixCls,a=u.className,_=u.style,N=u.disabled,F=u.hideOnSinglePage,S=u.total,U=u.locale,M=u.showQuickJumper,E=u.showLessItems,W=u.showTitle,Z=u.showTotal,ne=u.simple,ae=u.itemRender,we=u.showPrevNextJumpers,fe=u.jumpPrevIcon,_e=u.jumpNextIcon,Se=u.selectComponentClass,ve=u.selectPrefixCls,ue=u.pageSizeOptions,le=this.state,Oe=le.current,Ye=le.pageSize,Ve=le.currentInputValue;if(F===!0&&S<=Ye)return null;var $e=R(void 0,this.state,this.props),Ze=[],Fe=null,We=null,qe=null,oe=null,Ee=null,Ce=M&&M.goButton,Ae=E?1:2,ze=Oe-1>0?Oe-1:0,Je=Oe+1<$e?Oe+1:$e,tt=Object.keys(this.props).reduce(function(re,se){return(se.substr(0,5)==="data-"||se.substr(0,5)==="aria-"||se==="role")&&(re[se]=b.props[se]),re},{});if(ne)return Ce&&(typeof Ce=="boolean"?Ee=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},U.jump_to_confirm):Ee=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ce),Ee=n.a.createElement("li",{title:W?"".concat(U.jump_to).concat(Oe,"/").concat($e):null,className:"".concat(v,"-simple-pager")},Ee)),n.a.createElement("ul",Object(ie.a)({className:y()(v,"".concat(v,"-simple"),Object(J.a)({},"".concat(v,"-disabled"),N),a),style:_,ref:this.savePaginationNode},tt),n.a.createElement("li",{title:W?U.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:y()("".concat(v,"-prev"),Object(J.a)({},"".concat(v,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ze)),n.a.createElement("li",{title:W?"".concat(Oe,"/").concat($e):null,className:"".concat(v,"-simple-pager")},n.a.createElement("input",{type:"text",value:Ve,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(v,"-slash")},"/"),$e),n.a.createElement("li",{title:W?U.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:y()("".concat(v,"-next"),Object(J.a)({},"".concat(v,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Je)),Ee);if($e<=3+Ae*2){var nt={locale:U,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:W,itemRender:ae};$e||Ze.push(n.a.createElement(m,Object(ie.a)({},nt,{key:"noPager",page:$e,className:"".concat(v,"-disabled")})));for(var ht=1;ht<=$e;ht+=1){var it=Oe===ht;Ze.push(n.a.createElement(m,Object(ie.a)({},nt,{key:ht,page:ht,active:it})))}}else{var lt=E?U.prev_3:U.prev_5,Me=E?U.next_3:U.next_5;we&&(Fe=n.a.createElement("li",{title:W?lt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:y()("".concat(v,"-jump-prev"),Object(J.a)({},"".concat(v,"-jump-prev-custom-icon"),!!fe))},ae(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(fe,"prev page"))),We=n.a.createElement("li",{title:W?Me:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:y()("".concat(v,"-jump-next"),Object(J.a)({},"".concat(v,"-jump-next-custom-icon"),!!_e))},ae(this.getJumpNextPage(),"jump-next",this.getItemIcon(_e,"next page")))),oe=n.a.createElement(m,{locale:U,last:!0,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:$e,page:$e,active:!1,showTitle:W,itemRender:ae}),qe=n.a.createElement(m,{locale:U,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:W,itemRender:ae});var Tt=Math.max(1,Oe-Ae),mt=Math.min(Oe+Ae,$e);Oe-1<=Ae&&(mt=1+Ae*2),$e-Oe<=Ae&&(Tt=$e-Ae*2);for(var Ne=Tt;Ne<=mt;Ne+=1){var He=Oe===Ne;Ze.push(n.a.createElement(m,{locale:U,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ne,page:Ne,active:He,showTitle:W,itemRender:ae}))}Oe-1>=Ae*2&&Oe!==1+2&&(Ze[0]=Object(G.cloneElement)(Ze[0],{className:"".concat(v,"-item-after-jump-prev")}),Ze.unshift(Fe)),$e-Oe>=Ae*2&&Oe!==$e-2&&(Ze[Ze.length-1]=Object(G.cloneElement)(Ze[Ze.length-1],{className:"".concat(v,"-item-before-jump-next")}),Ze.push(We)),Tt!==1&&Ze.unshift(qe),mt!==$e&&Ze.push(oe)}var Te=null;Z&&(Te=n.a.createElement("li",{className:"".concat(v,"-total-text")},Z(S,[S===0?0:(Oe-1)*Ye+1,Oe*Ye>S?S:Oe*Ye])));var me=!this.hasPrev()||!$e,ge=!this.hasNext()||!$e;return n.a.createElement("ul",Object(ie.a)({className:y()(v,a,Object(J.a)({},"".concat(v,"-disabled"),N)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},tt),Te,n.a.createElement("li",{title:W?U.prev_page:null,onClick:this.prev,tabIndex:me?null:0,onKeyPress:this.runIfEnterPrev,className:y()("".concat(v,"-prev"),Object(J.a)({},"".concat(v,"-disabled"),me)),"aria-disabled":me},this.renderPrev(ze)),Ze,n.a.createElement("li",{title:W?U.next_page:null,onClick:this.next,tabIndex:ge?null:0,onKeyPress:this.runIfEnterNext,className:y()("".concat(v,"-next"),Object(J.a)({},"".concat(v,"-disabled"),ge)),"aria-disabled":ge},this.renderNext(Je)),n.a.createElement(p,{disabled:N,locale:U,rootPrefixCls:v,selectComponentClass:Se,selectPrefixCls:ve,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Oe,pageSize:Ye,pageSizeOptions:ue,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ce}))}}],[{key:"getDerivedStateFromProps",value:function(b,u){var v={};if("current"in b&&(v.current=b.current,b.current!==u.current&&(v.currentInputValue=v.current)),"pageSize"in b&&b.pageSize!==u.pageSize){var a=u.current,_=R(b.pageSize,u,b);a=a>_?_:a,"current"in b||(v.current=a,v.currentInputValue=a),v.pageSize=b.pageSize}return v}}]),A}(n.a.Component);x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:h,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:h,locale:l.a,style:{},itemRender:s,totalBoundaryShowSizeChanger:50};var C=x},"6UM0":function(dt,be,$){var ie,J;(function(){var k;(function(){"use strict";var j=[function(n,D,y){var g=y(1).Beautifier,m=y(5).Options;function c(d,p){var l=new g(d,p);return l.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),d=y(5).Options,p=y(7).Tokenizer,l=y(7).line_starters,h=y(7).positionable_operators,o=y(7).TOKEN;function s(E,W){return W.indexOf(E)!==-1}function R(E){return E.replace(/^\s+/g,"")}function x(E){for(var W={},Z=0;Z<E.length;Z++)W[E[Z].replace(/-/g,"_")]=E[Z];return W}function C(E,W){return E&&E.type===o.RESERVED&&E.text===W}function L(E,W){return E&&E.type===o.RESERVED&&s(E.text,W)}var O=["case","return","do","if","throw","else","await","break","continue","async"],A=["before-newline","after-newline","preserve-newline"],w=x(A),b=[w.before_newline,w.preserve_newline],u={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function v(E,W){if(W.multiline_frame||W.mode===u.ForInitializer||W.mode===u.Conditional)return;E.remove_indent(W.start_line_index)}function a(E){E=E.replace(c.allLineBreaks,`
|
|
`);for(var W=[],Z=E.indexOf(`
|
|
`);Z!==-1;)W.push(E.substring(0,Z)),E=E.substring(Z+1),Z=E.indexOf(`
|
|
`);return E.length&&W.push(E),W}function _(E){return E===u.ArrayLiteral}function N(E){return s(E,[u.Expression,u.ForInitializer,u.Conditional])}function F(E,W){for(var Z=0;Z<E.length;Z++){var ne=E[Z].trim();if(ne.charAt(0)!==W)return!1}return!0}function S(E,W){for(var Z=0,ne=E.length,ae;Z<ne;Z++)if(ae=E[Z],ae&&ae.indexOf(W)!==0)return!1;return!0}function U(E,W){W=W||{},this._source_text=E||"",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 d(W)}U.prototype.create_flags=function(E,W){var Z=0;E&&(Z=E.indentation_level,!this._output.just_added_newline()&&E.line_indent_level>Z&&(Z=E.line_indent_level));var ne={mode:W,parent:E,last_token:E?E.last_token:new m(o.START_BLOCK,""),last_word:E?E.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:Z,alignment:0,line_indent_level:E?E.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},U.prototype._reset=function(E){var W=E.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var Z=new p(E,this._options);return this._tokens=Z.tokenize(),E},U.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E,W=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=`
|
|
`,W&&c.lineBreak.test(W||"")&&(Z=W.match(c.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return E=this._output.get_code(Z),E},U.prototype.handle_token=function(E,W){E.type===o.START_EXPR?this.handle_start_expr(E):E.type===o.END_EXPR?this.handle_end_expr(E):E.type===o.START_BLOCK?this.handle_start_block(E):E.type===o.END_BLOCK?this.handle_end_block(E):E.type===o.WORD?this.handle_word(E):E.type===o.RESERVED?this.handle_word(E):E.type===o.SEMICOLON?this.handle_semicolon(E):E.type===o.STRING?this.handle_string(E):E.type===o.EQUALS?this.handle_equals(E):E.type===o.OPERATOR?this.handle_operator(E):E.type===o.COMMA?this.handle_comma(E):E.type===o.BLOCK_COMMENT?this.handle_block_comment(E,W):E.type===o.COMMENT?this.handle_comment(E,W):E.type===o.DOT?this.handle_dot(E):E.type===o.EOF?this.handle_eof(E):E.type===o.UNKNOWN?this.handle_unknown(E,W):this.handle_unknown(E,W)},U.prototype.handle_whitespace_and_comments=function(E,W){var Z=E.newlines,ne=this._options.keep_array_indentation&&_(this._flags.mode);if(E.comments_before)for(var ae=E.comments_before.next();ae;)this.handle_whitespace_and_comments(ae,W),this.handle_token(ae,W),ae=E.comments_before.next();if(ne)for(var we=0;we<Z;we+=1)this.print_newline(we>0,W);else if(this._options.max_preserve_newlines&&Z>this._options.max_preserve_newlines&&(Z=this._options.max_preserve_newlines),this._options.preserve_newlines&&Z>1){this.print_newline(!1,W);for(var fe=1;fe<Z;fe+=1)this.print_newline(!0,W)}};var M=["async","break","continue","return","throw","yield"];U.prototype.allow_wrap_or_preserved_newline=function(E,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var Z=this._options.preserve_newlines&&E.newlines||W,ne=s(this._flags.last_token.text,h)||s(E.text,h);if(ne){var ae=s(this._flags.last_token.text,h)&&s(this._options.operator_position,b)||s(E.text,h);Z=Z&&ae}if(Z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,M))return;this._output.set_wrap_point()}},U.prototype.print_newline=function(E,W){if(!W&&(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 Z=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&C(Z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(E)&&(this._flags.multiline_frame=!0)},U.prototype.print_token_line_indentation=function(E){this._output.just_added_newline()&&(this._options.keep_array_indentation&&E.newlines&&(E.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(E.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))},U.prototype.print_token=function(E){if(this._output.raw){this._output.add_raw_token(E);return}if(this._options.comma_first&&E.previous&&E.previous.type===o.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(E),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(E),this._output.non_breaking_space=!0,this._output.add_token(E.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},U.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.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))},U.prototype.set_mode=function(E){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,E),this._flags=this.create_flags(this._previous_flags,E),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===u.Statement&&v(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},U.prototype.start_of_object_property=function(){return this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},U.prototype.start_of_statement=function(E){var W=!1;return W=W||L(this._flags.last_token,["var","let","const"])&&E.type===o.WORD,W=W||C(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&L(this._flags.last_token,M)&&!E.newlines,W=W||C(this._flags.last_token,"else")&&!(C(E,"if")&&!E.comments_before),W=W||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),W=W||this._flags.last_token.type===o.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(E.text==="--"||E.text==="++")&&this._last_last_text!=="function"&&E.type!==o.WORD&&E.type!==o.RESERVED,W=W||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),W?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(E,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(E,L(E,["do","for","if","while"])),!0):!1},U.prototype.handle_start_expr=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E);var W=u.Expression;if(E.text==="["){if(this._flags.last_token.type===o.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(E),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=u.ArrayLiteral,_(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(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,W=u.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=u.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&E.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,l)||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(E);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var Z=this._tokens.peek(-3);if(this._options.space_after_named_function&&Z){var ne=this._tokens.peek(-4);L(Z,["async","function"])||Z.text==="*"&&L(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?(Z.text==="{"||Z.text===","||Z.text==="*"&&(ne.text==="{"||ne.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(E);(this._flags.last_token.type===o.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===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(E,E.newlines),this.print_token(E),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},U.prototype.handle_end_expr=function(E){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(E,E.text==="]"&&_(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(E),this.restore_mode(),v(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===u.Conditional&&(this._previous_flags.mode=u.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},U.prototype.handle_start_block=function(E){this.handle_whitespace_and_comments(E);var W=this._tokens.peek(),Z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(u.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(u.BlockStatement):Z&&(s(Z.text,[":",","])&&s(W.type,[o.STRING,o.WORD,o.RESERVED])||s(W.text,["get","set","..."])&&s(Z.type,[o.WORD,o.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(Z.text,[":",","])?this.set_mode(u.BlockStatement):this.set_mode(u.ObjectLiteral):this._flags.last_token.type===o.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(u.BlockStatement):s(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(u.ObjectLiteral):this.set_mode(u.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!W.comments_before&&W.text==="}",ae=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var we=0,fe=null;this._flags.inline_frame=!0;do if(we+=1,fe=this._tokens.peek(we-1),fe.newlines){this._flags.inline_frame=!1;break}while(fe.type!==o.EOF&&!(fe.type===o.END_BLOCK&&fe.opened===E))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(ae||this._flags.last_token.type===o.EQUALS||L(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(this._previous_flags.mode)&&(this._flags.last_token.type===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(E),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(E),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},U.prototype.handle_end_block=function(E){for(this.handle_whitespace_and_comments(E);this._flags.mode===u.Statement;)this.restore_mode();var W=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(_(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(E)},U.prototype.handle_word=function(E){if(E.type===o.RESERVED){if(s(E.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)E.type=o.WORD;else if(E.text==="import"&&s(this._tokens.peek().text,["(","."]))E.type=o.WORD;else if(s(E.text,["as","from"])&&!this._flags.import_block)E.type=o.WORD;else if(this._flags.mode===u.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(E.type=o.WORD)}}if(this.start_of_statement(E)?L(this._flags.last_token,["var","let","const"])&&E.type===o.WORD&&(this._flags.declaration_statement=!0):E.newlines&&!N(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||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(E),this.print_newline()):this.handle_whitespace_and_comments(E),this._flags.do_block&&!this._flags.do_while)if(C(E,"while")){this._output.space_before_token=!0,this.print_token(E),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&&C(E,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===u.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(E,["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(E),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(E)),C(E,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===o.OPERATOR))&&(!this._output.just_added_blankline()&&!E.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,M)?this._output.space_before_token=!0:C(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&&(N(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(E),this._flags.last_word=E.text;return}var Z="NONE";if(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":L(E,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===u.BlockStatement?Z="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&N(this._flags.mode)?Z="SPACE":this._flags.last_token.type===o.STRING?Z="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&s(this._last_last_text,["{",","]))?Z="SPACE":this._flags.last_token.type===o.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),L(E,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Z="SPACE":Z="NEWLINE"),L(E,["else","catch","finally"]))if((!(this._flags.last_token.type===o.END_BLOCK&&this._previous_flags.mode===u.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&E.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Z==="NEWLINE"?L(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(E,["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||!L(E,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(E,"if")&&C(E.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(E,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Z==="SPACE"&&(this._output.space_before_token=!0);E.previous&&(E.previous.type===o.WORD||E.previous.type===o.RESERVED)&&(this._output.space_before_token=!0),this.print_token(E),this._flags.last_word=E.text,E.type===o.RESERVED&&(E.text==="do"?this._flags.do_block=!0:E.text==="if"?this._flags.if_block=!0:E.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(E,"from")&&(this._flags.import_block=!1))},U.prototype.handle_semicolon=function(E){this.start_of_statement(E)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(E);for(var W=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&C(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(E)},U.prototype.handle_string=function(E){E.text.startsWith("`")&&E.newlines===0&&E.whitespace_before===""&&(E.previous.text===")"||this._flags.last_token.type===o.WORD)||(this.start_of_statement(E)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(E),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(E):E.text.startsWith("`")&&this._flags.last_token.type===o.END_EXPR&&(E.previous.text==="]"||E.previous.text===")")&&E.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(E)},U.prototype.handle_equals=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0},U.prototype.handle_comma=function(E){this.handle_whitespace_and_comments(E,!0),this.print_token(E),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(E)):this._flags.mode===u.ObjectLiteral||this._flags.mode===u.Statement&&this._flags.parent.mode===u.ObjectLiteral?(this._flags.mode===u.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(E)},U.prototype.handle_operator=function(E){var W=E.text==="*"&&(L(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),Z=s(E.text,["-","+"])&&(s(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||s(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(E)){var ne=!W;this.handle_whitespace_and_comments(E,ne)}if(E.text==="*"&&this._flags.last_token.type===o.DOT){this.print_token(E);return}if(E.text==="::"){this.print_token(E);return}if(this._flags.last_token.type===o.OPERATOR&&s(this._options.operator_position,b)&&this.allow_wrap_or_preserved_newline(E),E.text===":"&&this._flags.in_case){this.print_token(E),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 ae=!0,we=!0,fe=!1;if(E.text===":"?this._flags.ternary_depth===0?ae=!1:(this._flags.ternary_depth-=1,fe=!0):E.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!W&&this._options.preserve_newlines&&s(E.text,h)){var _e=E.text===":",Se=_e&&fe,ve=_e&&!fe;switch(this._options.operator_position){case w.before_newline:this._output.space_before_token=!ve,this.print_token(E),(!_e||Se)&&this.allow_wrap_or_preserved_newline(E),this._output.space_before_token=!0;return;case w.after_newline:this._output.space_before_token=!0,!_e||Se?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(E):this._output.space_before_token=!1,this.print_token(E),this._output.space_before_token=!0;return;case w.preserve_newline:ve||this.allow_wrap_or_preserved_newline(E),ae=!(this._output.just_added_newline()||ve),this._output.space_before_token=ae,this.print_token(E),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(E),ae=!1;var ue=this._tokens.peek();we=ue&&s(ue.type,[o.WORD,o.RESERVED])}else if(E.text==="...")this.allow_wrap_or_preserved_newline(E),ae=this._flags.last_token.type===o.START_BLOCK,we=!1;else if(s(E.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR)&&this.allow_wrap_or_preserved_newline(E),ae=!1,we=!1,E.newlines&&(E.text==="--"||E.text==="++"||E.text==="~")){var le=L(this._flags.last_token,O)&&E.newlines;le&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(le,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(ae=!0),this._flags.last_token.type===o.RESERVED?ae=!0:this._flags.last_token.type===o.END_EXPR?ae=!(this._flags.last_token.text==="]"&&(E.text==="--"||E.text==="++")):this._flags.last_token.type===o.OPERATOR&&(ae=s(E.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(E.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(we=!0)),(this._flags.mode===u.BlockStatement&&!this._flags.inline_frame||this._flags.mode===u.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ae,this.print_token(E),this._output.space_before_token=we},U.prototype.handle_block_comment=function(E,W){if(this._output.raw){this._output.add_raw_token(E),E.directives&&E.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(E.directives){this.print_newline(!1,W),this.print_token(E),E.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(E.text)&&!E.newlines){this._output.space_before_token=!0,this.print_token(E),this._output.space_before_token=!0;return}else this.print_block_commment(E,W)},U.prototype.print_block_commment=function(E,W){var Z=a(E.text),ne,ae=!1,we=!1,fe=E.whitespace_before,_e=fe.length;if(this.print_newline(!1,W),this.print_token_line_indentation(E),this._output.add_token(Z[0]),this.print_newline(!1,W),Z.length>1){for(Z=Z.slice(1),ae=F(Z,"*"),we=S(Z,fe),ae&&(this._flags.alignment=1),ne=0;ne<Z.length;ne++)ae?(this.print_token_line_indentation(E),this._output.add_token(R(Z[ne]))):we&&Z[ne]?(this.print_token_line_indentation(E),this._output.add_token(Z[ne].substring(_e))):(this._output.current_line.set_indent(-1),this._output.add_token(Z[ne])),this.print_newline(!1,W);this._flags.alignment=0}},U.prototype.handle_comment=function(E,W){E.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(E),this.print_newline(!1,W)},U.prototype.handle_dot=function(E){this.start_of_statement(E)||this.handle_whitespace_and_comments(E,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(E,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(E)},U.prototype.handle_unknown=function(E,W){this.print_token(E),E.text[E.text.length-1]===`
|
|
`&&this.print_newline(!1,W)},U.prototype.handle_eof=function(E){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(E)},n.exports.Beautifier=U},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 d=this.__base_string_length;return c=c||0,m<0&&(d=0),d+=m*this.__indent_size,d+=c,d},y.prototype.get_indent_string=function(m,c){var d=this.__base_string;return c=c||0,m<0&&(m=0,d=""),c+=m*this.__indent_size,this.__ensure_cache(c),d+=this.__cache[c],d},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,d="";this.__indent_size&&m>=this.__indent_size&&(c=Math.floor(m/this.__indent_size),m-=c*this.__indent_size,d=new Array(c+1).join(this.__indent_string)),m&&(d+=new Array(m+1).join(" ")),this.__cache.push(d)};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 d=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(d=d.replace(/[\n]/g,m)),d},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 d=this.__lines.length-2;d>=0;){var p=this.__lines[d];if(p.is_empty())break;if(p.item(0).indexOf(m)!==0&&p.item(-1)!==c){this.__lines.splice(d+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},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",d="(?:\\\\u[0-9a-fA-F]{4}|["+y+m+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+c+"])*";D.identifier=new RegExp(d+p,"g"),D.identifierStart=new RegExp(d),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+m+c+"])+");var l=/[\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(d){g.call(this,d,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="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 l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var h=0;h<l.length;h++)l[h]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[h];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 d=this.raw_options[m],p=c||[];return typeof d=="object"?d!==null&&typeof d.concat=="function"&&(p=d.concat()):typeof d=="string"&&(p=d.split(/[^a-zA-Z0-9_\/\-]+/)),p},D.prototype._get_boolean=function(m,c){var d=this.raw_options[m],p=d===void 0?!!c:!!d;return p},D.prototype._get_characters=function(m,c){var d=this.raw_options[m],p=c||"";return typeof d=="string"&&(p=d.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),p},D.prototype._get_number=function(m,c){var d=this.raw_options[m];c=parseInt(c,10),isNaN(c)&&(c=0);var p=parseInt(d,10);return isNaN(p)&&(p=c),p},D.prototype._get_selection=function(m,c,d){var p=this._get_selection_list(m,c,d);if(p.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 p[0]},D.prototype._get_selection_list=function(m,c,d){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(d=d||[c[0]],!this._is_valid_selection(d,c))throw new Error("Invalid Default Value!");var p=this._get_array(m,d);if(!this._is_valid_selection(p,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 p},D.prototype._is_valid_selection=function(m,c){return m.length&&c.length&&!m.some(function(d){return c.indexOf(d)===-1})};function y(m,c){var d={};m=g(m);var p;for(p in m)p!==c&&(d[p]=m[p]);if(c&&m[c])for(p in m[c])d[p]=m[c][p];return d}function g(m){var c={},d;for(d in m){var p=d.replace(/-/g,"_");c[p]=m[d]}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,d=y(13).Directives,p=y(4),l=y(12).Pattern,h=y(14).TemplatablePattern;function o(F,S){return S.indexOf(F)!==-1}var s={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:c.START,RAW:c.RAW,EOF:c.EOF},R=new d(/\/\*/,/\*\//),x=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,L=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var w=new RegExp(A),b="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),u=b.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+u.join("|")+")$"),a,_=function(F,S){m.call(this,F,S),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var U=new l(this._input),M=new h(this._input).read_options(this._options);this.__patterns={template:M,identifier:M.starting_with(p.identifier).matching(p.identifierMatch),number:U.matching(x),punct:U.matching(w),comment:U.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:U.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:U.matching(/<!--/),html_comment_end:U.matching(/-->/),include:U.starting_with(/#include/).until_after(p.lineBreak),shebang:U.starting_with(/#!/).until_after(p.lineBreak),xml:U.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:M.until(/['\\\n\r\u2028\u2029]/),double_quote:M.until(/["\\\n\r\u2028\u2029]/),template_text:M.until(/[`\\$]/),template_expression:M.until(/[`}\\]/)}};_.prototype=new m,_.prototype._is_comment=function(F){return F.type===s.COMMENT||F.type===s.BLOCK_COMMENT||F.type===s.UNKNOWN},_.prototype._is_opening=function(F){return F.type===s.START_BLOCK||F.type===s.START_EXPR},_.prototype._is_closing=function(F,S){return(F.type===s.END_BLOCK||F.type===s.END_EXPR)&&S&&(F.text==="]"&&S.text==="["||F.text===")"&&S.text==="("||F.text==="}"&&S.text==="{")},_.prototype._reset=function(){a=!1},_.prototype._get_next_token=function(F,S){var U=null;this._readWhitespace();var M=this._input.peek();return M===null?this._create_token(s.EOF,""):(U=U||this._read_non_javascript(M),U=U||this._read_string(M),U=U||this._read_word(F),U=U||this._read_singles(M),U=U||this._read_comment(M),U=U||this._read_regexp(M,F),U=U||this._read_xml(M,F),U=U||this._read_punctuation(),U=U||this._create_token(s.UNKNOWN,this._input.next()),U)},_.prototype._read_word=function(F){var S;if(S=this.__patterns.identifier.read(),S!=="")return S=S.replace(p.allLineBreaks,`
|
|
`),!(F.type===s.DOT||F.type===s.RESERVED&&(F.text==="set"||F.text==="get"))&&v.test(S)?(S==="in"||S==="of")&&(F.type===s.WORD||F.type===s.STRING)?this._create_token(s.OPERATOR,S):this._create_token(s.RESERVED,S):this._create_token(s.WORD,S);if(S=this.__patterns.number.read(),S!=="")return this._create_token(s.WORD,S)},_.prototype._read_singles=function(F){var S=null;return F==="("||F==="["?S=this._create_token(s.START_EXPR,F):F===")"||F==="]"?S=this._create_token(s.END_EXPR,F):F==="{"?S=this._create_token(s.START_BLOCK,F):F==="}"?S=this._create_token(s.END_BLOCK,F):F===";"?S=this._create_token(s.SEMICOLON,F):F==="."&&L.test(this._input.peek(1))?S=this._create_token(s.DOT,F):F===","&&(S=this._create_token(s.COMMA,F)),S&&this._input.next(),S},_.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(s.EQUALS,F):F==="?."?this._create_token(s.DOT,F):this._create_token(s.OPERATOR,F)},_.prototype._read_non_javascript=function(F){var S="";if(F==="#"){if(this._is_first_token()&&(S=this.__patterns.shebang.read(),S))return this._create_token(s.UNKNOWN,S.trim()+`
|
|
`);if(S=this.__patterns.include.read(),S)return this._create_token(s.UNKNOWN,S.trim()+`
|
|
`);F=this._input.next();var U="#";if(this._input.hasNext()&&this._input.testChar(C)){do F=this._input.next(),U+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(U+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(U+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,U)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(S=this.__patterns.html_comment_start.read(),S){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)S+=this._input.next();return a=!0,this._create_token(s.COMMENT,S)}}else if(a&&F==="-"&&(S=this.__patterns.html_comment_end.read(),S))return a=!1,this._create_token(s.COMMENT,S);return null},_.prototype._read_comment=function(F){var S=null;if(F==="/"){var U="";if(this._input.peek(1)==="*"){U=this.__patterns.block_comment.read();var M=R.get_directives(U);M&&M.ignore==="start"&&(U+=R.readIgnored(this._input)),U=U.replace(p.allLineBreaks,`
|
|
`),S=this._create_token(s.BLOCK_COMMENT,U),S.directives=M}else this._input.peek(1)==="/"&&(U=this.__patterns.comment.read(),S=this._create_token(s.COMMENT,U))}return S},_.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var S=this._input.next();return this.has_char_escapes=!1,F==="`"?S+=this._read_string_recursive("`",!0,"${"):S+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(S=N(S)),this._input.peek()===F&&(S+=this._input.next()),S=S.replace(p.allLineBreaks,`
|
|
`),this._create_token(s.STRING,S)}return null},_.prototype._allow_regexp_or_xml=function(F){return F.type===s.RESERVED&&o(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===s.END_EXPR&&F.text===")"&&F.opened.previous.type===s.RESERVED&&o(F.opened.previous.text,["if","while","for"])||o(F.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},_.prototype._read_regexp=function(F,S){if(F==="/"&&this._allow_regexp_or_xml(S)){for(var U=this._input.next(),M=!1,E=!1;this._input.hasNext()&&(M||E||this._input.peek()!==F)&&!this._input.testChar(p.newline);)U+=this._input.peek(),M?M=!1:(M=this._input.peek()==="\\",this._input.peek()==="["?E=!0:this._input.peek()==="]"&&(E=!1)),this._input.next();return this._input.peek()===F&&(U+=this._input.next(),U+=this._input.read(p.identifier)),this._create_token(s.STRING,U)}return null},_.prototype._read_xml=function(F,S){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(S)){var U="",M=this.__patterns.xml.read_match();if(M){for(var E=M[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=E.indexOf("{")===0,Z=0;M;){var ne=!!M[1],ae=M[2],we=!!M[M.length-1]||ae.slice(0,8)==="![CDATA[";if(!we&&(ae===E||W&&ae.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--Z:++Z),U+=M[0],Z<=0)break;M=this.__patterns.xml.read_match()}return M||(U+=this._input.match(/[\s\S]*/g)[0]),U=U.replace(p.allLineBreaks,`
|
|
`),this._create_token(s.STRING,U)}}return null};function N(F){for(var S="",U=0,M=new g(F),E=null;M.hasNext();)if(E=M.match(/([\s]|[^\\]|\\\\)+/g),E&&(S+=E[0]),M.peek()==="\\"){if(M.next(),M.peek()==="x")E=M.match(/x([0-9A-Fa-f]{2})/g);else if(M.peek()==="u")E=M.match(/u([0-9A-Fa-f]{4})/g);else{S+="\\",M.hasNext()&&(S+=M.next());continue}if(!E)return F;if(U=parseInt(E[1],16),U>126&&U<=255&&E[0].indexOf("x")===0)return F;if(U>=0&&U<32){S+="\\"+E[0];continue}else U===34||U===39||U===92?S+="\\"+String.fromCharCode(U):S+=String.fromCharCode(U)}return S}_.prototype._read_string_recursive=function(F,S,U){var M,E;F==="'"?E=this.__patterns.single_quote:F==='"'?E=this.__patterns.double_quote:F==="`"?E=this.__patterns.template_text:F==="}"&&(E=this.__patterns.template_expression);for(var W=E.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===F||!S&&p.newline.test(Z)){this._input.back();break}else Z==="\\"&&this._input.hasNext()?(M=this._input.peek(),M==="x"||M==="u"?this.has_char_escapes=!0:M==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Z+=this._input.next()):U&&(U==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),U===Z&&(F==="`"?Z+=this._read_string_recursive("}",S,"`"):Z+=this._read_string_recursive("`",S,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=E.read(),W+=Z}return W},n.exports.Tokenizer=_,n.exports.TOKEN=s,n.exports.positionable_operators=O.slice(),n.exports.line_starters=b.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 d="",p;return g&&(p=this.match(g),p&&(d+=p[0])),m&&(p||!g)&&(d+=this.readUntil(m,c)),d},y.prototype.readUntil=function(g,m){var c="",d=this.__position;g.lastIndex=this.__position;var p=g.exec(this.__input);return p?(d=p.index,m&&(d+=p[0].length)):d=this.__input_length,c=this.__input.substring(this.__position,d),this.__position=d,c},y.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},y.prototype.get_regexp=function(g,m){var c=null,d="g";return m&&D&&(d="y"),typeof g=="string"&&g!==""?c=new RegExp(g,d):g&&(c=new RegExp(g.source,d)),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,d=y(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(h,o){this._input=new g(h),this._options=o||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new d(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var h,o=new m(p.START,""),s=null,R=[],x=new c;o.type!==p.EOF;){for(h=this._get_next_token(o,s);this._is_comment(h);)x.add(h),h=this._get_next_token(o,s);x.isEmpty()||(h.comments_before=x,x=new c),h.parent=s,this._is_opening(h)?(R.push(s),s=h):s&&this._is_closing(h,s)&&(h.opened=s,s.closed=h,s=R.pop(),h.parent=s),h.previous=o,o.next=h,this.__tokens.add(h),o=h}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(h,o){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(p.RAW,s):this._create_token(p.EOF,"")},l.prototype._is_comment=function(h){return!1},l.prototype._is_opening=function(h){return!1},l.prototype._is_closing=function(h,o){return!1},l.prototype._create_token=function(h,o){var s=new m(h,o,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=l,n.exports.TOKEN=p},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,d){g.call(this,c,d),d?this._line_regexp=this._input.get_regexp(d._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,d){c+="\\t ",d+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+d+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+d+"]")},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 d=this.__split(this._newline_regexp,c);this.newline_count=d.length-1,this.whitespace_before_token=d[this.newline_count]}return c},m.prototype.matching=function(c,d){var p=this._create();return p.__set_whitespace_patterns(c,d),p._update(),p},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(c,d){c.lastIndex=0;for(var p=0,l=[],h=c.exec(d);h;)l.push(d.substring(p,h.index)),p=h.index+h[0].length,h=c.exec(d);return p<d.length?l.push(d.substring(p,d.length)):l.push(""),l},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(d,p){g.call(this,d,p),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var l=new g(d);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.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(d){var p=this._create();return p._disabled[d]=!0,p._update(),p},c.prototype.read_options=function(d){var p=this._create();for(var l in m)p._disabled[l]=d.templating.indexOf(l)===-1;return p._update(),p},c.prototype.exclude=function(d){var p=this._create();return p._excluded[d]=!0,p._update(),p},c.prototype.read=function(){var d="";this._match_pattern?d=this._input.read(this._starting_pattern):d=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),d+=p,p=this._read_template();return this._until_after&&(d+=this._input.readUntilAfter(this._until_pattern)),d},c.prototype.__set_templated_pattern=function(){var d=[];this._disabled.php||d.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||d.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||d.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(d.push(this.__patterns.django._starting_pattern.source),d.push(this.__patterns.django_value._starting_pattern.source),d.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||d.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&d.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+d.join("|")+")")},c.prototype._read_template=function(){var d="",p=this._input.peek();if(p==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(d=d||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(d=d||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(d=d||this.__patterns.handlebars_comment.read(),d=d||this.__patterns.handlebars_unescaped.read(),d=d||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(d=d||this.__patterns.django_value.read()),this._excluded.django||(d=d||this.__patterns.django_comment.read(),d=d||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(d=d||this.__patterns.smarty_comment.read(),d=d||this.__patterns.smarty_literal.read(),d=d||this.__patterns.smarty.read()));return d},n.exports.TemplatablePattern=c}],B={};function z(n){var D=B[n];if(D!==void 0)return D.exports;var y=B[n]={exports:{}};return j[n](y,y.exports,z),y.exports}var G=z(0);k=G})();var Y=k;!(ie=[],J=function(){return{js_beautify:Y}}.apply(be,ie),J!==void 0&&(dt.exports=J))})()},"746U":function(dt,be,$){"use strict";$.d(be,"f",function(){return ie}),$.d(be,"l",function(){return J}),$.d(be,"k",function(){return k}),$.d(be,"j",function(){return Y}),$.d(be,"g",function(){return j}),$.d(be,"m",function(){return B}),$.d(be,"h",function(){return z}),$.d(be,"n",function(){return G}),$.d(be,"c",function(){return n}),$.d(be,"a",function(){return D}),$.d(be,"i",function(){return y}),$.d(be,"o",function(){return g}),$.d(be,"e",function(){return d}),$.d(be,"d",function(){return p}),$.d(be,"p",function(){return l}),$.d(be,"b",function(){return h});function ie(o){return Array.isArray(o)}function J(o){return typeof o=="string"}function k(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function Y(o){return typeof o=="number"&&!isNaN(o)}function j(o){return o===!0||o===!1}function B(o){return typeof o=="undefined"}function z(o){return!G(o)}function G(o){return B(o)||o===null}function n(o,s){if(!o)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(o){if(G(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function y(o){return typeof o=="function"}function g(o,s){const R=Math.min(o.length,s.length);for(let x=0;x<R;x++)m(o[x],s[x])}function m(o,s){if(J(s)){if(typeof o!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(y(s)){try{if(o instanceof s)return}catch(R){}if(!G(o)&&o.constructor===s)return;if(s.length===1&&s.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 s=[],R=Object.getPrototypeOf(o);for(;Object.prototype!==R;)s=s.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return s}function d(o){const s=[];for(const R of c(o))typeof o[R]=="function"&&s.push(R);return s}function p(o,s){const R=C=>function(){const L=Array.prototype.slice.call(arguments,0);return s(C,L)};let x={};for(const C of o)x[C]=R(C);return x}function l(o){return o===null?void 0:o}function h(o,s="Unreachable"){throw new Error(s)}},"7Cbv":function(dt,be,$){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function k(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(J)}var Y=/^(?:[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 j(m){return typeof m=="string"&&Y.test(m)}for(var B=j,z=[],G=0;G<256;++G)z.push((G+256).toString(16).substr(1));function n(m){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,d=(z[m[c+0]]+z[m[c+1]]+z[m[c+2]]+z[m[c+3]]+"-"+z[m[c+4]]+z[m[c+5]]+"-"+z[m[c+6]]+z[m[c+7]]+"-"+z[m[c+8]]+z[m[c+9]]+"-"+z[m[c+10]]+z[m[c+11]]+z[m[c+12]]+z[m[c+13]]+z[m[c+14]]+z[m[c+15]]).toLowerCase();if(!B(d))throw TypeError("Stringified UUID is invalid");return d}var D=n;function y(m,c,d){m=m||{};var p=m.random||(m.rng||k)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,c){d=d||0;for(var l=0;l<16;++l)c[d+l]=p[l];return c}return D(p)}var g=be.a=y},"7ahc":function(dt,be,$){"use strict";$.d(be,"a",function(){return R});var ie=$("k1fw"),J=$("0Owb"),k=$("+L6B"),Y=$("2/Rp"),j=$("y8nQ"),B=$("Vl3Y"),z=$("tJVT"),G=$("OaEy"),n=$("2fM7"),D=$("q1tI"),y=$.n(D),g=$("VrN/"),m=$.n(g),c=$("p77/"),d=$.n(c),p=$("c5Ni"),l=$.n(p),h=n.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},s={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};be.b=function(x){var C=x.callback,L=x.onCancel,O=Object(D.useState)("python"),A=Object(z.a)(O,2),w=A[0],b=A[1];function u(a){b(s[a][1])}function v(a){C(a)}return y.a.createElement(B.a,Object(J.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:v}),y.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(n.a,{onChange:u},Object.keys(s).map(function(a){return y.a.createElement(h,{key:a,value:a},s[a][0])}))),y.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(R,{mode:w})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(Y.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function R(x){var C=x.value,L=x.onChange,O=x.mode,A=x.options,w=A===void 0?{}:A,b=Object(D.useRef)(),u=Object(D.useState)(),v=Object(z.a)(u,2),a=v[0],_=v[1];return Object(D.useEffect)(function(){if(a){function N(F){var S=F.getValue();L&&L(S)}return a.on("change",N),function(){a.off("change",N)}}},[a,L]),Object(D.useEffect)(function(){a&&a.setOption("mode",O)},[a,O]),Object(D.useEffect)(function(){a&&((C!==a.getValue()||C==="")&&setTimeout(function(){a.setValue(C||" ")},300))},[a,C]),Object(D.useEffect)(function(){if(b.current&&!a){var N=m.a.fromTextArea(b.current,Object(ie.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},w));_(N)}},[b.current,a]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:b}))}},"7qnI":function(dt,be,$){"use strict";var ie=$("5Dmo"),J=$("3S7+"),k=$("fWQN"),Y=$("mtLc"),j=$("yKVA"),B=$("879j"),z=$("5NDa"),G=$("5rEg"),n=$("q1tI"),D=$.n(n),y=$("O2Wb"),g=$.n(y),m=G.a.TextArea,c=function(d){Object(j.a)(l,d);var p=Object(B.a)(l);function l(){return Object(k.a)(this,l),p.apply(this,arguments)}return Object(Y.a)(l,[{key:"render",value:function(){var o=this,s=this.props,R=s.index,x=s.onAnswerChange,C=s.addChildAnswer,L=s.exerciseIsPublish,O=s.answers,A=s.activeOptionErrorIndex,w=s.flex,b=w===void 0?"0 0 1000px":w;return D.a.createElement("div",{className:g.a.flex},D.a.createElement("div",{className:"".concat(g.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",R+1,"):"),D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),style:{flexDirection:"column"}},O.map(function(u,v){var a="".concat(R,"-").concat(v);return D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),key:v},D.a.createElement("div",{className:g.a.flex1,style:{flex:b}},D.a.createElement("div",null,D.a.createElement(m,{className:a===A?g.a.error:"",spellCheck:!1,rows:4,value:u||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(v==0?"":"(\u53EF\u9009)"),onChange:function(N){return x(R,v,N.target.value)},style:{minHeight:95}}))),!L&&D.a.createElement(D.a.Fragment,null,v!=0&&D.a.createElement(J.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return o.props.deleteChildAnswer(R,v)},style:{float:"right"}})),v===0&&D.a.createElement(J.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return o.props.deleteChildAnswermain(R,v)},style:{float:"right"}})),D.a.createElement(J.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(g.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return C(R)},style:{float:"right",visibility:v==O.length-1?"":"hidden"}}))))})))}}]),l}(n.Component);be.a=c},"8EBN":function(dt,be,$){(function(ie){ie($("VrN/"))})(function(ie){"use strict";ie.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 J=0;J<ie.modeInfo.length;J++){var k=ie.modeInfo[J];k.mimes&&(k.mime=k.mimes[0])}ie.findModeByMIME=function(Y){Y=Y.toLowerCase();for(var j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.mime==Y)return B;if(B.mimes){for(var z=0;z<B.mimes.length;z++)if(B.mimes[z]==Y)return B}}if(/\+xml$/.test(Y))return ie.findModeByMIME("application/xml");if(/\+json$/.test(Y))return ie.findModeByMIME("application/json")},ie.findModeByExtension=function(Y){Y=Y.toLowerCase();for(var j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.ext){for(var z=0;z<B.ext.length;z++)if(B.ext[z]==Y)return B}}},ie.findModeByFileName=function(Y){for(var j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.file&&B.file.test(Y))return B}var z=Y.lastIndexOf("."),G=z>-1&&Y.substring(z+1,Y.length);if(G)return ie.findModeByExtension(G)},ie.findModeByName=function(Y){Y=Y.toLowerCase();for(var j=0;j<ie.modeInfo.length;j++){var B=ie.modeInfo[j];if(B.name.toLowerCase()==Y)return B;if(B.alias){for(var z=0;z<B.alias.length;z++)if(B.alias[z].toLowerCase()==Y)return B}}}})},"8HAY":function(dt,be,$){"use strict";$.d(be,"a",function(){return j}),$.d(be,"b",function(){return B}),$.d(be,"d",function(){return z}),$.d(be,"e",function(){return G}),$.d(be,"c",function(){return n});var ie=$("MI8n"),J=$("pmY6"),k=$("3/fG"),Y=function(D,y,g,m){function c(d){return d instanceof g?d:new g(function(p){p(d)})}return new(g||(g=Promise))(function(d,p){function l(s){try{o(m.next(s))}catch(R){p(R)}}function h(s){try{o(m.throw(s))}catch(R){p(R)}}function o(s){s.done?d(s.value):c(s.value).then(l,h)}o((m=m.apply(D,y||[])).next())})};class j extends J.a{constructor(D,y="",g="",m=!0,c){super();this._onDidChange=this._register(new ie.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 Y(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class B extends J.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ie.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ie.b),this.onDidRun=this._onDidRun.event}run(D,y){return Y(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 Y(this,void 0,void 0,function*(){yield D.run(y)})}}class z extends j{constructor(D){super(z.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}z.ID="vs.actions.separator";class G{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 Y(this,void 0,void 0,function*(){})}}class n extends j{constructor(){super(n.ID,k.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(dt,be,$){dt.exports={button:"button___1wy9m"}},"9Bee":function(dt,be,$){"use strict";var ie=$("DYRE"),J=$("zeV3"),k=$("+L6B"),Y=$("2/Rp"),j=$("k1fw"),B=$("9og8"),z=$("tJVT"),G=$("WmNS"),n=$.n(G),D=$("q1tI"),y=$.n(D),g=$("vg9a"),m=$("DlQD"),c=$.n(m),d=$("rUJ1");function p(X,T){var I=X.match(/^(\s+)(?:```)/);if(I===null)return T;var H=I[1];return T.split(`
|
|
`).map(function(q){var K=q.match(/^\s+/);if(K===null)return q;var he=Object(z.a)(K,1),ke=he[0];return ke.length>=H.length?q.slice(H.length):q}).join(`
|
|
`)}var l=[],h=["<ul>"],o=new c.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){l.length=0,h=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(X,T,I,H){if(T>=X.length||X[T].level<=I)return T;var q=X[T];H.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),T++;var K=[];return T=C(X,T,q.level,K),K.length>0&&(H.push("<ul>"),K.forEach(function(he){H.push(he)}),H.push("</ul>")),H.push("</li>"),T=C(X,T,I,H),T}function L(){return C(l,0,0,h),h.push("</ul>"),h.join("")}var O={heading:function(T){var I=s.exec(T);if(I)return{type:"heading",raw:I[0],depth:I[1].length,text:I[2]}},fences:function(T){var I=this.rules.block.fences.exec(T);if(I){var H=I[0],q=p(H,I[3]||""),K=I[2]?I[2].trim():I[2];if(["latex","katex","math"].indexOf(K)>=0){var he=b(),ke=q;q=he,u[he]={type:"block",expression:ke}}return{type:"code",raw:H,lang:K,text:q}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,b=function(){return"__special_katext_id_".concat(w++,"__")},u={};function v(){return u}function a(){w=0,u={}}function _(X){return X=X.replace(A,function(T,I){var H=b();return u[H]={type:"inline",expression:I},H}),X}var N=o.listitem;o.listitem=function(X){return N(_(X))};var F=o.paragraph;o.paragraph=function(X){return F(_(X))};var S=o.tablecell;o.tablecell=function(X,T){return S(_(X),T)},o.code=function(X,T,I){var H=(T||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(T,'">').concat(I?X:Object(d.escape)(X,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(I?X:Object(d.escape)(X,!0))+"</code></pre>"},o.heading=function(X,T,I){var H=this.options.headerPrefix+I.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:H,level:T,text:X}),"<h"+T+' id="'+H+'">'+X+"</h"+T+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:o});var U=c.a,M=$("SJMd"),E=$("ulZh"),W=$.n(E),Z=$("m3rI"),ne=$("Oy/b"),ae=$("p5ED"),we=$("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 fe=function(X,T){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(X,T)};function _e(X,T){function I(){this.constructor=X}fe(X,T),X.prototype=T===null?Object.create(T):(I.prototype=T.prototype,new I)}function Se(X,T,I,H){return new(I||(I=Promise))(function(q,K){function he(ct){try{je(H.next(ct))}catch(De){K(De)}}function ke(ct){try{je(H.throw(ct))}catch(De){K(De)}}function je(ct){var De;ct.done?q(ct.value):(De=ct.value,De instanceof I?De:new I(function(et){et(De)})).then(he,ke)}je((H=H.apply(X,T||[])).next())})}function ve(X,T){var I,H,q,K,he={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return K={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(K[Symbol.iterator]=function(){return this}),K;function ke(je){return function(ct){return function(De){if(I)throw new TypeError("Generator is already executing.");for(;he;)try{if(I=1,H&&(q=2&De[0]?H.return:De[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,De[1])).done)return q;switch(H=0,q&&(De=[2&De[0],q.value]),De[0]){case 0:case 1:q=De;break;case 4:return he.label++,{value:De[1],done:!1};case 5:he.label++,H=De[1],De=[0];continue;case 7:De=he.ops.pop(),he.trys.pop();continue;default:if(!(q=he.trys,(q=q.length>0&&q[q.length-1])||De[0]!==6&&De[0]!==2)){he=0;continue}if(De[0]===3&&(!q||De[1]>q[0]&&De[1]<q[3])){he.label=De[1];break}if(De[0]===6&&he.label<q[1]){he.label=q[1],q=De;break}if(q&&he.label<q[2]){he.label=q[2],he.ops.push(De);break}q[2]&&he.ops.pop(),he.trys.pop();continue}De=T.call(X,he)}catch(et){De=[6,et],H=0}finally{I=q=0}if(5&De[0])throw De[1];return{value:De[0]?De[1]:void 0,done:!0}}([je,ct])}}}function ue(){for(var X=0,T=0,I=arguments.length;T<I;T++)X+=arguments[T].length;var H=Array(X),q=0;for(T=0;T<I;T++)for(var K=arguments[T],he=0,ke=K.length;he<ke;he++,q++)H[q]=K[he];return H}var le=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(T,I){for(var H=0,q=I;H<q.length;H++){var K=q[H],he=K[0],ke=K[1];T.setAttribute(he,ke)}},X.createRect=function(T,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",T.toString()),q.setAttribute("height",I.toString()),H&&X.setAttributes(q,H),q},X.createLine=function(T,I,H,q,K){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",T.toString()),he.setAttribute("y1",I.toString()),he.setAttribute("x2",H.toString()),he.setAttribute("y2",q.toString()),K&&X.setAttributes(he,K),he},X.createPolygon=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",T),I&&X.setAttributes(H,I),H},X.createCircle=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(T/2).toString()),H.setAttribute("cy",(T/2).toString()),H.setAttribute("r",T.toString()),I&&X.setAttributes(H,I),H},X.createEllipse=function(T,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(T/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(T/2).toString()),q.setAttribute("ry",(I/2).toString()),H&&X.setAttributes(q,H),q},X.createGroup=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&X.setAttributes(I,T),I},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(T,I,H,q,K,he,ke){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(je,[["id",T],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",K.toString()],["refY",he.toString()]]),je.appendChild(ke),je},X.createText=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),T&&X.setAttributes(I,T),I},X.createTSpan=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=T,I&&X.setAttributes(H,I),H},X.createImage=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&X.setAttributes(I,T),I},X.createPoint=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=T,H.y=I,H},X.createPath=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",T),I&&X.setAttributes(H,I),H},X}(),Oe=function(){function X(){}return X.addKey=function(T){X.key=T},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Ye=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(T,I,H){var q=this;return new Promise(function(K){var he=H!==void 0?H:document.createElement("canvas");T===null&&(q.markersOnly=!0,q.naturalSize=!1);var ke=document.createElementNS("http://www.w3.org/2000/svg","svg");ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),ke.setAttribute("width",I.width.baseVal.valueAsString),ke.setAttribute("height",I.height.baseVal.valueAsString),ke.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),ke.innerHTML=I.innerHTML,q.naturalSize===!0?(ke.width.baseVal.value=T.naturalWidth,ke.height.baseVal.value=T.naturalHeight):q.width!==void 0&&q.height!==void 0&&(ke.width.baseVal.value=q.width,ke.height.baseVal.value=q.height),he.width=ke.width.baseVal.value,he.height=ke.height.baseVal.value;var je=ke.outerHTML,ct=he.getContext("2d");q.markersOnly!==!0&&ct.drawImage(T,0,0,he.width,he.height);var De=window.URL,et=new Image(he.width,he.height);et.setAttribute("crossOrigin","anonymous");var Xe=new Blob([je],{type:"image/svg+xml"}),Ct=De.createObjectURL(Xe);et.onload=function(){ct.drawImage(et,0,0),De.revokeObjectURL(Ct);var wt=he.toDataURL(q.imageType,q.imageQuality);K(wt)},et.src=Ct})},X}(),Ve=function(){},$e=function(){function X(T){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.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(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},X.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new Ze("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ze("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ze("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Fe("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Fe("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),Ze=function(X,T){this.selector=X,this.style=T},Fe=function(X,T){this.localName=X,this.style=T},We=function(){function X(T,I,H,q,K){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=I,this.markerItems=H,this.uiStyleSettings=q,this.styles=K,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(T){var I=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var H=document.createElement("div");H.className=this.toolbarBlockStyleClass.name,H.style.whiteSpace="nowrap",this.uiContainer.appendChild(H),this.addActionButton(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(K){var he=document.createElement("div");he.className=""+I.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",K.typeName),he.innerHTML=K.icon,he.addEventListener("click",function(){I.markerToolbarButtonClicked(he,K)}),I.buttons.push(he),I.markerButtons.push(he)}),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 q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<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(q,'<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()},X.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},X.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var I=0;I<this.markerButtons.length;I++)I<T||I===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[I]):(I===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[I]))}},X.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")},X.prototype.resetButtonStyles=function(){var T=this;this.buttons.forEach(function(I){I.className=I.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),I.className=I.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),I.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(T,I,H){var q=this,K=document.createElement("div");switch(K.className=""+this.toolbarButtonStyleClass.name,K.innerHTML=I,K.setAttribute("data-action",H),K.addEventListener("click",function(){q.actionToolbarButtonClicked(K,H)}),H){case"select":K.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":K.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":K.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":K.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":K.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(K),this.buttons.push(K)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Fe("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 Fe("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Fe("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Fe("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 Fe("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Fe("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Fe("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Fe("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ze("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ze("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},X.prototype.markerToolbarButtonClicked=function(T,I){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(T,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(T){var I=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===T});I&&this.setActiveButton(I)},X.prototype.setCurrentMarker=function(T){var I=this;this.currentMarker=T,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){I.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},X}(),qe=function(){function X(T,I,H,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=I,this.uiStyleSettings=H,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new Fe("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 Fe("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Fe("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Fe("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Fe("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 Fe("toolbox-panel-row_colors",`
|
|
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Fe("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
padding: `+I+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Fe("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Fe("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},X.prototype.show=function(T){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(T){var I,H,q=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(K){var he;K.uiStyleSettings=q.uiStyleSettings;var ke=document.createElement("div");ke.className=q.toolboxButtonStyleClass.name+" "+((he=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:q.toolboxButtonStyleColorsClass.name),ke.innerHTML=K.icon,ke.title=K.title,ke.addEventListener("click",function(){q.panelButtonClick(K)}),q.panelButtons.push(ke),q.buttonRow.appendChild(ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(T){var I=this,H=-1;if(T!==this.activePanel){H=this.panels.indexOf(T),this.panelRow.innerHTML="";var q=T.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),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=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){I.displayMode==="inline"?I.panelRow.style.display="none":I.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(K,he){var ke,je;K.className=I.toolboxButtonStyleClass.name+" "+(he===H?""+((ke=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ke!==void 0?ke:I.toolboxActiveButtonStyleColorsClass.name):""+((je=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:I.toolboxButtonStyleColorsClass.name))})},X}(),oe=function(X,T){this.title=X,this.icon=T},Ee=function(X){function T(I,H,q,K){var he=X.call(this,I,K||'<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 he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=H,he.currentColor=q,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return _e(T,X),T.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(q){var K=I.getColorBox(q);H.appendChild(K),I.colorBoxes.push(K)}),H},T.prototype.getColorBox=function(I){var H=this,q=this.uiStyleSettings.toolbarHeight/4,K=this.uiStyleSettings.toolbarHeight-q,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=K-2+"px",he.style.height=K-2+"px",he.style.padding="1px",he.style.marginRight="2px",he.style.marginBottom="2px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderRadius=(K+2)/2+"px",he.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){H.setCurrentColor(I,he)});var ke=document.createElement("div");return ke.style.display="inline-block",ke.style.width=K-2+"px",ke.style.height=K-2+"px",ke.style.backgroundColor=I,ke.style.borderRadius=K/2+"px",I==="transparent"&&(ke.style.fill=this.uiStyleSettings.toolboxAccentColor,ke.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>`),he.appendChild(ke),he},T.prototype.setCurrentColor=function(I,H){var q=this;this.currentColor=I,this.colorBoxes.forEach(function(K){K.style.borderColor=K===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},T}(oe),Ce=function(){function X(T,I,H){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=I,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(T){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(T,I){},X.prototype.dblClick=function(T,I){},X.prototype.manipulate=function(T){},X.prototype.pointerUp=function(T){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},X.prototype.scale=function(T,I){},X.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},X.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Ae=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},X}(),ze=function(){function X(){this.GRIP_SIZE=10,this.visual=le.createGroup(),this.visual.appendChild(le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(le.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},X}(),Je=function(){function X(){}return X.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},X.toSVGMatrix=function(T,I){return T.a=I.a,T.b=I.b,T.c=I.c,T.d=I.d,T.e=I.e,T.f=I.f,T},X}(),tt=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.left=0,K.top=0,K.width=0,K.height=0,K.defaultSize={x:50,y:20},K.offsetX=0,K.offsetY=0,K.rotationAngle=0,K.CB_DISTANCE=10,K._suppressMarkerCreateEvent=!1,K.container.transform.baseVal.appendItem(le.createTransform()),K.setupControlBox(),K}return _e(T,X),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var H=le.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(I){return!!X.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.left=I.x,this.top=I.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(I);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var K=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=K.x-this.width/2,this.top=K.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var he=this.container.transform.baseVal.getItem(0);he.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(he,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(I){var H=this.state;X.prototype.pointerUp.call(this,I),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},T.prototype.manipulate=function(I){var H=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(I)},T.prototype.resize=function(I){var H=this.manipulationStartLeft,q=this.manipulationStartWidth,K=this.manipulationStartTop,he=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+I.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+I.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:K=this.manipulationStartTop+I.y-this.manipulationStartY,he=this.manipulationStartHeight+this.manipulationStartTop-K;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+I.y-this.manipulationStartY}q>=0?(this.left=H,this.width=q):(this.left=H+q,this.width=-q),he>=0?(this.top=K,this.height=he):(this.top=K+he,this.height=-he),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var H=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},T.prototype.applyRotation=function(){var I=this.container.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(I,0)},T.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM(),q=le.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},T.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM();H=H.inverse();var q=le.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},T.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=le.createGroup();var I=le.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=le.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=le.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 Ae,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var I=this.controlBox.transform.baseVal.getItem(0);I.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(I,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()},T.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()},T.prototype.createGrip=function(){var I=new ze;return I.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(I.visual),I},T.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,H=-I/2,q=H,K=(this.width+this.CB_DISTANCE)/2-I/2,he=(this.height+this.CB_DISTANCE)/2-I/2,ke=this.height+this.CB_DISTANCE-I/2,je=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,H,q),this.positionGrip(this.controlGrips.topCenter.visual,K,q),this.positionGrip(this.controlGrips.topRight.visual,je,q),this.positionGrip(this.controlGrips.centerLeft.visual,H,he),this.positionGrip(this.controlGrips.centerRight.visual,je,he),this.positionGrip(this.controlGrips.bottomLeft.visual,H,ke),this.positionGrip(this.controlGrips.bottomCenter.visual,K,ke),this.positionGrip(this.controlGrips.bottomRight.visual,je,ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,K,q-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(I,H,q){var K=I.transform.baseVal.getItem(0);K.setTranslate(H,q),I.transform.baseVal.replaceItem(K,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},T.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var H=I;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},T.prototype.scale=function(I,H){X.prototype.scale.call(this,I,H);var q=this.rotatePoint({x:this.left,y:this.top}),K=this.unrotatePoint({x:q.x*I,y:q.y*H});this.left=K.x,this.top=K.y,this.width=this.width*I,this.height=this.height*H,this.adjustControlBox()},T}(Ce),nt=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.fillColor="transparent",K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.opacity=1,K.setStrokeColor=K.setStrokeColor.bind(K),K.setFillColor=K.setFillColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.createVisual=K.createVisual.bind(K),K}return _e(T,X),T.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual)},T.prototype.createVisual=function(){this.visual=le.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)},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},T.prototype.manipulate=function(I){X.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){X.prototype.resize.call(this,I),this.setSize()},T.prototype.setSize=function(){X.prototype.setSize.call(this),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(I){X.prototype.pointerUp.call(this,I),this.setSize()},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},T.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},T.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),X.prototype.restoreState.call(this,I),this.setSize()},T.prototype.scale=function(I,H){X.prototype.scale.call(this,I,H),this.setSize()},T.title="Rectangle marker",T}(tt),ht=function(X){function T(I,H,q,K){var he=X.call(this,I,K||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return he.widths=[],he.widthBoxes=[],he.widths=H,he.currentWidth=q,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return _e(T,X),T.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(q){var K=document.createElement("div");K.style.display="flex",K.style.flexGrow="2",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderColor=q===I.currentWidth?I.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){I.setCurrentWidth(q,K)}),H.appendChild(K);var he=document.createElement("div");he.innerText=q.toString(),he.style.marginRight="5px",K.appendChild(he);var ke=document.createElement("div");ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.display="flex",ke.style.alignItems="center";var je=document.createElement("hr");je.style.minWidth="20px",je.style.border="0px",je.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,je.style.flexGrow="2",ke.appendChild(je),K.appendChild(ke),I.widthBoxes.push(K)}),H},T.prototype.setCurrentWidth=function(I,H){var q=this;this.currentWidth=I,this.widthBoxes.forEach(function(K){K.style.borderColor=K===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(oe),it=function(X){function T(I,H,q,K){var he=X.call(this,I,K||'<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 he.styles=[],he.styleBoxes=[],he.styles=H,he.currentStyle=q,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return _e(T,X),T.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(q){var K=document.createElement("div");K.style.display="flex",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.overflow="hidden",K.style.maxWidth=100/I.styles.length-5+"%",K.style.borderColor=q===I.currentStyle?I.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){I.setCurrentStyle(q,K)}),H.appendChild(K);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var ke=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+I.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
|
|
</svg>`;he.innerHTML=ke,K.appendChild(he),I.styleBoxes.push(K)}),H},T.prototype.setCurrentStyle=function(I,H){var q=this;this.currentStyle=I,this.styleBoxes.forEach(function(K){K.style.borderColor=K===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(oe),lt=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.strokeColor=q.defaultColor,K.strokeWidth=q.defaultStrokeWidth,K.strokeDasharray=q.defaultStrokeDasharray,K.strokePanel=new Ee("Line color",q.defaultColorSet,q.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new ht("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return _e(T,X),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="FrameMarker",T.title="Frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',T}(nt),Me=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},Tt=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.x1=0,K.y1=0,K.x2=0,K.y2=0,K.defaultLength=50,K.manipulationStartX=0,K.manipulationStartY=0,K.manipulationStartX1=0,K.manipulationStartY1=0,K.manipulationStartX2=0,K.manipulationStartY2=0,K.setupControlBox(),K}return _e(T,X),T.prototype.ownsTarget=function(I){return!!X.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.manipulationStartX=I.x,this.manipulationStartY=I.y,this.state==="new"&&(this.x1=I.x,this.y1=I.y,this.x2=I.x,this.y2=I.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(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(I){var H=this.state;X.prototype.pointerUp.call(this,I),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(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(I){this.state==="creating"?this.resize(I):this.state==="move"?(this.x1=this.manipulationStartX1+I.x-this.manipulationStartX,this.y1=this.manipulationStartY1+I.y-this.manipulationStartY,this.x2=this.manipulationStartX2+I.x-this.manipulationStartX,this.y2=this.manipulationStartY2+I.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(I)},T.prototype.resize=function(I){switch(this.activeGrip){case this.grip1:this.x1=I.x,this.y1=I.y;break;case this.grip2:case void 0:this.x2=I.x,this.y2=I.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=le.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){this.positionGrips()},T.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},T.prototype.createGrip=function(){var I=new ze;return I.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(I.visual),I},T.prototype.positionGrips=function(){var I=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-I/2,this.y1-I/2),this.positionGrip(this.grip2.visual,this.x2-I/2,this.y2-I/2)},T.prototype.positionGrip=function(I,H,q){var K=I.transform.baseVal.getItem(0);K.setTranslate(H,q),I.transform.baseVal.replaceItem(K,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},T.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var H=I;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},T.prototype.scale=function(I,H){X.prototype.scale.call(this,I,H),this.x1=this.x1*I,this.y1=this.y1*H,this.x2=this.x2*I,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},T}(Ce),mt=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.setStrokeColor=K.setStrokeColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.strokeColor=q.defaultColor,K.strokeWidth=q.defaultStrokeWidth,K.strokeDasharray=q.defaultStrokeDasharray,K.strokePanel=new Ee("Line color",q.defaultColorSet,q.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new ht("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return _e(T,X),T.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorLine=le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=le.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)},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.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()),le.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',T}(Tt),Ne=function(X){function T(I,H,q,K){var he=X.call(this,I,K||'<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 he.fonts=[],he.fontBoxes=[],he.fonts=H,he.currentFont=q,he.setCurrentFont=he.setCurrentFont.bind(he),he}return _e(T,X),T.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(q){var K=document.createElement("div");K.style.display="inline-block",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.overflow="hidden",K.style.maxWidth=100/I.fonts.length-5+"%",K.style.borderColor=q===I.currentFont?I.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){I.setCurrentFont(q,K)}),H.appendChild(K);var he=document.createElement("div");he.style.display="flex",he.style.minHeight="20px",he.style.flexGrow="2",he.style.fontFamily=q,he.style.overflow="hidden";var ke=document.createElement("div");ke.style.whiteSpace="nowrap",ke.style.overflow="hidden",ke.style.textOverflow="ellipsis",ke.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(ke),K.appendChild(he),I.fontBoxes.push(K)}),H},T.prototype.setCurrentFont=function(I,H){var q=this;this.currentFont=I,this.fontBoxes.forEach(function(K){K.style.borderColor=K===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(oe),He=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.color="transparent",K.padding=5,K.DEFAULT_TEXT="your text here",K.text=K.DEFAULT_TEXT,K.isMoved=!1,K.color=q.defaultColor,K.fontFamily=q.defaultFontFamily,K.defaultSize={x:100,y:30},K.setColor=K.setColor.bind(K),K.setFont=K.setFont.bind(K),K.renderText=K.renderText.bind(K),K.sizeText=K.sizeText.bind(K),K.textEditDivClicked=K.textEditDivClicked.bind(K),K.showTextEditor=K.showTextEditor.bind(K),K.setSize=K.setSize.bind(K),K.positionTextEditor=K.positionTextEditor.bind(K),K.colorPanel=new Ee("Color",q.defaultColorSet,q.defaultColor),K.colorPanel.onColorChanged=K.setColor,K.fontFamilyPanel=new Ne("Font",q.defaultFontFamilies,q.defaultFontFamily),K.fontFamilyPanel.onFontChanged=K.setFont,K}return _e(T,X),T.prototype.ownsTarget=function(I){if(X.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(q){q===I&&(H=!0)}),H},T.prototype.createVisual=function(){this.visual=le.createGroup(),this.bgRectangle=le.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=le.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},T.prototype.renderText=function(){var I=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(H){I.textElement.appendChild(le.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var I=this.textElement.getBBox(),H=1;if(I.width>0&&I.height>0){var q=(1*this.width-this.width*this.padding*2/100)/I.width,K=(1*this.height-this.height*this.padding*2/100)/I.height;H=Math.min(q,K)}return H},T.prototype.getTextPosition=function(I){var H=this.textElement.getBBox(),q=0,K=0;return H.width>0&&H.height>0&&(q=(this.width-H.width*I)/2,K=this.height/2-H.height*I/2),{x:q,y:K}},T.prototype.sizeText=function(){var I=this.textElement.getBBox(),H=this.getTextScale(),q=this.getTextPosition(H);q.y-=I.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},T.prototype.manipulate=function(I){X.prototype.manipulate.call(this,I),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(I.x-this.pointerDownPoint.x)>5||Math.abs(I.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(I){X.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(I){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,I),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var I=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(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&H>.9;)H-=.1,I.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var q=H.clipboardData.getData("text"),K=window.getSelection();if(!K.rangeCount)return!1;K.deleteFromDocument(),K.getRangeAt(0).insertNode(document.createTextNode(q)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){I.textEditDivClicked(I.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),K={x:q.width*I,y:q.height*I};H.x-=K.x/2,H.y-=K.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(I){this.text=I.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},T.prototype.dblClick=function(I,H){X.prototype.dblClick.call(this,I,H),this.showTextEditor()},T.prototype.setColor=function(I){this.textElement&&le.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},T.prototype.setFont=function(I){this.textElement&&le.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},T.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},T.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){var H=I;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),X.prototype.restoreState.call(this,I),this.setSize()},T.prototype.scale=function(I,H){X.prototype.scale.call(this,I,H),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.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>',T}(tt),Te=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.color="transparent",K.lineWidth=3,K.drawing=!1,K.pixelRatio=1,K.color=q.defaultColor,K.lineWidth=q.defaultStrokeWidth,K.pixelRatio=q.freehandPixelRatio,K.setColor=K.setColor.bind(K),K.addCanvas=K.addCanvas.bind(K),K.finishCreation=K.finishCreation.bind(K),K.setLineWidth=K.setLineWidth.bind(K),K.colorPanel=new Ee("Color",q.defaultColorSet,q.defaultColor),K.colorPanel.onColorChanged=K.setColor,K.lineWidthPanel=new ht("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),K.lineWidthPanel.onWidthChanged=K.setLineWidth,K}return _e(T,X),T.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=le.createGroup(),this.drawingImage=le.createImage(),this.visual.appendChild(this.drawingImage);var I=le.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(I,H){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(I.x,I.y),this.drawing=!0):X.prototype.pointerDown.call(this,I,H)},T.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){X.prototype.resize.call(this,I),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,I)},T.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)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=H[0],K=H[1],he=H[2],ke=H[3],je=!1,ct=0;ct<this.canvasElement.height;ct++)for(var De=0;De<this.canvasElement.width;De++)I.data[ct*this.canvasElement.width*4+4*De+3]>0&&(je=!0,ct<K&&(K=ct),De<q&&(q=De),ct>ke&&(ke=ct),De>he&&(he=De));if(je){this.left=q/this.pixelRatio,this.top=K/this.pixelRatio,this.width=(he-q)/this.pixelRatio,this.height=(ke-K)/this.pixelRatio;var et=document.createElement("canvas");et.width=he-q,et.height=ke-K,et.getContext("2d").putImageData(this.canvasContext.getImageData(q,K,he-q,ke-K),0,0),this.drawingImgUrl=et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},T.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){this.createVisual(),X.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(I,H){X.prototype.scale.call(this,I,H),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.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>',T}(tt),me=function(X){function T(I,H,q){var K=X.call(this,I,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return K.typeBoxes=[],K.currentType=H,K.setCurrentType=K.setCurrentType.bind(K),K}return _e(T,X),T.prototype.getUi=function(){var I=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var q=function(ke){var je="both";switch(ke){case 0:je="both";break;case 1:je="start";break;case 2:je="end";break;case 3:je="none"}var ct=document.createElement("div");if(ct.style.display="flex",ct.style.flexGrow="2",ct.style.alignItems="center",ct.style.justifyContent="space-between",ct.style.padding="5px",ct.style.borderWidth="2px",ct.style.borderStyle="solid",ct.style.borderColor=je===K.currentType?K.uiStyleSettings.toolboxAccentColor:"transparent",ct.addEventListener("click",function(){I.setCurrentType(je,ct)}),H.appendChild(ct),je==="both"||je==="start"){var De=document.createElement("div");De.style.display="flex",De.style.alignItems="center",De.style.minHeight="20px",De.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="`+(K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,De.style.marginLeft="5px",ct.appendChild(De)}var et=document.createElement("div");et.style.display="flex",et.style.alignItems="center",et.style.minHeight="20px",et.style.flexGrow="2";var Xe=document.createElement("hr");if(Xe.style.minWidth="20px",Xe.style.border="0px",Xe.style.borderTop="3px solid "+(K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxColor:"#eeeeee"),Xe.style.flexGrow="2",et.appendChild(Xe),ct.appendChild(et),je==="both"||je==="end"){var Ct=document.createElement("div");Ct.style.display="flex",Ct.style.alignItems="center",Ct.style.minHeight="20px",Ct.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="`+(K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ct.style.marginRight="5px",ct.appendChild(Ct)}K.typeBoxes.push(ct)},K=this,he=0;he<4;he++)q(he);return H},T.prototype.setCurrentType=function(I,H){var q=this;this.currentType=I,this.typeBoxes.forEach(function(K){K.style.borderColor=K===H?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(oe),ge=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.arrowType="end",K.arrowBaseHeight=10,K.arrowBaseWidth=10,K.getArrowPoints=K.getArrowPoints.bind(K),K.setArrowType=K.setArrowType.bind(K),K.arrowTypePanel=new me("Arrow type","end"),K.arrowTypePanel.onArrowTypeChanged=K.setArrowType,K}return _e(T,X),T.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},T.prototype.getArrowPoints=function(I,H){var q=this.arrowBaseWidth+2*this.strokeWidth,K=this.arrowBaseHeight+2*this.strokeWidth;return I-q/2+","+(H+K/2)+" "+I+","+(H-K/2)+" "+(I+q/2)+","+(H+K/2)},T.prototype.createTips=function(){this.arrow1=le.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=le.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(X.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",le.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),le.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},T.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var H=I;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',T}(mt),re=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.fillColor=q.defaultFillColor,K.strokeWidth=0,K.fillPanel=new Ee("Color",q.defaultColorSet,q.defaultFillColor),K.fillPanel.onColorChanged=K.setFillColor,K}return _e(T,X),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(nt),se=function(X){function T(I,H,q,K){var he=X.call(this,I,K||'<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 he.opacities=[],he.opacityBoxes=[],he.opacities=H,he.currentOpacity=q,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return _e(T,X),T.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(q){var K=document.createElement("div");K.style.display="flex",K.style.alignItems="center",K.style.justifyContent="center",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderColor=q===I.currentOpacity?I.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){I.setCurrentOpacity(q,K)}),H.appendChild(K);var he=document.createElement("div");he.innerText=100*q+"%",K.appendChild(he),I.opacityBoxes.push(K)}),H},T.prototype.setCurrentOpacity=function(I,H){var q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(K){K.style.borderColor=K===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(oe),ce=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.setOpacity=K.setOpacity.bind(K),K.fillColor=q.defaultHighlightColor,K.strokeWidth=0,K.opacity=q.defaultHighlightOpacity,K.fillPanel=new Ee("Color",q.defaultColorSet,K.fillColor),K.fillPanel.onColorChanged=K.setFillColor,K.opacityPanel=new se("Opacity",q.defaultOpacitySteps,K.opacity),K.opacityPanel.onOpacityChanged=K.setOpacity,K}return _e(T,X),T.prototype.setOpacity=function(I){this.opacity=I,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="HighlightMarker",T.title="Highlight marker",T.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>',T}(re),pe='<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>',xe=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.bgColor="transparent",K.tipPosition={x:0,y:0},K.tipBase1Position={x:0,y:0},K.tipBase2Position={x:0,y:0},K.tipMoving=!1,K.color=q.defaultStrokeColor,K.bgColor=q.defaultFillColor,K.fontFamily=q.defaultFontFamily,K.defaultSize={x:100,y:30},K.setBgColor=K.setBgColor.bind(K),K.getTipPoints=K.getTipPoints.bind(K),K.positionTip=K.positionTip.bind(K),K.setTipPoints=K.setTipPoints.bind(K),K.colorPanel=new Ee("Text color",q.defaultColorSet,K.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>'),K.colorPanel.onColorChanged=K.setColor,K.bgColorPanel=new Ee("Fill color",q.defaultColorSet,K.bgColor,pe),K.bgColorPanel.onColorChanged=K.setBgColor,K.fontFamilyPanel=new Ne("Font",q.defaultFontFamilies,q.defaultFontFamily),K.fontFamilyPanel.onFontChanged=K.setFont,K.tipGrip=new ze,K.tipGrip.visual.transform.baseVal.appendItem(le.createTransform()),K.controlBox.appendChild(K.tipGrip.visual),K}return _e(T,X),T.prototype.ownsTarget=function(I){return X.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},T.prototype.createTip=function(){le.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=le.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(I,H){this.state==="new"&&X.prototype.pointerDown.call(this,I,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,I,H)},T.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,I);else{var H=this.state==="creating";X.prototype.pointerUp.call(this,I),this.setTipPoints(H),this.positionTip()}},T.prototype.manipulate=function(I){if(this.tipMoving){var H=this.unrotatePoint(I);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,I)},T.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(le.setAttributes(this.bgRectangle,[["fill",I]]),le.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},T.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},T.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var H=Math.min(this.height/2,15),q=this.height/5;I&&(this.tipPosition={x:H+q/2,y:this.height+20});var K=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?K<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:0},this.tipBase2Position={x:H+q,y:0}):(this.tipBase1Position={x:0,y:H},this.tipBase2Position={x:0,y:H+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?K<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:0},this.tipBase2Position={x:this.width-H,y:0}):(this.tipBase1Position={x:this.width,y:H},this.tipBase2Position={x:this.width,y:H+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?K<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:this.height},this.tipBase2Position={x:this.width-H,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-H-q},this.tipBase2Position={x:this.width,y:this.height-H}):K<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:this.height},this.tipBase2Position={x:H+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-H},this.tipBase2Position={x:0,y:this.height-H-q})},T.prototype.resize=function(I){X.prototype.resize.call(this,I),this.positionTip()},T.prototype.positionTip=function(){le.setAttributes(this.tip,[["points",this.getTipPoints()]]);var I=this.tipGrip.visual.transform.baseVal.getItem(0);I.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(I,0)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},T.prototype.getState=function(){var I=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){var H=I;this.bgColor=H.bgColor,this.tipPosition=H.tipPosition,X.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},T.prototype.scale=function(I,H){X.prototype.scale.call(this,I,H),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*H},this.positionTip()},T.typeName="CalloutMarker",T.title="Callout marker",T.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>',T}(He),Pe=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.fillColor="transparent",K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.opacity=1,K.strokeColor=q.defaultColor,K.strokeWidth=q.defaultStrokeWidth,K.strokeDasharray=q.defaultStrokeDasharray,K.fillColor=q.defaultFillColor,K.setStrokeColor=K.setStrokeColor.bind(K),K.setFillColor=K.setFillColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.setOpacity=K.setOpacity.bind(K),K.createVisual=K.createVisual.bind(K),K.strokePanel=new Ee("Line color",ue(q.defaultColorSet,["transparent"]),q.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.fillPanel=new Ee("Fill color",ue(q.defaultColorSet,["transparent"]),K.fillColor,pe),K.fillPanel.onColorChanged=K.setFillColor,K.strokeWidthPanel=new ht("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K.opacityPanel=new se("Opacity",q.defaultOpacitySteps,K.opacity),K.opacityPanel.onOpacityChanged=K.setOpacity,K}return _e(T,X),T.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual)},T.prototype.createVisual=function(){this.visual=le.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)},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},T.prototype.manipulate=function(I){X.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){X.prototype.resize.call(this,I),this.setSize()},T.prototype.setSize=function(){X.prototype.setSize.call(this),le.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},T.prototype.pointerUp=function(I){X.prototype.pointerUp.call(this,I),this.setSize()},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},T.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(I){this.opacity=I,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),X.prototype.restoreState.call(this,I),this.setSize()},T.prototype.scale=function(I,H){X.prototype.scale.call(this,I,H),this.setSize()},T.typeName="EllipseMarker",T.title="Ellipse marker",T.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>',T}(tt),Ke=function(X){function T(I,H,q){return X.call(this,I,H,q)||this}return _e(T,X),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},T.prototype.createTips=function(){this.tip1=le.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(le.createTransform()),this.visual.appendChild(this.tip1),this.tip2=le.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(le.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(le.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()]]),le.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 I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.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>',T}(mt),vt=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.strokePanel.colors=q.defaultColorSet,K.fillColor="transparent",K}return _e(T,X),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.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>',T}(Pe),Ft=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),Dt=function(X){function T(I,H,q){var K=X.call(this,I,H,q)||this;return K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.curveX=0,K.curveY=0,K.manipulationStartCurveX=0,K.manipulationStartCurveY=0,K.setStrokeColor=K.setStrokeColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.positionGrips=K.positionGrips.bind(K),K.addControlGrips=K.addControlGrips.bind(K),K.adjustVisual=K.adjustVisual.bind(K),K.setupControlBox=K.setupControlBox.bind(K),K.resize=K.resize.bind(K),K.strokeColor=q.defaultColor,K.strokeWidth=q.defaultStrokeWidth,K.strokeDasharray=q.defaultStrokeDasharray,K.strokePanel=new Ee("Line color",q.defaultColorSet,q.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new ht("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return _e(T,X),T.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},T.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},T.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorCurve=le.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=le.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)},T.prototype.pointerDown=function(I,H){X.prototype.pointerDown.call(this,I,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=I.x,this.curveY=I.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),le.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=le.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=le.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)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var I=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-I/2,this.curveY-I/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()))},T.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),X.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),X.prototype.resize.call(this,I),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},T.prototype.scale=function(I,H){this.curveX=this.curveX*I,this.curveY=this.curveY*H,X.prototype.scale.call(this,I,H)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.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>',T}(Tt),Kt=function(){function X(T,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=I}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),ut=function(X){function T(I,H,q){var K=X.call(this,I,!1)||this;return K.dataUrl=H,K.state=q,K}return _e(T,X),T}(Kt),Be=function(X){function T(I,H,q){q===void 0&&(q=!1);var K=X.call(this,I,q)||this;return K.marker=H,K}return _e(T,X),T}(Kt),kt=function(){function X(){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 X.prototype.addEventListener=function(T,I){this[T].push(I)},X.prototype.removeEventListener=function(T,I){var H=this[T].indexOf(I);H>-1&&this[T].splice(H,1)},X}(),Ot=function(){function X(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Me,this._isOpen=!1,this.undoRedoManager=new Ft,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=X.instanceCounter++,this.styles=new $e(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.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(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[lt,Te,ge,He,vt,Pe,ce,xe,Ke,re,mt,Dt]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[lt,Te,ge,He,Pe,ce,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[lt,Te,ge,He,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var I=this;this._availableMarkerTypes.splice(0),T.forEach(function(H){if(typeof H=="string"){var q=I.ALL_MARKER_TYPES.find(function(K){return K.typeName===H});q!==void 0&&I._availableMarkerTypes.push(q)}else I._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Oe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&Ve.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ve.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new Kt(T))})},X.prototype.render=function(){return Se(this,void 0,void 0,function(){var T;return ve(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(T=new Ye).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.markersOnly=this.renderMarkersOnly,T.width=this.renderWidth,T.height=this.renderHeight,[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},X.prototype.close=function(T){var I=this;if(T===void 0&&(T=!1),this.isOpen){var H=!1;T||this.eventListeners.beforeclose.forEach(function(q){var K=new Kt(I,!0);q(K),K.defaultPrevented&&(H=!0)}),H||(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(q){return q(new Kt(I))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var T,I=[],H=0;H<arguments.length;H++)I[H]=arguments[H];(T=this._availableMarkerTypes).push.apply(T,I)},X.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(I){T(I.dataUrl,I.state)})},X.prototype.removeRenderEventListener=function(T){},X.prototype.addCloseEventListener=function(T){this.addEventListener("close",function(){T()})},X.prototype.removeCloseEventListener=function(T){},X.prototype.setupResizeObserver=function(){var T=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return T.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var T=1*this.target.clientWidth/this.target.clientHeight,I=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,H=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(I,H)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(T,I){this._isResizing=!0;var H=T/this.imageWidth,q=I/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(I),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(H,q),this._isResizing=!1},X.prototype.scaleMarkers=function(T,I){var H,q=this;this._currentMarker&&this._currentMarker instanceof He?this._currentMarker.scale(T,I):(H=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(K){K!==q._currentMarker&&K.scale(T,I)}),H!==void 0&&this.setCurrentMarker(H)},X.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"},X.prototype.setTopLeft=function(){var T=this.editingTarget.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=T.left-I.left,this.top=T.top-I.top},X.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)},X.prototype.addDefs=function(){for(var T,I=[],H=0;H<arguments.length;H++)I[H]=arguments[H];this.defs=le.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,I)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.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)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.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)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.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)},X.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 T=document.createElement("a");T.href="https://markerjs.com/",T.target="_blank",T.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>',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.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")},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.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 T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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 We(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 qe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(T){this.markerImage.removeChild(T.container),this.markers.indexOf(T)>-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},X.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())},X.prototype.toolbarButtonClicked=function(T,I){if(T==="marker"&&I!==void 0)this.createNewMarker(I);else if(T==="action")switch(I){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()}},X.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var K=new Be(T,T._currentMarker,!0);q(K),K.defaultPrevented&&(I=!0)}),!I){var H=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(q){return q(new Be(T,H))})}}},X.prototype.clear=function(){var T=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var ke=new Be(T,void 0,!0);he(ke),ke.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var H=function(he){var ke=q.markers[he];q.setCurrentMarker(q.markers[he]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(je){return je(new Be(T,ke))})},q=this,K=this.markers.length-1;K>=0;K--)H(K);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var T;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=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},X.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)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===I.width&&H.height===I.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(I),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(K){return K(new Kt(T))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(K){return K(new Kt(T))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var T=this,I=this.undoRedoManager.undo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new Kt(T))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var T=this,I=this.undoRedoManager.redo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new Kt(T))}))},X.prototype.stepZoom=function(){var T=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=T<this.zoomSteps.length-1?this.zoomSteps[T+1]:this.zoomSteps[0]},X.prototype.panTo=function(T){this.contentDiv.scrollBy({left:this.prevPanPoint.x-T.x,top:this.prevPanPoint.y-T.y}),this.prevPanPoint=T},X.prototype.startRenderAndClose=function(){return Se(this,void 0,void 0,function(){var T,I,H=this;return ve(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return T=q.sent(),I=this.getState(),this.eventListeners.render.forEach(function(K){return K(new ut(H,T,I))}),this.close(!0),[2]}})})},X.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var I={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(H){return I.markers.push(H.getState())}),I},X.prototype.restoreState=function(T){var I=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(H){var q=I._availableMarkerTypes.find(function(he){return he.typeName===H.typeName});if(q!==void 0){var K=I.addNewMarker(q);K.restoreState(H),I.markers.push(K)}}),T.width&&T.height&&(T.width!==this.imageWidth||T.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/T.width,this.imageHeight/T.height),this.eventListeners.restorestate.forEach(function(H){return H(new Kt(I))})},X.prototype.addNewMarker=function(T){var I=le.createGroup();return this.markerImage.appendChild(I),new T(I,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(T){var I,H=this;(I=typeof T=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(I),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(I.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new Be(H,H._currentMarker))}))},X.prototype.markerCreated=function(T){var I=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof Te&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Te):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(H){return H(new Be(I,I._currentMarker))})},X.prototype.colorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=T,this.settings.defaultStrokeColor=T)},X.prototype.fillColorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=T)},X.prototype.markerStateChanged=function(T){var I=this;this.eventListeners.markerchange.forEach(function(H){return H(new Be(I,T))})},X.prototype.setCurrentMarker=function(T){var I=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(H){return H(new Be(I,I._currentMarker))})),this._currentMarker=T,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(H){return H(new Be(I,I._currentMarker))}))},X.prototype.onPointerDown=function(T){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||T.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var I=this.markers.find(function(H){return H.ownsTarget(T.target)});I!==void 0?(this.setCurrentMarker(I),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:T.clientX,y:T.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY))},X.prototype.onDblClick=function(T){if(this._isFocused||this.focus(),this.mode==="select"){var I=this.markers.find(function(H){return H.ownsTarget(T.target)});I!==void 0&&I!==this._currentMarker&&this.setCurrentMarker(I),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(T){this.touchPoints!==1&&T.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||T.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(T.clientX,T.clientY)):this.zoomLevel>1&&this.panTo({x:T.clientX,y:T.clientY}))},X.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(T,I){var H=this.markerImage.getBoundingClientRect();return{x:(T-H.left)/this.zoomLevel,y:(I-H.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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()},X.prototype.addLicenseKey=function(T){Oe.addKey(T)},X.prototype.addEventListener=function(T,I){this.eventListeners.addEventListener(T,I)},X.prototype.removeEventListener=function(T,I){this.eventListeners.removeEventListener(T,I)},X.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(I){return I(new Kt(T))}))},X.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new Kt(T))}))},X.instanceCounter=0,X}();/* **********************************
|
|
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 sn=function(X,T){return(sn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(X,T)};function qt(X,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function I(){this.constructor=X}sn(X,T),X.prototype=T===null?Object.create(T):(I.prototype=T.prototype,new I)}function At(X,T,I,H){return new(I||(I=Promise))(function(q,K){function he(ct){try{je(H.next(ct))}catch(De){K(De)}}function ke(ct){try{je(H.throw(ct))}catch(De){K(De)}}function je(ct){var De;ct.done?q(ct.value):(De=ct.value,De instanceof I?De:new I(function(et){et(De)})).then(he,ke)}je((H=H.apply(X,T||[])).next())})}function at(X,T){var I,H,q,K,he={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return K={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(K[Symbol.iterator]=function(){return this}),K;function ke(je){return function(ct){return function(De){if(I)throw new TypeError("Generator is already executing.");for(;he;)try{if(I=1,H&&(q=2&De[0]?H.return:De[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,De[1])).done)return q;switch(H=0,q&&(De=[2&De[0],q.value]),De[0]){case 0:case 1:q=De;break;case 4:return he.label++,{value:De[1],done:!1};case 5:he.label++,H=De[1],De=[0];continue;case 7:De=he.ops.pop(),he.trys.pop();continue;default:if(!(q=he.trys,(q=q.length>0&&q[q.length-1])||De[0]!==6&&De[0]!==2)){he=0;continue}if(De[0]===3&&(!q||De[1]>q[0]&&De[1]<q[3])){he.label=De[1];break}if(De[0]===6&&he.label<q[1]){he.label=q[1],q=De;break}if(q&&he.label<q[2]){he.label=q[2],he.ops.push(De);break}q[2]&&he.ops.pop(),he.trys.pop();continue}De=T.call(X,he)}catch(et){De=[6,et],H=0}finally{I=q=0}if(5&De[0])throw De[1];return{value:De[0]?De[1]:void 0,done:!0}}([je,ct])}}}var Ln=function(){function X(){}return X.addKey=function(T){X.key=T},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Le=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(T,I){for(var H=0,q=I;H<q.length;H++){var K=q[H],he=K[0],ke=K[1];T.setAttribute(he,ke)}},X.createRect=function(T,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",T.toString()),q.setAttribute("height",I.toString()),H&&X.setAttributes(q,H),q},X.createLine=function(T,I,H,q,K){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",T.toString()),he.setAttribute("y1",I.toString()),he.setAttribute("x2",H.toString()),he.setAttribute("y2",q.toString()),K&&X.setAttributes(he,K),he},X.createPolygon=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",T),I&&X.setAttributes(H,I),H},X.createCircle=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(T/2).toString()),H.setAttribute("cy",(T/2).toString()),H.setAttribute("r",T.toString()),I&&X.setAttributes(H,I),H},X.createEllipse=function(T,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(T/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(T/2).toString()),q.setAttribute("ry",(I/2).toString()),H&&X.setAttributes(q,H),q},X.createGroup=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&X.setAttributes(I,T),I},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(T,I,H,q,K,he,ke){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(je,[["id",T],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",K.toString()],["refY",he.toString()]]),je.appendChild(ke),je},X.createText=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),T&&X.setAttributes(I,T),I},X.createTSpan=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=T,I&&X.setAttributes(H,I),H},X.createImage=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&X.setAttributes(I,T),I},X.createPoint=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=T,H.y=I,H},X.createPath=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",T),I&&X.setAttributes(H,I),H},X.createElement=function(T,I){var H=document.createElementNS("http://www.w3.org/2000/svg",T);return I&&X.setAttributes(H,I),H},X.getHollowRectanglePath=function(T,I,H,q,K,he,ke,je){return"M"+T+","+I+"V"+(I+q)+"H"+(T+H)+"V"+I+"H"+K+"V"+he+"H"+(K+ke)+"V"+(he+je)+"H"+K+"V"+I+"Z"},X}(),vn=function(){function X(T){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.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(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},X.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new yt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new yt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new yt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new xt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new xt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),yt=function(X,T){this.selector=X,this.style=T},xt=function(X,T){this.localName=X,this.style=T},gt=function(){function X(){this.blocks=[],this.display=""}return X.prototype.addButtonBlock=function(T){T.className=this.blockClassName,T.buttonClassName=this.buttonClassName,T.buttonColorsClassName=this.buttonColorsClassName,T.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(T)},X.prototype.addElementBlock=function(T){T.className===void 0&&(T.className=this.blockClassName),this.blocks.push(T)},X.prototype.getUI=function(){var T=document.createElement("div");return T.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,T.style.display=this.display,this.blocks.forEach(function(I){return T.appendChild(I.getUI())}),T},X}(),Vt=function(){function X(){}return X.prototype.getUI=function(){var T=document.createElement("div");if(T.className=this.className,this.minWidth!==void 0&&(T.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":T.style.justifyContent="flex-start";break;case"center":T.style.justifyContent="center";break;case"end":T.style.justifyContent="flex-end"}return T.style.whiteSpace="nowrap",T},X}(),tn=function(X){function T(){var I=X!==null&&X.apply(this,arguments)||this;return I.buttons=[],I}return qt(T,X),T.prototype.addButton=function(I){I.className=this.buttonClassName,I.colorsClassName=this.buttonColorsClassName,I.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(I)},T.prototype.getUI=function(){var I=X.prototype.getUI.call(this);return this.buttons.forEach(function(H){return I.appendChild(H.getUI())}),I},T}(Vt),Mt=function(){function X(T,I){this._isActive=!1,this._isHidden=!1,this._icon=T,this.title=I,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(X.prototype,"icon",{get:function(){return this._icon},set:function(T){this._icon=T,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isActive",{get:function(){return this._isActive},set:function(T){this._isActive=T,this.adjustClassName()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){var T=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 T.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},X.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,"")))},X.prototype.hide=function(){this._isHidden=!0},X}(),st=function(X){function T(){var I=X!==null&&X.apply(this,arguments)||this;return I.elements=[],I}return qt(T,X),T.prototype.addElement=function(I){this.elements.push(I)},T.prototype.getUI=function(){var I=X.prototype.getUI.call(this);return this.elements.forEach(function(H){return I.appendChild(H)}),I},T}(Vt),cn=function(){function X(T,I){this.horizontal=T,this.vertical=I}return Object.defineProperty(X.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),X.prototype.getVerticalLength=function(T){return T/this.ratio},X.prototype.getHorizontalLength=function(T){return T*this.ratio},X}(),Gt=function(){function X(){}return X.getIcon=function(T,I){if(T>0&&I>0){var H=new cn(T,I),q=H.ratio>=1?20:H.getHorizontalLength(20),K=H.ratio<1?20:H.getVerticalLength(20),he=document.createElementNS("http://www.w3.org/2000/svg","svg");he.setAttribute("xmlns","http://www.w3.org/2000/svg"),he.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(he);var ke=Le.createDefs();he.appendChild(ke);var je=Le.createElement("clipPath",[["id","text-bg-clip"]]);ke.appendChild(je);var ct=Le.createPath(Le.getHollowRectanglePath((24-q)/2,(24-K)/2,q,K,(24-q)/2+2,(24-K)/2+2,q-4,K-4));he.appendChild(ct);var De=Le.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);De.appendChild(Le.createTSpan(T+":"+I)),he.appendChild(De);var et=De.getBBox();Le.setAttributes(De,[["x",((24-et.width)/2).toString()],["y",((24-et.height)/2-et.y).toString()]]);var Xe=Le.createPath(Le.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(et.width))/2,(24-Math.ceil(et.height))/2,Math.ceil(et.width),Math.ceil(et.height)));return je.appendChild(Xe),Le.setAttributes(ct,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(he),he.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>'},X}(),Bt=function(X){function T(I,H,q){var K=X.call(this,I,H)||this;return K.isDropdownOpen=!1,K.onClick=K.dropdownButtonClicked,K.dropdownButtons=q,K}return qt(T,X),T.prototype.setupDropdown=function(){var I=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(H){H.className=I.className,H.colorsClassName=I.colorsClassName,I.dropdownBlock.appendChild(H.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},T.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},T.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},T.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},T.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},T.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},T}(Mt),_t=function(){function X(T,I){this.GRIP_SIZE=10,this.color=T,this.fillColor=I,this.visual=Le.createGroup(),this.visual.appendChild(Le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Le.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},X.prototype.setCenter=function(T,I){this.visual.childNodes.forEach(function(H){return Le.setAttributes(H,[["cx",T.toString()],["cy",I.toString()]])})},X}(),Lt=function(){function X(T,I,H,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=T,this.canvasHeight=I,this.margin=H,this.container=q,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(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(T){this._aspectRatio=T,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.gridContainer&&Le.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(T){this._zoomFactor=T,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var T=this;this.cropShadeElement=Le.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Le.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var I=0;I<this.numberOfGridLines;I++)this.horizontalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(H){return T.gridContainer.appendChild(H)}),this.verticalGridLines.forEach(function(H){return T.gridContainer.appendChild(H)}),this.cropRectElement=Le.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(T){this.cropRect=T;var I=Object.assign({},this.cropRect);this.zoomFactor!==1&&(I.width=this.cropRect.width*this.zoomFactor,I.height=this.cropRect.height*this.zoomFactor,I.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-I.width/2,I.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-I.height/2),Le.setAttributes(this.cropRectElement,[["x",I.x.toString()],["y",I.y.toString()],["width",I.width.toString()],["height",I.height.toString()]]);var H=I.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(K,he){var ke=I.y+H*(he+1);Le.setAttributes(K,[["x1",""+I.x],["y1",""+ke],["x2",""+(I.x+I.width)],["y2",""+ke]])});var q=I.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(K,he){var ke=I.x+q*(he+1);Le.setAttributes(K,[["x1",""+ke],["y1",""+I.y],["x2",""+ke],["y2",""+(I.y+I.height)]])}),Le.setAttributes(this.cropShadeElement,[["d",Le.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,I.x,I.y,I.width,I.height)]]),this.topLeftGrip.setCenter(I.x,I.y),this.topRightGrip.setCenter(I.x+I.width,I.y),this.bottomLeftGrip.setCenter(I.x,I.y+I.height),this.bottomRightGrip.setCenter(I.x+I.width,I.y+I.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.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)},X.prototype.clientToLocalCoordinates=function(T,I){var H=this.container.getBoundingClientRect();return{x:T-H.left+this.margin,y:I-H.top+this.margin}},X.prototype.onPointerDown=function(T){this.container.setPointerCapture(T.pointerId),this.previousPoint=this.clientToLocalCoordinates(T.clientX,T.clientY),this.cropRectElement===T.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(T.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(T.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(T.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(T.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(T){if(this.isMoving)this.move(this.clientToLocalCoordinates(T.clientX,T.clientY));else if(this.activeGrip){var I=this.clientToLocalCoordinates(T.clientX,T.clientY);this.resize(I)}T.preventDefault()},X.prototype.onPointerUp=function(T){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(T.pointerId)},X.prototype.move=function(T){var I=T.x-this.previousPoint.x,H=T.y-this.previousPoint.y;this.zoomFactor!==1&&(I=-I/this.zoomFactor,H=-H/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+I),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+H),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=T},X.prototype.resize=function(T){var I=Object.assign({},this.cropRect),H=T.x-this.previousPoint.x,q=T.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:I.x+H<this.margin&&(H=this.margin-I.x),I.x+=H,I.width=this.cropRect.x+this.cropRect.width-I.x;break;case this.bottomRightGrip:case this.topRightGrip:I.width+H>this.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-I.width),I.width+=H}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(I.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(H),I.height=this.aspectRatio.getVerticalLength(I.width)):(I.y+=q,I.height=this.cropRect.y+this.cropRect.height-I.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?I.height=this.aspectRatio.getVerticalLength(I.width):I.height+=q}I.width<10&&(I.x=this.cropRect.x,I.width=10),I.height<10&&(I.y=this.cropRect.y,I.height=10),this.previousPoint=T,I.x>=this.margin&&I.y>=this.margin&&I.x-this.margin+I.width<=this.canvasWidth&&I.y-this.margin+I.height<=this.canvasHeight&&(this.cropRect=I,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var T=this.cropRect.x+this.cropRect.width/2,I=this.cropRect.y+this.cropRect.height/2,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);H/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=H:this.cropRect.height=q,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=T-this.cropRect.width/2,this.cropRect.y=I-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)}},X.prototype.getRescaledRect=function(T,I,H,q,K,he){var ke=H/T,je=q/I;return{x:(K.x-he)*ke+he,y:(K.y-he)*je+he,width:K.width*ke,height:K.height*je}},X.prototype.scaleCanvas=function(T,I){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,T,I,this.cropRect,this.margin);this.canvasWidth=T,this.canvasHeight=I,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},X}(),Qt=function(){function X(T){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=T,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(X.prototype,"angle",{get:function(){return this._angle},set:function(T){this._angle=T,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.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},X.prototype.onPointerDown=function(T){this.controlContainer.setPointerCapture(T.pointerId),this.isDragging=!0,this.previousPoint={x:T.clientX,y:T.clientY}},X.prototype.onPointerMove=function(T){this.isDragging&&(this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.previousPoint.x=T.clientX)},X.prototype.onPointerUp=function(T){this.isDragging&&this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(T.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var T=this.angleLabelText.getBBox();Le.setAttributes(this.angleLabelElement,[["x",((this.width-T.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var T=this.scaleShape.transform.baseVal.getItem(0);T.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(T,0)}},X.prototype.getVisual=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg");T.setAttribute("xmlns","http://www.w3.org/2000/svg"),T.setAttribute("width",this.width+"px"),T.setAttribute("height",this.height+"px"),T.setAttribute("viewBox","0 0 "+this.width+" "+this.height),T.style.flexShrink="0",document.body.appendChild(T);for(var I="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,H=1;H<=this.width/5+10;H++){var q=H%5==0?this.height/3:this.height/6;I+="h4v"+-q+"h1v"+q}I+="v1H0Z",this.scaleShape=Le.createPath(I);var K=Le.createTransform();this.scaleShape.transform.baseVal.appendItem(K),T.appendChild(this.scaleShape),this.angleLabelElement=Le.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Le.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var he=Le.createTSpan("");return he.innerHTML="°",this.angleLabelElement.appendChild(he),T.appendChild(this.angleLabelElement),document.body.removeChild(T),T},X}(),rn=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(T,I,H,q,K,he,ke){var je=this;return new Promise(function(ct){var De=document.createElement("canvas");De.width=T.width.baseVal.value-2*q,De.height=T.height.baseVal.value-2*q;var et=1,Xe=1;je.naturalSize===!0?(et=I.naturalWidth/(T.width.baseVal.value-2*q)/he,Xe=I.naturalHeight/(T.height.baseVal.value-2*q)/ke,De.width=I.naturalWidth/he,De.height=I.naturalHeight/ke):je.width!==void 0&&je.height!==void 0&&(et=je.width/H.width,Xe=je.height/H.height,De.width*=et,De.height*=Xe);var Ct=De.getContext("2d");Ct.translate(De.width/2,De.height/2),Ct.rotate(K*Math.PI/180),Ct.scale(he,ke),Ct.translate(-De.width/2,-De.height/2),Ct.drawImage(I,0,0,De.width,De.height);var wt=document.createElement("canvas");wt.width=H.width*et,wt.height=H.height*Xe,wt.getContext("2d").putImageData(Ct.getImageData((H.x-q)*et,(H.y-q)*Xe,H.width*et,H.height*Xe),0,0),ct(wt.toDataURL(je.imageType,je.imageQuality))})},X}(),Ue=function(){function X(T){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=X.instanceCounter++,this.styles=new vn(this.instanceNo),this.target=T,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(T){this._zoomToCropEnabled=T,T?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(T){this._gridLines=T,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(T){this._rotationAngle=T,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var T;return(T=this._aspectRatio)!==null&&T!==void 0?T:this.aspectRatios[0]},set:function(T){this._aspectRatio=T},enumerable:!1,configurable:!0}),X.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},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(T){T===void 0&&(T=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),T||this.closeEventListeners.forEach(function(I){return I()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(T){this.renderEventListeners.push(T)},X.prototype.removeRenderEventListener=function(T){this.renderEventListeners.indexOf(T)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(T),1)},X.prototype.addCloseEventListener=function(T){this.closeEventListeners.push(T)},X.prototype.removeCloseEventListener=function(T){this.closeEventListeners.indexOf(T)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(T),1)},X.prototype.setupResizeObserver=function(){var T=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.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))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var T=1*this.target.clientWidth/this.target.clientHeight,I=this.contentDiv.clientWidth/T>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*T:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,H=I+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/T;this.resize(I,H)}},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.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",Le.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},X.prototype.resize=function(T,I){this.imageWidth=Math.round(T),this.imageHeight=Math.round(I),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()},X.prototype.setEditingTarget=function(){var T=document.createElement("canvas");T.width=this.target.naturalWidth,T.height=this.target.naturalHeight,T.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var I=T.toDataURL();Le.setAttributes(this.editingTarget,[["href",I]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var T=this.target.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=T.left-I.left-this.CANVAS_MARGIN,this.top=T.top-I.top-this.CANVAS_MARGIN},X.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=Le.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Le.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Le.createGroup(),this.editingTargetRotationScaleContainer=Le.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var T=Le.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(T);var I=Le.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(I),this.editingTargetContainer=Le.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)},X.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},X.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Le.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Lt(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()},X.prototype.zoomToCrop=function(){if(this.cropRect){var T=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,I=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=T+"px "+I+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-T+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-I+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},X.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)},X.prototype.cropRectChanged=function(T){this.cropRect=T,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},X.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.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 T=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,I=this.target.offsetTop>T+this.CANVAS_MARGIN?this.target.offsetTop-(T+this.CANVAS_MARGIN):0;this.coverDiv.style.top=I+"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},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var T=this;this.topToolbar=new gt,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 I=new tn;I.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(I);var H=[];this.aspectRatios.forEach(function(Xe){var Ct=new Mt(Gt.getIcon(Xe.horizontal,Xe.vertical),Xe.horizontal===0&&Xe.vertical===0?"FREE":Xe.horizontal+":"+Xe.vertical);Ct.onClick=function(){return T.ratioButtonClicked(Xe)},H.push(Ct)}),this.aspectRatioButton=new Bt(Gt.getIcon(0,0),"Aspect ratio",H),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,I.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new Mt('<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");q.isActive=this.isGridVisible,q.onClick=function(){T.isGridVisible=!T.isGridVisible,q.isActive=T.isGridVisible},I.addButton(q);var K=new Mt('<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(K.isActive=this.zoomToCropEnabled,K.onClick=function(){T.zoomToCropEnabled=!T.zoomToCropEnabled,K.isActive=T.zoomToCropEnabled},I.addButton(K),!Ln.isLicensed){var he=new st;this.topToolbar.addElementBlock(he);var ke=document.createElement("div");ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var je=document.createElement("a");je.style.color="currentColor",je.href="https://markerjs.com/products/cropro",je.target="_blank",je.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>',ke.appendChild(je),he.addElement(ke)}var ct=new tn;ct.minWidth=3*this.toolbarHeight+"px",ct.contentAlign="end",this.topToolbar.addButtonBlock(ct);var De=new Mt('<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");De.onClick=this.startRenderAndClose,ct.addButton(De),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(De.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var et=new Mt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");et.onClick=this.close,ct.addButton(et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var T=this;this.bottomToolbar=new gt,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 I=new tn;I.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(I);var H=new Mt('<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");H.onClick=this.rotateLeftButtonClicked,I.addButton(H);var q=new Mt('<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");q.onClick=this.rotateRightButtonClicked,I.addButton(q);var K=new st;K.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(K),this.straightener=new Qt("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(ct){T.rotateBy(ct),T.straightener.angle=T.rotationAngle},K.addElement(this.straightener.getUI());var he=new tn;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var ke=new Mt('<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");ke.onClick=this.flipHorizontallyButtonClicked,he.addButton(ke);var je=new Mt('<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");je.onClick=this.flipVerticallyButtonClicked,he.addButton(je)},X.prototype.ratioButtonClicked=function(T){this.aspectRatio=T,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Gt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new cn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(T){if(T){var I=this.cropLayer.getRescaledRect(T.width,T.height,this.imageWidth,this.imageHeight,T.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(I),this.cropRectChanged(I),this.flippedHorizontally=T.flippedHorizontally,this.flippedVertically=T.flippedVertically,this.applyFlip(),this.rotationAngle=T.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(T,I){var H=this.cropImage.getBoundingClientRect();return{x:T-H.left,y:I-H.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var T=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=T+"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()},X.prototype.rotateLeftButtonClicked=function(){var T=this.rotationAngle-90;this.rotationAngle%90!=0&&(T+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(T)},X.prototype.rotateRightButtonClicked=function(){var T=this.rotationAngle+90;this.rotationAngle%90!=0&&(T-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(T)},X.prototype.rotateTo=function(T){T=(T=T>180?T-360:T)<=-180?T+360:T,this.rotationAngle=T,this.applyRotation()},X.prototype.rotateBy=function(T){this.rotateTo((this.rotationAngle+T)%360)},X.prototype.applyRotation=function(){var T=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var I=this.editingTargetRotationContainer.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(I,0);var H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=T},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return At(this,void 0,void 0,function(){var T,I;return at(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return T=H.sent(),I=this.getState(),this.renderEventListeners.forEach(function(q){return q(T,I)}),this.close(!0),[2]}})})},X.prototype.render=function(){return At(this,void 0,void 0,function(){var T;return at(this,function(I){switch(I.label){case 0:return(T=new rn).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.width=this.renderWidth,T.height=this.renderHeight,this.unzoomFromCrop(),Le.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,T.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 I.sent(),[4,T.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,I.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("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 xt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var T=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*T)+`px;
|
|
height: `+(this.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new yt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new yt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("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 xt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("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 xt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},X.instanceCounter=0,X}(),Et=$("8hTe"),pn=$.n(Et),xn=/<pre[^>]*>/g;function Sn(X){var T=document.createElement("div");return T.innerHTML=X,T.childNodes.length===0?"":T.childNodes[0].nodeValue}var yn=be.a=function(X){var T=X.value,I=T===void 0?"":T,H=X.edit,q=H===void 0?!1:H,K=X.className,he=X.showTextOnly,ke=X.showLines,je=X.replaces,ct=X.zoomImg,De=X.hasMask,et=X.style,Xe=et===void 0?{}:et,Ct=X.stylesPrev,wt=Ct===void 0?{}:Ct,dn=String(I),Ut=Object(D.useRef)(),Xt=Object(D.useRef)(),bn=Object(D.useState)(""),Cn=Object(z.a)(bn,2),En=Cn[0],Zt=Cn[1],Rt=Object(D.useState)("office"),bt=Object(z.a)(Rt,2),Wt=bt[0],Jt=bt[1],on=function(){var un=new Ue(Xt.current);un.displayMode="popup",un.addRenderEventListener(function(){var An=Object(B.a)(n.a.mark(function nn(Dn){var hn;return n.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Ut.current.style.display="none",Mn.next=3,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dn}});case 3:hn=Mn.sent,hn!=null&&hn.id&&je(Xt.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(hn==null?void 0:hn.id,"?type=").concat(hn.content_type));case 5:case"end":return Mn.stop()}},nn)}));return function(nn){return An.apply(this,arguments)}}()),un.show()},Ht=function(){var un=new Ot(Xt.current);un.settings.displayMode="popup",un.addEventListener("render",function(){var An=Object(B.a)(n.a.mark(function nn(Dn){var hn;return n.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(Ut.current.style.display="none",!Xt.current){Mn.next=6;break}return Mn.next=4,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dn.dataUrl}});case 4:hn=Mn.sent,hn!=null&&hn.id&&je(Xt.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(hn==null?void 0:hn.id,"?type=").concat(hn.content_type));case 6:case"end":return Mn.stop()}},nn)}));return function(nn){return An.apply(this,arguments)}}()),un.show(),window.markerArea=un},Bn=Object(D.useMemo)(function(){Ut.current&&(Ut.current.style.zIndex=-1);try{var wn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,un=/\"\/api\/attachments\/|\"\/attachments\/download\//g,An=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;dn=dn.replace(wn,"("+Z.a.API_SERVER+"/api/attachments/").replace(un,'"'+Z.a.API_SERVER+"/api/attachments/").replace(An,'"'+Z.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(pi){}var nn=U(dn),Dn=v();if(dn.match(/\[TOC\]/)&&(nn=nn.replace("<p>[TOC]</p>",L()),R()),nn=nn.replace(/(__special_katext_id_\d+__)/g,function(pi,Mn){var Rn=Dn[Mn],Ei=Rn.type,xi=Rn.expression;return Object(ne.renderToString)(Sn(xi)||"",{displayMode:Ei==="block",throwOnError:!1,output:"html"})}),nn=nn.replace(/▁/g,"\u2581\u2581\u2581"),a(),he){var hn=document.createElement("div");return hn.innerHTML=nn,hn.innerText}return setTimeout(function(){return gi()},500),nn},[dn]),Pn=Object(D.useRef)();x.WebkitLineClamp=ke,ke&&(Xe=Object(j.a)(Object(j.a)({},Xe),x));function ti(wn){var un=wn.target;if(un.tagName.toUpperCase()==="IMG"){if(ct){var An=un.getAttribute("src");Zt(An),Jt("image")}}else if(un.tagName.toUpperCase()==="A"){var nn=un.getAttribute("href");if(nn.indexOf("office")>-1)wn.preventDefault(),Zt(nn),Jt("office");else if(nn.indexOf("application/pdf")>-1)wn.preventDefault(),Zt(nn),Jt("pdf");else if(nn.indexOf("text/html")>-1)wn.preventDefault(),Zt(nn),Jt("html");else if(nn.startsWith("#")){wn.preventDefault();var Dn=document.getElementById(nn.replace("#",""));Dn&&Dn.scrollIntoView(!0)}}}var gi=function(){var un,An=(un=Pn.current)===null||un===void 0?void 0:un.querySelectorAll("video");An==null||An.forEach(function(nn){if(nn.oncontextmenu=function(){return!1},nn.src.indexOf(".m3u8")>-1&&!nn.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var Dn=new W.a;Dn.loadSource(nn.src),Dn.attachMedia(nn)}}})};Object(D.useEffect)(function(){if(Pn.current&&Bn&&(Bn.match(xn)&&window.PR.prettyPrint()),Pn.current)return Pn.current.addEventListener("click",ti),function(){Pn.current.removeEventListener("click",ti),a(),R()}},[Bn,Pn.current,ti]);var Ci=function(un){if(!q)return;un.target.nodeName==="IMG"?(Ut.current.style.zIndex=1,Ut.current.style.display="flex",Ut.current.style.width=un.target.clientWidth+"px",Ut.current.style.height=un.target.clientHeight+"px",Ut.current.style.top=un.target.offsetTop+"px",Ut.current.style.left=un.target.offsetLeft+"px",Xt.current.src=un.target.getAttribute("src")):Ut.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Pn,style:Object(j.a)({},Xe),className:"".concat(K||""," markdown-body ").concat(pn.a.mdBody),onMouseOver:Ci,dangerouslySetInnerHTML:{__html:Bn}}),y.a.createElement("div",{ref:Ut,className:pn.a.button},y.a.createElement(J.a,null,y.a.createElement(Y.a,{onClick:function(){return on()}},"\u88C1\u526A"),y.a.createElement(Y.a,{onClick:function(){return Ht()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Xt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(ae.a,{close:!0,data:En,type:En!=null&&En.length?Wt:"",style:Object(j.a)({},wt),onClose:function(){return Zt("")}}))}},"9VGf":function(dt,be,$){"use strict";$.d(be,"a",function(){return k});var ie=$("q1tI"),J=$.n(ie);function k(Y,j){var B=Object(ie.useRef)();Object(ie.useEffect)(function(){B.current=Y}),Object(ie.useEffect)(function(){function z(){B.current()}if(j!==null){var G=setInterval(z,j);return function(){return clearInterval(G)}}},[j])}},BU3w:function(dt,be,$){"use strict";$.d(be,"a",function(){return B});var ie=$("MNnm"),J="rc-util-key";function k(z){if(z.attachTo)return z.attachTo;var G=document.querySelector("head");return G||document.body}function Y(z){var G,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var D=document.createElement("style");if((G=n.csp)===null||G===void 0?void 0:G.nonce){var y;D.nonce=(y=n.csp)===null||y===void 0?void 0:y.nonce}D.innerHTML=z;var g=k(n),m=g.firstChild;return n.prepend&&g.prepend?g.prepend(D):n.prepend&&m?g.insertBefore(D,m):g.appendChild(D),D}var j=new Map;function B(z,G){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=k(n);if(!j.has(D)){var y=Y("",n),g=y.parentNode;j.set(D,g),g.removeChild(y)}var m=Array.from(j.get(D).children).find(function(h){return h.tagName==="STYLE"&&h[J]===G});if(m){var c,d;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&m.nonce!==((d=n.csp)===null||d===void 0?void 0:d.nonce)){var p;m.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}return m.innerHTML!==z&&(m.innerHTML=z),m}var l=Y(z,n);return l[J]=G,l}},Bd2K:function(dt,be,$){(function(ie){ie($("VrN/"),$("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(n,D,y){if(y!=ie.Init&&y&&n.removeKeyMap("autoCloseTags"),!D)return;var g={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(g["'/'"]=function(m){return B(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(g["'>'"]=function(m){return Y(m)}),n.addKeyMap(g)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["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 Y(n){if(n.getOption("disableInput"))return ie.Pass;for(var D=n.listSelections(),y=[],g=n.getOption("autoCloseTags"),m=0;m<D.length;m++){if(!D[m].empty())return ie.Pass;var c=D[m].head,d=n.getTokenAt(c),p=ie.innerMode(n.getMode(),d.state),l=p.state,h=p.mode.xmlCurrentTag&&p.mode.xmlCurrentTag(l),o=h&&h.name;if(!o)return ie.Pass;var s=p.mode.configuration=="html",R=typeof g=="object"&&g.dontCloseTags||s&&J,x=typeof g=="object"&&g.indentTags||s&&k;d.end>c.ch&&(o=o.slice(0,o.length-d.end+c.ch));var C=o.toLowerCase();if(!o||d.type=="string"&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||d.string.length==1)||d.type=="tag"&&h.close||d.string.indexOf("/")==c.ch-d.start-1||R&&z(R,C)>-1||G(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(l)||[],o,c,!0))return ie.Pass;var L=typeof g=="object"&&g.emptyTags;if(L&&z(L,o)>-1){y[m]={text:"/>",newPos:ie.Pos(c.line,c.ch+2)};continue}var O=x&&z(x,C)>-1;y[m]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+o+">",newPos:O?ie.Pos(c.line+1,0):ie.Pos(c.line,c.ch+1)}}for(var A=typeof g=="object"&&g.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var w=y[m];n.replaceRange(w.text,D[m].head,D[m].anchor,"+insert");var b=n.listSelections().slice(0);b[m]={head:w.newPos,anchor:w.newPos},n.setSelections(b),!A&&w.indent&&(n.indentLine(w.newPos.line,null,!0),n.indentLine(w.newPos.line+1,null,!0))}}function j(n,D){for(var y=n.listSelections(),g=[],m=D?"/":"</",c=n.getOption("autoCloseTags"),d=typeof c=="object"&&c.dontIndentOnSlash,p=0;p<y.length;p++){if(!y[p].empty())return ie.Pass;var l=y[p].head,h=n.getTokenAt(l),o=ie.innerMode(n.getMode(),h.state),s=o.state;if(D&&(h.type=="string"||h.string.charAt(0)!="<"||h.start!=l.ch-1))return ie.Pass;var R,x=o.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(x&&o.mode.name=="javascript")R=m+"script";else if(x&&o.mode.name=="css")R=m+"style";else{var C=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(s);if(!C||C.length&&G(n,C,C[C.length-1],l))return ie.Pass;R=m+C[C.length-1]}n.getLine(l.line).charAt(h.end)!=">"&&(R+=">"),g[p]=R}if(n.replaceSelections(g),y=n.listSelections(),!d)for(var p=0;p<y.length;p++)(p==y.length-1||y[p].head.line<y[p+1].head.line)&&n.indentLine(y[p].head.line)}function B(n){return n.getOption("disableInput")?ie.Pass:j(n,!0)}ie.commands.closeTag=function(n){return j(n)};function z(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 G(n,D,y,g,m){if(!ie.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,g.line+500),d=ie.scanForClosingTag(n,g,null,c);if(!d||d.tag!=y)return!1;for(var p=m?1:0,l=D.length-1;l>=0&&D[l]==y;l--)++p;g=d.to;for(var l=1;l<p;l++){var h=ie.scanForClosingTag(n,g,null,c);if(!h||h.tag!=y)return!1;g=h.to}return!0}})},BjJ7:function(dt,be,$){"use strict";$.d(be,"d",function(){return J}),$.d(be,"c",function(){return k}),$.d(be,"e",function(){return Y}),$.d(be,"b",function(){return j}),$.d(be,"a",function(){return z});var ie=$("m3rI");function J(G){var n=!0;if(G.length>0){for(var D=0;D<G.length;D++)if(G[D].compile_success==0||!G[D].compile_success){n=!1;break}}else n=!1;return n}function k(G){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],y=0;y<G.length;y++){var g=G[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 Y(G,n,D){for(var y=0;y<G.length;y++){var g=G[y];if(g.key===n){g.children=D;break}g.children&&Y(g.children,n,D)}return G}function j(G,n,D){var y;return function(){var g=this,m=arguments,c=function(){y=null,D||G.apply(g,m)},d=D&&!y;clearTimeout(y),y=setTimeout(c,n),d&&G.apply(g,m)}}var B=!0,z=ie.a.API_SERVER},"C+DQ":function(dt,be,$){},"C/vA":function(dt,be,$){"use strict";$.d(be,"a",function(){return ie});function ie(J){const k=this;let Y=!1,j;return function(){return Y||(Y=!0,j=J.apply(k,arguments)),j}}},"Cg/j":function(dt,be,$){"use strict";$.d(be,"b",function(){return ie}),$.d(be,"a",function(){return J}),$.d(be,"c",function(){return Y}),$.d(be,"d",function(){return j});var ie;(function(B){B.serviceIds=new Map,B.DI_TARGET="$di$target",B.DI_DEPENDENCIES="$di$dependencies";function z(G){return G[B.DI_DEPENDENCIES]||[]}B.getServiceDependencies=z})(ie||(ie={}));const J=Y("instantiationService");function k(B,z,G,n){z[ie.DI_TARGET]===z?z[ie.DI_DEPENDENCIES].push({id:B,index:G,optional:n}):(z[ie.DI_DEPENDENCIES]=[{id:B,index:G,optional:n}],z[ie.DI_TARGET]=z)}function Y(B){if(ie.serviceIds.has(B))return ie.serviceIds.get(B);const z=function(G,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");k(z,G,D,!1)};return z.toString=()=>B,ie.serviceIds.set(B,z),z}function j(B){return function(z,G,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");k(B,z,n,!0)}}},DlQD:function(dt,be,$){(function(ie,J){dt.exports=J()})(this,function(){"use strict";function ie(Te,me){for(var ge=0;ge<me.length;ge++){var re=me[ge];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Te,re.key,re)}}function J(Te,me,ge){return me&&ie(Te.prototype,me),ge&&ie(Te,ge),Te}function k(Te,me){if(!Te)return;if(typeof Te=="string")return Y(Te,me);var ge=Object.prototype.toString.call(Te).slice(8,-1);if(ge==="Object"&&Te.constructor&&(ge=Te.constructor.name),ge==="Map"||ge==="Set")return Array.from(Te);if(ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))return Y(Te,me)}function Y(Te,me){(me==null||me>Te.length)&&(me=Te.length);for(var ge=0,re=new Array(me);ge<me;ge++)re[ge]=Te[ge];return re}function j(Te,me){var ge;if(typeof Symbol=="undefined"||Te[Symbol.iterator]==null){if(Array.isArray(Te)||(ge=k(Te))||me&&Te&&typeof Te.length=="number"){ge&&(Te=ge);var re=0;return function(){return re>=Te.length?{done:!0}:{done:!1,value:Te[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 ge=Te[Symbol.iterator](),ge.next.bind(ge)}function B(Te,me){return me={exports:{}},Te(me,me.exports),me.exports}var z=B(function(Te){function me(){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 ge(re){Te.exports.defaults=re}Te.exports={defaults:me(),getDefaults:me,changeDefaults:ge}}),G=z.defaults,n=z.getDefaults,D=z.changeDefaults,y=/[&<>"']/,g=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,d={"&":"&","<":"<",">":">",'"':""","'":"'"},p=function(me){return d[me]};function l(Te,me){if(me){if(y.test(Te))return Te.replace(g,p)}else if(m.test(Te))return Te.replace(c,p);return Te}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(Te){return Te.replace(h,function(me,ge){return ge=ge.toLowerCase(),ge==="colon"?":":ge.charAt(0)==="#"?ge.charAt(1)==="x"?String.fromCharCode(parseInt(ge.substring(2),16)):String.fromCharCode(+ge.substring(1)):""})}var s=/(^|[^\[])\^/g;function R(Te,me){Te=Te.source||Te,me=me||"";var ge={replace:function(se,ce){return ce=ce.source||ce,ce=ce.replace(s,"$1"),Te=Te.replace(se,ce),ge},getRegex:function(){return new RegExp(Te,me)}};return ge}var x=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(Te,me,ge){if(Te){var re;try{re=decodeURIComponent(o(ge)).replace(x,"").toLowerCase()}catch(se){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}me&&!C.test(ge)&&(ge=u(me,ge));try{ge=encodeURI(ge).replace(/%25/g,"%")}catch(se){return null}return ge}var O={},A=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(Te,me){O[" "+Te]||(A.test(Te)?O[" "+Te]=Te+"/":O[" "+Te]=N(Te,"/",!0)),Te=O[" "+Te];var ge=Te.indexOf(":")===-1;return me.substring(0,2)==="//"?ge?me:Te.replace(w,"$1")+me:me.charAt(0)==="/"?ge?me:Te.replace(b,"$1")+me:Te+me}var v={exec:function(){}};function a(Te){for(var me=1,ge,re;me<arguments.length;me++){ge=arguments[me];for(re in ge)Object.prototype.hasOwnProperty.call(ge,re)&&(Te[re]=ge[re])}return Te}function _(Te,me){var ge=Te.replace(/\|/g,function(ce,pe,xe){for(var Pe=!1,Ke=pe;--Ke>=0&&xe[Ke]==="\\";)Pe=!Pe;return Pe?"|":" |"}),re=ge.split(/ \|/),se=0;if(re.length>me)re.splice(me);else for(;re.length<me;)re.push("");for(;se<re.length;se++)re[se]=re[se].trim().replace(/\\\|/g,"|");return re}function N(Te,me,ge){var re=Te.length;if(re===0)return"";for(var se=0;se<re;){var ce=Te.charAt(re-se-1);if(ce===me&&!ge)se++;else if(ce!==me&&ge)se++;else break}return Te.substr(0,re-se)}function F(Te,me){if(Te.indexOf(me[1])===-1)return-1;for(var ge=Te.length,re=0,se=0;se<ge;se++)if(Te[se]==="\\")se++;else if(Te[se]===me[0])re++;else if(Te[se]===me[1]&&(re--,re<0))return se;return-1}function S(Te){Te&&Te.sanitize&&!Te.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var U={escape:l,unescape:o,edit:R,cleanUrl:L,resolveUrl:u,noopTest:v,merge:a,splitCells:_,rtrim:N,findClosingBracket:F,checkSanitizeDeprecation:S},M=z.defaults,E=U.rtrim,W=U.splitCells,Z=U.escape,ne=U.findClosingBracket;function ae(Te,me,ge){var re=me.href,se=me.title?Z(me.title):null,ce=Te[1].replace(/\\([\[\]])/g,"$1");return Te[0].charAt(0)!=="!"?{type:"link",raw:ge,href:re,title:se,text:ce}:{type:"image",raw:ge,href:re,title:se,text:Z(ce)}}function we(Te,me){var ge=Te.match(/^(\s+)(?:```)/);if(ge===null)return me;var re=ge[1];return me.split(`
|
|
`).map(function(se){var ce=se.match(/^\s+/);if(ce===null)return se;var pe=ce[0];return pe.length>=re.length?se.slice(re.length):se}).join(`
|
|
`)}var fe=function(){function Te(ge){this.options=ge||M}var me=Te.prototype;return me.space=function(re){var se=this.rules.block.newline.exec(re);if(se)return se[0].length>1?{type:"space",raw:se[0]}:{raw:`
|
|
`}},me.code=function(re,se){var ce=this.rules.block.code.exec(re);if(ce){var pe=se[se.length-1];if(pe&&pe.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var xe=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:E(xe,`
|
|
`)}}},me.fences=function(re){var se=this.rules.block.fences.exec(re);if(se){var ce=se[0],pe=we(ce,se[3]||"");return{type:"code",raw:ce,lang:se[2]?se[2].trim():se[2],text:pe}}},me.heading=function(re){var se=this.rules.block.heading.exec(re);if(se)return{type:"heading",raw:se[0],depth:se[1].length,text:se[2]}},me.nptable=function(re){var se=this.rules.block.nptable.exec(re);if(se){var ce={type:"table",header:W(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
|
|
`):[],raw:se[0]};if(ce.header.length===ce.align.length){var pe=ce.align.length,xe;for(xe=0;xe<pe;xe++)/^ *-+: *$/.test(ce.align[xe])?ce.align[xe]="right":/^ *:-+: *$/.test(ce.align[xe])?ce.align[xe]="center":/^ *:-+ *$/.test(ce.align[xe])?ce.align[xe]="left":ce.align[xe]=null;for(pe=ce.cells.length,xe=0;xe<pe;xe++)ce.cells[xe]=W(ce.cells[xe],ce.header.length);return ce}}},me.hr=function(re){var se=this.rules.block.hr.exec(re);if(se)return{type:"hr",raw:se[0]}},me.blockquote=function(re){var se=this.rules.block.blockquote.exec(re);if(se){var ce=se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:se[0],text:ce}}},me.list=function(re){var se=this.rules.block.list.exec(re);if(se){for(var ce=se[0],pe=se[2],xe=pe.length>1,Pe=pe[pe.length-1]===")",Ke={type:"list",raw:ce,ordered:xe,start:xe?+pe.slice(0,-1):"",loose:!1,items:[]},vt=se[0].match(this.rules.block.item),Ft=!1,Dt,Kt,ut,Be,kt,Ot,sn,qt=vt.length,At=0;At<qt;At++)Dt=vt[At],ce=Dt,Kt=Dt.length,Dt=Dt.replace(/^ *([*+-]|\d+[.)]) */,""),~Dt.indexOf(`
|
|
`)&&(Kt-=Dt.length,Dt=this.options.pedantic?Dt.replace(/^ {1,4}/gm,""):Dt.replace(new RegExp("^ {1,"+Kt+"}","gm"),"")),At!==qt-1&&(ut=this.rules.block.bullet.exec(vt[At+1])[0],(xe?ut.length===1||!Pe&&ut[ut.length-1]===")":ut.length>1||this.options.smartLists&&ut!==pe)&&(Be=vt.slice(At+1).join(`
|
|
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-Be.length),At=qt-1)),kt=Ft||/\n\n(?!\s*$)/.test(Dt),At!==qt-1&&(Ft=Dt.charAt(Dt.length-1)===`
|
|
`,kt||(kt=Ft)),kt&&(Ke.loose=!0),Ot=/^\[[ xX]\] /.test(Dt),sn=void 0,Ot&&(sn=Dt[1]!==" ",Dt=Dt.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:ce,task:Ot,checked:sn,loose:kt,text:Dt});return Ke}},me.html=function(re){var se=this.rules.block.html.exec(re);if(se)return{type:this.options.sanitize?"paragraph":"html",raw:se[0],pre:!this.options.sanitizer&&(se[1]==="pre"||se[1]==="script"||se[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):Z(se[0]):se[0]}},me.def=function(re){var se=this.rules.block.def.exec(re);if(se){se[3]&&(se[3]=se[3].substring(1,se[3].length-1));var ce=se[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:se[0],href:se[2],title:se[3]}}},me.table=function(re){var se=this.rules.block.table.exec(re);if(se){var ce={type:"table",header:W(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ce.header.length===ce.align.length){ce.raw=se[0];var pe=ce.align.length,xe;for(xe=0;xe<pe;xe++)/^ *-+: *$/.test(ce.align[xe])?ce.align[xe]="right":/^ *:-+: *$/.test(ce.align[xe])?ce.align[xe]="center":/^ *:-+ *$/.test(ce.align[xe])?ce.align[xe]="left":ce.align[xe]=null;for(pe=ce.cells.length,xe=0;xe<pe;xe++)ce.cells[xe]=W(ce.cells[xe].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},me.lheading=function(re){var se=this.rules.block.lheading.exec(re);if(se)return{type:"heading",raw:se[0],depth:se[2].charAt(0)==="="?1:2,text:se[1]}},me.paragraph=function(re){var se=this.rules.block.paragraph.exec(re);if(se)return{type:"paragraph",raw:se[0],text:se[1].charAt(se[1].length-1)===`
|
|
`?se[1].slice(0,-1):se[1]}},me.text=function(re,se){var ce=this.rules.block.text.exec(re);if(ce){var pe=se[se.length-1];return pe&&pe.type==="text"?{raw:ce[0],text:ce[0]}:{type:"text",raw:ce[0],text:ce[0]}}},me.escape=function(re){var se=this.rules.inline.escape.exec(re);if(se)return{type:"escape",raw:se[0],text:Z(se[1])}},me.tag=function(re,se,ce){var pe=this.rules.inline.tag.exec(re);if(pe)return!se&&/^<a /i.test(pe[0])?se=!0:se&&/^<\/a>/i.test(pe[0])&&(se=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:se,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):Z(pe[0]):pe[0]}},me.link=function(re){var se=this.rules.inline.link.exec(re);if(se){var ce=ne(se[2],"()");if(ce>-1){var pe=se[0].indexOf("!")===0?5:4,xe=pe+se[1].length+ce;se[2]=se[2].substring(0,ce),se[0]=se[0].substring(0,xe).trim(),se[3]=""}var Pe=se[2],Ke="";if(this.options.pedantic){var vt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Pe);vt?(Pe=vt[1],Ke=vt[3]):Ke=""}else Ke=se[3]?se[3].slice(1,-1):"";Pe=Pe.trim().replace(/^<([\s\S]*)>$/,"$1");var Ft=ae(se,{href:Pe&&Pe.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},se[0]);return Ft}},me.reflink=function(re,se){var ce;if((ce=this.rules.inline.reflink.exec(re))||(ce=this.rules.inline.nolink.exec(re))){var pe=(ce[2]||ce[1]).replace(/\s+/g," ");if(pe=se[pe.toLowerCase()],!pe||!pe.href){var xe=ce[0].charAt(0);return{type:"text",raw:xe,text:xe}}var Pe=ae(ce,pe,ce[0]);return Pe}},me.strong=function(re,se,ce){ce===void 0&&(ce="");var pe=this.rules.inline.strong.start.exec(re);if(pe&&(!pe[1]||pe[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){se=se.slice(-1*re.length);var xe=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var Pe;(pe=xe.exec(se))!=null;)if(Pe=this.rules.inline.strong.middle.exec(se.slice(0,pe.index+3)),Pe)return{type:"strong",raw:re.slice(0,Pe[0].length),text:re.slice(2,Pe[0].length-2)}}},me.em=function(re,se,ce){ce===void 0&&(ce="");var pe=this.rules.inline.em.start.exec(re);if(pe&&(!pe[1]||pe[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){se=se.slice(-1*re.length);var xe=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var Pe;(pe=xe.exec(se))!=null;)if(Pe=this.rules.inline.em.middle.exec(se.slice(0,pe.index+2)),Pe)return{type:"em",raw:re.slice(0,Pe[0].length),text:re.slice(1,Pe[0].length-1)}}},me.codespan=function(re){var se=this.rules.inline.code.exec(re);if(se){var ce=se[2].replace(/\n/g," "),pe=/[^ ]/.test(ce),xe=ce.startsWith(" ")&&ce.endsWith(" ");return pe&&xe&&(ce=ce.substring(1,ce.length-1)),ce=Z(ce,!0),{type:"codespan",raw:se[0],text:ce}}},me.br=function(re){var se=this.rules.inline.br.exec(re);if(se)return{type:"br",raw:se[0]}},me.del=function(re){var se=this.rules.inline.del.exec(re);if(se)return{type:"del",raw:se[0],text:se[1]}},me.autolink=function(re,se){var ce=this.rules.inline.autolink.exec(re);if(ce){var pe,xe;return ce[2]==="@"?(pe=Z(this.options.mangle?se(ce[1]):ce[1]),xe="mailto:"+pe):(pe=Z(ce[1]),xe=pe),{type:"link",raw:ce[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},me.url=function(re,se){var ce;if(ce=this.rules.inline.url.exec(re)){var pe,xe;if(ce[2]==="@")pe=Z(this.options.mangle?se(ce[0]):ce[0]),xe="mailto:"+pe;else{var Pe;do Pe=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Pe!==ce[0]);pe=Z(ce[0]),ce[1]==="www."?xe="http://"+pe:xe=pe}return{type:"link",raw:ce[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},me.inlineText=function(re,se,ce){var pe=this.rules.inline.text.exec(re);if(pe){var xe;return se?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):Z(pe[0]):pe[0]:xe=Z(this.options.smartypants?ce(pe[0]):pe[0]),{type:"text",raw:pe[0],text:xe}}},Te}(),_e=U.noopTest,Se=U.edit,ve=U.merge,ue={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:_e,table:_e,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ue._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ue._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ue.def=Se(ue.def).replace("label",ue._label).replace("title",ue._title).getRegex(),ue.bullet=/(?:[*+-]|\d{1,9}[.)])/,ue.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ue.item=Se(ue.item,"gm").replace(/bull/g,ue.bullet).getRegex(),ue.list=Se(ue.list).replace(/bull/g,ue.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ue.def.source+")").getRegex(),ue._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",ue._comment=/<!--(?!-?>)[\s\S]*?-->/,ue.html=Se(ue.html,"i").replace("comment",ue._comment).replace("tag",ue._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ue.paragraph=Se(ue._paragraph).replace("hr",ue.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",ue._tag).getRegex(),ue.blockquote=Se(ue.blockquote).replace("paragraph",ue.paragraph).getRegex(),ue.normal=ve({},ue),ue.gfm=ve({},ue.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*|$)"}),ue.gfm.nptable=Se(ue.gfm.nptable).replace("hr",ue.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",ue._tag).getRegex(),ue.gfm.table=Se(ue.gfm.table).replace("hr",ue.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",ue._tag).getRegex(),ue.pedantic=ve({},ue.normal,{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ue._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:_e,paragraph:Se(ue.normal._paragraph).replace("hr",ue.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ue.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:_e,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:_e,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};le._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",le.punctuation=Se(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",le._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",le.em.start=Se(le.em.start).replace(/punctuation/g,le._punctuation).getRegex(),le.em.middle=Se(le.em.middle).replace(/punctuation/g,le._punctuation).replace(/overlapSkip/g,le._overlapSkip).getRegex(),le.em.endAst=Se(le.em.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.em.endUnd=Se(le.em.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.start=Se(le.strong.start).replace(/punctuation/g,le._punctuation).getRegex(),le.strong.middle=Se(le.strong.middle).replace(/punctuation/g,le._punctuation).replace(/blockSkip/g,le._blockSkip).getRegex(),le.strong.endAst=Se(le.strong.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.endUnd=Se(le.strong.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=Se(le._blockSkip,"g").getRegex(),le.overlapSkip=Se(le._overlapSkip,"g").getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._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])?)+(?![-_])/,le.autolink=Se(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=Se(le.tag).replace("comment",ue._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=Se(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=Se(le.reflink).replace("label",le._label).getRegex(),le.reflinkSearch=Se(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=ve({},le),le.pedantic=ve({},le.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:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=ve({},le.normal,{escape:Se(le.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),le.gfm.url=Se(le.gfm.url,"i").replace("email",le.gfm._extended_email).getRegex(),le.breaks=ve({},le.gfm,{br:Se(le.br).replace("{2,}","*").getRegex(),text:Se(le.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Oe={block:ue,inline:le},Ye=z.defaults,Ve=Oe.block,$e=Oe.inline;function Ze(Te){return Te.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Fe(Te){var me="",ge,re,se=Te.length;for(ge=0;ge<se;ge++)re=Te.charCodeAt(ge),Math.random()>.5&&(re="x"+re.toString(16)),me+="&#"+re+";";return me}var We=function(){function Te(ge){this.tokens=[],this.tokens.links=Object.create(null),this.options=ge||Ye,this.options.tokenizer=this.options.tokenizer||new fe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:Ve.normal,inline:$e.normal};this.options.pedantic?(re.block=Ve.pedantic,re.inline=$e.pedantic):this.options.gfm&&(re.block=Ve.gfm,this.options.breaks?re.inline=$e.breaks:re.inline=$e.gfm),this.tokenizer.rules=re}Te.lex=function(re,se){var ce=new Te(se);return ce.lex(re)};var me=Te.prototype;return me.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},me.blockTokens=function(re,se,ce){se===void 0&&(se=[]),ce===void 0&&(ce=!0),re=re.replace(/^ +$/gm,"");for(var pe,xe,Pe,Ke;re;){if(pe=this.tokenizer.space(re)){re=re.substring(pe.raw.length),pe.type&&se.push(pe);continue}if(pe=this.tokenizer.code(re,se)){re=re.substring(pe.raw.length),pe.type?se.push(pe):(Ke=se[se.length-1],Ke.raw+=`
|
|
`+pe.raw,Ke.text+=`
|
|
`+pe.text);continue}if(pe=this.tokenizer.fences(re)){re=re.substring(pe.raw.length),se.push(pe);continue}if(pe=this.tokenizer.heading(re)){re=re.substring(pe.raw.length),se.push(pe);continue}if(pe=this.tokenizer.nptable(re)){re=re.substring(pe.raw.length),se.push(pe);continue}if(pe=this.tokenizer.hr(re)){re=re.substring(pe.raw.length),se.push(pe);continue}if(pe=this.tokenizer.blockquote(re)){re=re.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],ce),se.push(pe);continue}if(pe=this.tokenizer.list(re)){for(re=re.substring(pe.raw.length),Pe=pe.items.length,xe=0;xe<Pe;xe++)pe.items[xe].tokens=this.blockTokens(pe.items[xe].text,[],!1);se.push(pe);continue}if(pe=this.tokenizer.html(re)){re=re.substring(pe.raw.length),se.push(pe);continue}if(ce&&(pe=this.tokenizer.def(re))){re=re.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(re)){re=re.substring(pe.raw.length),se.push(pe);continue}if(pe=this.tokenizer.lheading(re)){re=re.substring(pe.raw.length),se.push(pe);continue}if(ce&&(pe=this.tokenizer.paragraph(re))){re=re.substring(pe.raw.length),se.push(pe);continue}if(pe=this.tokenizer.text(re,se)){re=re.substring(pe.raw.length),pe.type?se.push(pe):(Ke=se[se.length-1],Ke.raw+=`
|
|
`+pe.raw,Ke.text+=`
|
|
`+pe.text);continue}if(re){var vt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(vt);break}else throw new Error(vt)}}return se},me.inline=function(re){var se,ce,pe,xe,Pe,Ke,vt=re.length;for(se=0;se<vt;se++){Ke=re[se];switch(Ke.type){case"paragraph":case"text":case"heading":{Ke.tokens=[],this.inlineTokens(Ke.text,Ke.tokens);break}case"table":{for(Ke.tokens={header:[],cells:[]},xe=Ke.header.length,ce=0;ce<xe;ce++)Ke.tokens.header[ce]=[],this.inlineTokens(Ke.header[ce],Ke.tokens.header[ce]);for(xe=Ke.cells.length,ce=0;ce<xe;ce++)for(Pe=Ke.cells[ce],Ke.tokens.cells[ce]=[],pe=0;pe<Pe.length;pe++)Ke.tokens.cells[ce][pe]=[],this.inlineTokens(Pe[pe],Ke.tokens.cells[ce][pe]);break}case"blockquote":{this.inline(Ke.tokens);break}case"list":{for(xe=Ke.items.length,ce=0;ce<xe;ce++)this.inline(Ke.items[ce].tokens);break}}}return re},me.inlineTokens=function(re,se,ce,pe,xe){se===void 0&&(se=[]),ce===void 0&&(ce=!1),pe===void 0&&(pe=!1),xe===void 0&&(xe="");var Pe,Ke=re,vt;if(this.tokens.links){var Ft=Object.keys(this.tokens.links);if(Ft.length>0)for(;(vt=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)Ft.includes(vt[0].slice(vt[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,vt.index)+"["+"a".repeat(vt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(vt=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,vt.index)+"["+"a".repeat(vt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Pe=this.tokenizer.escape(re)){re=re.substring(Pe.raw.length),se.push(Pe);continue}if(Pe=this.tokenizer.tag(re,ce,pe)){re=re.substring(Pe.raw.length),ce=Pe.inLink,pe=Pe.inRawBlock,se.push(Pe);continue}if(Pe=this.tokenizer.link(re)){re=re.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,pe)),se.push(Pe);continue}if(Pe=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,pe)),se.push(Pe);continue}if(Pe=this.tokenizer.strong(re,Ke,xe)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],ce,pe),se.push(Pe);continue}if(Pe=this.tokenizer.em(re,Ke,xe)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],ce,pe),se.push(Pe);continue}if(Pe=this.tokenizer.codespan(re)){re=re.substring(Pe.raw.length),se.push(Pe);continue}if(Pe=this.tokenizer.br(re)){re=re.substring(Pe.raw.length),se.push(Pe);continue}if(Pe=this.tokenizer.del(re)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],ce,pe),se.push(Pe);continue}if(Pe=this.tokenizer.autolink(re,Fe)){re=re.substring(Pe.raw.length),se.push(Pe);continue}if(!ce&&(Pe=this.tokenizer.url(re,Fe))){re=re.substring(Pe.raw.length),se.push(Pe);continue}if(Pe=this.tokenizer.inlineText(re,pe,Ze)){re=re.substring(Pe.raw.length),xe=Pe.raw.slice(-1),se.push(Pe);continue}if(re){var Dt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Dt);break}else throw new Error(Dt)}}return se},J(Te,null,[{key:"rules",get:function(){return{block:Ve,inline:$e}}}]),Te}(),qe=z.defaults,oe=U.cleanUrl,Ee=U.escape,Ce=function(){function Te(ge){this.options=ge||qe}var me=Te.prototype;return me.code=function(re,se,ce){var pe=(se||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(re,pe);xe!=null&&xe!==re&&(ce=!0,re=xe)}return pe?'<pre><code class="'+this.options.langPrefix+Ee(pe,!0)+'">'+(ce?re:Ee(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ce?re:Ee(re,!0))+`</code></pre>
|
|
`},me.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},me.html=function(re){return re},me.heading=function(re,se,ce,pe){return this.options.headerIds?"<h"+se+' id="'+this.options.headerPrefix+pe.slug(ce)+'">'+re+"</h"+se+`>
|
|
`:"<h"+se+">"+re+"</h"+se+`>
|
|
`},me.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},me.list=function(re,se,ce){var pe=se?"ol":"ul",xe=se&&ce!==1?' start="'+ce+'"':"";return"<"+pe+xe+`>
|
|
`+re+"</"+pe+`>
|
|
`},me.listitem=function(re){return"<li>"+re+`</li>
|
|
`},me.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},me.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},me.table=function(re,se){return se&&(se="<tbody>"+se+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+se+`</table>
|
|
`},me.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},me.tablecell=function(re,se){var ce=se.header?"th":"td",pe=se.align?"<"+ce+' align="'+se.align+'">':"<"+ce+">";return pe+re+"</"+ce+`>
|
|
`},me.strong=function(re){return"<strong>"+re+"</strong>"},me.em=function(re){return"<em>"+re+"</em>"},me.codespan=function(re){return"<code>"+re+"</code>"},me.br=function(){return this.options.xhtml?"<br/>":"<br>"},me.del=function(re){return"<del>"+re+"</del>"},me.link=function(re,se,ce){if(re=oe(this.options.sanitize,this.options.baseUrl,re),re===null)return ce;var pe='<a href="'+Ee(re)+'"';return se&&(pe+=' title="'+se+'"'),pe+=">"+ce+"</a>",pe},me.image=function(re,se,ce){if(re=oe(this.options.sanitize,this.options.baseUrl,re),re===null)return ce;var pe='<img src="'+re+'" alt="'+ce+'"';return se&&(pe+=' title="'+se+'"'),pe+=this.options.xhtml?"/>":">",pe},me.text=function(re){return re},Te}(),Ae=function(){function Te(){}var me=Te.prototype;return me.strong=function(re){return re},me.em=function(re){return re},me.codespan=function(re){return re},me.del=function(re){return re},me.html=function(re){return re},me.text=function(re){return re},me.link=function(re,se,ce){return""+ce},me.image=function(re,se,ce){return""+ce},me.br=function(){return""},Te}(),ze=function(){function Te(){this.seen={}}var me=Te.prototype;return me.slug=function(re){var se=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(se)){var ce=se;do this.seen[ce]++,se=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(se))}return this.seen[se]=0,se},Te}(),Je=z.defaults,tt=U.unescape,nt=function(){function Te(ge){this.options=ge||Je,this.options.renderer=this.options.renderer||new Ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ae,this.slugger=new ze}Te.parse=function(re,se){var ce=new Te(se);return ce.parse(re)};var me=Te.prototype;return me.parse=function(re,se){se===void 0&&(se=!0);var ce="",pe,xe,Pe,Ke,vt,Ft,Dt,Kt,ut,Be,kt,Ot,sn,qt,At,at,Ln,Le,vn=re.length;for(pe=0;pe<vn;pe++){Be=re[pe];switch(Be.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(Be.tokens),Be.depth,tt(this.parseInline(Be.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(Be.text,Be.lang,Be.escaped);continue}case"table":{for(Kt="",Dt="",Ke=Be.header.length,xe=0;xe<Ke;xe++)Dt+=this.renderer.tablecell(this.parseInline(Be.tokens.header[xe]),{header:!0,align:Be.align[xe]});for(Kt+=this.renderer.tablerow(Dt),ut="",Ke=Be.cells.length,xe=0;xe<Ke;xe++){for(Ft=Be.tokens.cells[xe],Dt="",vt=Ft.length,Pe=0;Pe<vt;Pe++)Dt+=this.renderer.tablecell(this.parseInline(Ft[Pe]),{header:!1,align:Be.align[Pe]});ut+=this.renderer.tablerow(Dt)}ce+=this.renderer.table(Kt,ut);continue}case"blockquote":{ut=this.parse(Be.tokens),ce+=this.renderer.blockquote(ut);continue}case"list":{for(kt=Be.ordered,Ot=Be.start,sn=Be.loose,Ke=Be.items.length,ut="",xe=0;xe<Ke;xe++)At=Be.items[xe],at=At.checked,Ln=At.task,qt="",At.task&&(Le=this.renderer.checkbox(at),sn?At.tokens.length>0&&At.tokens[0].type==="text"?(At.tokens[0].text=Le+" "+At.tokens[0].text,At.tokens[0].tokens&&At.tokens[0].tokens.length>0&&At.tokens[0].tokens[0].type==="text"&&(At.tokens[0].tokens[0].text=Le+" "+At.tokens[0].tokens[0].text)):At.tokens.unshift({type:"text",text:Le}):qt+=Le),qt+=this.parse(At.tokens,sn),ut+=this.renderer.listitem(qt,Ln,at);ce+=this.renderer.list(ut,kt,Ot);continue}case"html":{ce+=this.renderer.html(Be.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(Be.tokens));continue}case"text":{for(ut=Be.tokens?this.parseInline(Be.tokens):Be.text;pe+1<vn&&re[pe+1].type==="text";)Be=re[++pe],ut+=`
|
|
`+(Be.tokens?this.parseInline(Be.tokens):Be.text);ce+=se?this.renderer.paragraph(ut):ut;continue}default:{var yt='Token with "'+Be.type+'" type was not found.';if(this.options.silent){console.error(yt);return}else throw new Error(yt)}}}return ce},me.parseInline=function(re,se){se=se||this.renderer;var ce="",pe,xe,Pe=re.length;for(pe=0;pe<Pe;pe++){xe=re[pe];switch(xe.type){case"escape":{ce+=se.text(xe.text);break}case"html":{ce+=se.html(xe.text);break}case"link":{ce+=se.link(xe.href,xe.title,this.parseInline(xe.tokens,se));break}case"image":{ce+=se.image(xe.href,xe.title,xe.text);break}case"strong":{ce+=se.strong(this.parseInline(xe.tokens,se));break}case"em":{ce+=se.em(this.parseInline(xe.tokens,se));break}case"codespan":{ce+=se.codespan(xe.text);break}case"br":{ce+=se.br();break}case"del":{ce+=se.del(this.parseInline(xe.tokens,se));break}case"text":{ce+=se.text(xe.text);break}default:{var Ke='Token with "'+xe.type+'" type was not found.';if(this.options.silent){console.error(Ke);return}else throw new Error(Ke)}}}return ce},Te}(),ht=U.merge,it=U.checkSanitizeDeprecation,lt=U.escape,Me=z.getDefaults,Tt=z.changeDefaults,mt=z.defaults;function Ne(Te,me,ge){if(typeof Te=="undefined"||Te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Te)+", string expected");if(typeof me=="function"&&(ge=me,me=null),me=ht({},Ne.defaults,me||{}),it(me),ge){var re=me.highlight,se;try{se=We.lex(Te,me)}catch(Pe){return ge(Pe)}var ce=function(Ke){var vt;if(!Ke)try{vt=nt.parse(se,me)}catch(Ft){Ke=Ft}return me.highlight=re,Ke?ge(Ke):ge(null,vt)};if(!re||re.length<3)return ce();if(delete me.highlight,!se.length)return ce();var pe=0;Ne.walkTokens(se,function(Pe){Pe.type==="code"&&(pe++,setTimeout(function(){re(Pe.text,Pe.lang,function(Ke,vt){if(Ke)return ce(Ke);vt!=null&&vt!==Pe.text&&(Pe.text=vt,Pe.escaped=!0),pe--,pe===0&&ce()})},0))}),pe===0&&ce();return}try{var xe=We.lex(Te,me);return me.walkTokens&&Ne.walkTokens(xe,me.walkTokens),nt.parse(xe,me)}catch(Pe){if(Pe.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+lt(Pe.message+"",!0)+"</pre>";throw Pe}}Ne.options=Ne.setOptions=function(Te){return ht(Ne.defaults,Te),Tt(Ne.defaults),Ne},Ne.getDefaults=Me,Ne.defaults=mt,Ne.use=function(Te){var me=ht({},Te);if(Te.renderer&&function(){var re=Ne.defaults.renderer||new Ce,se=function(xe){var Pe=re[xe];re[xe]=function(){for(var Ke=arguments.length,vt=new Array(Ke),Ft=0;Ft<Ke;Ft++)vt[Ft]=arguments[Ft];var Dt=Te.renderer[xe].apply(re,vt);return Dt===!1&&(Dt=Pe.apply(re,vt)),Dt}};for(var ce in Te.renderer)se(ce);me.renderer=re}(),Te.tokenizer&&function(){var re=Ne.defaults.tokenizer||new fe,se=function(xe){var Pe=re[xe];re[xe]=function(){for(var Ke=arguments.length,vt=new Array(Ke),Ft=0;Ft<Ke;Ft++)vt[Ft]=arguments[Ft];var Dt=Te.tokenizer[xe].apply(re,vt);return Dt===!1&&(Dt=Pe.apply(re,vt)),Dt}};for(var ce in Te.tokenizer)se(ce);me.tokenizer=re}(),Te.walkTokens){var ge=Ne.defaults.walkTokens;me.walkTokens=function(re){Te.walkTokens(re),ge&&ge(re)}}Ne.setOptions(me)},Ne.walkTokens=function(Te,me){for(var ge=j(Te),re;!(re=ge()).done;){var se=re.value;me(se);switch(se.type){case"table":{for(var ce=j(se.tokens.header),pe;!(pe=ce()).done;){var xe=pe.value;Ne.walkTokens(xe,me)}for(var Pe=j(se.tokens.cells),Ke;!(Ke=Pe()).done;)for(var vt=Ke.value,Ft=j(vt),Dt;!(Dt=Ft()).done;){var Kt=Dt.value;Ne.walkTokens(Kt,me)}break}case"list":{Ne.walkTokens(se.items,me);break}default:se.tokens&&Ne.walkTokens(se.tokens,me)}}},Ne.Parser=nt,Ne.parser=nt.parse,Ne.Renderer=Ce,Ne.TextRenderer=Ae,Ne.Lexer=We,Ne.lexer=We.lex,Ne.Tokenizer=fe,Ne.Slugger=ze,Ne.parse=Ne;var He=Ne;return He})},ELLl:function(dt,be,$){(function(ie){ie($("VrN/"))})(function(ie){var J={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},k=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(d,p,l){l&&l!=ie.Init&&(d.removeKeyMap(j),d.state.closeBrackets=null),p&&(B(Y(p,"pairs")),d.state.closeBrackets=p,d.addKeyMap(j))});function Y(d,p){return p=="pairs"&&typeof d=="string"?d:typeof d=="object"&&d[p]!=null?d[p]:J[p]}var j={Backspace:n,Enter:D};function B(d){for(var p=0;p<d.length;p++){var l=d.charAt(p),h="'"+l+"'";j[h]||(j[h]=z(l))}}B(J.pairs+"`");function z(d){return function(p){return g(p,d)}}function G(d){var p=d.state.closeBrackets;if(!p||p.override)return p;var l=d.getModeAt(d.getCursor());return l.closeBrackets||p}function n(d){var p=G(d);if(!p||d.getOption("disableInput"))return ie.Pass;for(var l=Y(p,"pairs"),h=d.listSelections(),o=0;o<h.length;o++){if(!h[o].empty())return ie.Pass;var s=m(d,h[o].head);if(!s||l.indexOf(s)%2!=0)return ie.Pass}for(var o=h.length-1;o>=0;o--){var R=h[o].head;d.replaceRange("",k(R.line,R.ch-1),k(R.line,R.ch+1),"+delete")}}function D(d){var p=G(d),l=p&&Y(p,"explode");if(!l||d.getOption("disableInput"))return ie.Pass;for(var h=d.listSelections(),o=0;o<h.length;o++){if(!h[o].empty())return ie.Pass;var s=m(d,h[o].head);if(!s||l.indexOf(s)%2!=0)return ie.Pass}d.operation(function(){var R=d.lineSeparator()||`
|
|
`;d.replaceSelection(R+R,null),d.execCommand("goCharLeft"),h=d.listSelections();for(var x=0;x<h.length;x++){var C=h[x].head.line;d.indentLine(C,null,!0),d.indentLine(C+1,null,!0)}})}function y(d){var p=ie.cmpPos(d.anchor,d.head)>0;return{anchor:new k(d.anchor.line,d.anchor.ch+(p?-1:1)),head:new k(d.head.line,d.head.ch+(p?1:-1))}}function g(d,p){var l=G(d);if(!l||d.getOption("disableInput"))return ie.Pass;var h=Y(l,"pairs"),o=h.indexOf(p);if(o==-1)return ie.Pass;for(var s=Y(l,"closeBefore"),R=Y(l,"triples"),x=h.charAt(o+1)==p,C=d.listSelections(),L=o%2==0,O,A=0;A<C.length;A++){var w=C[A],b=w.head,u,v=d.getRange(b,k(b.line,b.ch+1));if(L&&!w.empty())u="surround";else if((x||!L)&&v==p)x&&c(d,b)?u="both":R.indexOf(p)>=0&&d.getRange(b,k(b.line,b.ch+3))==p+p+p?u="skipThree":u="skip";else if(x&&b.ch>1&&R.indexOf(p)>=0&&d.getRange(k(b.line,b.ch-2),b)==p+p){if(b.ch>2&&/\bstring/.test(d.getTokenTypeAt(k(b.line,b.ch-2))))return ie.Pass;u="addFour"}else if(x){var a=b.ch==0?" ":d.getRange(k(b.line,b.ch-1),b);if(!ie.isWordChar(v)&&a!=p&&!ie.isWordChar(a))u="both";else return ie.Pass}else if(L&&(v.length===0||/\s/.test(v)||s.indexOf(v)>-1))u="both";else return ie.Pass;if(!O)O=u;else if(O!=u)return ie.Pass}var _=o%2?h.charAt(o-1):p,N=o%2?p:h.charAt(o+1);d.operation(function(){if(O=="skip")d.execCommand("goCharRight");else if(O=="skipThree")for(var F=0;F<3;F++)d.execCommand("goCharRight");else if(O=="surround"){for(var S=d.getSelections(),F=0;F<S.length;F++)S[F]=_+S[F]+N;d.replaceSelections(S,"around"),S=d.listSelections().slice();for(var F=0;F<S.length;F++)S[F]=y(S[F]);d.setSelections(S)}else O=="both"?(d.replaceSelection(_+N,null),d.triggerElectric(_+N),d.execCommand("goCharLeft")):O=="addFour"&&(d.replaceSelection(_+_+_+_,"before"),d.execCommand("goCharRight"))})}function m(d,p){var l=d.getRange(k(p.line,p.ch-1),k(p.line,p.ch+1));return l.length==2?l:null}function c(d,p){var l=d.getTokenAt(k(p.line,p.ch+1));return/\bstring/.test(l.type)&&l.start==p.ch&&(p.ch==0||!/\bstring/.test(d.getTokenTypeAt(p)))}})},FWmy:function(dt,be,$){"use strict";$.d(be,"a",function(){return ie});function ie(J,k){if(!J)throw new Error(k?`Assertion failed (${k})`:"Assertion Failed")}},HmJG:function(dt,be,$){},JYp7:function(dt,be,$){"use strict";$.d(be,"a",function(){return ie});var ie;(function(J){function k(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}J.is=k;const Y=Object.freeze([]);function j(){return Y}J.empty=j;function*B(s){yield s}J.single=B;function z(s){return s||Y}J.from=z;function G(s){return!s||s[Symbol.iterator]().next().done===!0}J.isEmpty=G;function n(s){return s[Symbol.iterator]().next().value}J.first=n;function D(s,R){for(const x of s)if(R(x))return!0;return!1}J.some=D;function y(s,R){for(const x of s)if(R(x))return x;return}J.find=y;function*g(s,R){for(const x of s)R(x)&&(yield x)}J.filter=g;function*m(s,R){let x=0;for(const C of s)yield R(C,x++)}J.map=m;function*c(...s){for(const R of s)for(const x of R)yield x}J.concat=c;function*d(s){for(const R of s)for(const x of R)yield x}J.concatNested=d;function p(s,R,x){let C=x;for(const L of s)C=R(C,L);return C}J.reduce=p;function*l(s,R,x=s.length){for(R<0&&(R+=s.length),x<0?x+=s.length:x>s.length&&(x=s.length);R<x;R++)yield s[R]}J.slice=l;function h(s,R=Number.POSITIVE_INFINITY){const x=[];if(R===0)return[x,s];const C=s[Symbol.iterator]();for(let L=0;L<R;L++){const O=C.next();if(O.done)return[x,J.empty()];x.push(O.value)}return[x,{[Symbol.iterator](){return C}}]}J.consume=h;function o(s,R,x=(C,L)=>C===L){const C=s[Symbol.iterator](),L=R[Symbol.iterator]();for(;;){const O=C.next(),A=L.next();if(O.done!==A.done)return!1;if(O.done)return!0;if(!x(O.value,A.value))return!1}}J.equals=o})(ie||(ie={}))},LdHM:function(dt,be,$){"use strict";$.d(be,"b",function(){return s}),$.d(be,"a",function(){return x});var ie=$("1OyB"),J=$("vuIU"),k=$("Ji7U"),Y=$("LK+K"),j=$("q1tI"),B=$("rePB"),z=$("Ff2n"),G=$("ODXe"),n=$("4IlW"),D=$("bX4T"),y=$("YrtM"),g=$("TSYQ"),m=$.n(g),c=$("+nKL"),d=$("8OUc"),p=function(W,Z){var ne=W.prefixCls,ae=W.id,we=W.flattenOptions,fe=W.childrenAsData,_e=W.values,Se=W.searchValue,ve=W.multiple,ue=W.defaultActiveFirstOption,le=W.height,Oe=W.itemHeight,Ye=W.notFoundContent,Ve=W.open,$e=W.menuItemSelectedIcon,Ze=W.virtual,Fe=W.onSelect,We=W.onToggleOpen,qe=W.onActiveValue,oe=W.onScroll,Ee=W.onMouseEnter,Ce="".concat(ne,"-item"),Ae=Object(y.a)(function(){return we},[Ve,we],function(He,Te){return Te[0]&&He[1]!==Te[1]}),ze=j.useRef(null),Je=function(Te){Te.preventDefault()},tt=function(Te){ze.current&&ze.current.scrollTo({index:Te})},nt=function(Te){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ge=Ae.length,re=0;re<ge;re+=1){var se=(Te+re*me+ge)%ge,ce=Ae[se],pe=ce.group,xe=ce.data;if(!pe&&!xe.disabled)return se}return-1},ht=j.useState(function(){return nt(0)}),it=Object(G.a)(ht,2),lt=it[0],Me=it[1],Tt=function(Te){Me(Te);var me=Ae[Te];if(!me){qe(null,-1);return}qe(me.data.value,Te)};j.useEffect(function(){Tt(ue!==!1?nt(0):-1)},[Ae.length,Se]),j.useEffect(function(){var He=setTimeout(function(){if(!ve&&Ve&&_e.size===1){var Te=Array.from(_e)[0],me=Ae.findIndex(function(ge){var re=ge.data;return re.value===Te});Tt(me),tt(me)}});return function(){return clearTimeout(He)}},[Ve]);var mt=function(Te){Te!==void 0&&Fe(Te,{selected:!_e.has(Te)}),ve||We(!1)};if(j.useImperativeHandle(Z,function(){return{onKeyDown:function(Te){var me=Te.which;switch(me){case n.a.UP:case n.a.DOWN:{var ge=0;if(me===n.a.UP?ge=-1:me===n.a.DOWN&&(ge=1),ge!==0){var re=nt(lt+ge,ge);tt(re),Tt(re)}break}case n.a.ENTER:{var se=Ae[lt];se&&!se.data.disabled?mt(se.data.value):mt(void 0),Ve&&Te.preventDefault();break}case n.a.ESC:We(!1)}},onKeyUp:function(){},scrollTo:function(Te){tt(Te)}}}),Ae.length===0)return j.createElement("div",{role:"listbox",id:"".concat(ae,"_list"),className:"".concat(Ce,"-empty"),onMouseDown:Je},Ye);function Ne(He){var Te=Ae[He];if(!Te)return null;var me=Te.data||{},ge=me.value,re=me.label,se=me.children,ce=Object(D.a)(me,!0),pe=fe?se:re;return Te?j.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},ce,{key:He,role:"option",id:"".concat(ae,"_list_").concat(He),"aria-selected":_e.has(ge)}),ge):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(ae,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ne(lt-1),Ne(lt),Ne(lt+1)),j.createElement(c.a,{itemKey:"key",ref:ze,data:Ae,height:le,itemHeight:Oe,fullHeight:!1,onMouseDown:Je,onScroll:oe,virtual:Ze,onMouseEnter:Ee},function(He,Te){var me,ge=He.group,re=He.groupOption,se=He.data,ce=se.label,pe=se.key;if(ge)return j.createElement("div",{className:m()(Ce,"".concat(Ce,"-group"))},ce!==void 0?ce:pe);var xe=se.disabled,Pe=se.value,Ke=se.title,vt=se.children,Ft=se.style,Dt=se.className,Kt=Object(z.a)(se,["disabled","value","title","children","style","className"]),ut=_e.has(Pe),Be="".concat(Ce,"-option"),kt=m()(Ce,Be,Dt,(me={},Object(B.a)(me,"".concat(Be,"-grouped"),re),Object(B.a)(me,"".concat(Be,"-active"),lt===Te&&!xe),Object(B.a)(me,"".concat(Be,"-disabled"),xe),Object(B.a)(me,"".concat(Be,"-selected"),ut),me)),Ot=fe?vt:ce,sn=!$e||typeof $e=="function"||ut;return j.createElement("div",Object.assign({},Kt,{"aria-selected":ut,className:kt,title:Ke,onMouseMove:function(){if(lt===Te||xe)return;Tt(Te)},onClick:function(){xe||mt(Pe)},style:Ft}),j.createElement("div",{className:"".concat(Be,"-content")},Ot||Pe),j.isValidElement($e)||ut,sn&&j.createElement(d.a,{className:"".concat(Ce,"-option-state"),customizeIcon:$e,customizeIconProps:{isSelected:ut}},ut?"\u2713":null))}))},l=j.forwardRef(p);l.displayName="OptionList";var h=l,o=function(){return null};o.isSelectOption=!0;var s=o,R=function(){return null};R.isSelectOptGroup=!0;var x=R,C=$("VTBJ"),L=$("Zm9Q");function O(E){var W=E.key,Z=E.props,ne=Z.children,ae=Z.value,we=Object(z.a)(Z,["children","value"]);return Object(C.a)({key:W,value:ae!==void 0?ae:W,children:ne},we)}function A(E){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(E).map(function(Z,ne){if(!j.isValidElement(Z)||!Z.type)return null;var ae=Z.type.isSelectOptGroup,we=Z.key,fe=Z.props,_e=fe.children,Se=Object(z.a)(fe,["children"]);return W||!ae?O(Z):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat(we===null?ne:we,"__"),label:we},Se),{},{options:A(_e)})}).filter(function(Z){return Z})}var w=$("2Qr1"),b=$("qNPg"),u=$("U8pU"),v=$("Kwbf"),a=$("WKfj");function _(E){var W=E.mode,Z=E.options,ne=E.children,ae=E.backfill,we=E.allowClear,fe=E.placeholder,_e=E.getInputElement,Se=E.showSearch,ve=E.onSearch,ue=E.defaultOpen,le=E.autoFocus,Oe=E.labelInValue,Ye=E.value,Ve=E.inputValue,$e=E.optionLabelProp,Ze=W==="multiple"||W==="tags",Fe=Se!==void 0?Se:Ze||W==="combobox",We=Z||A(ne);if(Object(v.a)(W!=="tags"||We.every(function(Ce){return!Ce.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var qe=We.some(function(Ce){return Ce.options?Ce.options.some(function(Ae){return typeof("value"in Ae?Ae.value:Ae.key)=="number"}):typeof("value"in Ce?Ce.value:Ce.key)=="number"});Object(v.a)(!qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(W!=="combobox"||!$e,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(W==="combobox"||!ae,"`backfill` only works with `combobox` mode."),Object(v.a)(W==="combobox"||!_e,"`getInputElement` only work with `combobox` mode."),Object(v.b)(W!=="combobox"||!_e||!we||!fe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ve&&!Fe&&W!=="combobox"&&W!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!ue||le,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ye!=null){var oe=Object(a.d)(Ye);Object(v.a)(!Oe||oe.every(function(Ce){return Object(u.a)(Ce)==="object"&&("key"in Ce||"value"in Ce)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!Ze||Array.isArray(Ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var Ee=null;Object(L.a)(ne).some(function(Ce){if(!j.isValidElement(Ce)||!Ce.type)return!1;var Ae=Ce.type;if(Ae.isSelectOption)return!1;if(Ae.isSelectOptGroup){var ze=Object(L.a)(Ce.props.children).every(function(Je){return!j.isValidElement(Je)||!Ce.type||Je.type.isSelectOption?!0:(Ee=Je.type,!1)});return!ze}return Ee=Ae,!0}),Ee&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ee.displayName||Ee.name||Ee,"`.")),Object(v.a)(Ve===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=_,F=Object(b.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:A,flattenOptions:w.d,getLabeledValue:w.e,filterOptions:w.b,isValueDisabled:w.g,findValueOption:w.c,warningProps:N,fillOptionsWithMissingValue:w.a}),S=function(E){Object(k.a)(Z,E);var W=Object(Y.a)(Z);function Z(){var ne;return Object(ie.a)(this,Z),ne=W.apply(this,arguments),ne.selectRef=j.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(J.a)(Z,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Z}(j.Component);S.Option=s,S.OptGroup=x;var U=S,M=be.c=U},LuLp:function(dt,be,$){dt.exports={flex_box_center:"flex_box_center___4bUZY",flex_space_between:"flex_space_between___1xTjN",flex_box_vertical_center:"flex_box_vertical_center___1vgGz",flex_box_center_end:"flex_box_center_end___P7hNa",flex_box_column:"flex_box_column___2sxpi",wrap:"wrap___lYrXF",modal:"modal___jAVte",titleWrap:"titleWrap___3ZYOv",required:"required___TyqrE",title:"title___YHdJB",colorGray:"colorGray___QPU3J",choiceWrap:"choiceWrap___3fip5",answer:"answer___1b5_q",activeAnswer:"activeAnswer___3IKUq",deleteIcon:"deleteIcon___dg_3n",addIcon:"addIcon___3bFJA",editorWrap:"editorWrap___xeZgL",htmlWrap:"htmlWrap___1-J33",radio:"radio___14ZC8",color333:"color333___2Hi7e",color999:"color999___wFMNh",questionType:"questionType___2DcP-",questionChoices:"questionChoices___1QDDn"}},M8RZ:function(dt,be,$){"use strict";$.d(be,"a",function(){return n});var ie=$("fWQN"),J=$("mtLc"),k=$("yKVA"),Y=$("879j"),j=$("q1tI"),B=$.n(j),z=$("i8i4"),G=$.n(z),n=function(D){Object(k.a)(g,D);var y=Object(Y.a)(g);function g(m){var c;Object(ie.a)(this,g),c=y.call(this,m);var d=window.document;return c.node=d.createElement("div"),d.body.appendChild(c.node),c}return Object(J.a)(g,[{key:"render",value:function(){var c=this.props.children;return Object(z.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(B.a.Component)},MI8n:function(dt,be,$){"use strict";$.d(be,"c",function(){return j}),$.d(be,"b",function(){return n}),$.d(be,"e",function(){return D}),$.d(be,"a",function(){return y}),$.d(be,"d",function(){return g}),$.d(be,"f",function(){return m});var ie=$("/cxE"),J=$("pmY6"),k=$("24hK"),Y=$("5Y4S"),j;(function(c){c.None=()=>J.a.None;function d(_){return(N,F=null,S)=>{let U=!1,M;return M=_(E=>U?void 0:(M?M.dispose():U=!0,N.call(F,E)),null,S),U&&M.dispose(),M}}c.once=d;function p(_,N){return x((F,S=null,U)=>_(M=>F.call(S,N(M)),null,U))}c.map=p;function l(_,N){return x((F,S=null,U)=>_(M=>{N(M),F.call(S,M)},null,U))}c.forEach=l;function h(_,N){return x((F,S=null,U)=>_(M=>N(M)&&F.call(S,M),null,U))}c.filter=h;function o(_){return _}c.signal=o;function s(..._){return(N,F=null,S)=>Object(J.e)(..._.map(U=>U(M=>N.call(F,M),null,S)))}c.any=s;function R(_,N,F){let S=F;return p(_,U=>(S=N(S,U),S))}c.reduce=R;function x(_){let N;const F=new n({onFirstListenerAdd(){N=_(F.fire,F)},onLastListenerRemove(){N.dispose()}});return F.event}function C(_,N,F=100,S=!1,U){let M,E,W,Z=0;const ne=new n({leakWarningThreshold:U,onFirstListenerAdd(){M=_(ae=>{Z++,E=N(E,ae),S&&!W&&(ne.fire(E),E=void 0),clearTimeout(W),W=setTimeout(()=>{const we=E;E=void 0,W=void 0,(!S||Z>1)&&ne.fire(we),Z=0},F)})},onLastListenerRemove(){M.dispose()}});return ne.event}c.debounce=C;function L(_,N=(F,S)=>F===S){let F=!0,S;return h(_,U=>{const M=F||!N(U,S);return F=!1,S=U,M})}c.latch=L;function O(_,N){return[c.filter(_,N),c.filter(_,F=>!N(F))]}c.split=O;function A(_,N=!1,F=[]){let S=F.slice(),U=_(W=>{S?S.push(W):E.fire(W)});const M=()=>{S&&S.forEach(W=>E.fire(W)),S=null},E=new n({onFirstListenerAdd(){U||(U=_(W=>E.fire(W)))},onFirstListenerDidAdd(){S&&(N?setTimeout(M):M())},onLastListenerRemove(){U&&U.dispose(),U=null}});return E.event}c.buffer=A;class w{constructor(_){this.event=_}map(_){return new w(p(this.event,_))}forEach(_){return new w(l(this.event,_))}filter(_){return new w(h(this.event,_))}reduce(_,N){return new w(R(this.event,_,N))}latch(){return new w(L(this.event))}debounce(_,N=100,F=!1,S){return new w(C(this.event,_,N,F,S))}on(_,N,F){return this.event(_,N,F)}once(_,N,F){return d(this.event)(_,N,F)}}function b(_){return new w(_)}c.chain=b;function u(_,N,F=S=>S){const S=(...W)=>E.fire(F(...W)),U=()=>_.on(N,S),M=()=>_.removeListener(N,S),E=new n({onFirstListenerAdd:U,onLastListenerRemove:M});return E.event}c.fromNodeEventEmitter=u;function v(_,N,F=S=>S){const S=(...W)=>E.fire(F(...W)),U=()=>_.addEventListener(N,S),M=()=>_.removeEventListener(N,S),E=new n({onFirstListenerAdd:U,onLastListenerRemove:M});return E.event}c.fromDOMEventEmitter=v;function a(_){return new Promise(N=>d(_)(N))}c.toPromise=a})(j||(j={}));class B{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${B._idPool++}`}start(c){this._stopWatch=new Y.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}}}B._idPool=0;let z=-1;class G{constructor(c,d=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=d,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let d=z;if(typeof this.customThreshold=="number"&&(d=this.customThreshold),d<=0||c<d)return;this._stacks||(this._stacks=new Map);const p=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),l=this._stacks.get(p)||0;if(this._stacks.set(p,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=d*.5;let h,o=0;for(const[s,R]of this._stacks)(!h||o<R)&&(h=s,o=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${o}):`),console.warn(h)}return()=>{const h=this._stacks.get(p)||0;this._stacks.set(p,h-1)}}}class n{constructor(c){var d;this._disposed=!1,this._options=c,this._leakageMon=z>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((d=this._options)===null||d===void 0?void 0:d._profName)?new B(this._options._profName):void 0}get event(){return this._event||(this._event=(c,d,p)=>{var l;this._listeners||(this._listeners=new k.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(d?[c,d]:c);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,d);const s=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),R=Object(J.i)(()=>{if(s&&s(),!this._disposed&&(o(),this._options&&this._options.onLastListenerRemove)){const x=this._listeners&&!this._listeners.isEmpty();x||this._options.onLastListenerRemove(this)}});return p instanceof J.b?p.add(R):Array.isArray(p)&&p.push(R),R}),this._event}fire(c){var d,p;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new k.a);for(let l of this._listeners)this._deliveryQueue.push([l,c]);for((d=this._perfMon)===null||d===void 0||d.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,h]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,h):l[0].call(l[1],h)}catch(o){Object(ie.f)(o)}}(p=this._perfMon)===null||p===void 0||p.stop()}}dispose(){var c,d,p,l,h;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(d=this._deliveryQueue)===null||d===void 0||d.clear(),(l=(p=this._options)===null||p===void 0?void 0:p.onLastListenerRemove)===null||l===void 0||l.call(p),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class D extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new k.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 d;super(c);this._delay=(d=c.delay)!==null&&d!==void 0?d: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(d,p,l)=>c(h=>{const o=this.buffers[this.buffers.length-1];o?o.push(()=>d.call(p,h)):d.call(p,h)},void 0,l)}bufferEvents(c){const d=[];this.buffers.push(d);const p=c();return this.buffers.pop(),d.forEach(l=>l()),p}}class m{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.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(dt,be,$){"use strict";(function(ie,J){$.d(be,"b",function(){return p}),$.d(be,"i",function(){return s}),$.d(be,"f",function(){return R}),$.d(be,"d",function(){return x}),$.d(be,"g",function(){return C}),$.d(be,"h",function(){return L}),$.d(be,"c",function(){return O}),$.d(be,"k",function(){return A}),$.d(be,"j",function(){return w}),$.d(be,"a",function(){return b}),$.d(be,"e",function(){return a});var k;const Y="en";let j=!1,B=!1,z=!1,G=!1,n=!1,D=!1,y=!1,g,m=Y,c,d;const p=typeof self=="object"?self:typeof ie=="object"?ie:{};let l;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?l=p.vscode.process:typeof J!="undefined"&&(l=J);const h=typeof((k=l==null?void 0:l.versions)===null||k===void 0?void 0:k.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!h)d=navigator.userAgent,j=d.indexOf("Windows")>=0,B=d.indexOf("Macintosh")>=0,y=(d.indexOf("Macintosh")>=0||d.indexOf("iPad")>=0||d.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,z=d.indexOf("Linux")>=0,D=!0,g=navigator.language,m=g;else if(typeof l=="object"){j=l.platform==="win32",B=l.platform==="darwin",z=l.platform==="linux",G=z&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,g=Y,m=Y;const _=l.env.VSCODE_NLS_CONFIG;if(_)try{const N=JSON.parse(_),F=N.availableLanguages["*"];g=N.locale,m=F||Y,c=N._translationsConfigFile}catch(N){}n=!0}else console.error("Unable to resolve platform.");let o=0;B?o=1:j?o=3:z&&(o=2);const s=j,R=B,x=z,C=n,L=D,O=y,A=d,w=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let F=[];p.addEventListener("message",U=>{if(U.data&&U.data.vscodeSetImmediateId)for(let M=0,E=F.length;M<E;M++){const W=F[M];if(W.id===U.data.vscodeSetImmediateId){F.splice(M,1),W.callback();return}}});let S=0;return U=>{const M=++S;F.push({id:M,callback:U}),p.postMessage({vscodeSetImmediateId:M},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const N=Promise.resolve();return F=>N.then(F)}(),b=B||y?2:j?1:3;let u=!0,v=!1;function a(){if(!v){v=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const N=new Uint16Array(_.buffer);u=N[0]===(2<<8)+1}return u}}).call(this,$("IyRk"),$("Q2Ig"))},N0LK:function(dt,be,$){"use strict";$.d(be,"C",function(){return ie}),$.d(be,"v",function(){return k}),$.d(be,"s",function(){return Y}),$.d(be,"t",function(){return j}),$.d(be,"U",function(){return B}),$.d(be,"J",function(){return z}),$.d(be,"O",function(){return G}),$.d(be,"p",function(){return n}),$.d(be,"T",function(){return D}),$.d(be,"q",function(){return y}),$.d(be,"N",function(){return g}),$.d(be,"M",function(){return m}),$.d(be,"Q",function(){return c}),$.d(be,"u",function(){return d}),$.d(be,"x",function(){return p}),$.d(be,"I",function(){return l}),$.d(be,"f",function(){return h}),$.d(be,"h",function(){return o}),$.d(be,"g",function(){return s}),$.d(be,"i",function(){return R}),$.d(be,"G",function(){return x}),$.d(be,"H",function(){return C}),$.d(be,"r",function(){return L}),$.d(be,"R",function(){return O}),$.d(be,"d",function(){return A}),$.d(be,"e",function(){return w}),$.d(be,"E",function(){return b}),$.d(be,"F",function(){return u}),$.d(be,"j",function(){return v}),$.d(be,"z",function(){return a}),$.d(be,"K",function(){return N}),$.d(be,"L",function(){return F}),$.d(be,"m",function(){return U}),$.d(be,"k",function(){return E}),$.d(be,"A",function(){return Z}),$.d(be,"a",function(){return ne}),$.d(be,"n",function(){return ae}),$.d(be,"l",function(){return we}),$.d(be,"D",function(){return fe}),$.d(be,"B",function(){return _e}),$.d(be,"b",function(){return Se}),$.d(be,"S",function(){return ve}),$.d(be,"o",function(){return ue}),$.d(be,"P",function(){return le}),$.d(be,"w",function(){return Oe}),$.d(be,"c",function(){return Ye}),$.d(be,"y",function(){return Ze});function ie(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const J=/{(\d+)}/g;function k(oe,...Ee){return Ee.length===0?oe:oe.replace(J,function(Ce,Ae){const ze=parseInt(Ae,10);return isNaN(ze)||ze<0||ze>=Ee.length?Ce:Ee[ze]})}function Y(oe){return oe.replace(/[<>&]/g,function(Ee){switch(Ee){case"<":return"<";case">":return">";case"&":return"&";default:return Ee}})}function j(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function B(oe,Ee=" "){const Ce=z(oe,Ee);return G(Ce,Ee)}function z(oe,Ee){if(!oe||!Ee)return oe;const Ce=Ee.length;if(Ce===0||oe.length===0)return oe;let Ae=0;for(;oe.indexOf(Ee,Ae)===Ae;)Ae=Ae+Ce;return oe.substring(Ae)}function G(oe,Ee){if(!oe||!Ee)return oe;const Ce=Ee.length,Ae=oe.length;if(Ce===0||Ae===0)return oe;let ze=Ae,Je=-1;for(;!(Je=oe.lastIndexOf(Ee,ze-1),Je===-1||Je+Ce!==ze);){if(Je===0)return"";ze=Je}return oe.substring(0,ze)}function n(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(oe){return oe.replace(/\*/g,"")}function y(oe,Ee,Ce={}){if(!oe)throw new Error("Cannot create regex from empty string");Ee||(oe=j(oe)),Ce.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let Ae="";return Ce.global&&(Ae+="g"),Ce.matchCase||(Ae+="i"),Ce.multiline&&(Ae+="m"),Ce.unicode&&(Ae+="u"),new RegExp(oe,Ae)}function g(oe){if(oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$")return!1;const Ee=oe.exec("");return!!(Ee&&oe.lastIndex===0)}function m(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function c(oe){return oe.split(/\r\n|\r|\n/)}function d(oe){for(let Ee=0,Ce=oe.length;Ee<Ce;Ee++){const Ae=oe.charCodeAt(Ee);if(Ae!==32&&Ae!==9)return Ee}return-1}function p(oe,Ee=0,Ce=oe.length){for(let Ae=Ee;Ae<Ce;Ae++){const ze=oe.charCodeAt(Ae);if(ze!==32&&ze!==9)return oe.substring(Ee,Ae)}return oe.substring(Ee,Ce)}function l(oe,Ee=oe.length-1){for(let Ce=Ee;Ce>=0;Ce--){const Ae=oe.charCodeAt(Ce);if(Ae!==32&&Ae!==9)return Ce}return-1}function h(oe,Ee){return oe<Ee?-1:oe>Ee?1:0}function o(oe,Ee,Ce=0,Ae=oe.length,ze=0,Je=Ee.length){for(;Ce<Ae&&ze<Je;Ce++,ze++){let ht=oe.charCodeAt(Ce),it=Ee.charCodeAt(ze);if(ht<it)return-1;if(ht>it)return 1}const tt=Ae-Ce,nt=Je-ze;return tt<nt?-1:tt>nt?1:0}function s(oe,Ee){return R(oe,Ee,0,oe.length,0,Ee.length)}function R(oe,Ee,Ce=0,Ae=oe.length,ze=0,Je=Ee.length){for(;Ce<Ae&&ze<Je;Ce++,ze++){let ht=oe.charCodeAt(Ce),it=Ee.charCodeAt(ze);if(ht===it)continue;if(ht>=128||it>=128)return o(oe.toLowerCase(),Ee.toLowerCase(),Ce,Ae,ze,Je);x(ht)&&(ht-=32),x(it)&&(it-=32);const lt=ht-it;if(lt===0)continue;return lt}const tt=Ae-Ce,nt=Je-ze;return tt<nt?-1:tt>nt?1:0}function x(oe){return oe>=97&&oe<=122}function C(oe){return oe>=65&&oe<=90}function L(oe,Ee){return oe.length===Ee.length&&R(oe,Ee)===0}function O(oe,Ee){const Ce=Ee.length;return Ee.length>oe.length?!1:R(oe,Ee,0,Ce)===0}function A(oe,Ee){let Ce,Ae=Math.min(oe.length,Ee.length);for(Ce=0;Ce<Ae;Ce++)if(oe.charCodeAt(Ce)!==Ee.charCodeAt(Ce))return Ce;return Ae}function w(oe,Ee){let Ce,Ae=Math.min(oe.length,Ee.length);const ze=oe.length-1,Je=Ee.length-1;for(Ce=0;Ce<Ae;Ce++)if(oe.charCodeAt(ze-Ce)!==Ee.charCodeAt(Je-Ce))return Ce;return Ae}function b(oe){return 55296<=oe&&oe<=56319}function u(oe){return 56320<=oe&&oe<=57343}function v(oe,Ee){return(oe-55296<<10)+(Ee-56320)+65536}function a(oe,Ee,Ce){const Ae=oe.charCodeAt(Ce);if(b(Ae)&&Ce+1<Ee){const ze=oe.charCodeAt(Ce+1);if(u(ze))return v(Ae,ze)}return Ae}function _(oe,Ee){const Ce=oe.charCodeAt(Ee-1);if(u(Ce)&&Ee>1){const Ae=oe.charCodeAt(Ee-2);if(b(Ae))return v(Ae,Ce)}return Ce}function N(oe,Ee){const Ce=Ve.getInstance(),Ae=Ee,ze=oe.length,Je=a(oe,ze,Ee);Ee+=Je>=65536?2:1;let tt=Ce.getGraphemeBreakType(Je);for(;Ee<ze;){const nt=a(oe,ze,Ee),ht=Ce.getGraphemeBreakType(nt);if(Ye(tt,ht))break;Ee+=nt>=65536?2:1,tt=ht}return Ee-Ae}function F(oe,Ee){const Ce=Ve.getInstance(),Ae=Ee,ze=_(oe,Ee);Ee-=ze>=65536?2:1;let Je=Ce.getGraphemeBreakType(ze);for(;Ee>0;){const tt=_(oe,Ee),nt=Ce.getGraphemeBreakType(tt);if(Ye(nt,Je))break;Ee-=tt>=65536?2:1,Je=nt}return Ae-Ee}const S=/(?:[\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 U(oe){return S.test(oe)}const M=/(?:[\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 E(oe){return M.test(oe)}const W=/^[\t\n\r\x20-\x7E]*$/;function Z(oe){return W.test(oe)}const ne=/[\u2028\u2029]/;function ae(oe){return ne.test(oe)}function we(oe){for(let Ee=0,Ce=oe.length;Ee<Ce;Ee++)if(fe(oe.charCodeAt(Ee)))return!0;return!1}function fe(oe){return oe=+oe,oe>=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function _e(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const Se=String.fromCharCode(65279);function ve(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function ue(oe,Ee=!1){return oe?(Ee&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function le(oe){const Ee=90-65+1;return oe=oe%(2*Ee),oe<Ee?String.fromCharCode(97+oe):String.fromCharCode(65+oe-Ee)}function Oe(oe){const Ee=Ve.getInstance();return Ee.getGraphemeBreakType(oe)}function Ye(oe,Ee){return oe===0?Ee!==5&&Ee!==7:oe===2&&Ee===3?!1:oe===4||oe===2||oe===3||(Ee===4||Ee===2||Ee===3)?!0:oe===8&&(Ee===8||Ee===9||Ee===11||Ee===12)||((oe===11||oe===9)&&(Ee===9||Ee===10)||((oe===12||oe===10)&&Ee===10||(Ee===5||Ee===13||(Ee===7||(oe===1||oe===13&&Ee===14)))))?!1:!(oe===6&&Ee===6)}class Ve{constructor(){this._data=$e()}static getInstance(){return Ve._INSTANCE||(Ve._INSTANCE=new Ve),Ve._INSTANCE}getGraphemeBreakType(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;const Ee=this._data,Ce=Ee.length/3;let Ae=1;for(;Ae<=Ce;)if(oe<Ee[3*Ae])Ae=2*Ae;else if(oe>Ee[3*Ae+1])Ae=2*Ae+1;else return Ee[3*Ae+2];return 0}}Ve._INSTANCE=null;function $e(){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 Ze(oe,Ee){if(oe===0)return 0;const Ce=Fe(oe,Ee);if(Ce!==void 0)return Ce;const Ae=_(Ee,oe);return oe-=We(Ae),oe}function Fe(oe,Ee){let Ce=_(Ee,oe);for(oe-=We(Ce);qe(Ce)||Ce===65039||Ce===8419;){if(oe===0)return;Ce=_(Ee,oe),oe-=We(Ce)}if(!_e(Ce))return;if(oe>=0){const Ae=_(Ee,oe);Ae===8205&&(oe-=We(Ae))}return oe}function We(oe){return oe>=65536?2:1}function qe(oe){return 127995<=oe&&oe<=127999}},O2Wb:function(dt,be,$){dt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},Ot1p:function(dt,be,$){"use strict";var ie=$("2qtc"),J=$("kLXV"),k=$("rAM+"),Y=$("miYZ"),j=$("tsqr"),B=$("9og8"),z=$("tJVT"),G=$("jrin"),n=$("WmNS"),D=$.n(n),y=$("q1tI"),g=$.n(y),m=$("VrN/"),c=$.n(m),d=$("bdgK"),p=$("p77/"),l=$("Bd2K"),h=$("ELLl"),o=$("19Vz"),s=$("lZu9"),R=$("+NIl"),x=$("kSUc"),C=$("9Bee"),L=function(xe){var Pe=xe.value,Ke=Pe===void 0?"":Pe,vt=xe.className,Ft=xe.showTextOnly,Dt=xe.showLines,Kt=xe.style,ut=Kt===void 0?{}:Kt,Be=Object(y.useMemo)(function(){return""},[Ke]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:Be}}))},O=$("0Owb"),A=$("dejd"),w=$("C+DQ"),b=$("1vsH"),u=$("m3rI"),v=[{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 a(xe){var Pe=xe.onActionCallback,Ke=xe.title,vt=xe.icon,Ft=xe.actionName,Dt=xe.className,Kt=Dt===void 0?"":Dt,ut=xe.children;function Be(){Pe(Ft)}return g.a.createElement("a",{title:Ke,className:Kt,onClick:Be},g.a.createElement("i",{className:"md-iconfont ".concat(vt)}),ut)}var _=function(xe){var Pe=xe.watch,Ke=xe.showNullButton,vt=xe.onActionCallback,Ft=xe.fullScreen,Dt=xe.insertTemp,Kt=xe.hidetoolBar,ut=xe.uuid,Be=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(b.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(b.F)("_educoder_session"),"&key=").concat(ut,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var kt=[].concat(v,[{title:"".concat(Pe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Pe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!Kt&&kt.map(function(Ot,sn){return g.a.createElement("li",{key:sn},Ot.actionName?g.a.createElement(a,Object(O.a)({},Ot,{onActionCallback:vt})):g.a.createElement("span",{className:"v-line"}))}),Ke?g.a.createElement("li",null,g.a.createElement(a,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:vt},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Dt&&g.a.createElement("li",null,g.a.createElement(a,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Dt),onActionCallback:vt},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(a,{icon:"".concat(Ft?"icon-shrink":"icon-enlarge"),title:Ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:vt})))},N=$("M8RZ"),F=$("+L6B"),S=$("2/Rp"),U=$("y8nQ"),M=$("Vl3Y"),E=$("5NDa"),W=$("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},ne=function(xe){var Pe=xe.callback,Ke=xe.onCancel;function vt(Ft){Pe(Ft)}return g.a.createElement(M.a,Object(O.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:vt}),g.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(W.a,null)),g.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(W.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(S.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},ae=$("7ahc"),we=$("HmJG"),fe=$("BjJ7"),_e=M.a.useForm,Se={width:280,marginRight:10},ve={labelCol:{span:5},wrapperCol:{span:19}},ue=function(xe){var Pe=xe.callback,Ke=xe.onCancel,vt=_e(),Ft=Object(z.a)(vt,1),Dt=Ft[0];function Kt(kt){Pe(kt)}function ut(kt,Ot){if(kt.status===-1){j.b.error(kt.message);return}Dt.setFieldsValue({src:"/api/attachments/".concat(kt.id),type:Ot.type})}function Be(kt){var Ot=kt.target.files[0];Oe(Ot,ut)}return g.a.createElement(M.a,Object(O.a)({form:Dt},ve,{className:"upload-image-panel",onFinish:Kt}),g.a.createElement(M.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(M.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},g.a.createElement(W.a,{style:Se})),g.a.createElement(le,{onFileChange:Be}))),g.a.createElement(M.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(W.a,{style:{width:264}})),g.a.createElement(M.a.Item,{style:{textAlign:"right"}},g.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(S.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))};function le(xe){var Pe=xe.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:Pe}))}function Oe(xe,Pe){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ke=new FormData;Ke.append("editormd-image-file",xe),Ke.append("file_param_name","editormd-image-file"),Ke.append("byxhr","true");var vt=new window.XMLHttpRequest;vt.withCredentials=!0,vt.addEventListener("load",function(Ft){Pe(JSON.parse(Ft.target.responseText),xe)},!1),vt.addEventListener("error",function(Ft){console.error(Ft)},!1),vt.open("POST","".concat(fe.a,"/api/attachments.json")),vt.send(Ke)}var Ye=$("giR+"),Ve=$("fyUT"),$e=$("7Kak"),Ze=$("9yH6"),Fe=Ze.a.Group,We={margin:"0 8px"},qe=function(xe){var Pe=xe.callback,Ke=xe.onCancel;function vt(Ft){Pe(Ft)}return g.a.createElement(M.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:vt},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:We},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:We},"\u884C\u6570"),g.a.createElement(M.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(Ve.a,null)),g.a.createElement("span",{style:We},"\u5217\u6570"),g.a.createElement(M.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(Ve.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:We},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(M.a.Item,{name:"align"},g.a.createElement(Fe,null,g.a.createElement(Ze.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(Ze.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(Ze.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(Ze.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(S.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},oe=$("ErOA"),Ee=$("7Cbv"),Ce="link",Ae="upload-image",ze="code-block",Je="add-table",tt="------------",nt={default:tt,left:":".concat(tt),center:":".concat(tt,":"),right:"".concat(tt,":")},ht=$("9VGf"),it,lt;function Me(){}var Tt=0,mt=1e4,Ne="\u2581",He=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Te(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,ge=me?"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"],se=(it={},Object(G.a)(it,ge+"-B","bold"),Object(G.a)(it,ge+"-I","italic"),it),ce=(lt={},Object(G.a)(lt,Ce,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(lt,ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(lt,Ae,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(lt,Je,"\u6DFB\u52A0\u8868\u683C"),lt),pe=be.a=function(xe){var Pe=xe.defaultValue,Ke=Pe===void 0?"":Pe,vt=xe.onChange,Ft=xe.width,Dt=Ft===void 0?"100%":Ft,Kt=xe.height,ut=Kt===void 0?400:Kt,Be=xe.miniToolbar,kt=Be===void 0?!1:Be,Ot=xe.isFocus,sn=Ot===void 0?!1:Ot,qt=xe.watch,At=xe.insertTemp,at=xe.mode,Ln=at===void 0?"markdown":at,Le=xe.id,vn=Le===void 0?"markdown-editor-id":Le,yt=xe.showResizeBar,xt=yt===void 0?!1:yt,gt=xe.noStorage,Vt=gt===void 0?!1:gt,tn=xe.showNullButton,Mt=tn===void 0?!1:tn,st=xe.hidetoolBar,cn=st===void 0?!1:st,Gt=xe.fullScreen,Bt=Gt===void 0?!1:Gt,_t=xe.onBlur,Lt=xe.onCMBeforeChange,Qt=xe.onFullScreen,rn=xe.className,Ue=rn===void 0?"":rn,Et=xe.disablePaste,pn=Et===void 0?!1:Et,xn=xe.placeholder,Sn=xn===void 0?"":xn,yn=xe.values,X=yn===void 0?"":yn,T=Object(y.useState)(null),I=Object(z.a)(T,2),H=I[0],q=I[1],K=Object(y.useState)(Ke),he=Object(z.a)(K,2),ke=he[0],je=he[1],ct=Object(y.useState)(qt),De=Object(z.a)(ct,2),et=De[0],Xe=De[1],Ct=Object(y.useState)(Bt),wt=Object(z.a)(Ct,2),dn=wt[0],Ut=wt[1],Xt=Object(y.useState)(""),bn=Object(z.a)(Xt,2),Cn=bn[0],En=bn[1],Zt=Object(y.useState)(0),Rt=Object(z.a)(Zt,2),bt=Rt[0],Wt=Rt[1],Jt=Object(y.useState)(ut),on=Object(z.a)(Jt,2),Ht=on[0],Bn=on[1],Pn=Object(y.useState)(!1),ti=Object(z.a)(Pn,2),gi=ti[0],Ci=ti[1],wn=Object(y.useRef)(Object(Ee.a)()),un=Object(y.useRef)(!1),An=Object(y.useRef)(),nn=Object(y.useRef)(),Dn=Object(y.useRef)(),hn=Object(y.useRef)(),pi=Object(y.useRef)(),Mn=function(){var ot=Object(B.a)(D.a.mark(function Nt(){var Pt,Yt;return D.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:wn.current}});case 2:Yt=fn.sent,Yt!=null&&(Pt=Yt.attachments)!==null&&Pt!==void 0&&Pt.length&&(console.log("cm:",H,nn),Yt.attachments.map(function(ln){ln.content_type.indexOf("image")>-1?H.replaceSelection(".concat(ln.content_type,")")):ln.content_type.indexOf("video")>-1?H.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):ln.content_type.indexOf("pdf")>-1?H.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):H.replaceSelection("[".concat(ln.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,")"))}));case 4:case"end":return fn.stop()}},Nt)}));return function(){return ot.apply(this,arguments)}}();Object(y.useEffect)(function(){je(X),H==null||H.setValue(X)},[X]),Object(y.useEffect)(function(){Qt==null||Qt(dn)},[dn]),Object(y.useEffect)(function(){if(nn.current){var ot=c.a.fromTextArea(nn.current,{mode:Ln,lineNumbers:!kt,lineWrapping:!0,value:Ke,autoCloseTags:!0,autoCloseBrackets:!0});sn&&ot.focus();function Nt(Pt,Yt){if(pn){Yt.preventDefault();return}var $t=Yt.clipboardData;if($t){var fn=$t.types.toString(),ln=$t.items;if(fn==="Files"||$t.types.indexOf("Files")>-1){if(Yt.preventDefault(),Ln=="stex")return;try{var jn,ni=ln[1];((jn=ln[0])===null||jn===void 0?void 0:jn.kind)==="file"&&(ni=ln[0]);var an=ni.getAsFile(),Ri=an.name.split(".").pop();Oe(an,function(mn){if(mn.id){var ii,Jn,mi;(an==null||((ii=an.type)===null||ii===void 0)?void 0:ii.indexOf("image"))>-1?ot.replaceSelection(".concat(mn.content_type,")")):(an==null||((Jn=an.type)===null||Jn===void 0)?void 0:Jn.indexOf("video"))>-1?ot.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(an==null||((mi=an.type)===null||mi===void 0)?void 0:mi.indexOf("pdf"))>-1?ot.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):re.includes(Ri)?ot.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):ot.replaceSelection("[".concat(an.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(mn.content_type,")"))}else(mn==null?void 0:mn.status)===401&&(document.location.href="/user/login")})}catch(mn){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ot.on("paste",Nt),ot.on("dragleave",function(Pt,Yt){Dn.current.classList.remove("mouse-hover-md")}),ot.on("dragover",function(Pt,Yt){Dn.current.classList.add("mouse-hover-md")}),ot.on("drop",function(Pt,Yt){Dn.current.classList.add("mouse-hover-md");var $t;if($t=Yt.dataTransfer.files,$t.length>0){Yt.preventDefault(),Yt.stopPropagation();for(var fn=function(ni){var an=$t[ni],Ri=an.name.split(".").pop();Oe(an,function(mn){if(mn.id){var ii,Jn,mi;(an==null||((ii=an.type)===null||ii===void 0)?void 0:ii.indexOf("image"))>-1?ot.replaceSelection(".concat(mn.content_type,")")):(an==null||((Jn=an.type)===null||Jn===void 0)?void 0:Jn.indexOf("video"))>-1?ot.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(an==null||((mi=an.type)===null||mi===void 0)?void 0:mi.indexOf("pdf"))>-1?ot.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):re.includes(Ri)?ot.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):ot.replaceSelection("[".concat(an.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(mn.content_type,")"))}else(mn==null?void 0:mn.status)===401&&(document.location.href="/user/login")})},ln=0;ln<$t.length;ln++)fn(ln)}}),q(ot),function(){ot.off("paste",Nt)}}},[]);var Rn=Object(y.useCallback)(function(){if(Dn.current)try{}catch(ot){console.log(ot,"---- to set md editor body height")}},[Ht,Dn,dn]);Object(y.useEffect)(function(){function ot(){var Pt=new d.default(function(Yt){var $t=Object(k.a)(Yt),fn;try{for($t.s();!(fn=$t.n()).done;){var ln=fn.value;(ln.target.offsetHeight>0||ln.target.offsetWidth>0)&&(Rn(),H.setSize("100%","100%"),H.refresh())}}catch(jn){$t.e(jn)}finally{$t.f()}});return Pt.observe(nn.current.parentElement),Pt}if(H){var Nt=ot();return function(){Nt.unobserve(nn.current.parentElement)}}},[H,Rn]),Object(y.useEffect)(function(){if(H){for(var ot=[],Nt=function(){var ln=Yt[Pt];$t=Object(z.a)(ln,2);var jn=$t[0],ni=$t[1],an=Object(G.a)({},jn,function(){Ei(ni)});ot.push(an),H.addKeyMap(an)},Pt=0,Yt=Object.entries(se);Pt<Yt.length;Pt++){var $t;Nt()}return An.current=setInterval(function(){un.current&&Mn()},4e3),function(){clearInterval(An.current);var fn=Object(k.a)(ot),ln;try{for(fn.s();!(ln=fn.n()).done;){var jn=ln.value;H.removeKeyMap(jn)}}catch(ni){fn.e(ni)}finally{fn.f()}}}},[H]),Object(y.useEffect)(function(){Bt!==dn&&Ut(Bt)},[Bt]),Object(ht.a)(function(){if(!Vt&&bt>0){var ot=new Date().getTime(),Nt=window.sessionStorage.getItem(vn);ot>=bt+mt&&(!Nt||Nt!==ke)&&(window.sessionStorage.setItem(vn,ke),Ci(!0))}},mt),Object(y.useEffect)(function(){Xe(qt)},[H,qt]),Object(y.useEffect)(function(){H&&(sn&&H.focus())},[H,sn]),Object(y.useEffect)(function(){if(et&&H){var ot=H.getScrollerElement();function Nt(Pt){var Yt=Pt.target;if(pi.current){var $t=Yt.scrollTop/Yt.scrollHeight;pi.current.scrollTop=pi.current.scrollHeight*$t}}return ot.addEventListener("scroll",Nt),function(){ot.removeEventListener("scroll",Nt)}}},[H,et]),Object(y.useEffect)(function(){if(H&&Lt){function ot(Nt,Pt){Lt(Nt,Pt)}return H.on("beforeChange",ot),function(){H.off("beforeChange",ot)}}},[H,Lt]),Object(y.useEffect)(function(){if(H&&_t){function ot(){_t(H.getValue())}return H.on("blur",ot),function(){H.off("blur",ot)}}},[H,_t]),Object(y.useEffect)(function(){if(H){function ot(Nt){var Pt=Nt.getValue();je(Pt),Wt(new Date().getTime()),Nt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),vt&&vt(Pt)}return H.on("change",ot),function(){H.off("change",ot)}}},[H,vt]),Object(y.useEffect)(function(){H&&(Ke==null?(H.setValue(""),je("")):Ke!==H.getValue()&&(H.setValue(Ke),je(Ke),H.setCursor(H.lineCount(),0)))},[H,Ke]);var Ei=Object(y.useCallback)(function(ot){var Nt=H.getCursor(),Pt=H.getSelection(),Yt=Pt.split(`
|
|
`);switch(ot){case"bold":return H.replaceSelection("**"+Pt+"**"),Pt===""&&H.setCursor(Nt.line,Nt.ch+2),H.focus();case"italic":return H.replaceSelection("*"+Pt+"*"),Pt===""&&H.setCursor(Nt.line,Nt.ch+1),H.focus();case"code":return H.replaceSelection("`"+Pt+"`"),Pt===""&&H.setCursor(Nt.line,Nt.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+Pt+"$$`"),Pt===""&&H.setCursor(Nt.line,Nt.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+Pt+"\n```"),H.setCursor(Nt.line+1,Pt.length+1),H.focus();case"line-break":return H.replaceSelection(`<br/>
|
|
`),H.focus();case"list-ul":return Pt===""?H.replaceSelection("- "+Pt):H.replaceSelection(Yt.map(function($t){return $t===""?"":"- ".concat($t)}).join(`
|
|
`)),H.focus();case"list-ol":return Pt===""?H.replaceSelection("1. "+Pt):H.replaceSelection(Yt.map(function($t,fn){return $t===""?"":"".concat(fn+1,". ").concat($t)}).join(`
|
|
`)),H.focus();case"add-null-ch":return Pt===""&&H.setCursor(Nt.line,Nt.ch+1),H.replaceSelection(Ne),H.focus();case"inster-template-1":return Pt===""&&H.setCursor(Nt.line,Nt.ch),H.replaceSelection(He),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return Xe(!et),H.focus();case"trigger-full-screen":return Ut(!dn),H.focus();case Ce:En(Ce);return;case ze:En(ze);return;case Ae:En(Ae);return;case Je:En(Je);return;default:throw new Error}},[H,et,dn]),xi=Object(y.useCallback)(function(ot){En("");switch(Cn){case Ce:var Nt=ot.title,Pt=ot.link;return H.replaceSelection("[".concat(Nt,"](").concat(Pt,")")),H.focus();case ze:var Yt=ot.language,$t=ot.content;return H.replaceSelection(["```"+Yt,$t,"```"].join(`
|
|
`)),H.focus();case Ae:var fn=ot.src,ln=ot.alt;return ln?H.replaceSelection(".concat(fn,' "').concat(ln,'" )')):H.replaceSelection("")),H.focus();case Je:for(var jn=ot.row,ni=ot.col,an=ot.align,Ri=`
|
|
`,mn=0;mn<jn;mn++){for(var ii=[],Jn=[],mi=0;mi<ni;mi++)mn===1&&Jn.push(nt[an]),ii.push(" ");mn===1&&(Ri+="| ".concat(Jn.join(" | "),` |
|
|
`)),Ri+="| ".concat(ii.join(ni===1?"":" | "),` |
|
|
`)}return H.replaceSelection(Ri+`
|
|
`),H.focus();default:throw new Error}},[H,Cn]),Di=Object(y.useMemo)(function(){switch(Cn){case Ce:return g.a.createElement(ne,{callback:xi,onCancel:vi});case ze:return g.a.createElement(ae.b,{callback:xi,onCancel:vi});case Ae:return g.a.createElement(ue,{callback:xi,onCancel:vi});case Je:return g.a.createElement(qe,{callback:xi,onCancel:vi});default:return null}},[Cn]);function vi(){En("")}Object(y.useEffect)(function(){if(hn.current){var ot=hn.current,Nt=!1,Pt=0;function Yt(ln){Nt=!0,Pt=ln.pageY}function $t(){Nt=!1}function fn(ln){if(Nt){var jn=ln.pageY-Pt;jn<0&&(jn=0),jn>300&&(jn=300);var ni=ut+jn+"px";Bn(ni)}}return ot.addEventListener("mousedown",Yt),document.addEventListener("mousemove",fn),document.addEventListener("mouseup",$t),function(){ot.removeEventListener("mousedown",Yt),document.removeEventListener("mousemove",fn),document.removeEventListener("mouseup",$t)}}},[H,hn]),Object(y.useEffect)(function(){Bn(ut)},[ut]);var ci=Te(Dt),Hi=Te(Ht),Vn={width:ci,height:Hi},Wi=Object(y.useMemo)(function(){if(bt){var ot=new Date(bt),Nt=ot.getHours(),Pt=ot.getMinutes(),Yt=ot.getSeconds();return Nt=Nt<10?"0"+Nt:Nt,Pt=Pt<10?"0"+Pt:Pt,Yt=Yt<10?"0"+Yt:Yt,"".concat(Nt,":").concat(Pt,":").concat(Yt)}return 0},[bt]);function qi(){window.sessionStorage.removeItem(vn),Ci(!1),Wt(0)}function Ai(){Ci(!1),Wt(0),H.setValue(window.sessionStorage.getItem(vn))}function Xn(ot,Nt){var Pt=H.getValue();Pt=Pt.replace(ot,Nt),je(Pt),H==null||H.setValue(Pt)}return g.a.createElement(y.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:Dn},g.a.createElement("div",{className:"markdown-editor-container ".concat(Ue," ").concat(et?"on-preview":""," ").concat(kt?"mini":""," ").concat(dn?"full-screen":""),style:Vn},g.a.createElement(_,{insertTemp:At,watch:et,fullScreen:dn,showNullButton:Mt,onActionCallback:Ei,hidetoolBar:cn,uuid:wn.current,setOpenPhones:function(){un.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:nn,placeholder:Sn})),et?g.a.createElement("div",{ref:pi,className:"preview-container"},Ln==="stex"&&g.a.createElement(L,{value:ke}),Ln!=="stex"&&g.a.createElement(C.a,{edit:!0,value:ke,replaces:Xn})):null))),xt?g.a.createElement("a",{ref:hn,className:"editor-resize"}):null,g.a.createElement(N.a,null,ce[Cn]?g.a.createElement(J.a,{centered:!0,title:ce[Cn],visible:!0,onCancel:vi,footer:null,className:"markdown-popup-form"},Di):null))}},SJMd:function(dt,be){/**
|
|
* @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 $,ie,J,k=!1,Y,j;window.PR_SHOULD_USE_CONTINUATION=!0;var B,z;(function(){var G=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"],d="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",p=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",h=[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"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[g,c,m,p,l,h,o,s],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,C="str",L="kwd",O="com",A="typ",w="lit",b="pun",u="pln",v="tag",a="dec",_="src",N="atn",F="atv",S="nocode",U="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(Fe){for(var We=0,qe=!1,oe=!1,Ee=0,Ce=Fe.length;Ee<Ce;++Ee){var Ae=Fe[Ee];if(Ae.ignoreCase)oe=!0;else if(/[a-z]/i.test(Ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){qe=!0,oe=!1;break}}var ze={b:8,t:9,n:10,v:11,f:12,r:13};function Je(lt){var Me=lt.charCodeAt(0);if(Me!==92)return Me;var Tt=lt.charAt(1);return Me=ze[Tt],Me||("0"<=Tt&&Tt<="7"?parseInt(lt.substring(1),8):Tt==="u"||Tt==="x"?parseInt(lt.substring(2),16):lt.charCodeAt(1))}function tt(lt){if(lt<32)return(lt<16?"\\x0":"\\x")+lt.toString(16);var Me=String.fromCharCode(lt);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function nt(lt){var Me=lt.substring(1,lt.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")),Tt=[],mt=Me[0]==="^",Ne=["["];mt&&Ne.push("^");for(var He=mt?1:0,Te=Me.length;He<Te;++He){var me=Me[He];if(/\\[bdsw]/i.test(me))Ne.push(me);else{var ge=Je(me),re;He+2<Te&&Me[He+1]==="-"?(re=Je(Me[He+2]),He+=2):re=ge,Tt.push([ge,re]),re<65||ge>122||(re<65||ge>90||Tt.push([Math.max(65,ge)|32,Math.min(re,90)|32]),re<97||ge>122||Tt.push([Math.max(97,ge)&~32,Math.min(re,122)&~32]))}}Tt.sort(function(xe,Pe){return xe[0]-Pe[0]||Pe[1]-xe[1]});for(var se=[],ce=[],He=0;He<Tt.length;++He){var pe=Tt[He];pe[0]<=ce[1]+1?ce[1]=Math.max(ce[1],pe[1]):se.push(ce=pe)}for(var He=0;He<se.length;++He){var pe=se[He];Ne.push(tt(pe[0])),pe[1]>pe[0]&&(pe[1]+1>pe[0]&&Ne.push("-"),Ne.push(tt(pe[1])))}return Ne.push("]"),Ne.join("")}function ht(lt){for(var Me=lt.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")),Tt=Me.length,mt=[],Ne=0,He=0;Ne<Tt;++Ne){var Te=Me[Ne];if(Te==="(")++He;else if(Te.charAt(0)==="\\"){var me=+Te.substring(1);me&&(me<=He?mt[me]=-1:Me[Ne]=tt(me))}}for(var Ne=1;Ne<mt.length;++Ne)mt[Ne]===-1&&(mt[Ne]=++We);for(var Ne=0,He=0;Ne<Tt;++Ne){var Te=Me[Ne];if(Te==="(")++He,mt[He]||(Me[Ne]="(?:");else if(Te.charAt(0)==="\\"){var me=+Te.substring(1);me&&me<=He&&(Me[Ne]="\\"+mt[me])}}for(var Ne=0;Ne<Tt;++Ne)Me[Ne]==="^"&&Me[Ne+1]!=="^"&&(Me[Ne]="");if(lt.ignoreCase&&qe)for(var Ne=0;Ne<Tt;++Ne){var Te=Me[Ne],ge=Te.charAt(0);Te.length>=2&&ge==="["?Me[Ne]=nt(Te):ge!=="\\"&&(Me[Ne]=Te.replace(/[a-zA-Z]/g,function(ce){var pe=ce.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Me.join("")}for(var it=[],Ee=0,Ce=Fe.length;Ee<Ce;++Ee){var Ae=Fe[Ee];if(Ae.global||Ae.multiline)throw new Error(""+Ae);it.push("(?:"+ht(Ae)+")")}return new RegExp(it.join("|"),oe?"gi":"g")}function E(Fe,We){var qe=/(?:^|\s)nocode(?:\s|$)/,oe=[],Ee=0,Ce=[],Ae=0;function ze(Je){var tt=Je.nodeType;if(tt==1){if(qe.test(Je.className))return;for(var nt=Je.firstChild;nt;nt=nt.nextSibling)ze(nt);var ht=Je.nodeName.toLowerCase();(ht==="br"||ht==="li")&&(oe[Ae]=`
|
|
`,Ce[Ae<<1]=Ee++,Ce[Ae++<<1|1]=Je)}else if(tt==3||tt==4){var it=Je.nodeValue;it.length&&(We?it=it.replace(/\r\n?/g,`
|
|
`):it=it.replace(/[ \t\r\n]+/g," "),oe[Ae]=it,Ce[Ae<<1]=Ee,Ee+=it.length,Ce[Ae++<<1|1]=Je)}}return ze(Fe),{sourceCode:oe.join("").replace(/\n$/,""),spans:Ce}}function W(Fe,We,qe,oe,Ee){if(!qe)return;var Ce={sourceNode:Fe,pre:1,langExtension:null,numberLines:null,sourceCode:qe,spans:null,basePos:We,decorations:null};oe(Ce),Ee.push.apply(Ee,Ce.decorations)}var Z=/\S/;function ne(Fe){for(var We=void 0,qe=Fe.firstChild;qe;qe=qe.nextSibling){var oe=qe.nodeType;We=oe===1?We?Fe:qe:oe===3&&Z.test(qe.nodeValue)?Fe:We}return We===Fe?void 0:We}function ae(Fe,We){var qe={},oe;(function(){for(var Ae=Fe.concat(We),ze=[],Je={},tt=0,nt=Ae.length;tt<nt;++tt){var ht=Ae[tt],it=ht[3];if(it)for(var lt=it.length;--lt>=0;)qe[it.charAt(lt)]=ht;var Me=ht[1],Tt=""+Me;Je.hasOwnProperty(Tt)||(ze.push(Me),Je[Tt]=null)}ze.push(/[\0-\uffff]/),oe=M(ze)})();var Ee=We.length,Ce=function(Ae){for(var ze=Ae.sourceCode,Je=Ae.basePos,tt=Ae.sourceNode,nt=[Je,u],ht=0,it=ze.match(oe)||[],lt={},Me=0,Tt=it.length;Me<Tt;++Me){var mt=it[Me],Ne=lt[mt],He=void 0,Te;if(typeof Ne=="string")Te=!1;else{var me=qe[mt.charAt(0)];if(me)He=mt.match(me[1]),Ne=me[0];else{for(var ge=0;ge<Ee;++ge)if(me=We[ge],He=mt.match(me[1]),He){Ne=me[0];break}He||(Ne=u)}Te=Ne.length>=5&&Ne.substring(0,5)==="lang-",Te&&!(He&&typeof He[1]=="string")&&(Te=!1,Ne=_),Te||(lt[mt]=Ne)}var re=ht;if(ht+=mt.length,!Te)nt.push(Je+re,Ne);else{var se=He[1],ce=mt.indexOf(se),pe=ce+se.length;He[2]&&(pe=mt.length-He[2].length,ce=pe-se.length);var xe=Ne.substring(5);W(tt,Je+re,mt.substring(0,ce),Ce,nt),W(tt,Je+re+ce,se,le(xe,se),nt),W(tt,Je+re+pe,mt.substring(pe),Ce,nt)}}Ae.decorations=nt};return Ce}function we(Fe){var We=[],qe=[];Fe.tripleQuotedStrings?We.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Fe.multiLineStrings?We.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Fe.verbatimStrings&&qe.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var oe=Fe.hashComments;oe&&(Fe.cStyleComments?(oe>1?We.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),qe.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([O,/^#[^\r\n]*/,null,"#"])),Fe.cStyleComments&&(qe.push([O,/^\/\/[^\r\n]*/,null]),qe.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ee=Fe.regexLiterals;if(Ee){var Ce=Ee>1?"":`
|
|
\r`,Ae=Ce?".":"[\\S\\s]",ze="/(?=[^/*"+Ce+"])(?:[^/\\x5B\\x5C"+Ce+"]|\\x5C"+Ae+"|\\x5B(?:[^\\x5C\\x5D"+Ce+"]|\\x5C"+Ae+")*(?:\\x5D|$))+/";qe.push(["lang-regex",RegExp("^"+U+"("+ze+")")])}var Je=Fe.types;Je&&qe.push([A,Je]);var tt=(""+Fe.keywords).replace(/^ | $/g,"");tt.length&&qe.push([L,new RegExp("^(?:"+tt.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([u,/^\s+/,null,` \r
|
|
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return Fe.regexLiterals&&(nt+="(?!s*/)"),qe.push([w,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[w,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[b,new RegExp(nt),null]),ae(We,qe)}var fe=we({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function _e(Fe,We,qe){for(var oe=/(?:^|\s)nocode(?:\s|$)/,Ee=/\r\n?|\n/,Ce=Fe.ownerDocument,Ae=Ce.createElement("li");Fe.firstChild;)Ae.appendChild(Fe.firstChild);var ze=[Ae];function Je(Me){var Tt=Me.nodeType;if(Tt==1&&!oe.test(Me.className))if(Me.nodeName==="br")tt(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var mt=Me.firstChild;mt;mt=mt.nextSibling)Je(mt);else if((Tt==3||Tt==4)&&qe){var Ne=Me.nodeValue,He=Ne.match(Ee);if(He){var Te=Ne.substring(0,He.index);Me.nodeValue=Te;var me=Ne.substring(He.index+He[0].length);if(me){var ge=Me.parentNode;ge.insertBefore(Ce.createTextNode(me),Me.nextSibling)}tt(Me),Te||Me.parentNode.removeChild(Me)}}}function tt(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function Tt(He,Te){var me=Te?He.cloneNode(!1):He,ge=He.parentNode;if(ge){var re=Tt(ge,1),se=He.nextSibling;re.appendChild(me);for(var ce=se;ce;ce=se)se=ce.nextSibling,re.appendChild(ce)}return me}for(var mt=Tt(Me.nextSibling,0),Ne;(Ne=mt.parentNode)&&Ne.nodeType===1;)mt=Ne;ze.push(mt)}for(var nt=0;nt<ze.length;++nt)Je(ze[nt]);We===(We|0)&&ze[0].setAttribute("value",We);var ht=Ce.createElement("ol");ht.className="linenums";for(var it=Math.max(0,We-1|0)||0,nt=0,lt=ze.length;nt<lt;++nt)Ae=ze[nt],Ae.className="L"+(nt+it)%10,Ae.firstChild||Ae.appendChild(Ce.createTextNode("\xA0")),ht.appendChild(Ae);Fe.appendChild(ht)}function Se(Fe){var We=/\bMSIE\s(\d+)/.exec(navigator.userAgent);We=We&&+We[1]<=8;var qe=/\n/g,oe=Fe.sourceCode,Ee=oe.length,Ce=0,Ae=Fe.spans,ze=Ae.length,Je=0,tt=Fe.decorations,nt=tt.length,ht=0;tt[nt]=Ee;var it,lt;for(lt=it=0;lt<nt;)tt[lt]!==tt[lt+2]?(tt[it++]=tt[lt++],tt[it++]=tt[lt++]):lt+=2;for(nt=it,lt=it=0;lt<nt;){for(var Me=tt[lt],Tt=tt[lt+1],mt=lt+2;mt+2<=nt&&tt[mt+1]===Tt;)mt+=2;tt[it++]=Me,tt[it++]=Tt,lt=mt}nt=tt.length=it;var Ne=Fe.sourceNode,He="";Ne&&(He=Ne.style.display,Ne.style.display="none");try{for(var Te=null;Je<ze;){var me=Ae[Je],ge=Ae[Je+2]||Ee,re=tt[ht+2]||Ee,mt=Math.min(ge,re),se=Ae[Je+1],ce;if(se.nodeType!==1&&(ce=oe.substring(Ce,mt))){We&&(ce=ce.replace(qe,"\r")),se.nodeValue=ce;var pe=se.ownerDocument,xe=pe.createElement("span");xe.className=tt[ht+1];var Pe=se.parentNode;Pe.replaceChild(xe,se),xe.appendChild(se),Ce<ge&&(Ae[Je+1]=se=pe.createTextNode(oe.substring(mt,ge)),Pe.insertBefore(se,xe.nextSibling))}Ce=mt,Ce>=ge&&(Je+=2),Ce>=re&&(ht+=2)}}finally{Ne&&(Ne.style.display=He)}}var ve={};function ue(Fe,We){for(var qe=We.length;--qe>=0;){var oe=We[qe];ve.hasOwnProperty(oe)?G.console&&console.warn("cannot override language handler %s",oe):ve[oe]=Fe}}function le(Fe,We){return Fe&&ve.hasOwnProperty(Fe)||(Fe=/^\s*</.test(We)?"default-markup":"default-code"),ve[Fe]}ue(fe,["default-code"]),ue(ae([],[[u,/^[^<?]+/],[a,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[b,/^(?:<[%?]|[%?]>)/],["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"]),ue(ae([[u,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[b,/^[=<>\/]+/],["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"]),ue(ae([],[[F,/^[\s\S]+/]]),["uq.val"]),ue(we({keywords:g,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),ue(we({keywords:"null,true,false"}),["json"]),ue(we({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),ue(we({keywords:m,cStyleComments:!0}),["java"]),ue(we({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ue(we({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ue(we({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ue(we({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ue(we({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ue(we({keywords:d,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ue(ae([],[[C,/^[\s\S]+/]]),["regex"]);function Oe(Fe){var We=Fe.langExtension;try{var qe=E(Fe.sourceNode,Fe.pre),oe=qe.sourceCode;Fe.sourceCode=oe,Fe.spans=qe.spans,Fe.basePos=0,le(We,oe)(Fe),Se(Fe)}catch(Ee){G.console&&console.log(Ee&&Ee.stack||Ee)}}function Ye(Fe,We,qe){var oe=qe||!1,Ee=We||null,Ce=document.createElement("div");Ce.innerHTML="<pre>"+Fe+"</pre>",Ce=Ce.firstChild,oe&&_e(Ce,oe,!0);var Ae={langExtension:Ee,numberLines:oe,sourceNode:Ce,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Oe(Ae),Ce.innerHTML}function Ve(Fe,We){var qe=We||document.body,oe=qe.ownerDocument||document;function Ee(me){return qe.getElementsByTagName(me)}for(var Ce=[Ee("pre"),Ee("code"),Ee("xmp")],Ae=[],ze=0;ze<Ce.length;++ze)for(var Je=0,tt=Ce[ze].length;Je<tt;++Je)Ae.push(Ce[ze][Je]);Ce=null;var nt=Date;nt.now||(nt={now:function(){return+new Date}});var ht=0,it=/\blang(?:uage)?-([\w.]+)(?!\S)/,lt=/\bprettyprint\b/,Me=/\bprettyprinted\b/,Tt=/pre|xmp/i,mt=/^code$/i,Ne=/^(?:pre|code|xmp)$/i,He={};function Te(){for(var me=G.PR_SHOULD_USE_CONTINUATION?nt.now()+250:Infinity;ht<Ae.length&&nt.now()<me;ht++){for(var ge=Ae[ht],re=He,se=ge;se=se.previousSibling;){var ce=se.nodeType,pe=(ce===7||ce===8)&&se.nodeValue;if(pe?!/^\??prettify\b/.test(pe):ce!==3||/\S/.test(se.nodeValue))break;if(pe){re={},pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(qt,At,at){re[At]=at});break}}var xe=ge.className;if((re!==He||lt.test(xe))&&!Me.test(xe)){for(var Pe=!1,Ke=ge.parentNode;Ke;Ke=Ke.parentNode){var vt=Ke.tagName;if(Ne.test(vt)&&Ke.className&<.test(Ke.className)){Pe=!0;break}}if(!Pe){ge.className+=" prettyprinted";var Ft=re.lang;if(!Ft){Ft=xe.match(it);var Dt;!Ft&&(Dt=ne(ge))&&mt.test(Dt.tagName)&&(Ft=Dt.className.match(it)),Ft&&(Ft=Ft[1])}var Kt;if(Tt.test(ge.tagName))Kt=1;else{var ut=ge.currentStyle,Be=oe.defaultView,kt=ut?ut.whiteSpace:Be&&Be.getComputedStyle?Be.getComputedStyle(ge,null).getPropertyValue("white-space"):0;Kt=kt&&kt.substring(0,3)==="pre"}var Ot=re.linenums;(Ot=Ot==="true"||+Ot)||(Ot=xe.match(/\blinenums\b(?::(\d+))?/),Ot=Ot?Ot[1]&&Ot[1].length?+Ot[1]:!0:!1),Ot&&_e(ge,Ot,Kt);var sn={langExtension:Ft,sourceNode:ge,numberLines:Ot,pre:Kt,sourceCode:null,basePos:null,spans:null,decorations:null};Oe(sn)}}}ht<Ae.length?G.setTimeout(Te,250):typeof Fe=="function"&&Fe()}Te()}var $e=G.PR={createSimpleLexer:ae,registerLangHandler:ue,sourceDecorator:we,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:F,PR_COMMENT:O,PR_DECLARATION:a,PR_KEYWORD:L,PR_LITERAL:w,PR_NOCODE:S,PR_PLAIN:u,PR_PUNCTUATION:b,PR_SOURCE:_,PR_STRING:C,PR_TAG:v,PR_TYPE:A,prettyPrintOne:k?G.prettyPrintOne=Ye:B=Ye,prettyPrint:z=k?G.prettyPrint=Ve:z=Ve},Ze=G.define;typeof Ze=="function"&&Ze.amd&&Ze("google-code-prettify",[],function(){return $e})})()},T8No:function(dt,be,$){"use strict";$.d(be,"a",function(){return z}),$.d(be,"e",function(){return G}),$.d(be,"c",function(){return b}),$.d(be,"b",function(){return u}),$.d(be,"d",function(){return v}),$.d(be,"f",function(){return N});var ie=$("MNsG"),J=$("N0LK"),k=$("Cg/j");let Y=ie.k||"";const j=new Map;j.set("false",!1),j.set("true",!0),j.set("isMac",ie.f),j.set("isLinux",ie.d),j.set("isWindows",ie.i),j.set("isWeb",ie.h),j.set("isMacNative",ie.f&&!ie.h),j.set("isEdge",Y.indexOf("Edg/")>=0),j.set("isFirefox",Y.indexOf("Firefox")>=0),j.set("isChrome",Y.indexOf("Chrome")>=0),j.set("isSafari",Y.indexOf("Safari")>=0);const B=Object.prototype.hasOwnProperty;class z{static has(S){return g.create(S)}static equals(S,U){return m.create(S,U)}static regex(S,U){return C.create(S,U)}static not(S){return l.create(S)}static and(...S){return A.create(S,null)}static or(...S){return w.create(S,null,!0)}static deserialize(S,U=!1){return S?this._deserializeOrExpression(S,U):void 0}static _deserializeOrExpression(S,U){let M=S.split("||");return w.create(M.map(E=>this._deserializeAndExpression(E,U)),null,!0)}static _deserializeAndExpression(S,U){let M=S.split("&&");return A.create(M.map(E=>this._deserializeOne(E,U)),null)}static _deserializeOne(S,U){if(S=S.trim(),S.indexOf("!=")>=0){let M=S.split("!=");return p.create(M[0].trim(),this._deserializeValue(M[1],U))}if(S.indexOf("==")>=0){let M=S.split("==");return m.create(M[0].trim(),this._deserializeValue(M[1],U))}if(S.indexOf("=~")>=0){let M=S.split("=~");return C.create(M[0].trim(),this._deserializeRegexValue(M[1],U))}if(S.indexOf(" in ")>=0){let M=S.split(" in ");return c.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const M=S.split(">=");return s.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const M=S.split(">");return o.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const M=S.split("<=");return x.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const M=S.split("<");return R.create(M[0].trim(),M[1].trim())}return/^\!\s*/.test(S)?l.create(S.substr(1).trim()):g.create(S)}static _deserializeValue(S,U){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let M=/^'([^']*)'$/.exec(S);return M?M[1].trim():S}static _deserializeRegexValue(S,U){if(Object(J.C)(S)){if(U)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let M=S.indexOf("/"),E=S.lastIndexOf("/");if(M===E||M<0){if(U)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let W=S.slice(M+1,E),Z=S[E+1]==="i"?"i":"";try{return new RegExp(W,Z)}catch(ne){if(U)throw new Error(`bad regexp-value '${S}', parse error: ${ne}`);return console.warn(`bad regexp-value '${S}', parse error: ${ne}`),null}}}function G(S,U){const M=S?S.substituteConstants():void 0,E=U?U.substituteConstants():void 0;return!M&&!E?!0:!M||!E?!1:M.equals(E)}function n(S,U){return S.cmp(U)}class D{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return y.INSTANCE}}D.INSTANCE=new D;class y{constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}y.INSTANCE=new y;class g{constructor(S,U){this.key=S,this.negated=U,this.type=2}static create(S,U=null){const M=j.get(S);return typeof M=="boolean"?M?y.INSTANCE:D.INSTANCE:new g(S,U)}cmp(S){return S.type!==this.type?this.type-S.type:a(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=j.get(this.key);return typeof S=="boolean"?S?y.INSTANCE:D.INSTANCE:this}evaluate(S){return!!S.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class m{constructor(S,U,M){this.key=S,this.value=U,this.negated=M,this.type=4}static create(S,U,M=null){if(typeof U=="boolean")return U?g.create(S,M):l.create(S,M);const E=j.get(S);if(typeof E=="boolean"){const W=E?"true":"false";return U===W?y.INSTANCE:D.INSTANCE}return new m(S,U,M)}cmp(S){return S.type!==this.type?this.type-S.type:_(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=j.get(this.key);if(typeof S=="boolean"){const U=S?"true":"false";return this.value===U?y.INSTANCE:D.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class c{constructor(S,U){this.key=S,this.valueKey=U,this.type=10,this.negated=null}static create(S,U){return new c(S,U)}cmp(S){return S.type!==this.type?this.type-S.type:_(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const U=S.getValue(this.valueKey),M=S.getValue(this.key);return Array.isArray(U)?U.indexOf(M)>=0:typeof M=="string"&&typeof U=="object"&&U!==null?B.call(U,M):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=d.create(this)),this.negated}}class d{constructor(S){this._actual=S,this.type=11}static create(S){return new d(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class p{constructor(S,U,M){this.key=S,this.value=U,this.negated=M,this.type=5}static create(S,U,M=null){if(typeof U=="boolean")return U?l.create(S,M):g.create(S,M);const E=j.get(S);if(typeof E=="boolean"){const W=E?"true":"false";return U===W?D.INSTANCE:y.INSTANCE}return new p(S,U,M)}cmp(S){return S.type!==this.type?this.type-S.type:_(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=j.get(this.key);if(typeof S=="boolean"){const U=S?"true":"false";return this.value===U?D.INSTANCE:y.INSTANCE}return this}evaluate(S){return S.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 l{constructor(S,U){this.key=S,this.negated=U,this.type=3}static create(S,U=null){const M=j.get(S);return typeof M=="boolean"?M?D.INSTANCE:y.INSTANCE:new l(S,U)}cmp(S){return S.type!==this.type?this.type-S.type:a(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=j.get(this.key);return typeof S=="boolean"?S?D.INSTANCE:y.INSTANCE:this}evaluate(S){return!S.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 h(S,U){if(typeof S=="string"){const M=parseFloat(S);isNaN(M)||(S=M)}return typeof S=="string"||typeof S=="number"?U(S):D.INSTANCE}class o{constructor(S,U,M){this.key=S,this.value=U,this.negated=M,this.type=12}static create(S,U,M=null){return h(U,E=>new o(S,E,M))}cmp(S){return S.type!==this.type?this.type-S.type:_(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class s{constructor(S,U,M){this.key=S,this.value=U,this.negated=M,this.type=13}static create(S,U,M=null){return h(U,E=>new s(S,E,M))}cmp(S){return S.type!==this.type?this.type-S.type:_(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(S,U,M){this.key=S,this.value=U,this.negated=M,this.type=14}static create(S,U,M=null){return h(U,E=>new R(S,E,M))}cmp(S){return S.type!==this.type?this.type-S.type:_(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class x{constructor(S,U,M){this.key=S,this.value=U,this.negated=M,this.type=15}static create(S,U,M=null){return h(U,E=>new x(S,E,M))}cmp(S){return S.type!==this.type?this.type-S.type:_(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.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 C{constructor(S,U){this.key=S,this.regexp=U,this.type=7,this.negated=null}static create(S,U){return new C(S,U)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const U=this.regexp?this.regexp.source:"",M=S.regexp?S.regexp.source:"";return U<M?-1:U>M?1:0}equals(S){if(S.type===this.type){const U=this.regexp?this.regexp.source:"",M=S.regexp?S.regexp.source:"";return this.key===S.key&&U===M}return!1}substituteConstants(){return this}evaluate(S){let U=S.getValue(this.key);return this.regexp?this.regexp.test(U):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(S){this._actual=S,this.type=8}static create(S){return new L(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(S){let U=null;for(let M=0,E=S.length;M<E;M++){const W=S[M].substituteConstants();if(S[M]!==W&&U===null){U=[];for(let Z=0;Z<M;Z++)U[Z]=S[Z]}U!==null&&(U[M]=W)}return U===null?S:U}class A{constructor(S,U){this.expr=S,this.negated=U,this.type=6}static create(S,U){return A._normalizeArr(S,U)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let U=0,M=this.expr.length;U<M;U++){const E=n(this.expr[U],S.expr[U]);if(E!==0)return E}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let U=0,M=this.expr.length;U<M;U++)if(!this.expr[U].equals(S.expr[U]))return!1;return!0}return!1}substituteConstants(){const S=O(this.expr);return S===this.expr?this:A.create(S,this.negated)}evaluate(S){for(let U=0,M=this.expr.length;U<M;U++)if(!this.expr[U].evaluate(S))return!1;return!0}static _normalizeArr(S,U){const M=[];let E=!1;for(const W of S){if(!W)continue;if(W.type===1){E=!0;continue}if(W.type===0)return D.INSTANCE;if(W.type===6){M.push(...W.expr);continue}M.push(W)}if(M.length===0&&E)return y.INSTANCE;if(M.length===0)return;if(M.length===1)return M[0];M.sort(n);for(let W=1;W<M.length;W++)M[W-1].equals(M[W])&&(M.splice(W,1),W--);if(M.length===1)return M[0];for(;M.length>1;){const W=M[M.length-1];if(W.type!==9)break;M.pop();const Z=M.pop(),ne=M.length===0,ae=w.create(W.expr.map(we=>A.create([we,Z],null)),null,ne);ae&&(M.push(ae),M.sort(n))}return M.length===1?M[0]:new A(M,U)}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let U of this.expr)S.push(...U.keys());return S}negate(){if(!this.negated){const S=[];for(let U of this.expr)S.push(U.negate());this.negated=w.create(S,this,!0)}return this.negated}}class w{constructor(S,U){this.expr=S,this.negated=U,this.type=9}static create(S,U,M){return w._normalizeArr(S,U,M)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let U=0,M=this.expr.length;U<M;U++){const E=n(this.expr[U],S.expr[U]);if(E!==0)return E}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let U=0,M=this.expr.length;U<M;U++)if(!this.expr[U].equals(S.expr[U]))return!1;return!0}return!1}substituteConstants(){const S=O(this.expr);return S===this.expr?this:w.create(S,this.negated,!1)}evaluate(S){for(let U=0,M=this.expr.length;U<M;U++)if(this.expr[U].evaluate(S))return!0;return!1}static _normalizeArr(S,U,M){let E=[],W=!1;if(S){for(let Z=0,ne=S.length;Z<ne;Z++){const ae=S[Z];if(!ae)continue;if(ae.type===0){W=!0;continue}if(ae.type===1)return y.INSTANCE;if(ae.type===9){E=E.concat(ae.expr);continue}E.push(ae)}if(E.length===0&&W)return D.INSTANCE;E.sort(n)}if(E.length===0)return;if(E.length===1)return E[0];for(let Z=1;Z<E.length;Z++)E[Z-1].equals(E[Z])&&(E.splice(Z,1),Z--);if(E.length===1)return E[0];if(M){for(let Z=0;Z<E.length;Z++)for(let ne=Z+1;ne<E.length;ne++)N(E[Z],E[ne])&&(E.splice(ne,1),ne--);if(E.length===1)return E[0]}return new w(E,U)}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let U of this.expr)S.push(...U.keys());return S}negate(){if(!this.negated){let S=[];for(let U of this.expr)S.push(U.negate());for(;S.length>1;){const U=S.shift(),M=S.shift(),E=[];for(const Z of F(U))for(const ne of F(M))E.push(A.create([Z,ne],null));const W=S.length===0;S.unshift(w.create(E,null,W))}this.negated=S[0]}return this.negated}}class b extends g{constructor(S,U,M){super(S,null);this._defaultValue=U,typeof M=="object"?b._info.push(Object.assign(Object.assign({},M),{key:S})):M!==!0&&b._info.push({key:S,description:M,type:U!=null?typeof U:void 0})}static all(){return b._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return m.create(this.key,S)}}b._info=[];const u=Object(k.c)("contextKeyService"),v="setContext";function a(S,U){return S<U?-1:S>U?1:0}function _(S,U,M,E){return S<M?-1:S>M?1:U<E?-1:U>E?1:0}function N(S,U){if(U.type===6&&S.type!==9&&S.type!==6){for(const W of U.expr)if(S.equals(W))return!0}const M=S.negate(),E=F(M).concat(F(U));E.sort(n);for(let W=0;W<E.length;W++){const Z=E[W],ne=Z.negate();for(let ae=W+1;ae<E.length;ae++){const we=E[ae];if(ne.equals(we))return!0}}return!1}function F(S){return S.type===9?S.expr:[S]}},TXwP:function(dt,be,$){var ie,J;(function(){var k;(function(){"use strict";var j=[,,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 d=this.__base_string_length;return c=c||0,m<0&&(d=0),d+=m*this.__indent_size,d+=c,d},y.prototype.get_indent_string=function(m,c){var d=this.__base_string;return c=c||0,m<0&&(m=0,d=""),c+=m*this.__indent_size,this.__ensure_cache(c),d+=this.__cache[c],d},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,d="";this.__indent_size&&m>=this.__indent_size&&(c=Math.floor(m/this.__indent_size),m-=c*this.__indent_size,d=new Array(c+1).join(this.__indent_string)),m&&(d+=new Array(m+1).join(" ")),this.__cache.push(d)};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 d=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(d=d.replace(/[\n]/g,m)),d},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 d=this.__lines.length-2;d>=0;){var p=this.__lines[d];if(p.is_empty())break;if(p.item(0).indexOf(m)!==0&&p.item(-1)!==c){this.__lines.splice(d+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},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 d=this.raw_options[m],p=c||[];return typeof d=="object"?d!==null&&typeof d.concat=="function"&&(p=d.concat()):typeof d=="string"&&(p=d.split(/[^a-zA-Z0-9_\/\-]+/)),p},D.prototype._get_boolean=function(m,c){var d=this.raw_options[m],p=d===void 0?!!c:!!d;return p},D.prototype._get_characters=function(m,c){var d=this.raw_options[m],p=c||"";return typeof d=="string"&&(p=d.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),p},D.prototype._get_number=function(m,c){var d=this.raw_options[m];c=parseInt(c,10),isNaN(c)&&(c=0);var p=parseInt(d,10);return isNaN(p)&&(p=c),p},D.prototype._get_selection=function(m,c,d){var p=this._get_selection_list(m,c,d);if(p.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 p[0]},D.prototype._get_selection_list=function(m,c,d){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(d=d||[c[0]],!this._is_valid_selection(d,c))throw new Error("Invalid Default Value!");var p=this._get_array(m,d);if(!this._is_valid_selection(p,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 p},D.prototype._is_valid_selection=function(m,c){return m.length&&c.length&&!m.some(function(d){return c.indexOf(d)===-1})};function y(m,c){var d={};m=g(m);var p;for(p in m)p!==c&&(d[p]=m[p]);if(c&&m[c])for(p in m[c])d[p]=m[c][p];return d}function g(m){var c={},d;for(d in m){var p=d.replace(/-/g,"_");c[p]=m[d]}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 d="",p;return g&&(p=this.match(g),p&&(d+=p[0])),m&&(p||!g)&&(d+=this.readUntil(m,c)),d},y.prototype.readUntil=function(g,m){var c="",d=this.__position;g.lastIndex=this.__position;var p=g.exec(this.__input);return p?(d=p.index,m&&(d+=p[0].length)):d=this.__input_length,c=this.__input.substring(this.__position,d),this.__position=d,c},y.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},y.prototype.get_regexp=function(g,m){var c=null,d="g";return m&&D&&(d="y"),typeof g=="string"&&g!==""?c=new RegExp(g,d):g&&(c=new RegExp(g.source,d)),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(d,p){var l=new g(d,p);return l.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,d=y(13).Directives,p=new d(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,o=/\s/,s=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,x=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(L,O){this._source_text=L||"",this._options=new g(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}C.prototype.eatString=function(L){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},C.prototype.eatWhitespace=function(L){for(var O=o.test(this._input.peek()),A=0;o.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
|
|
`&&((A===0||A<this._options.max_preserve_newlines)&&(A++,this._output.add_new_line(!0)));return O},C.prototype.foundNestedPseudoClass=function(){for(var L=0,O=1,A=this._input.peek(O);A;){if(A==="{")return!0;if(A==="(")L+=1;else if(A===")"){if(L===0)return!1;L-=1}else if(A===";"||A==="}")return!1;O++,A=this._input.peek(O)}return!1},C.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},C.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
`,L&&l.test(L||"")&&(O=L.match(l)[0])),L=L.replace(h,`
|
|
`);var A=L.match(/^[\t ]*/)[0];this._output=new m(this._options,A),this._input=new c(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var w=0,b=!1,u=!1,v=!1,a=!1,_=!1,N=!1,F=this._ch,S=!1,U,M,E;U=this._input.read(s),M=U!=="",E=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(R),Z=p.get_directives(W);Z&&Z.ignore==="start"&&(W+=p.readIgnored(this._input)),this.print_string(W),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(x)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(M),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ne=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ne.match(/[ :]$/)&&(ne=this.eatString(": ").replace(/\s$/,""),this.print_string(ne),this._output.space_before_token=!0),ne=ne.replace(/\s$/,""),ne==="extend"?a=!0:ne==="import"&&(_=!0),ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,ne in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!b&&w===0&&ne.indexOf(":")!==-1&&(u=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(M),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")u&&(u=!1,this.outdent()),v?(v=!1,b=this._indentLevel>=this._nestedLevel):b=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&b&&(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)):(E==="("?this._output.space_before_token=!1:E!==","&&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(),E==="{"&&this._output.trim(!0),_=!1,a=!1,u&&(this.outdent(),u=!1),this.print_string(this._ch),b=!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 ae=0;ae<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ae++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ae])){S=!0;break}(b||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!a&&w===0?(this.print_string(":"),u||(u=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var we=E==='"'||E==="'";this.preserveSingleSpace(we||M),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")S=!1,w===0?(u&&(this.outdent(),u=!1),a=!1,_=!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(),w++,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(")")),w&&(w--,this.outdent()));else{var fe=!1;this._input.lookBack("with")&&(fe=!0),this.preserveSingleSpace(M||fe),this.print_string(this._ch),u&&E==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),w++,this.indent())}else if(this._ch===")")w&&(w--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!u||N)&&w===0&&!_&&!a?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!u&&w===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(M),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 _e=E==='"'||E==="'";this.preserveSingleSpace(_e||M),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&S&&this._output.add_new_line()}var Se=this._output.get_code(O);return Se},n.exports.Beautifier=C},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 d=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||d;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<p.length;l++)p[l]!=="expand"?this.brace_style="collapse":this.brace_style=p[l]}m.prototype=new g,n.exports.Options=m}],B={};function z(n){var D=B[n];if(D!==void 0)return D.exports;var y=B[n]={exports:{}};return j[n](y,y.exports,z),y.exports}var G=z(15);k=G})();var Y=k;!(ie=[],J=function(){return{css_beautify:Y}}.apply(be,ie),J!==void 0&&(dt.exports=J))})()},Vhoy:function(dt,be,$){"use strict";$.d(be,"d",function(){return Y}),$.d(be,"e",function(){return j}),$.d(be,"c",function(){return B}),$.d(be,"b",function(){return z}),$.d(be,"a",function(){return G});var ie=$("MI8n");class J{constructor(){this._icons=new Map,this._onDidRegister=new ie.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 k=new J,Y=k;function j(n,D){return new z(n,D)}function B(n){return n?n.replace(/\$\((.*?)\)/g,(D,y)=>` ${y} `).trim():""}class z{constructor(n,D,y){this.id=n,this.definition=D,this.description=y,k.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var G;(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 z)return["codicon","codicon-"+c.id];const d=D.exec(c.id);if(!d)return y(z.error);let[,p,l]=d;const h=["codicon","codicon-"+p];return l&&h.push("codicon-modifier-"+l.substr(1)),h}n.asClassNameArray=y;function g(c){return y(c).join(" ")}n.asClassName=g;function m(c){return"."+y(c).join(".")}n.asCSSSelector=m})(G||(G={})),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"})}(z||(z={}))},"VrN/":function(dt,be,$){(function(ie,J){dt.exports=J()})(this,function(){"use strict";var ie=navigator.userAgent,J=navigator.platform,k=/gecko\/\d/i.test(ie),Y=/MSIE \d/.test(ie),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),B=/Edge\/(\d+)/.exec(ie),z=Y||j||B,G=z&&(Y?document.documentMode||6:+(B||j)[1]),n=!B&&/WebKit\//.test(ie),D=n&&/Qt\/\d+\.\d+/.test(ie),y=!B&&/Chrome\//.test(ie),g=/Opera\//.test(ie),m=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),d=/PhantomJS/.test(ie),p=!B&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),l=/Android/.test(ie),h=p||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),o=p||/Mac/.test(J),s=/\bCrOS\b/.test(ie),R=/win/i.test(J),x=g&&ie.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(g=!1,n=!0);var C=o&&(D||g&&(x==null||x<12.11)),L=k||z&&G>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A=function(e,t){var r=e.className,i=O(t).exec(r);if(i){var f=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(f?i[1]+f:"")}};function w(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function b(e,t){return w(e).appendChild(t)}function u(e,t,r,i){var f=document.createElement(e);if(r&&(f.className=r),i&&(f.style.cssText=i),typeof t=="string")f.appendChild(document.createTextNode(t));else if(t)for(var P=0;P<t.length;++P)f.appendChild(t[P]);return f}function v(e,t,r,i){var f=u(e,t,r,i);return f.setAttribute("role","presentation"),f}var a;document.createRange?a=function(e,t,r,i){var f=document.createRange();return f.setEnd(i||e,r),f.setStart(e,t),f}:a=function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(f){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};function _(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var r=e.className;O(t).test(r)||(e.className+=(r?" ":"")+t)}function S(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!O(r[i]).test(t)&&(t+=" "+r[i]);return t}var U=function(e){e.select()};p?U=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:z&&(U=function(e){try{e.select()}catch(t){}});function M(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function E(e,t,r){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(r!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function W(e,t,r,i,f){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var P=i||0,V=f||0;;){var Q=e.indexOf(" ",P);if(Q<0||Q>=t)return V+(t-P);V+=Q-P,V+=r-V%r,P=Q+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function ne(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var ae=50,we={toString:function(){return"CodeMirror.Pass"}},fe={scroll:!1},_e={origin:"*mouse"},Se={origin:"+move"};function ve(e,t,r){for(var i=0,f=0;;){var P=e.indexOf(" ",i);P==-1&&(P=e.length);var V=P-i;if(P==e.length||f+V>=t)return i+Math.min(V,t-f);if(f+=P-i,f+=r-f%r,i=P+1,f>=t)return i}}var ue=[""];function le(e){for(;ue.length<=e;)ue.push(Oe(ue)+" ");return ue[e]}function Oe(e){return e[e.length-1]}function Ye(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function Ve(e,t,r){for(var i=0,f=r(t);i<e.length&&r(e[i])<=f;)i++;e.splice(i,0,t)}function $e(){}function Ze(e,t){var r;return Object.create?r=Object.create(e):($e.prototype=e,r=new $e),t&&E(t,r),r}var Fe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function We(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Fe.test(e))}function qe(e,t){return t?t.source.indexOf("\\w")>-1&&We(e)?!0:t.test(e):We(e)}function oe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ee=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ce(e){return e.charCodeAt(0)>=768&&Ee.test(e)}function Ae(e,t,r){for(;(r<0?t>0:t<e.length)&&Ce(e.charAt(t));)t+=r;return t}function ze(e,t,r){for(var i=t>r?-1:1;;){if(t==r)return t;var f=(t+r)/2,P=i<0?Math.ceil(f):Math.floor(f);if(P==t)return e(P)?t:r;e(P)?r=P:t=P+i}}function Je(e,t,r,i){if(!e)return i(t,r,"ltr",0);for(var f=!1,P=0;P<e.length;++P){var V=e[P];(V.from<r&&V.to>t||t==r&&V.to==t)&&(i(Math.max(V.from,t),Math.min(V.to,r),V.level==1?"rtl":"ltr",P),f=!0)}f||i(t,r,"ltr")}var tt=null;function nt(e,t,r){var i;tt=null;for(var f=0;f<e.length;++f){var P=e[f];if(P.from<t&&P.to>t)return f;P.to==t&&(P.from!=P.to&&r=="before"?i=f:tt=f),P.from==t&&(P.from!=P.to&&r!="before"?i=f:tt=f)}return i!=null?i:tt}var ht=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,P=/[LRr]/,V=/[Lb1n]/,Q=/[1n]/;function ee(te,de,ye){this.level=te,this.from=de,this.to=ye}return function(te,de){var ye=de=="ltr"?"L":"R";if(te.length==0||de=="ltr"&&!i.test(te))return!1;for(var Ie=te.length,Re=[],Ge=0;Ge<Ie;++Ge)Re.push(r(te.charCodeAt(Ge)));for(var Qe=0,rt=ye;Qe<Ie;++Qe){var ft=Re[Qe];ft=="m"?Re[Qe]=rt:rt=ft}for(var St=0,pt=ye;St<Ie;++St){var It=Re[St];It=="1"&&pt=="r"?Re[St]="n":P.test(It)&&(pt=It,It=="r"&&(Re[St]="R"))}for(var zt=1,jt=Re[0];zt<Ie-1;++zt){var en=Re[zt];en=="+"&&jt=="1"&&Re[zt+1]=="1"?Re[zt]="1":en==","&&jt==Re[zt+1]&&(jt=="1"||jt=="n")&&(Re[zt]=jt),jt=en}for(var Tn=0;Tn<Ie;++Tn){var zn=Re[Tn];if(zn==",")Re[Tn]="N";else if(zn=="%"){var In=void 0;for(In=Tn+1;In<Ie&&Re[In]=="%";++In);for(var hi=Tn&&Re[Tn-1]=="!"||In<Ie&&Re[In]=="1"?"1":"N",si=Tn;si<In;++si)Re[si]=hi;Tn=In-1}}for(var Fn=0,oi=ye;Fn<Ie;++Fn){var $n=Re[Fn];oi=="L"&&$n=="1"?Re[Fn]="L":P.test($n)&&(oi=$n)}for(var Hn=0;Hn<Ie;++Hn)if(f.test(Re[Hn])){var Un=void 0;for(Un=Hn+1;Un<Ie&&f.test(Re[Un]);++Un);for(var kn=(Hn?Re[Hn-1]:ye)=="L",li=(Un<Ie?Re[Un]:ye)=="L",mr=kn==li?kn?"L":"R":ye,ji=Hn;ji<Un;++ji)Re[ji]=mr;Hn=Un-1}for(var Zn=[],Si,Kn=0;Kn<Ie;)if(V.test(Re[Kn])){var Va=Kn;for(++Kn;Kn<Ie&&V.test(Re[Kn]);++Kn);Zn.push(new ee(0,Va,Kn))}else{var Ii=Kn,Qi=Zn.length,Zi=de=="rtl"?1:0;for(++Kn;Kn<Ie&&Re[Kn]!="L";++Kn);for(var ei=Ii;ei<Kn;)if(Q.test(Re[ei])){Ii<ei&&(Zn.splice(Qi,0,new ee(1,Ii,ei)),Qi+=Zi);var gr=ei;for(++ei;ei<Kn&&Q.test(Re[ei]);++ei);Zn.splice(Qi,0,new ee(2,gr,ei)),Qi+=Zi,Ii=ei}else++ei;Ii<Kn&&Zn.splice(Qi,0,new ee(1,Ii,Kn))}return de=="ltr"&&(Zn[0].level==1&&(Si=te.match(/^\s+/))&&(Zn[0].from=Si[0].length,Zn.unshift(new ee(0,0,Si[0].length))),Oe(Zn).level==1&&(Si=te.match(/\s+$/))&&(Oe(Zn).to-=Si[0].length,Zn.push(new ee(0,Ie-Si[0].length,Ie)))),de=="rtl"?Zn.reverse():Zn}}();function it(e,t){var r=e.order;return r==null&&(r=e.order=ht(e.text,t)),r}var lt=[],Me=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||lt).concat(r)}};function Tt(e,t){return e._handlers&&e._handlers[t]||lt}function mt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var i=e._handlers,f=i&&i[t];if(f){var P=ne(f,r);P>-1&&(i[t]=f.slice(0,P).concat(f.slice(P+1)))}}}function Ne(e,t){var r=Tt(e,t);if(!r.length)return;for(var i=Array.prototype.slice.call(arguments,2),f=0;f<r.length;++f)r[f].apply(null,i)}function He(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ne(e,r||t.type,e,t),ce(t)||t.codemirrorIgnore}function Te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ne(r,t[i])==-1&&r.push(t[i])}function me(e,t){return Tt(e,t).length>0}function ge(e){e.prototype.on=function(t,r){Me(this,t,r)},e.prototype.off=function(t,r){mt(this,t,r)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){re(e),se(e)}function xe(e){return e.target||e.srcElement}function Pe(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 Ke=function(){if(z&&G<9)return!1;var e=u("div");return"draggable"in e||"dragDrop"in e}(),vt;function Ft(e){if(vt==null){var t=u("span","\u200B");b(e,u("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(vt=t.offsetWidth<=1&&t.offsetHeight>2&&!(z&&G<8))}var r=vt?u("span","\u200B"):u("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var Dt;function Kt(e){if(Dt!=null)return Dt;var t=b(e,document.createTextNode("A\u062EA")),r=a(t,0,1).getBoundingClientRect(),i=a(t,1,2).getBoundingClientRect();return w(e),!r||r.left==r.right?!1:Dt=i.right-r.right<3}var ut=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],i=e.length;t<=i;){var f=e.indexOf(`
|
|
`,t);f==-1&&(f=e.length);var P=e.slice(t,e.charAt(f-1)=="\r"?f-1:f),V=P.indexOf("\r");V!=-1?(r.push(P.slice(0,V)),t+=V+1):(r.push(P),t=f+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Be=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(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},kt=function(){var e=u("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ot=null;function sn(e){if(Ot!=null)return Ot;var t=b(e,u("span","x")),r=t.getBoundingClientRect(),i=a(t,0,1).getBoundingClientRect();return Ot=Math.abs(r.left-i.left)>1}var qt={},At={};function at(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),qt[e]=t}function Ln(e,t){At[e]=t}function Le(e){if(typeof e=="string"&&At.hasOwnProperty(e))e=At[e];else if(e&&typeof e.name=="string"&&At.hasOwnProperty(e.name)){var t=At[e.name];typeof t=="string"&&(t={name:t}),e=Ze(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Le("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Le("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function vn(e,t){t=Le(t);var r=qt[t.name];if(!r)return vn(e,"text/plain");var i=r(e,t);if(yt.hasOwnProperty(t.name)){var f=yt[t.name];for(var P in f){if(!f.hasOwnProperty(P))continue;i.hasOwnProperty(P)&&(i["_"+P]=i[P]),i[P]=f[P]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var V in t.modeProps)i[V]=t.modeProps[V];return i}var yt={};function xt(e,t){var r=yt.hasOwnProperty(e)?yt[e]:yt[e]={};E(t,r)}function gt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var f=t[i];f instanceof Array&&(f=f.concat([])),r[i]=f}return r}function Vt(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function tn(e,t,r){return e.startState?e.startState(t,r):!0}var Mt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Mt.prototype.eol=function(){return this.pos>=this.string.length},Mt.prototype.sol=function(){return this.pos==this.lineStart},Mt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Mt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Mt.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Mt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Mt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Mt.prototype.skipToEnd=function(){this.pos=this.string.length},Mt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Mt.prototype.backUp=function(e){this.pos-=e},Mt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Mt.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Mt.prototype.match=function(e,t,r){if(typeof e=="string"){var i=function(V){return r?V.toLowerCase():V},f=this.string.substr(this.pos,e.length);if(i(f)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var P=this.string.slice(this.pos).match(e);return P&&P.index>0?null:(P&&t!==!1&&(this.pos+=P[0].length),P)}},Mt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Mt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Mt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Mt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function st(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 r=e;!r.lines;)for(var i=0;;++i){var f=r.children[i],P=f.chunkSize();if(t<P){r=f;break}t-=P}return r.lines[t]}function cn(e,t,r){var i=[],f=t.line;return e.iter(t.line,r.line+1,function(P){var V=P.text;f==r.line&&(V=V.slice(0,r.ch)),f==t.line&&(V=V.slice(t.ch)),i.push(V),++f}),i}function Gt(e,t,r){var i=[];return e.iter(t,r,function(f){i.push(f.text)}),i}function Bt(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function _t(e){if(e.parent==null)return null;for(var t=e.parent,r=ne(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var f=0;!(i.children[f]==t);++f)r+=i.children[f].chunkSize();return r+t.first}function Lt(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var f=e.children[i],P=f.height;if(t<P){e=f;continue e}t-=P,r+=f.chunkSize()}return r}while(!e.lines);for(var V=0;V<e.lines.length;++V){var Q=e.lines[V],ee=Q.height;if(t<ee)break;t-=ee}return r+V}function Qt(e,t){return t>=e.first&&t<e.first+e.size}function rn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ue(e,t,r){if(r===void 0&&(r=null),!(this instanceof Ue))return new Ue(e,t,r);this.line=e,this.ch=t,this.sticky=r}function Et(e,t){return e.line-t.line||e.ch-t.ch}function pn(e,t){return e.sticky==t.sticky&&Et(e,t)==0}function xn(e){return Ue(e.line,e.ch)}function Sn(e,t){return Et(e,t)<0?t:e}function yn(e,t){return Et(e,t)<0?e:t}function X(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function T(e,t){if(t.line<e.first)return Ue(e.first,0);var r=e.first+e.size-1;return t.line>r?Ue(r,st(e,r).text.length):I(t,st(e,t.line).text.length)}function I(e,t){var r=e.ch;return r==null||r>t?Ue(e.line,t):r<0?Ue(e.line,0):e}function H(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=T(e,t[i]);return r}var q=function(e,t){this.state=e,this.lookAhead=t},K=function(e,t,r,i){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};K.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},K.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}},K.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},K.fromSaved=function(e,t,r){return t instanceof q?new K(e,gt(e.mode,t.state),r,t.lookAhead):new K(e,gt(e.mode,t),r)},K.prototype.save=function(e){var t=e!==!1?gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function he(e,t,r,i){var f=[e.state.modeGen],P={};dn(e,t.text,e.doc.mode,r,function(te,de){return f.push(te,de)},P,i);for(var V=r.state,Q=function(te){r.baseTokens=f;var de=e.state.overlays[te],ye=1,Ie=0;r.state=!0,dn(e,t.text,de.mode,r,function(Re,Ge){for(var Qe=ye;Ie<Re;){var rt=f[ye];rt>Re&&f.splice(ye,1,Re,f[ye+1],rt),ye+=2,Ie=Math.min(Re,rt)}if(!Ge)return;if(de.opaque)f.splice(Qe,ye-Qe,Re,"overlay "+Ge),ye=Qe+2;else for(;Qe<ye;Qe+=2){var ft=f[Qe+1];f[Qe+1]=(ft?ft+" ":"")+"overlay "+Ge}},P),r.state=V,r.baseTokens=null,r.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)Q(ee);return{styles:f,classes:P.bgClass||P.textClass?P:null}}function ke(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=je(e,_t(t)),f=t.text.length>e.options.maxHighlightLength&>(e.doc.mode,i.state),P=he(e,t,i);f&&(i.state=f),t.stateAfter=i.save(!f),t.styles=P.styles,P.classes?t.styleClasses=P.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function je(e,t,r){var i=e.doc,f=e.display;if(!i.mode.startState)return new K(i,!0,t);var P=Ut(e,t,r),V=P>i.first&&st(i,P-1).stateAfter,Q=V?K.fromSaved(i,V,P):new K(i,tn(i.mode),P);return i.iter(P,t,function(ee){ct(e,ee.text,Q);var te=Q.line;ee.stateAfter=te==t-1||te%5==0||te>=f.viewFrom&&te<f.viewTo?Q.save():null,Q.nextLine()}),r&&(i.modeFrontier=Q.line),Q}function ct(e,t,r,i){var f=e.doc.mode,P=new Mt(t,e.options.tabSize,r);for(P.start=P.pos=i||0,t==""&&De(f,r.state);!P.eol();)et(f,P,r.state),P.start=P.pos}function De(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Vt(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function et(e,t,r,i){for(var f=0;f<10;f++){i&&(i[0]=Vt(e,r).mode);var P=e.token(t,r);if(t.pos>t.start)return P}throw new Error("Mode "+e.name+" failed to advance stream.")}var Xe=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Ct(e,t,r,i){var f=e.doc,P=f.mode,V;t=T(f,t);var Q=st(f,t.line),ee=je(e,t.line,r),te=new Mt(Q.text,e.options.tabSize,ee),de;for(i&&(de=[]);(i||te.pos<t.ch)&&!te.eol();)te.start=te.pos,V=et(P,te,ee.state),i&&de.push(new Xe(te,V,gt(f.mode,ee.state)));return i?de:new Xe(te,V,ee.state)}function wt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";t[i]==null?t[i]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+r[2])}return e}function dn(e,t,r,i,f,P,V){var Q=r.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var ee=0,te=null,de=new Mt(t,e.options.tabSize,i),ye,Ie=e.options.addModeClass&&[null];for(t==""&&wt(De(r,i.state),P);!de.eol();){if(de.pos>e.options.maxHighlightLength?(Q=!1,V&&ct(e,t,i,de.pos),de.pos=t.length,ye=null):ye=wt(et(r,de,i.state,Ie),P),Ie){var Re=Ie[0].name;Re&&(ye="m-"+(ye?Re+" "+ye:Re))}if(!Q||te!=ye){for(;ee<de.start;)ee=Math.min(de.start,ee+5e3),f(ee,te);te=ye}de.start=de.pos}for(;ee<de.pos;){var Ge=Math.min(de.pos,ee+5e3);f(Ge,te),ee=Ge}}function Ut(e,t,r){for(var i,f,P=e.doc,V=r?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>V;--Q){if(Q<=P.first)return P.first;var ee=st(P,Q-1),te=ee.stateAfter;if(te&&(!r||Q+(te instanceof q?te.lookAhead:0)<=P.modeFrontier))return Q;var de=W(ee.text,null,e.options.tabSize);(f==null||i>de)&&(f=Q-1,i=de)}return f}function Xt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,i=t-1;i>r;i--){var f=st(e,i).stateAfter;if(f&&(!(f instanceof q)||i+f.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var bn=!1,Cn=!1;function En(){bn=!0}function Zt(){Cn=!0}function Rt(e,t,r){this.marker=e,this.from=t,this.to=r}function bt(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function Wt(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r||(r=[])).push(e[i]);return r}function Jt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function on(e,t,r){var i;if(e)for(var f=0;f<e.length;++f){var P=e[f],V=P.marker,Q=P.from==null||(V.inclusiveLeft?P.from<=t:P.from<t);if(Q||P.from==t&&V.type=="bookmark"&&(!r||!P.marker.insertLeft)){var ee=P.to==null||(V.inclusiveRight?P.to>=t:P.to>t);(i||(i=[])).push(new Rt(V,P.from,ee?null:P.to))}}return i}function Ht(e,t,r){var i;if(e)for(var f=0;f<e.length;++f){var P=e[f],V=P.marker,Q=P.to==null||(V.inclusiveRight?P.to>=t:P.to>t);if(Q||P.from==t&&V.type=="bookmark"&&(!r||P.marker.insertLeft)){var ee=P.from==null||(V.inclusiveLeft?P.from<=t:P.from<t);(i||(i=[])).push(new Rt(V,ee?null:P.from-t,P.to==null?null:P.to-t))}}return i}function Bn(e,t){if(t.full)return null;var r=Qt(e,t.from.line)&&st(e,t.from.line).markedSpans,i=Qt(e,t.to.line)&&st(e,t.to.line).markedSpans;if(!r&&!i)return null;var f=t.from.ch,P=t.to.ch,V=Et(t.from,t.to)==0,Q=on(r,f,V),ee=Ht(i,P,V),te=t.text.length==1,de=Oe(t.text).length+(te?f:0);if(Q)for(var ye=0;ye<Q.length;++ye){var Ie=Q[ye];if(Ie.to==null){var Re=bt(ee,Ie.marker);Re?te&&(Ie.to=Re.to==null?null:Re.to+de):Ie.to=f}}if(ee)for(var Ge=0;Ge<ee.length;++Ge){var Qe=ee[Ge];if(Qe.to!=null&&(Qe.to+=de),Qe.from==null){var rt=bt(Q,Qe.marker);rt||(Qe.from=de,te&&(Q||(Q=[])).push(Qe))}else Qe.from+=de,te&&(Q||(Q=[])).push(Qe)}Q&&(Q=Pn(Q)),ee&&ee!=Q&&(ee=Pn(ee));var ft=[Q];if(!te){var St=t.text.length-2,pt;if(St>0&&Q)for(var It=0;It<Q.length;++It)Q[It].to==null&&(pt||(pt=[])).push(new Rt(Q[It].marker,null,null));for(var zt=0;zt<St;++zt)ft.push(pt);ft.push(ee)}return ft}function Pn(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ti(e,t,r){var i=null;if(e.iter(t.line,r.line+1,function(Re){if(Re.markedSpans)for(var Ge=0;Ge<Re.markedSpans.length;++Ge){var Qe=Re.markedSpans[Ge].marker;Qe.readOnly&&(!i||ne(i,Qe)==-1)&&(i||(i=[])).push(Qe)}}),!i)return null;for(var f=[{from:t,to:r}],P=0;P<i.length;++P)for(var V=i[P],Q=V.find(0),ee=0;ee<f.length;++ee){var te=f[ee];if(Et(te.to,Q.from)<0||Et(te.from,Q.to)>0)continue;var de=[ee,1],ye=Et(te.from,Q.from),Ie=Et(te.to,Q.to);(ye<0||!V.inclusiveLeft&&!ye)&&de.push({from:te.from,to:Q.from}),(Ie>0||!V.inclusiveRight&&!Ie)&&de.push({from:Q.to,to:te.to}),f.splice.apply(f,de),ee+=de.length-3}return f}function gi(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function Ci(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function wn(e){return e.inclusiveLeft?-1:0}function un(e){return e.inclusiveRight?1:0}function An(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var i=e.find(),f=t.find(),P=Et(i.from,f.from)||wn(e)-wn(t);if(P)return-P;var V=Et(i.to,f.to)||un(e)-un(t);return V||t.id-e.id}function nn(e,t){var r=Cn&&e.markedSpans,i;if(r)for(var f=void 0,P=0;P<r.length;++P)f=r[P],f.marker.collapsed&&(t?f.from:f.to)==null&&(!i||An(i,f.marker)<0)&&(i=f.marker);return i}function Dn(e){return nn(e,!0)}function hn(e){return nn(e,!1)}function pi(e,t){var r=Cn&&e.markedSpans,i;if(r)for(var f=0;f<r.length;++f){var P=r[f];P.marker.collapsed&&(P.from==null||P.from<t)&&(P.to==null||P.to>t)&&(!i||An(i,P.marker)<0)&&(i=P.marker)}return i}function Mn(e,t,r,i,f){var P=st(e,t),V=Cn&&P.markedSpans;if(V)for(var Q=0;Q<V.length;++Q){var ee=V[Q];if(!ee.marker.collapsed)continue;var te=ee.marker.find(0),de=Et(te.from,r)||wn(ee.marker)-wn(f),ye=Et(te.to,i)||un(ee.marker)-un(f);if(de>=0&&ye<=0||de<=0&&ye>=0)continue;if(de<=0&&(ee.marker.inclusiveRight&&f.inclusiveLeft?Et(te.to,r)>=0:Et(te.to,r)>0)||de>=0&&(ee.marker.inclusiveRight&&f.inclusiveLeft?Et(te.from,i)<=0:Et(te.from,i)<0))return!0}}function Rn(e){for(var t;t=Dn(e);)e=t.find(-1,!0).line;return e}function Ei(e){for(var t;t=hn(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,r;t=hn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Di(e,t){var r=st(e,t),i=Rn(r);return r==i?t:_t(i)}function vi(e,t){if(t>e.lastLine())return t;var r=st(e,t),i;if(!ci(e,r))return t;for(;i=hn(r);)r=i.find(1,!0).line;return _t(r)+1}function ci(e,t){var r=Cn&&t.markedSpans;if(r)for(var i=void 0,f=0;f<r.length;++f){if(i=r[f],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&Hi(e,t,i))return!0}}function Hi(e,t,r){if(r.to==null){var i=r.marker.find(1,!0);return Hi(e,i.line,bt(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var f=void 0,P=0;P<t.markedSpans.length;++P)if(f=t.markedSpans[P],f.marker.collapsed&&!f.marker.widgetNode&&f.from==r.to&&(f.to==null||f.to!=r.from)&&(f.marker.inclusiveLeft||r.marker.inclusiveRight)&&Hi(e,t,f))return!0}function Vn(e){e=Rn(e);for(var t=0,r=e.parent,i=0;i<r.lines.length;++i){var f=r.lines[i];if(f==e)break;t+=f.height}for(var P=r.parent;P;r=P,P=r.parent)for(var V=0;V<P.children.length;++V){var Q=P.children[V];if(Q==r)break;t+=Q.height}return t}function Wi(e){if(e.height==0)return 0;for(var t=e.text.length,r,i=e;r=Dn(i);){var f=r.find(0,!0);i=f.from.line,t+=f.from.ch-f.to.ch}for(i=e;r=hn(i);){var P=r.find(0,!0);t-=i.text.length-P.from.ch,i=P.to.line,t+=i.text.length-P.to.ch}return t}function qi(e){var t=e.display,r=e.doc;t.maxLine=st(r,r.first),t.maxLineLength=Wi(t.maxLine),t.maxLineChanged=!0,r.iter(function(i){var f=Wi(i);f>t.maxLineLength&&(t.maxLineLength=f,t.maxLine=i)})}var Ai=function(e,t,r){this.text=e,Ci(this,t),this.height=r?r(this):1};Ai.prototype.lineNo=function(){return _t(this)},ge(Ai);function Xn(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),gi(e),Ci(e,r);var f=i?i(e):1;f!=e.height&&Bt(e,f)}function ot(e){e.parent=null,gi(e)}var Nt={},Pt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Pt:Nt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function $t(e,t){var r=v("span",null,null,n?"padding-right: .1px":null),i={pre:v("pre",[r],"CodeMirror-line"),content:r,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 P=f?t.rest[f-1]:t.line,V=void 0;i.pos=0,i.addToken=ln,Kt(e.display.measure)&&(V=it(P,e.doc.direction))&&(i.addToken=ni(i.addToken,V)),i.map=[];var Q=t!=e.display.externalMeasured&&_t(P);Ri(P,i,ke(e,P,Q)),P.styleClasses&&(P.styleClasses.bgClass&&(i.bgClass=S(P.styleClasses.bgClass,i.bgClass||"")),P.styleClasses.textClass&&(i.textClass=S(P.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(Ft(e.display.measure))),f==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var ee=i.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=S(i.pre.className,i.textClass||"")),i}function fn(e){var t=u("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ln(e,t,r,i,f,P,V){if(!t)return;var Q=e.splitSpaces?jn(t,e.trailingSpace):t,ee=e.cm.state.specialChars,te=!1,de;if(!ee.test(t))e.col+=t.length,de=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,de),z&&G<9&&(te=!0),e.pos+=t.length;else{de=document.createDocumentFragment();for(var ye=0;;){ee.lastIndex=ye;var Ie=ee.exec(t),Re=Ie?Ie.index-ye:t.length-ye;if(Re){var Ge=document.createTextNode(Q.slice(ye,ye+Re));z&&G<9?de.appendChild(u("span",[Ge])):de.appendChild(Ge),e.map.push(e.pos,e.pos+Re,Ge),e.col+=Re,e.pos+=Re}if(!Ie)break;ye+=Re+1;var Qe=void 0;if(Ie[0]==" "){var rt=e.cm.options.tabSize,ft=rt-e.col%rt;Qe=de.appendChild(u("span",le(ft),"cm-tab")),Qe.setAttribute("role","presentation"),Qe.setAttribute("cm-text"," "),e.col+=ft}else Ie[0]=="\r"||Ie[0]==`
|
|
`?(Qe=de.appendChild(u("span",Ie[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Qe.setAttribute("cm-text",Ie[0]),e.col+=1):(Qe=e.cm.options.specialCharPlaceholder(Ie[0]),Qe.setAttribute("cm-text",Ie[0]),z&&G<9?de.appendChild(u("span",[Qe])):de.appendChild(Qe),e.col+=1);e.map.push(e.pos,e.pos+1,Qe),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,r||i||f||te||P||V){var St=r||"";i&&(St+=i),f&&(St+=f);var pt=u("span",[de],St,P);if(V)for(var It in V)V.hasOwnProperty(It)&&It!="style"&&It!="class"&&pt.setAttribute(It,V[It]);return e.content.appendChild(pt)}e.content.appendChild(de)}function jn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,i="",f=0;f<e.length;f++){var P=e.charAt(f);P==" "&&r&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(P="\xA0"),i+=P,r=P==" "}return i}function ni(e,t){return function(r,i,f,P,V,Q,ee){f=f?f+" cm-force-border":"cm-force-border";for(var te=r.pos,de=te+i.length;;){for(var ye=void 0,Ie=0;Ie<t.length&&!(ye=t[Ie],ye.to>te&&ye.from<=te);Ie++);if(ye.to>=de)return e(r,i,f,P,V,Q,ee);e(r,i.slice(0,ye.to-te),f,P,null,Q,ee),P=null,i=i.slice(ye.to-te),te=ye.to}}}function an(e,t,r,i){var f=!i&&r.widgetNode;f&&e.map.push(e.pos,e.pos+t,f),!i&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",r.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=t,e.trailingSpace=!1}function Ri(e,t,r){var i=e.markedSpans,f=e.text,P=0;if(!i){for(var V=1;V<r.length;V+=2)t.addToken(t,f.slice(P,P=r[V]),Yt(r[V+1],t.cm.options));return}for(var Q=f.length,ee=0,te=1,de="",ye,Ie,Re=0,Ge,Qe,rt,ft,St;;){if(Re==ee){Ge=Qe=rt=Ie="",St=null,ft=null,Re=Infinity;for(var pt=[],It=void 0,zt=0;zt<i.length;++zt){var jt=i[zt],en=jt.marker;if(en.type=="bookmark"&&jt.from==ee&&en.widgetNode)pt.push(en);else if(jt.from<=ee&&(jt.to==null||jt.to>ee||en.collapsed&&jt.to==ee&&jt.from==ee)){if(jt.to!=null&&jt.to!=ee&&Re>jt.to&&(Re=jt.to,Qe=""),en.className&&(Ge+=" "+en.className),en.css&&(Ie=(Ie?Ie+";":"")+en.css),en.startStyle&&jt.from==ee&&(rt+=" "+en.startStyle),en.endStyle&&jt.to==Re&&(It||(It=[])).push(en.endStyle,jt.to),en.title&&((St||(St={})).title=en.title),en.attributes)for(var Tn in en.attributes)(St||(St={}))[Tn]=en.attributes[Tn];en.collapsed&&(!ft||An(ft.marker,en)<0)&&(ft=jt)}else jt.from>ee&&Re>jt.from&&(Re=jt.from)}if(It)for(var zn=0;zn<It.length;zn+=2)It[zn+1]==Re&&(Qe+=" "+It[zn]);if(!ft||ft.from==ee)for(var In=0;In<pt.length;++In)an(t,0,pt[In]);if(ft&&(ft.from||0)==ee){if(an(t,(ft.to==null?Q+1:ft.to)-ee,ft.marker,ft.from==null),ft.to==null)return;ft.to==ee&&(ft=!1)}}if(ee>=Q)break;for(var hi=Math.min(Q,Re);;){if(de){var si=ee+de.length;if(!ft){var Fn=si>hi?de.slice(0,hi-ee):de;t.addToken(t,Fn,ye?ye+Ge:Ge,rt,ee+Fn.length==Re?Qe:"",Ie,St)}if(si>=hi){de=de.slice(hi-ee),ee=hi;break}ee=si,rt=""}de=f.slice(P,P=r[te++]),ye=Yt(r[te++],t.cm.options)}}}function mn(e,t,r){this.line=t,this.rest=xi(t),this.size=this.rest?_t(Oe(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ci(e,t)}function ii(e,t,r){for(var i=[],f,P=t;P<r;P=f){var V=new mn(e.doc,st(e.doc,P),P);f=P+V.size,i.push(V)}return i}var Jn=null;function mi(e){Jn?Jn.ops.push(e):e.ownsGroup=Jn={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var i=0;i<e.ops.length;i++){var f=e.ops[i];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(r<t.length)}function Io(e,t){var r=e.ownsGroup;if(!r)return;try{Lo(r)}finally{Jn=null,t(r)}}var vr=null;function Yn(e,t){var r=Tt(e,t);if(!r.length)return;var i=Array.prototype.slice.call(arguments,2),f;Jn?f=Jn.delayedCallbacks:vr?f=vr:(f=vr=[],setTimeout(Do,0));for(var P=function(Q){f.push(function(){return r[Q].apply(null,i)})},V=0;V<r.length;++V)P(V)}function Do(){var e=vr;vr=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,r,i){for(var f=0;f<t.changes.length;f++){var P=t.changes[f];P=="text"?Po(e,t):P=="gutter"?Ja(e,t,r,i):P=="class"?ha(e,t):P=="widget"&&Mo(e,t,i)}t.changes=null}function yr(e){return e.node==e.text&&(e.node=u("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),z&&G<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=yr(t);t.background=i.insertBefore(u("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):$t(e,t)}function Po(e,t){var r=t.text.className,i=$a(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,ha(e,t)):r&&(t.text.className=r)}function ha(e,t){ko(e,t),t.line.wrapClass?yr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ja(e,t,r,i){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=yr(t);t.gutterBackground=u("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),f.insertBefore(t.gutterBackground,t.text)}var P=t.line.gutterMarkers;if(e.options.lineNumbers||P){var V=yr(t),Q=t.gutter=u("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),V.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!P||!P["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(u("div",rn(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),P)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var te=e.display.gutterSpecs[ee].className,de=P.hasOwnProperty(te)&&P[te];de&&Q.appendChild(u("div",[de],"CodeMirror-gutter-elt","left: "+i.gutterLeft[te]+"px; width: "+i.gutterWidth[te]+"px"))}}}function Mo(e,t,r){t.alignable&&(t.alignable=null);for(var i=O("CodeMirror-linewidget"),f=t.node.firstChild,P=void 0;f;f=P)P=f.nextSibling,i.test(f.className)&&t.node.removeChild(f);Qa(e,t,r)}function No(e,t,r,i){var f=$a(e,t);return t.text=t.node=f.pre,f.bgClass&&(t.bgClass=f.bgClass),f.textClass&&(t.textClass=f.textClass),ha(e,t),Ja(e,t,r,i),Qa(e,t,i),t.node}function Qa(e,t,r){if(Za(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)Za(e,t.rest[i],t,r,!1)}function Za(e,t,r,i,f){if(!t.widgets)return;for(var P=yr(r),V=0,Q=t.widgets;V<Q.length;++V){var ee=Q[V],te=u("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(ee,te,r,i),e.display.input.setUneditable(te),f&&ee.above?P.insertBefore(te,r.gutter||r.text):P.appendChild(te),Yn(ee,"redraw")}}function Fo(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var f=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(f-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=f+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function br(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),b(t.display.measure,u("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Oi(e,t){for(var r=xe(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=b(e.measure,u("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function wi(e){return ae-e.display.nativeBarWidth}function Gi(e){return e.display.scroller.clientWidth-wi(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-wi(e)-e.display.barHeight}function Uo(e,t,r){var i=e.options.lineWrapping,f=i&&Gi(e);if(!t.measure.heights||i&&t.measure.width!=f){var P=t.measure.heights=[];if(i){t.measure.width=f;for(var V=t.text.firstChild.getClientRects(),Q=0;Q<V.length-1;Q++){var ee=V[Q],te=V[Q+1];Math.abs(ee.bottom-te.bottom)>2&&P.push((ee.bottom+te.top)/2-r.top)}}P.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var f=0;f<e.rest.length;f++)if(_t(e.rest[f])>r)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}function Bo(e,t){t=Rn(t);var r=_t(t),i=e.display.externalMeasured=new mn(e.doc,t,r);i.lineN=r;var f=i.built=$t(e,i);return i.text=f.pre,b(e.display.lineMeasure,f.pre),i}function ts(e,t,r,i){return Ti(e,er(e,t),r,i)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Vi(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function er(e,t){var r=_t(t),i=fa(e,r);i&&!i.text?i=null:i&&i.changes&&(Ya(e,i,r,ba(e)),e.curOp.forceUpdate=!0),i||(i=Bo(e,t));var f=es(i,t,r);return{line:t,view:i,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function Ti(e,t,r,i,f){t.before&&(r=-1);var P=r+(i||""),V;return t.cache.hasOwnProperty(P)?V=t.cache[P]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),V=Ho(e,t,r,i),V.bogus||(t.cache[P]=V)),{left:V.left,right:V.right,top:f?V.rtop:V.top,bottom:f?V.rbottom:V.bottom}}var ns={left:0,right:0,top:0,bottom:0};function is(e,t,r){for(var i,f,P,V,Q,ee,te=0;te<e.length;te+=3)if(Q=e[te],ee=e[te+1],t<Q?(f=0,P=1,V="left"):t<ee?(f=t-Q,P=f+1):(te==e.length-3||t==ee&&e[te+3]>t)&&(P=ee-Q,f=P-1,t>=ee&&(V="right")),f!=null){if(i=e[te+2],Q==ee&&r==(i.insertLeft?"left":"right")&&(V=r),r=="left"&&f==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)i=e[(te-=3)+2],V="left";if(r=="right"&&f==ee-Q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)i=e[(te+=3)+2],V="right";break}return{node:i,start:f,end:P,collapse:V,coverStart:Q,coverEnd:ee}}function jo(e,t){var r=ns;if(t=="left")for(var i=0;i<e.length&&!((r=e[i]).left!=r.right);i++);else for(var f=e.length-1;f>=0&&!((r=e[f]).left!=r.right);f--);return r}function Ho(e,t,r,i){var f=is(t.map,r,i),P=f.node,V=f.start,Q=f.end,ee=f.collapse,te;if(P.nodeType==3){for(var de=0;de<4;de++){for(;V&&Ce(t.line.text.charAt(f.coverStart+V));)--V;for(;f.coverStart+Q<f.coverEnd&&Ce(t.line.text.charAt(f.coverStart+Q));)++Q;if(z&&G<9&&V==0&&Q==f.coverEnd-f.coverStart?te=P.parentNode.getBoundingClientRect():te=jo(a(P,V,Q).getClientRects(),i),te.left||te.right||V==0)break;Q=V,V=V-1,ee="right"}z&&G<11&&(te=Wo(e.display.measure,te))}else{V>0&&(ee=i="right");var ye;e.options.lineWrapping&&(ye=P.getClientRects()).length>1?te=ye[i=="right"?ye.length-1:0]:te=P.getBoundingClientRect()}if(z&&G<9&&!V&&(!te||!te.left&&!te.right)){var Ie=P.parentNode.getClientRects()[0];Ie?te={left:Ie.left,right:Ie.left+nr(e.display),top:Ie.top,bottom:Ie.bottom}:te=ns}for(var Re=te.top-t.rect.top,Ge=te.bottom-t.rect.top,Qe=(Re+Ge)/2,rt=t.view.measure.heights,ft=0;ft<rt.length-1&&!(Qe<rt[ft]);ft++);var St=ft?rt[ft-1]:0,pt=rt[ft],It={left:(ee=="right"?te.right:te.left)-t.rect.left,right:(ee=="left"?te.left:te.right)-t.rect.left,top:St,bottom:pt};return!te.left&&!te.right&&(It.bogus=!0),e.options.singleCursorHeightPerLine||(It.rtop=Re,It.rbottom=Ge),It}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!sn(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}function rs(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 as(e){e.display.externalMeasure=null,w(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rs(e.display.view[t])}function _r(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return y&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return y&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=br(e.widgets[r]));return t}function Gr(e,t,r,i,f){if(!f){var P=pa(t);r.top+=P,r.bottom+=P}if(i=="line")return r;i||(i="local");var V=Vn(t);if(i=="local"?V+=Wr(e.display):V-=e.display.viewOffset,i=="page"||i=="window"){var Q=e.display.lineSpace.getBoundingClientRect();V+=Q.top+(i=="window"?0:os());var ee=Q.left+(i=="window"?0:ss());r.left+=ee,r.right+=ee}return r.top+=V,r.bottom+=V,r}function ls(e,t,r){if(r=="div")return t;var i=t.left,f=t.top;if(r=="page")i-=ss(),f-=os();else if(r=="local"||!r){var P=e.display.sizer.getBoundingClientRect();i+=P.left,f+=P.top}var V=e.display.lineSpace.getBoundingClientRect();return{left:i-V.left,top:f-V.top}}function ma(e,t,r,i,f){return i||(i=st(e.doc,t.line)),Gr(e,i,ts(e,i,t.ch,f),r)}function yi(e,t,r,i,f,P){i=i||st(e.doc,t.line),f||(f=er(e,i));function V(Ge,Qe){var rt=Ti(e,f,Ge,Qe?"right":"left",P);return Qe?rt.left=rt.right:rt.right=rt.left,Gr(e,i,rt,r)}var Q=it(i,e.doc.direction),ee=t.ch,te=t.sticky;if(ee>=i.text.length?(ee=i.text.length,te="before"):ee<=0&&(ee=0,te="after"),!Q)return V(te=="before"?ee-1:ee,te=="before");function de(Ge,Qe,rt){var ft=Q[Qe],St=ft.level==1;return V(rt?Ge-1:Ge,St!=rt)}var ye=nt(Q,ee,te),Ie=tt,Re=de(ee,ye,te=="before");return Ie!=null&&(Re.other=de(ee,Ie,te!="before")),Re}function us(e,t){var r=0;t=T(e.doc,t),e.options.lineWrapping||(r=nr(e.display)*t.ch);var i=st(e.doc,t.line),f=Vn(i)+Wr(e.display);return{left:r,right:r,top:f,bottom:f+i.height}}function ga(e,t,r,i,f){var P=Ue(e,t,r);return P.xRel=f,i&&(P.outside=i),P}function va(e,t,r){var i=e.doc;if(r+=e.display.viewOffset,r<0)return ga(i.first,0,null,-1,-1);var f=Lt(i,r),P=i.first+i.size-1;if(f>P)return ga(i.first+i.size-1,st(i,P).text.length,null,1,1);t<0&&(t=0);for(var V=st(i,f);;){var Q=Go(e,V,f,t,r),ee=pi(V,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!ee)return Q;var te=ee.find(1);if(te.line==f)return te;V=st(i,f=te.line)}}function hs(e,t,r,i){i-=pa(t);var f=t.text.length,P=ze(function(V){return Ti(e,r,V-1).bottom<=i},f,0);return f=ze(function(V){return Ti(e,r,V).top>i},P,f),{begin:P,end:f}}function cs(e,t,r,i){r||(r=er(e,t));var f=Gr(e,t,Ti(e,r,i),"line").top;return hs(e,t,r,f)}function ya(e,t,r,i){return e.bottom<=r?!1:e.top>r?!0:(i?e.left:e.right)>t}function Go(e,t,r,i,f){f-=Vn(t);var P=er(e,t),V=pa(t),Q=0,ee=t.text.length,te=!0,de=it(t,e.doc.direction);if(de){var ye=(e.options.lineWrapping?Ko:zo)(e,t,r,P,de,i,f);te=ye.level!=1,Q=te?ye.from:ye.to-1,ee=te?ye.to:ye.from-1}var Ie=null,Re=null,Ge=ze(function(zt){var jt=Ti(e,P,zt);return jt.top+=V,jt.bottom+=V,ya(jt,i,f,!1)?(jt.top<=f&&jt.left<=i&&(Ie=zt,Re=jt),!0):!1},Q,ee),Qe,rt,ft=!1;if(Re){var St=i-Re.left<Re.right-i,pt=St==te;Ge=Ie+(pt?0:1),rt=pt?"after":"before",Qe=St?Re.left:Re.right}else{!te&&(Ge==ee||Ge==Q)&&Ge++,rt=Ge==0?"after":Ge==t.text.length?"before":Ti(e,P,Ge-(te?1:0)).bottom+V<=f==te?"after":"before";var It=yi(e,Ue(r,Ge,rt),"line",t,P);Qe=It.left,ft=f<It.top?-1:f>=It.bottom?1:0}return Ge=Ae(t.text,Ge,1),ga(r,Ge,rt,ft,i-Qe)}function zo(e,t,r,i,f,P,V){var Q=ze(function(ye){var Ie=f[ye],Re=Ie.level!=1;return ya(yi(e,Ue(r,Re?Ie.to:Ie.from,Re?"before":"after"),"line",t,i),P,V,!0)},0,f.length-1),ee=f[Q];if(Q>0){var te=ee.level!=1,de=yi(e,Ue(r,te?ee.from:ee.to,te?"after":"before"),"line",t,i);ya(de,P,V,!0)&&de.top>V&&(ee=f[Q-1])}return ee}function Ko(e,t,r,i,f,P,V){var Q=hs(e,t,i,V),ee=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var de=null,ye=null,Ie=0;Ie<f.length;Ie++){var Re=f[Ie];if(Re.from>=te||Re.to<=ee)continue;var Ge=Re.level!=1,Qe=Ti(e,i,Ge?Math.min(te,Re.to)-1:Math.max(ee,Re.from)).right,rt=Qe<P?P-Qe+1e9:Qe-P;(!de||ye>rt)&&(de=Re,ye=rt)}return de||(de=f[f.length-1]),de.from<ee&&(de={from:ee,to:de.to,level:de.level}),de.to>te&&(de={from:de.from,to:te,level:de.level}),de}var zi;function tr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(zi==null){zi=u("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)zi.appendChild(document.createTextNode("x")),zi.appendChild(u("br"));zi.appendChild(document.createTextNode("x"))}b(e.measure,zi);var r=zi.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),w(e.measure),r||1}function nr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=u("span","xxxxxxxxxx"),r=u("pre",[t],"CodeMirror-line-like");b(e.measure,r);var i=t.getBoundingClientRect(),f=(i.right-i.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function ba(e){for(var t=e.display,r={},i={},f=t.gutters.clientLeft,P=t.gutters.firstChild,V=0;P;P=P.nextSibling,++V){var Q=e.display.gutterSpecs[V].className;r[Q]=P.offsetLeft+P.clientLeft+f,i[Q]=P.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=tr(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/nr(e.display)-3);return function(f){if(ci(e.doc,f))return 0;var P=0;if(f.widgets)for(var V=0;V<f.widgets.length;V++)f.widgets[V].height&&(P+=f.widgets[V].height);return r?P+(Math.ceil(f.text.length/i)||1)*t:P+t}}function Ea(e){var t=e.doc,r=ds(e);t.iter(function(i){var f=r(i);f!=i.height&&Bt(i,f)})}function Ki(e,t,r,i){var f=e.display;if(!r&&xe(t).getAttribute("cm-not-content")=="true")return null;var P,V,Q=f.lineSpace.getBoundingClientRect();try{P=t.clientX-Q.left,V=t.clientY-Q.top}catch(ye){return null}var ee=va(e,P,V),te;if(i&&ee.xRel>0&&(te=st(e.doc,ee.line).text).length==ee.ch){var de=W(te,te.length,e.options.tabSize)-te.length;ee=Ue(ee.line,Math.max(0,Math.round((P-qa(e.display).left)/nr(e.display))-de))}return ee}function Vi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,i=0;i<r.length;i++)if(t-=r[i].size,t<0)return i}function ri(e,t,r,i){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),i||(i=0);var f=e.display;if(i&&r<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>t)&&(f.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=f.viewTo)Cn&&Di(e.doc,t)<f.viewTo&&Pi(e);else if(r<=f.viewFrom)Cn&&vi(e.doc,r+i)>f.viewFrom?Pi(e):(f.viewFrom+=i,f.viewTo+=i);else if(t<=f.viewFrom&&r>=f.viewTo)Pi(e);else if(t<=f.viewFrom){var P=zr(e,r,r+i,1);P?(f.view=f.view.slice(P.index),f.viewFrom=P.lineN,f.viewTo+=i):Pi(e)}else if(r>=f.viewTo){var V=zr(e,t,t,-1);V?(f.view=f.view.slice(0,V.index),f.viewTo=V.lineN):Pi(e)}else{var Q=zr(e,t,t,-1),ee=zr(e,r,r+i,1);Q&&ee?(f.view=f.view.slice(0,Q.index).concat(ii(e,Q.lineN,ee.lineN)).concat(f.view.slice(ee.index)),f.viewTo+=i):Pi(e)}var te=f.externalMeasured;te&&(r<te.lineN?te.lineN+=i:t<te.lineN+te.size&&(f.externalMeasured=null))}function ki(e,t,r){e.curOp.viewChanged=!0;var i=e.display,f=e.display.externalMeasured;if(f&&t>=f.lineN&&t<f.lineN+f.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var P=i.view[Vi(e,t)];if(P.node==null)return;var V=P.changes||(P.changes=[]);ne(V,r)==-1&&V.push(r)}function Pi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zr(e,t,r,i){var f=Vi(e,t),P,V=e.display.view;if(!Cn||r==e.doc.first+e.doc.size)return{index:f,lineN:r};for(var Q=e.display.viewFrom,ee=0;ee<f;ee++)Q+=V[ee].size;if(Q!=t){if(i>0){if(f==V.length-1)return null;P=Q+V[f].size-t,f++}else P=Q-t;t+=P,r+=P}for(;Di(e.doc,r)!=r;){if(f==(i<0?0:V.length-1))return null;r+=i*V[f-(i<0?1:0)].size,f+=i}return{index:f,lineN:r}}function Vo(e,t,r){var i=e.display,f=i.view;f.length==0||t>=i.viewTo||r<=i.viewFrom?(i.view=ii(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=ii(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Vi(e,t))),i.viewFrom=t,i.viewTo<r?i.view=i.view.concat(ii(e,i.viewTo,r)):i.viewTo>r&&(i.view=i.view.slice(0,Vi(e,r)))),i.viewTo=r}function fs(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var f=t[i];!f.hidden&&(!f.node||f.changes)&&++r}return r}function Er(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var r=e.doc,i={},f=i.cursors=document.createDocumentFragment(),P=i.selection=document.createDocumentFragment(),V=0;V<r.sel.ranges.length;V++){if(!t&&V==r.sel.primIndex)continue;var Q=r.sel.ranges[V];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var ee=Q.empty();(ee||e.options.showCursorWhenSelecting)&&ms(e,Q.head,f),ee||Xo(e,Q,P)}return i}function ms(e,t,r){var i=yi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),f=r.appendChild(u("div","\xA0","CodeMirror-cursor"));if(f.style.left=i.left+"px",f.style.top=i.top+"px",f.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var P=r.appendChild(u("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));P.style.display="",P.style.left=i.other.left+"px",P.style.top=i.other.top+"px",P.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Kr(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,r){var i=e.display,f=e.doc,P=document.createDocumentFragment(),V=qa(e.display),Q=V.left,ee=Math.max(i.sizerWidth,Gi(e)-i.sizer.offsetLeft)-V.right,te=f.direction=="ltr";function de(pt,It,zt,jt){It<0&&(It=0),It=Math.round(It),jt=Math.round(jt),P.appendChild(u("div",null,"CodeMirror-selected","position: absolute; left: "+pt+`px;
|
|
top: `+It+"px; width: "+(zt==null?ee-pt:zt)+`px;
|
|
height: `+(jt-It)+"px"))}function ye(pt,It,zt){var jt=st(f,pt),en=jt.text.length,Tn,zn;function In(Fn,oi){return ma(e,Ue(pt,Fn),"div",jt,oi)}function hi(Fn,oi,$n){var Hn=cs(e,jt,null,Fn),Un=oi=="ltr"==($n=="after")?"left":"right",kn=$n=="after"?Hn.begin:Hn.end-(/\s/.test(jt.text.charAt(Hn.end-1))?2:1);return In(kn,Un)[Un]}var si=it(jt,f.direction);return Je(si,It||0,zt==null?en:zt,function(Fn,oi,$n,Hn){var Un=$n=="ltr",kn=In(Fn,Un?"left":"right"),li=In(oi-1,Un?"right":"left"),mr=It==null&&Fn==0,ji=zt==null&&oi==en,Zn=Hn==0,Si=!si||Hn==si.length-1;if(li.top-kn.top<=3){var Kn=(te?mr:ji)&&Zn,Va=(te?ji:mr)&&Si,Ii=Kn?Q:(Un?kn:li).left,Qi=Va?ee:(Un?li:kn).right;de(Ii,kn.top,Qi-Ii,kn.bottom)}else{var Zi,ei,gr,Xa;Un?(Zi=te&&mr&&Zn?Q:kn.left,ei=te?ee:hi(Fn,$n,"before"),gr=te?Q:hi(oi,$n,"after"),Xa=te&&ji&&Si?ee:li.right):(Zi=te?hi(Fn,$n,"before"):Q,ei=!te&&mr&&Zn?ee:kn.right,gr=!te&&ji&&Si?Q:li.left,Xa=te?hi(oi,$n,"after"):ee),de(Zi,kn.top,ei-Zi,kn.bottom),kn.bottom<li.top&&de(Q,kn.bottom,null,li.top),de(gr,li.top,Xa-gr,li.bottom)}(!Tn||Kr(kn,Tn)<0)&&(Tn=kn),Kr(li,Tn)<0&&(Tn=li),(!zn||Kr(kn,zn)<0)&&(zn=kn),Kr(li,zn)<0&&(zn=li)}),{start:Tn,end:zn}}var Ie=t.from(),Re=t.to();if(Ie.line==Re.line)ye(Ie.line,Ie.ch,Re.ch);else{var Ge=st(f,Ie.line),Qe=st(f,Re.line),rt=Rn(Ge)==Rn(Qe),ft=ye(Ie.line,Ie.ch,rt?Ge.text.length+1:null).end,St=ye(Re.line,rt?0:null,Re.ch).start;rt&&(ft.top<St.top-2?(de(ft.right,ft.top,null,ft.bottom),de(Q,St.top,St.left,St.bottom)):de(ft.right,ft.top,St.left-ft.right,ft.bottom)),ft.bottom<St.top&&de(Q,ft.bottom,null,St.top)}r.appendChild(P)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ir(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),wa(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ir(e))},100)}function wa(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,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function ir(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ne(e,"blur",e,t),e.state.focused=!1,A(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var f=t.view[i],P=e.options.lineWrapping,V=void 0,Q=0;if(f.hidden)continue;if(z&&G<8){var ee=f.node.offsetTop+f.node.offsetHeight;V=ee-r,r=ee}else{var te=f.node.getBoundingClientRect();V=te.bottom-te.top,!P&&f.text.firstChild&&(Q=f.text.firstChild.getBoundingClientRect().right-te.left-1)}var de=f.line.height-V;if((de>.005||de<-.005)&&(Bt(f.line,V),ys(f.line),f.rest))for(var ye=0;ye<f.rest.length;ye++)ys(f.rest[ye]);if(Q>e.display.sizerWidth){var Ie=Math.ceil(Q/nr(e.display));Ie>e.display.maxLineLength&&(e.display.maxLineLength=Ie,e.display.maxLine=f.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;i&&(r.height=i.offsetHeight)}}function Xr(e,t,r){var i=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;i=Math.floor(i-Wr(e));var f=r&&r.bottom!=null?r.bottom:i+e.wrapper.clientHeight,P=Lt(t,i),V=Lt(t,f);if(r&&r.ensure){var Q=r.ensure.from.line,ee=r.ensure.to.line;Q<P?(P=Q,V=Lt(t,Vn(st(t,Q))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=V&&(P=Lt(t,Vn(st(t,ee))-e.wrapper.clientHeight),V=ee)}return{from:P,to:Math.max(V,P+1)}}function Yo(e,t){if(He(e,"scrollCursorIntoView"))return;var r=e.display,i=r.sizer.getBoundingClientRect(),f=null;if(t.top+i.top<0?f=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!d){var P=u("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Wr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+wi(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(P),P.scrollIntoView(f),e.display.lineSpace.removeChild(P)}}function $o(e,t,r,i){i==null&&(i=0);var f;!e.options.lineWrapping&&t==r&&(t=t.ch?Ue(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Ue(t.line,t.ch+1,"before"):t);for(var P=0;P<5;P++){var V=!1,Q=yi(e,t),ee=!r||r==t?Q:yi(e,r);f={left:Math.min(Q.left,ee.left),top:Math.min(Q.top,ee.top)-i,right:Math.max(Q.left,ee.left),bottom:Math.max(Q.bottom,ee.bottom)+i};var te=Ta(e,f),de=e.doc.scrollTop,ye=e.doc.scrollLeft;if(te.scrollTop!=null&&(wr(e,te.scrollTop),Math.abs(e.doc.scrollTop-de)>1&&(V=!0)),te.scrollLeft!=null&&(Xi(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(V=!0)),!V)break}return f}function Jo(e,t){var r=Ta(e,t);r.scrollTop!=null&&wr(e,r.scrollTop),r.scrollLeft!=null&&Xi(e,r.scrollLeft)}function Ta(e,t){var r=e.display,i=tr(e.display);t.top<0&&(t.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,P=da(e),V={};t.bottom-t.top>P&&(t.bottom=t.top+P);var Q=e.doc.height+ca(r),ee=t.top<i,te=t.bottom>Q-i;if(t.top<f)V.scrollTop=ee?0:t.top;else if(t.bottom>f+P){var de=Math.min(t.top,(te?Q:t.bottom)-P);de!=f&&(V.scrollTop=de)}var ye=e.options.fixedGutter?0:r.gutters.offsetWidth,Ie=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-ye,Re=Gi(e)-r.gutters.offsetWidth,Ge=t.right-t.left>Re;return Ge&&(t.right=t.left+Re),t.left<10?V.scrollLeft=0:t.left<Ie?V.scrollLeft=Math.max(0,t.left+ye-(Ge?0:10)):t.right>Re+Ie-3&&(V.scrollLeft=t.right+(Ge?0:10)-Re),V}function Sa(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function rr(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xr(e,t,r){(t!=null||r!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Qo(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),i=us(e,t.to);bs(e,r,i,t.margin)}}function bs(e,t,r,i){var f=Ta(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});xr(e,f.scrollLeft,f.scrollTop)}function wr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;k||Aa(e,{top:t}),_s(e,t,!0),k&&Aa(e),Cr(e,100)}function _s(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Xi(e,t,r,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Tr(e){var t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+ca(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?r:0,docHeight:i,scrollHeight:i+wi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Yi=function(e,t,r){this.cm=r;var i=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=u("div",[u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=f.tabIndex=-1,e(i),e(f),Me(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Me(f,"scroll",function(){f.clientWidth&&t(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Yi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var f=e.viewHeight-(t?i: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=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var P=e.viewWidth-e.barLeft-(r?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+P)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?i:0,bottom:t?i:0}},Yi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Yi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Yi.prototype.zeroWidthHack=function(){var e=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 Z,this.disableVert=new Z},Yi.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function i(){var f=e.getBoundingClientRect(),P=r=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);P!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},Yi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sr=function(){};Sr.prototype.update=function(){return{bottom:0,right:0}},Sr.prototype.setScrollLeft=function(){},Sr.prototype.setScrollTop=function(){},Sr.prototype.clear=function(){};function ar(e,t){t||(t=Tr(e));var r=e.display.barWidth,i=e.display.barHeight;Es(e,t);for(var f=0;f<4&&r!=e.display.barWidth||i!=e.display.barHeight;f++)r!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),Es(e,Tr(e)),r=e.display.barWidth,i=e.display.barHeight}function Es(e,t){var r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var xs={native:Yi,null:Sr};function ws(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Xi(e,t):wr(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function $i(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:++Zo},mi(e.curOp)}function Ji(e){var t=e.curOp;t&&Io(t,function(r){for(var i=0;i<r.ops.length;i++)r.ops[i].cm.curOp=null;qo(r)})}function qo(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var i=0;i<t.length;i++)tl(t[i]);for(var f=0;f<t.length;f++)nl(t[f]);for(var P=0;P<t.length;P++)il(t[P]);for(var V=0;V<t.length;V++)rl(t[V])}function el(e){var t=e.cm,r=t.display;sl(t),e.updateMaxLine&&qi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=Tr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+wi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Gi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Xi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ar(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&gs(e.cm)}function rl(e){var t=e.cm,r=t.display,i=t.doc;if(e.updatedDisplay&&Ts(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Xi(t,e.scrollLeft,!0,!0),e.scrollToPos){var f=$o(t,T(i,e.scrollToPos.from),T(i,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,f)}var P=e.maybeHiddenMarkers,V=e.maybeUnhiddenMarkers;if(P)for(var Q=0;Q<P.length;++Q)P[Q].lines.length||Ne(P[Q],"hide");if(V)for(var ee=0;ee<V.length;++ee)V[ee].lines.length&&Ne(V[ee],"unhide");r.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ne(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ui(e,t){if(e.curOp)return t();$i(e);try{return t()}finally{Ji(e)}}function Wn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);$i(e);try{return t.apply(e,arguments)}finally{Ji(e)}}}function qn(e){return function(){if(this.curOp)return e.apply(this,arguments);$i(this);try{return e.apply(this,arguments)}finally{Ji(this)}}}function Gn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);$i(t);try{return e.apply(this,arguments)}finally{Ji(t)}}}function Cr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,M(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,i=je(e,t.highlightFrontier),f=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(P){if(i.line>=e.display.viewFrom){var V=P.styles,Q=P.text.length>e.options.maxHighlightLength?gt(t.mode,i.state):null,ee=he(e,P,i,!0);Q&&(i.state=Q),P.styles=ee.styles;var te=P.styleClasses,de=ee.classes;de?P.styleClasses=de:te&&(P.styleClasses=null);for(var ye=!V||V.length!=P.styles.length||te!=de&&(!te||!de||te.bgClass!=de.bgClass||te.textClass!=de.textClass),Ie=0;!ye&&Ie<V.length;++Ie)ye=V[Ie]!=P.styles[Ie];ye&&f.push(i.line),P.stateAfter=i.save(),i.nextLine()}else P.text.length<=e.options.maxHighlightLength&&ct(e,P.text,i),P.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>r)return Cr(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),f.length&&ui(e,function(){for(var P=0;P<f.length;P++)ki(e,f[P],"text")})}var $r=function(e,t,r){var i=e.display;this.viewport=t,this.visible=Xr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Gi(e),this.force=r,this.dims=ba(e),this.events=[]};$r.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ne.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=wi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=wi(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=N();if(!t||!_(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&_(e.display.lineDiv,i.anchorNode)&&(r.anchorNode=i.anchorNode,r.anchorOffset=i.anchorOffset,r.focusNode=i.focusNode,r.focusOffset=i.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return Pi(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Cs(e)&&(Pi(e),t.dims=ba(e));var f=i.first+i.size,P=Math.max(t.visible.from-e.options.viewportMargin,i.first),V=Math.min(f,t.visible.to+e.options.viewportMargin);r.viewFrom<P&&P-r.viewFrom<20&&(P=Math.max(i.first,r.viewFrom)),r.viewTo>V&&r.viewTo-V<20&&(V=Math.min(f,r.viewTo)),Cn&&(P=Di(e.doc,P),V=vi(e.doc,V));var Q=P!=r.viewFrom||V!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,P,V),r.viewOffset=Vn(st(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var ee=fs(e);if(!Q&&ee==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var te=ol(e);return ee>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),ee>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(te),w(r.cursorDiv),w(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,Q&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Cr(e,400)),r.updateLineNumbers=null,!0}function Ts(e,t){for(var r=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Gi(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ca(e.display)-da(e),r.top)}),t.visible=Xr(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Xr(e.display,e.doc,r));if(!Ca(e,t))break;Vr(e);var f=Tr(e);Er(e),ar(e,f),Oa(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 Aa(e,t){var r=new $r(e,t);if(Ca(e,r)){Vr(e),Ts(e,r);var i=Tr(e);Er(e),ar(e,i),Oa(e,i),r.finish()}}function ul(e,t,r){var i=e.display,f=e.options.lineNumbers,P=i.lineDiv,V=P.firstChild;function Q(Ge){var Qe=Ge.nextSibling;return n&&o&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),Qe}for(var ee=i.view,te=i.viewFrom,de=0;de<ee.length;de++){var ye=ee[de];if(!ye.hidden)if(!ye.node||ye.node.parentNode!=P){var Ie=No(e,ye,te,r);P.insertBefore(Ie,V)}else{for(;V!=ye.node;)V=Q(V);var Re=f&&t!=null&&t<=te&&ye.lineNumber;ye.changes&&(ne(ye.changes,"gutter")>-1&&(Re=!1),Ya(e,ye,te,r)),Re&&(w(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode(rn(e.options,te)))),V=ye.node.nextSibling}te+=ye.size}for(;V;)V=Q(V)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oa(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+wi(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,f=t.gutters.offsetWidth,P=i+"px",V=0;V<r.length;V++)if(!r[V].hidden){e.options.fixedGutter&&(r[V].gutter&&(r[V].gutter.style.left=P),r[V].gutterBackground&&(r[V].gutterBackground.style.left=P));var Q=r[V].alignable;if(Q)for(var ee=0;ee<Q.length;ee++)Q[ee].style.left=P}e.options.fixedGutter&&(t.gutters.style.left=i+f+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=rn(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var f=i.measure.appendChild(u("div",[u("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),P=f.firstChild.offsetWidth,V=f.offsetWidth-P;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(P,i.lineGutter.offsetWidth-V)+1,i.lineNumWidth=i.lineNumInnerWidth+V,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ra(e.display),!0}return!1}function La(e,t){for(var r=[],i=!1,f=0;f<e.length;f++){var P=e[f],V=null;if(typeof P!="string"&&(V=P.style,P=P.className),P=="CodeMirror-linenumbers")if(t)i=!0;else continue;r.push({className:P,style:V})}return t&&!i&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function As(e){var t=e.gutters,r=e.gutterSpecs;w(t),e.lineGutter=null;for(var i=0;i<r.length;++i){var f=r[i],P=f.className,V=f.style,Q=t.appendChild(u("div",null,"CodeMirror-gutter "+P));V&&(Q.style.cssText=V),P=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Ra(e)}function Ar(e){As(e.display),ri(e),Ss(e)}function hl(e,t,r,i){var f=this;this.input=r,f.scrollbarFiller=u("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=u("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=v("div",null,"CodeMirror-code"),f.selectionDiv=u("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=u("div",null,"CodeMirror-cursors"),f.measure=u("div",null,"CodeMirror-measure"),f.lineMeasure=u("div",null,"CodeMirror-measure"),f.lineSpace=v("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var P=v("div",[f.lineSpace],"CodeMirror-lines");f.mover=u("div",[P],null,"position: relative"),f.sizer=u("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=u("div",null,null,"position: absolute; height: "+ae+"px; width: 1px;"),f.gutters=u("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=u("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=u("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),z&&G<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!n&&!(k&&h)&&(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=La(i.gutters,i.lineNumbers),As(f),r.init(f)}var Jr=0,di=null;z?di=-.53:k?di=15:y?di=-.7:m&&(di=-1/3);function Rs(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function cl(e){var t=Rs(e);return t.x*=di,t.y*=di,t}function Os(e,t){var r=Rs(t),i=r.x,f=r.y,P=e.display,V=P.scroller,Q=V.scrollWidth>V.clientWidth,ee=V.scrollHeight>V.clientHeight;if(!(i&&Q||f&&ee))return;if(f&&o&&n){e:for(var te=t.target,de=P.view;te!=V;te=te.parentNode)for(var ye=0;ye<de.length;ye++)if(de[ye].node==te){e.display.currentWheelTarget=te;break e}}if(i&&!k&&!g&&di!=null){f&&ee&&wr(e,Math.max(0,V.scrollTop+f*di)),Xi(e,Math.max(0,V.scrollLeft+i*di)),(!f||f&&ee)&&re(t),P.wheelStartX=null;return}if(f&&di!=null){var Ie=f*di,Re=e.doc.scrollTop,Ge=Re+P.wrapper.clientHeight;Ie<0?Re=Math.max(0,Re+Ie-50):Ge=Math.min(e.doc.height,Ge+Ie+50),Aa(e,{top:Re,bottom:Ge})}Jr<20&&(P.wheelStartX==null?(P.wheelStartX=V.scrollLeft,P.wheelStartY=V.scrollTop,P.wheelDX=i,P.wheelDY=f,setTimeout(function(){if(P.wheelStartX==null)return;var Qe=V.scrollLeft-P.wheelStartX,rt=V.scrollTop-P.wheelStartY,ft=rt&&P.wheelDY&&rt/P.wheelDY||Qe&&P.wheelDX&&Qe/P.wheelDX;if(P.wheelStartX=P.wheelStartY=null,!ft)return;di=(di*Jr+ft)/(Jr+1),++Jr},200)):(P.wheelDX+=i,P.wheelDY+=f))}var fi=function(e,t){this.ranges=e,this.primIndex=t};fi.prototype.primary=function(){return this.ranges[this.primIndex]},fi.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 r=this.ranges[t],i=e.ranges[t];if(!pn(r.anchor,i.anchor)||!pn(r.head,i.head))return!1}return!0},fi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new gn(xn(this.ranges[t].anchor),xn(this.ranges[t].head));return new fi(e,this.primIndex)},fi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},fi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(Et(t,i.from())>=0&&Et(e,i.to())<=0)return r}return-1};var gn=function(e,t){this.anchor=e,this.head=t};gn.prototype.from=function(){return yn(this.anchor,this.head)},gn.prototype.to=function(){return Sn(this.anchor,this.head)},gn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function bi(e,t,r){var i=e&&e.options.selectionsMayTouch,f=t[r];t.sort(function(Ie,Re){return Et(Ie.from(),Re.from())}),r=ne(t,f);for(var P=1;P<t.length;P++){var V=t[P],Q=t[P-1],ee=Et(Q.to(),V.from());if(i&&!V.empty()?ee>0:ee>=0){var te=yn(Q.from(),V.from()),de=Sn(Q.to(),V.to()),ye=Q.empty()?V.from()==V.head:Q.from()==Q.head;P<=r&&--r,t.splice(--P,2,new gn(ye?de:te,ye?te:de))}}return new fi(t,r)}function Mi(e,t){return new fi([new gn(e,t||e)],0)}function Ni(e){return e.text?Ue(e.from.line+e.text.length-1,Oe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Et(e,t.from)<0)return e;if(Et(e,t.to)<=0)return Ni(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Ni(t).ch-t.to.ch),Ue(r,i)}function Ia(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var f=e.sel.ranges[i];r.push(new gn(Ls(f.anchor,t),Ls(f.head,t)))}return bi(e.cm,r,e.sel.primIndex)}function Is(e,t,r){return e.line==t.line?Ue(r.line,e.ch-t.ch+r.ch):Ue(r.line+(e.line-t.line),e.ch)}function dl(e,t,r){for(var i=[],f=Ue(e.first,0),P=f,V=0;V<t.length;V++){var Q=t[V],ee=Is(Q.from,f,P),te=Is(Ni(Q),f,P);if(f=Q.to,P=te,r=="around"){var de=e.sel.ranges[V],ye=Et(de.head,de.anchor)<0;i[V]=new gn(ye?te:ee,ye?ee:te)}else i[V]=new gn(ee,ee)}return new fi(i,e.sel.primIndex)}function Da(e){e.doc.mode=vn(e.options,e.doc.modeOption),Rr(e)}function Rr(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,Cr(e,100),e.state.modeGen++,e.curOp&&ri(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&Oe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,r,i){function f(St){return r?r[St]:null}function P(St,pt,It){Xn(St,pt,It,i),Yn(St,"change",St,t)}function V(St,pt){for(var It=[],zt=St;zt<pt;++zt)It.push(new Ai(te[zt],f(zt),i));return It}var Q=t.from,ee=t.to,te=t.text,de=st(e,Q.line),ye=st(e,ee.line),Ie=Oe(te),Re=f(te.length-1),Ge=ee.line-Q.line;if(t.full)e.insert(0,V(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var Qe=V(0,te.length-1);P(ye,ye.text,Re),Ge&&e.remove(Q.line,Ge),Qe.length&&e.insert(Q.line,Qe)}else if(de==ye)if(te.length==1)P(de,de.text.slice(0,Q.ch)+Ie+de.text.slice(ee.ch),Re);else{var rt=V(1,te.length-1);rt.push(new Ai(Ie+de.text.slice(ee.ch),Re,i)),P(de,de.text.slice(0,Q.ch)+te[0],f(0)),e.insert(Q.line+1,rt)}else if(te.length==1)P(de,de.text.slice(0,Q.ch)+te[0]+ye.text.slice(ee.ch),f(0)),e.remove(Q.line+1,Ge);else{P(de,de.text.slice(0,Q.ch)+te[0],f(0)),P(ye,Ie+ye.text.slice(ee.ch),Re);var ft=V(1,te.length-1);Ge>1&&e.remove(Q.line+1,Ge-1),e.insert(Q.line+1,ft)}Yn(e,"change",e,t)}function Fi(e,t,r){function i(f,P,V){if(f.linked)for(var Q=0;Q<f.linked.length;++Q){var ee=f.linked[Q];if(ee.doc==P)continue;var te=V&&ee.sharedHist;if(r&&!te)continue;t(ee.doc,te),i(ee.doc,f,te)}}i(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ps(e),e.options.lineWrapping||qi(e),e.options.mode=t.modeOption,ri(e)}function Ps(e){(e.doc.direction=="rtl"?F:A)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){ui(e,function(){Ps(e),ri(e)})}function Qr(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 Pa(e,t){var r={from:xn(t.from),to:Ni(t),text:cn(e,t.from,t.to)};return Fs(e,r,t.from.line,t.to.line+1),Fi(e,function(i){return Fs(i,r,t.from.line,t.to.line+1)},!0),r}function Ms(e){for(;e.length;){var t=Oe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ms(e.done),Oe(e.done);if(e.done.length&&!Oe(e.done).ranges)return Oe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Oe(e.done)}function Ns(e,t,r,i){var f=e.history;f.undone.length=0;var P=+new Date,V,Q;if((f.lastOp==i||f.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&f.lastModTime>P-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(V=pl(f,f.lastOp==i)))Q=Oe(V.changes),Et(t.from,t.to)==0&&Et(t.from,Q.to)==0?Q.to=Ni(t):V.changes.push(Pa(e,t));else{var ee=Oe(f.done);for((!ee||!ee.ranges)&&Zr(e.sel,f.done),V={changes:[Pa(e,t)],generation:f.generation},f.done.push(V);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(r),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=P,f.lastOp=f.lastSelOp=i,f.lastOrigin=f.lastSelOrigin=t.origin,Q||Ne(e,"historyAdded")}function ml(e,t,r,i){var f=t.charAt(0);return f=="*"||f=="+"&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,i){var f=e.history,P=i&&i.origin;r==f.lastSelOp||P&&f.lastSelOrigin==P&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==P||ml(e,P,Oe(f.done),t))?f.done[f.done.length-1]=t:Zr(t,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=P,f.lastSelOp=r,i&&i.clearRedo!==!1&&Ms(f.undone)}function Zr(e,t){var r=Oe(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,i){var f=t["spans_"+e.id],P=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(V){V.markedSpans&&((f||(f=t["spans_"+e.id]={}))[P]=V.markedSpans),++P})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=[],f=0;f<t.text.length;++f)i.push(vl(r[f]));return i}function Us(e,t){var r=yl(e,t),i=Bn(e,t);if(!r)return i;if(!i)return r;for(var f=0;f<r.length;++f){var P=r[f],V=i[f];if(P&&V){e:for(var Q=0;Q<V.length;++Q){for(var ee=V[Q],te=0;te<P.length;++te)if(P[te].marker==ee.marker)continue e;P.push(ee)}}else V&&(r[f]=V)}return r}function sr(e,t,r){for(var i=[],f=0;f<e.length;++f){var P=e[f];if(P.ranges){i.push(r?fi.prototype.deepCopy.call(P):P);continue}var V=P.changes,Q=[];i.push({changes:Q});for(var ee=0;ee<V.length;++ee){var te=V[ee],de=void 0;if(Q.push({from:te.from,to:te.to,text:te.text}),t)for(var ye in te)(de=ye.match(/^spans_(\d+)$/))&&(ne(t,Number(de[1]))>-1&&(Oe(Q)[ye]=te[ye],delete te[ye]))}}return i}function Ma(e,t,r,i){if(i){var f=e.anchor;if(r){var P=Et(t,f)<0;P!=Et(r,f)<0?(f=t,t=r):P!=Et(t,r)<0&&(t=r)}return new gn(f,t)}else return new gn(r||t,t)}function qr(e,t,r,i,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Qn(e,new fi([Ma(e.sel.primary(),t,r,f)],0),i)}function Bs(e,t,r){for(var i=[],f=e.cm&&(e.cm.display.shift||e.extend),P=0;P<e.sel.ranges.length;P++)i[P]=Ma(e.sel.ranges[P],t[P],null,f);var V=bi(e.cm,i,e.sel.primIndex);Qn(e,V,r)}function Na(e,t,r,i){var f=e.sel.ranges.slice(0);f[t]=r,Qn(e,bi(e.cm,f,e.sel.primIndex),i)}function js(e,t,r,i){Qn(e,Mi(t,r),i)}function bl(e,t,r){var i={ranges:t.ranges,update:function(f){this.ranges=[];for(var P=0;P<f.length;P++)this.ranges[P]=new gn(T(e,f[P].anchor),T(e,f[P].head))},origin:r&&r.origin};return Ne(e,"beforeSelectionChange",e,i),e.cm&&Ne(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?bi(e.cm,i.ranges,i.ranges.length-1):t}function Hs(e,t,r){var i=e.history.done,f=Oe(i);f&&f.ranges?(i[i.length-1]=t,ea(e,t,r)):Qn(e,t,r)}function Qn(e,t,r){ea(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function ea(e,t,r){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var i=r&&r.bias||(Et(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,zs(e,t,i,!0)),!(r&&r.scroll===!1)&&e.cm&&rr(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Te(e.cm)),Yn(e,"cursorActivity",e)}function Gs(e){Ws(e,zs(e,e.sel,null,!1))}function zs(e,t,r,i){for(var f,P=0;P<t.ranges.length;P++){var V=t.ranges[P],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[P],ee=ta(e,V.anchor,Q&&Q.anchor,r,i),te=ta(e,V.head,Q&&Q.head,r,i);(f||ee!=V.anchor||te!=V.head)&&(f||(f=t.ranges.slice(0,P)),f[P]=new gn(ee,te))}return f?bi(e.cm,f,t.primIndex):t}function or(e,t,r,i,f){var P=st(e,t.line);if(P.markedSpans)for(var V=0;V<P.markedSpans.length;++V){var Q=P.markedSpans[V],ee=Q.marker,te="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,de="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((Q.from==null||(te?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(de?Q.to>=t.ch:Q.to>t.ch))){if(f&&(Ne(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(P.markedSpans){--V;continue}else break;if(!ee.atomic)continue;if(r){var ye=ee.find(i<0?1:-1),Ie=void 0;if((i<0?de:te)&&(ye=Ks(e,ye,-i,ye&&ye.line==t.line?P:null)),ye&&ye.line==t.line&&(Ie=Et(ye,r))&&(i<0?Ie<0:Ie>0))return or(e,ye,t,i,f)}var Re=ee.find(i<0?-1:1);return(i<0?te:de)&&(Re=Ks(e,Re,i,Re.line==t.line?P:null)),Re?or(e,Re,t,i,f):null}}return t}function ta(e,t,r,i,f){var P=i||1,V=or(e,t,r,P,f)||!f&&or(e,t,r,P,!0)||or(e,t,r,-P,f)||!f&&or(e,t,r,-P,!0);return V||(e.cantEdit=!0,Ue(e.first,0))}function Ks(e,t,r,i){return r<0&&t.ch==0?t.line>e.first?T(e,Ue(t.line-1)):null:r>0&&t.ch==(i||st(e,t.line)).text.length?t.line<e.first+e.size-1?Ue(t.line+1,0):null:new Ue(t.line,t.ch+r)}function Vs(e){e.setSelection(Ue(e.firstLine(),0),Ue(e.lastLine()),fe)}function Xs(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return r&&(i.update=function(f,P,V,Q){f&&(i.from=T(e,f)),P&&(i.to=T(e,P)),V&&(i.text=V),Q!==void 0&&(i.origin=Q)}),Ne(e,"beforeChange",e,i),e.cm&&Ne(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function lr(e,t,r){if(e.cm){if(!e.cm.curOp)return Wn(e.cm,lr)(e,t,r);if(e.cm.state.suppressEdits)return}if((me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var i=bn&&!r&&ti(e,t.from,t.to);if(i)for(var f=i.length-1;f>=0;--f)Ys(e,{from:i[f].from,to:i[f].to,text:f?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&Et(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),Or(e,t,r,Bn(e,t));var i=[];Fi(e,function(f,P){!P&&ne(i,f.history)==-1&&(Zs(f.history,t),i.push(f.history)),Or(f,t,null,Bn(f,t))})}function na(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!r)return;for(var f=e.history,P,V=e.sel,Q=t=="undo"?f.done:f.undone,ee=t=="undo"?f.undone:f.done,te=0;te<Q.length&&!(P=Q[te],r?P.ranges&&!P.equals(e.sel):!P.ranges);te++);if(te==Q.length)return;for(f.lastOrigin=f.lastSelOrigin=null;;)if(P=Q.pop(),P.ranges){if(Zr(P,ee),r&&!P.equals(e.sel)){Qn(e,P,{clearRedo:!1});return}V=P}else if(i){Q.push(P);return}else break;var de=[];Zr(V,ee),ee.push({changes:de,generation:f.generation}),f.generation=P.generation||++f.maxGeneration;for(var ye=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),Ie=function(Qe){var rt=P.changes[Qe];if(rt.origin=t,ye&&!Xs(e,rt,!1))return Q.length=0,{};de.push(Pa(e,rt));var ft=Qe?Ia(e,rt):Oe(Q);Or(e,rt,ft,Us(e,rt)),!Qe&&e.cm&&e.cm.scrollIntoView({from:rt.from,to:Ni(rt)});var St=[];Fi(e,function(pt,It){!It&&ne(St,pt.history)==-1&&(Zs(pt.history,rt),St.push(pt.history)),Or(pt,rt,null,Us(pt,rt))})},Re=P.changes.length-1;Re>=0;--Re){var Ge=Ie(Re);if(Ge)return Ge.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new fi(Ye(e.sel.ranges,function(f){return new gn(Ue(f.anchor.line+t,f.anchor.ch),Ue(f.head.line+t,f.head.ch))}),e.sel.primIndex),e.cm){ri(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)ki(e.cm,i,"gutter")}}function Or(e,t,r,i){if(e.cm&&!e.cm.curOp)return Wn(e.cm,Or)(e,t,r,i);if(t.to.line<e.first){$s(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);$s(e,f),t={from:Ue(e.first,0),to:Ue(t.to.line+f,t.to.ch),text:[Oe(t.text)],origin:t.origin}}var P=e.lastLine();t.to.line>P&&(t={from:t.from,to:Ue(P,st(e,P).text.length),text:[t.text[0]],origin:t.origin}),t.removed=cn(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?_l(e.cm,t,i):ka(e,t,i),ea(e,r,fe),e.cantEdit&&ta(e,Ue(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,r){var i=e.doc,f=e.display,P=t.from,V=t.to,Q=!1,ee=P.line;e.options.lineWrapping||(ee=_t(Rn(st(i,P.line))),i.iter(ee,V.line+1,function(Re){if(Re==f.maxLine)return Q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Te(e),ka(i,t,r,ds(e)),e.options.lineWrapping||(i.iter(ee,P.line+t.text.length,function(Re){var Ge=Wi(Re);Ge>f.maxLineLength&&(f.maxLine=Re,f.maxLineLength=Ge,f.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Xt(i,P.line),Cr(e,400);var te=t.text.length-(V.line-P.line)-1;t.full?ri(e):P.line==V.line&&t.text.length==1&&!Ds(e.doc,t)?ki(e,P.line,"text"):ri(e,P.line,V.line+1,te);var de=me(e,"changes"),ye=me(e,"change");if(ye||de){var Ie={from:P,to:V,text:t.text,removed:t.removed,origin:t.origin};ye&&Yn(e,"change",e,Ie),de&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ie)}e.display.selForContextMenu=null}function ur(e,t,r,i,f){var P;i||(i=r),Et(i,r)<0&&(P=[i,r],r=P[0],i=P[1]),typeof t=="string"&&(t=e.splitLines(t)),lr(e,{from:r,to:i,text:t,origin:f})}function Js(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,r,i){for(var f=0;f<e.length;++f){var P=e[f],V=!0;if(P.ranges){P.copied||(P=e[f]=P.deepCopy(),P.copied=!0);for(var Q=0;Q<P.ranges.length;Q++)Js(P.ranges[Q].anchor,t,r,i),Js(P.ranges[Q].head,t,r,i);continue}for(var ee=0;ee<P.changes.length;++ee){var te=P.changes[ee];if(r<te.from.line)te.from=Ue(te.from.line+i,te.from.ch),te.to=Ue(te.to.line+i,te.to.ch);else if(t<=te.to.line){V=!1;break}}V||(e.splice(0,f+1),f=0)}}function Zs(e,t){var r=t.from.line,i=t.to.line,f=t.text.length-(i-r)-1;Qs(e.done,r,i,f),Qs(e.undone,r,i,f)}function Lr(e,t,r,i){var f=t,P=t;return typeof t=="number"?P=st(e,X(e,t)):f=_t(t),f==null?null:(i(P,f)&&e.cm&&ki(e.cm,f,r),P)}function Ir(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}Ir.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;r<i;++r){var f=this.lines[r];this.height-=f.height,ot(f),Yn(f,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;e<i;++e)if(r(this.lines[e]))return!0}};function Dr(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var f=e[i];t+=f.chunkSize(),r+=f.height,f.parent=this}this.size=t,this.height=r,this.parent=null}Dr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],f=i.chunkSize();if(e<f){var P=Math.min(t,f-e),V=i.height;if(i.removeInner(e,P),this.height-=V-i.height,f==P&&(this.children.splice(r--,1),i.parent=null),(t-=P)==0)break;e=0}else e-=f}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ir))){var Q=[];this.collapse(Q),this.children=[new Ir(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,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var f=this.children[i],P=f.chunkSize();if(e<=P){if(f.insertInner(e,t,r),f.lines&&f.lines.length>50){for(var V=f.lines.length%25+25,Q=V;Q<f.lines.length;){var ee=new Ir(f.lines.slice(Q,Q+=25));f.height-=ee.height,this.children.splice(++i,0,ee),ee.parent=this}f.lines=f.lines.slice(0,V),this.maybeSpill()}break}e-=P}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Dr(t);if(e.parent){e.size-=r.size,e.height-=r.height;var f=ne(e.parent.children,e);e.parent.children.splice(f+1,0,r)}else{var i=new Dr(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var f=this.children[i],P=f.chunkSize();if(e<P){var V=Math.min(t,P-e);if(f.iterN(e,V,r))return!0;if((t-=V)==0)break;e=0}else e-=P}}};var kr=function(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t};kr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=_t(r);if(i==null||!t)return;for(var f=0;f<t.length;++f)t[f]==this&&t.splice(f--,1);t.length||(r.widgets=null);var P=br(this);Bt(r,Math.max(0,r.height-P)),e&&(ui(e,function(){qs(e,r,-P),ki(e,i,"widget")}),Yn(e,"lineWidgetCleared",e,this,i))},kr.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var f=br(this)-t;if(!f)return;ci(this.doc,i)||Bt(i,i.height+f),r&&ui(r,function(){r.curOp.forceUpdate=!0,qs(r,i,f),Yn(r,"lineWidgetChanged",r,e,_t(i))})},ge(kr);function qs(e,t,r){Vn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function El(e,t,r,i){var f=new kr(e,r,i),P=e.cm;return P&&f.noHScroll&&(P.display.alignWidgets=!0),Lr(e,t,"widget",function(V){var Q=V.widgets||(V.widgets=[]);if(f.insertAt==null?Q.push(f):Q.splice(Math.min(Q.length-1,Math.max(0,f.insertAt)),0,f),f.line=V,P&&!ci(e,V)){var ee=Vn(V)<e.scrollTop;Bt(V,V.height+br(f)),ee&&Sa(P,f.height),P.curOp.forceUpdate=!0}return!0}),P&&Yn(P,"lineWidgetAdded",P,f,typeof t=="number"?t:_t(t)),f}var eo=0,Ui=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Ui.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&$i(e),me(this,"clear")){var r=this.find();r&&Yn(this,"clear",r.from,r.to)}for(var i=null,f=null,P=0;P<this.lines.length;++P){var V=this.lines[P],Q=bt(V.markedSpans,this);e&&!this.collapsed?ki(e,_t(V),"text"):e&&(Q.to!=null&&(f=_t(V)),Q.from!=null&&(i=_t(V))),V.markedSpans=Wt(V.markedSpans,Q),Q.from==null&&this.collapsed&&!ci(this.doc,V)&&e&&Bt(V,tr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var te=Rn(this.lines[ee]),de=Wi(te);de>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=de,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&ri(e,i,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&Yn(e,"markerCleared",e,this,i,f),t&&Ji(e),this.parent&&this.parent.clear()},Ui.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,i,f=0;f<this.lines.length;++f){var P=this.lines[f],V=bt(P.markedSpans,this);if(V.from!=null&&(r=Ue(t?P:_t(P),V.from),e==-1))return r;if(V.to!=null&&(i=Ue(t?P:_t(P),V.to),e==1))return i}return r&&{from:r,to:i}},Ui.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;if(!t||!i)return;ui(i,function(){var f=t.line,P=_t(t.line),V=fa(i,P);if(V&&(rs(V),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!ci(r.doc,f)&&r.height!=null){var Q=r.height;r.height=null;var ee=br(r)-Q;ee&&Bt(f,f.height+ee)}Yn(i,"markerChanged",i,e)})},Ui.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ne(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ui.prototype.detachLine=function(e){if(this.lines.splice(ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ge(Ui);function hr(e,t,r,i,f){if(i&&i.shared)return xl(e,t,r,i,f);if(e.cm&&!e.cm.curOp)return Wn(e.cm,hr)(e,t,r,i,f);var P=new Ui(e,f),V=Et(t,r);if(i&&E(i,P,!1),V>0||V==0&&P.clearWhenEmpty!==!1)return P;if(P.replacedWith&&(P.collapsed=!0,P.widgetNode=v("span",[P.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||P.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(P.widgetNode.insertLeft=!0)),P.collapsed){if(Mn(e,t.line,t,r,P)||t.line!=r.line&&Mn(e,r.line,t,r,P))throw new Error("Inserting collapsed marker partially overlapping an existing one");Zt()}P.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var Q=t.line,ee=e.cm,te;if(e.iter(Q,r.line+1,function(ye){ee&&P.collapsed&&!ee.options.lineWrapping&&Rn(ye)==ee.display.maxLine&&(te=!0),P.collapsed&&Q!=t.line&&Bt(ye,0),Jt(ye,new Rt(P,Q==t.line?t.ch:null,Q==r.line?r.ch:null)),++Q}),P.collapsed&&e.iter(t.line,r.line+1,function(ye){ci(e,ye)&&Bt(ye,0)}),P.clearOnEnter&&Me(P,"beforeCursorEnter",function(){return P.clear()}),P.readOnly&&(En(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),P.collapsed&&(P.id=++eo,P.atomic=!0),ee){if(te&&(ee.curOp.updateMaxLine=!0),P.collapsed)ri(ee,t.line,r.line+1);else if(P.className||P.startStyle||P.endStyle||P.css||P.attributes||P.title)for(var de=t.line;de<=r.line;de++)ki(ee,de,"text");P.atomic&&Gs(ee.doc),Yn(ee,"markerAdded",ee,P)}return P}var Pr=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Pr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Yn(this,"clear")},Pr.prototype.find=function(e,t){return this.primary.find(e,t)},ge(Pr);function xl(e,t,r,i,f){i=E(i),i.shared=!1;var P=[hr(e,t,r,i,f)],V=P[0],Q=i.widgetNode;return Fi(e,function(ee){Q&&(i.widgetNode=Q.cloneNode(!0)),P.push(hr(ee,T(ee,t),T(ee,r),i,f));for(var te=0;te<ee.linked.length;++te)if(ee.linked[te].isParent)return;V=Oe(P)}),new Pr(P,V)}function to(e){return e.findMarks(Ue(e.first,0),e.clipPos(Ue(e.lastLine())),function(t){return t.parent})}function wl(e,t){for(var r=0;r<t.length;r++){var i=t[r],f=i.find(),P=e.clipPos(f.from),V=e.clipPos(f.to);if(Et(P,V)){var Q=hr(e,P,V,i.primary,i.primary.type);i.markers.push(Q),Q.parent=i}}}function Tl(e){for(var t=function(i){var f=e[i],P=[f.primary.doc];Fi(f.primary.doc,function(ee){return P.push(ee)});for(var V=0;V<f.markers.length;V++){var Q=f.markers[V];ne(P,Q.doc)==-1&&(Q.parent=null,f.markers.splice(V--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,ai=function(e,t,r,i,f){if(!(this instanceof ai))return new ai(e,t,r,i,f);r==null&&(r=0),Dr.call(this,[new Ir([new Ai("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var P=Ue(r,0);this.sel=Mi(P),this.history=new Qr(null),this.id=++Sl,this.modeOption=t,this.lineSep=i,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:P,to:P,text:e}),Qn(this,Mi(P),fe)};ai.prototype=Ze(Dr.prototype,{constructor:ai,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Gt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Gn(function(e){var t=Ue(this.first,0),r=this.first+this.size-1;lr(this,{from:t,to:Ue(r,st(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&xr(this.cm,0,0),Qn(this,Mi(t),fe)}),replaceRange:function(e,t,r,i){t=T(this,t),r=r?T(this,r):t,ur(this,e,t,r,i)},getRange:function(e,t,r){var i=cn(this,T(this,e),T(this,t));return r===!1?i:i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qt(this,e))return st(this,e)},getLineNumber:function(e){return _t(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=st(this,e)),Rn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return T(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Gn(function(e,t,r){js(this,T(this,typeof e=="number"?Ue(e,t||0):e),null,r)}),setSelection:Gn(function(e,t,r){js(this,T(this,e),T(this,t||e),r)}),extendSelection:Gn(function(e,t,r){qr(this,T(this,e),t&&T(this,t),r)}),extendSelections:Gn(function(e,t){Bs(this,H(this,e),t)}),extendSelectionsBy:Gn(function(e,t){var r=Ye(this.sel.ranges,e);Bs(this,H(this,r),t)}),setSelections:Gn(function(e,t,r){if(!e.length)return;for(var i=[],f=0;f<e.length;f++)i[f]=new gn(T(this,e[f].anchor),T(this,e[f].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Qn(this,bi(this.cm,i,t),r)}),addSelection:Gn(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new gn(T(this,e),T(this,t||e))),Qn(this,bi(this.cm,i,i.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,i=0;i<t.length;i++){var f=cn(this,t[i].from(),t[i].to());r=r?r.concat(f):f}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var f=cn(this,r[i].from(),r[i].to());e!==!1&&(f=f.join(e||this.lineSeparator())),t[i]=f}return t},replaceSelection:function(e,t,r){for(var i=[],f=0;f<this.sel.ranges.length;f++)i[f]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:Gn(function(e,t,r){for(var i=[],f=this.sel,P=0;P<f.ranges.length;P++){var V=f.ranges[P];i[P]={from:V.from(),to:V.to(),text:this.splitLines(e[P]),origin:r}}for(var Q=t&&t!="end"&&dl(this,i,t),ee=i.length-1;ee>=0;ee--)lr(this,i[ee]);Q?Hs(this,Q):this.cm&&rr(this.cm)}),undo:Gn(function(){na(this,"undo")}),redo:Gn(function(){na(this,"redo")}),undoSelection:Gn(function(){na(this,"undo",!0)}),redoSelection:Gn(function(){na(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Qr(this.history.maxGeneration),Fi(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:sr(this.history.done),undone:sr(this.history.undone)}},setHistory:function(e){var t=this.history=new Qr(this.history.maxGeneration);t.done=sr(e.done.slice(0),null,!0),t.undone=sr(e.undone.slice(0),null,!0)},setGutterMarker:Gn(function(e,t,r){return Lr(this,e,"gutter",function(i){var f=i.gutterMarkers||(i.gutterMarkers={});return f[t]=r,!r&&oe(f)&&(i.gutterMarkers=null),!0})}),clearGutter:Gn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Lr(t,r,"gutter",function(){return r.gutterMarkers[e]=null,oe(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Qt(this,e))return null;if(t=e,e=st(this,e),!e)return null}else if(t=_t(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:Gn(function(e,t,r){return Lr(this,e,t=="gutter"?"gutter":"class",function(i){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[f])i[f]=r;else{if(O(r).test(i[f]))return!1;i[f]+=" "+r}return!0})}),removeLineClass:Gn(function(e,t,r){return Lr(this,e,t=="gutter"?"gutter":"class",function(i){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",P=i[f];if(P)if(r==null)i[f]=null;else{var V=P.match(O(r));if(!V)return!1;var Q=V.index+V[0].length;i[f]=P.slice(0,V.index)+(!V.index||Q==P.length?"":" ")+P.slice(Q)||null}else return!1;return!0})}),addLineWidget:Gn(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return hr(this,T(this,e),T(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=T(this,e),hr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=T(this,e);var t=[],r=st(this,e.line).markedSpans;if(r)for(var i=0;i<r.length;++i){var f=r[i];(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,r){e=T(this,e),t=T(this,t);var i=[],f=e.line;return this.iter(e.line,t.line+1,function(P){var V=P.markedSpans;if(V)for(var Q=0;Q<V.length;Q++){var ee=V[Q];!(ee.to!=null&&f==e.line&&e.ch>=ee.to||ee.from==null&&f!=e.line||ee.from!=null&&f==t.line&&ee.from>=t.ch)&&(!r||r(ee.marker))&&i.push(ee.marker.parent||ee.marker)}++f}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)r[i].from!=null&&e.push(r[i].marker)}),e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;return this.iter(function(f){var P=f.text.length+i;if(P>e)return t=e,!0;e-=P,++r}),T(this,Ue(r,t))},indexFromPos:function(e){e=T(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+r}),t},copy:function(e){var t=new ai(Gt(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,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var i=new ai(Gt(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(i,to(this)),i},unlinkDoc:function(e){if(e instanceof On&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(to(this));break}if(e.history==this.history){var i=[e.id];Fi(e,function(f){return i.push(f.id)},!0),e.history=new Qr(null),e.history.done=sr(this.history.done,i),e.history.undone=sr(this.history.undone,i)}},iterLinkedDocs:function(e){Fi(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:Gn(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)})}),ai.prototype.eachLine=ai.prototype.iter;var no=0;function Cl(e){var t=this;if(io(t),He(t,e)||Oi(t.display,e))return;re(e),z&&(no=+new Date);var r=Ki(t,e,!0),i=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var f=i.length,P=Array(f),V=0,Q=function(){++V==f&&Wn(t,function(){r=T(t.doc,r);var Re={from:r,to:r,text:t.doc.splitLines(P.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};lr(t.doc,Re),Hs(t.doc,Mi(T(t.doc,r),T(t.doc,Ni(Re))))})()},ee=function(Re,Ge){if(t.options.allowDropFileTypes&&ne(t.options.allowDropFileTypes,Re.type)==-1){Q();return}var Qe=new FileReader;Qe.onerror=function(){return Q()},Qe.onload=function(){var rt=Qe.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(rt)){Q();return}P[Ge]=rt,Q()},Qe.readAsText(Re)},te=0;te<i.length;te++)ee(i[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var de=e.dataTransfer.getData("Text");if(de){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),ea(t.doc,Mi(r,r)),ye)for(var Ie=0;Ie<ye.length;++Ie)ur(t.doc,"",ye[Ie].anchor,ye[Ie].head,"drag");t.replaceSelection(de,"around","paste"),t.display.input.focus()}}catch(Re){}}}function Al(e,t){if(z&&(!e.state.draggingText||+new Date-no<100)){pe(t);return}if(He(e,t)||Oi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var r=u("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),g&&r.parentNode.removeChild(r)}}function Rl(e,t){var r=Ki(e,t);if(!r)return;var i=document.createDocumentFragment();ms(e,r,i),e.display.dragCursor||(e.display.dragCursor=u("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),b(e.display.dragCursor,i)}function io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ro(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],i=0;i<t.length;i++){var f=t[i].CodeMirror;f&&r.push(f)}r.length&&r[0].operation(function(){for(var P=0;P<r.length;P++)e(r[P])})}var ao=!1;function Ol(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ro(Il)},100))}),Me(window,"blur",function(){return ro(ir)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Bi={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"},Mr=0;Mr<10;Mr++)Bi[Mr+48]=Bi[Mr+96]=String(Mr);for(var ia=65;ia<=90;ia++)Bi[ia]=String.fromCharCode(ia);for(var Nr=1;Nr<=12;Nr++)Bi[Nr+111]=Bi[Nr+63235]="F"+Nr;var Li={};Li.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"},Li.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"},Li.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"},Li.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"]},Li.default=o?Li.macDefault:Li.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,i,f,P,V=0;V<t.length-1;V++){var Q=t[V];if(/^(cmd|meta|m)$/i.test(Q))P=!0;else if(/^a(lt)?$/i.test(Q))r=!0;else if(/^(c|ctrl|control)$/i.test(Q))i=!0;else if(/^s(hift)?$/i.test(Q))f=!0;else throw new Error("Unrecognized modifier name: "+Q)}return r&&(e="Alt-"+e),i&&(e="Ctrl-"+e),P&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function kl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(i=="..."){delete e[r];continue}for(var f=Ye(r.split(" "),Dl),P=0;P<f.length;P++){var V=void 0,Q=void 0;P==f.length-1?(Q=f.join(" "),V=i):(Q=f.slice(0,P+1).join(" "),V="...");var ee=t[Q];if(!ee)t[Q]=V;else if(ee!=V)throw new Error("Inconsistent bindings for "+Q)}delete e[r]}for(var te in t)e[te]=t[te];return e}function cr(e,t,r,i){t=ra(t);var f=t.call?t.call(e,i):t[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&r(f))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return cr(e,t.fallthrough,r,i);for(var P=0;P<t.fallthrough.length;P++){var V=cr(e,t.fallthrough[P],r,i);if(V)return V}}}function so(e){var t=typeof e=="string"?e:Bi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,r){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(g&&e.keyCode==34&&e.char)return!1;var r=Bi[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),oo(r,e,t))}function ra(e){return typeof e=="string"?Li[e]:e}function dr(e,t){for(var r=e.doc.sel.ranges,i=[],f=0;f<r.length;f++){for(var P=t(r[f]);i.length&&Et(P.from,Oe(i).to)<=0;){var V=i.pop();if(Et(V.from,P.from)<0){P.from=V.from;break}}i.push(P)}ui(e,function(){for(var Q=i.length-1;Q>=0;Q--)ur(e.doc,"",i[Q].from,i[Q].to,"+delete");rr(e)})}function Fa(e,t,r){var i=Ae(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Ua(e,t,r){var i=Fa(e,t.ch,r);return i==null?null:new Ue(t.line,i,r<0?"after":"before")}function Ba(e,t,r,i,f){if(e){t.doc.direction=="rtl"&&(f=-f);var P=it(r,t.doc.direction);if(P){var V=f<0?Oe(P):P[0],Q=f<0==(V.level==1),ee=Q?"after":"before",te;if(V.level>0||t.doc.direction=="rtl"){var de=er(t,r);te=f<0?r.text.length-1:0;var ye=Ti(t,de,te).top;te=ze(function(Ie){return Ti(t,de,Ie).top==ye},f<0==(V.level==1)?V.from:V.to-1,te),ee=="before"&&(te=Fa(r,te,1))}else te=f<0?V.to:V.from;return new Ue(i,te,ee)}}return new Ue(i,f<0?r.text.length:0,f<0?"before":"after")}function Pl(e,t,r,i){var f=it(t,e.doc.direction);if(!f)return Ua(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var P=nt(f,r.ch,r.sticky),V=f[P];if(e.doc.direction=="ltr"&&V.level%2==0&&(i>0?V.to>r.ch:V.from<r.ch))return Ua(t,r,i);var Q=function(ft,St){return Fa(t,ft instanceof Ue?ft.ch:ft,St)},ee,te=function(ft){return e.options.lineWrapping?(ee=ee||er(e,t),cs(e,t,ee,ft)):{begin:0,end:t.text.length}},de=te(r.sticky=="before"?Q(r,-1):r.ch);if(e.doc.direction=="rtl"||V.level==1){var ye=V.level==1==i<0,Ie=Q(r,ye?1:-1);if(Ie!=null&&(ye?Ie<=V.to&&Ie<=de.end:Ie>=V.from&&Ie>=de.begin)){var Re=ye?"before":"after";return new Ue(r.line,Ie,Re)}}var Ge=function(ft,St,pt){for(var It=function(Tn,zn){return zn?new Ue(r.line,Q(Tn,1),"before"):new Ue(r.line,Tn,"after")};ft>=0&&ft<f.length;ft+=St){var zt=f[ft],jt=St>0==(zt.level!=1),en=jt?pt.begin:Q(pt.end,-1);if(zt.from<=en&&en<zt.to)return It(en,jt);if(en=jt?zt.from:Q(zt.to,-1),pt.begin<=en&&en<pt.end)return It(en,jt)}},Qe=Ge(P+i,i,de);if(Qe)return Qe;var rt=i>0?de.end:Q(de.begin,-1);return rt!=null&&!(i>0&&rt==t.text.length)&&(Qe=Ge(i>0?0:f.length-1,i,te(rt)),Qe)?Qe:null}var Fr={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),fe)},killLine:function(e){return dr(e,function(t){if(t.empty()){var r=st(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ue(t.head.line+1,0)}:{from:t.head,to:Ue(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return dr(e,function(t){return{from:Ue(t.from().line,0),to:T(e.doc,Ue(t.to().line+1,0))}})},delLineLeft:function(e){return dr(e,function(t){return{from:Ue(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return dr(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return dr(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}})},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(Ue(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ue(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Se)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Se)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?ho(e,t.head):i},Se)},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=[],r=e.listSelections(),i=e.options.tabSize,f=0;f<r.length;f++){var P=r[f].from(),V=W(e.getLine(P.line),P.ch,i);t.push(le(i-V%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ui(e,function(){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var f=t[i].head,P=st(e.doc,f.line).text;if(P){if(f.ch==P.length&&(f=new Ue(f.line,f.ch-1)),f.ch>0)f=new Ue(f.line,f.ch+1),e.replaceRange(P.charAt(f.ch-1)+P.charAt(f.ch-2),Ue(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var V=st(e.doc,f.line-1).text;V&&(f=new Ue(f.line,1),e.replaceRange(P.charAt(0)+e.doc.lineSeparator()+V.charAt(V.length-1),Ue(f.line-1,V.length-1),f,"+transpose"))}}r.push(new gn(f,f))}e.setSelections(r)})},newlineAndIndent:function(e){return ui(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);rr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var r=st(e.doc,t),i=Rn(r);return i!=r&&(t=_t(i)),Ba(!0,e,i,t,1)}function Ml(e,t){var r=st(e.doc,t),i=Ei(r);return i!=r&&(t=_t(i)),Ba(!0,e,r,t,-1)}function ho(e,t){var r=uo(e,t.line),i=st(e.doc,r.line),f=it(i,e.doc.direction);if(!f||f[0].level==0){var P=Math.max(r.ch,i.text.search(/\S/)),V=t.line==r.line&&t.ch<=P&&t.ch;return Ue(r.line,V?0:P,r.sticky)}return r}function aa(e,t,r){if(typeof t=="string"&&(t=Fr[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),f=t(e)!=we}finally{e.display.shift=i,e.state.suppressEdits=!1}return f}function Nl(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var f=cr(t,e.state.keyMaps[i],r,e);if(f)return f}return e.options.extraKeys&&cr(t,e.options.extraKeys,r,e)||cr(t,e.options.keyMap,r,e)}var Fl=new Z;function Ur(e,t,r,i){var f=e.state.keySeq;if(f){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),co(e,f+" "+t,r,i))return!0}return co(e,t,r,i)}function co(e,t,r,i){var f=Nl(e,t,i);return f=="multi"&&(e.state.keySeq=t),f=="handled"&&Yn(e,"keyHandled",e,t,r),(f=="handled"||f=="multi")&&(re(r),xa(e)),!!f}function fo(e,t){var r=lo(t,!0);return r?t.shiftKey&&!e.state.keySeq?Ur(e,"Shift-"+r,t,function(i){return aa(e,i,!0)})||Ur(e,r,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return aa(e,i)}):Ur(e,r,t,function(i){return aa(e,i)}):!1}function Ul(e,t,r){return Ur(e,"'"+r+"'",t,function(i){return aa(e,i,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),He(t,e))return;z&&G<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=fo(t,e);g&&(ja=i?r:null,!i&&r==88&&!kt&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),k&&!o&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function r(i){(i.keyCode==18||!i.altKey)&&(A(t,"CodeMirror-crosshair"),mt(document,"keyup",r),mt(document,"mouseover",r))}Me(document,"keyup",r),Me(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),He(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Oi(t.display,e)||He(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var r=e.keyCode,i=e.charCode;if(g&&r==ja){ja=null,re(e);return}if(g&&(!e.which||e.which<10)&&fo(t,e))return;var f=String.fromCharCode(i==null?r:i);if(f=="\b")return;if(Ul(t,e,f))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ha.prototype.compare=function(e,t,r){return this.time+jl>e&&Et(t,this.pos)==0&&r==this.button};var Br,jr;function Hl(e,t){var r=+new Date;return jr&&jr.compare(r,e,t)?(Br=jr=null,"triple"):Br&&Br.compare(r,e,t)?(jr=new Ha(r,e,t),Br=null,"double"):(Br=new Ha(r,e,t),jr=null,"single")}function vo(e){var t=this,r=t.display;if(He(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,Oi(r,e)){n||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var i=Ki(t,e),f=Pe(e),P=i?Hl(i,f):"single";if(window.focus(),f==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,f,i,P,e))return;f==1?i?zl(t,i,P,e):xe(e)==r.scroller&&re(e):f==2?(i&&qr(t.doc,i),setTimeout(function(){return r.input.focus()},20)):f==3&&(L?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,i,f){var P="Click";return i=="double"?P="Double"+P:i=="triple"&&(P="Triple"+P),P=(t==1?"Left":t==2?"Middle":"Right")+P,Ur(e,oo(P,f),f,function(V){if(typeof V=="string"&&(V=Fr[V]),!V)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=V(e,r)!=we}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,r){var i=e.getOption("configureMouse"),f=i?i(e,t,r):{};if(f.unit==null){var P=s?r.shiftKey&&r.metaKey:r.altKey;f.unit=P?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||r.shiftKey),f.addNew==null&&(f.addNew=o?r.metaKey:r.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(o?r.altKey:r.ctrlKey)),f}function zl(e,t,r,i){z?setTimeout(M(gs,e),0):e.curOp.focus=N();var f=Gl(e,r,i),P=e.doc.sel,V;e.options.dragDrop&&Ke&&!e.isReadOnly()&&r=="single"&&(V=P.contains(t))>-1&&(Et((V=P.ranges[V]).from(),t)<0||t.xRel>0)&&(Et(V.to(),t)>0||t.xRel<0)?Kl(e,i,t,f):Vl(e,i,t,f)}function Kl(e,t,r,i){var f=e.display,P=!1,V=Wn(e,function(te){n&&(f.scroller.draggable=!1),e.state.draggingText=!1,mt(f.wrapper.ownerDocument,"mouseup",V),mt(f.wrapper.ownerDocument,"mousemove",Q),mt(f.scroller,"dragstart",ee),mt(f.scroller,"drop",V),P||(re(te),i.addNew||qr(e.doc,r,null,null,i.extend),n&&!m||z&&G==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),Q=function(te){P=P||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},ee=function(){return P=!0};n&&(f.scroller.draggable=!0),e.state.draggingText=V,V.copy=!i.moveOnDrag,f.scroller.dragDrop&&f.scroller.dragDrop(),Me(f.wrapper.ownerDocument,"mouseup",V),Me(f.wrapper.ownerDocument,"mousemove",Q),Me(f.scroller,"dragstart",ee),Me(f.scroller,"drop",V),vs(e),setTimeout(function(){return f.input.focus()},20)}function yo(e,t,r){if(r=="char")return new gn(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new gn(Ue(t.line,0),T(e.doc,Ue(t.line+1,0)));var i=r(e,t);return new gn(i.from,i.to)}function Vl(e,t,r,i){var f=e.display,P=e.doc;re(t);var V,Q,ee=P.sel,te=ee.ranges;if(i.addNew&&!i.extend?(Q=P.sel.contains(r),Q>-1?V=te[Q]:V=new gn(r,r)):(V=P.sel.primary(),Q=P.sel.primIndex),i.unit=="rectangle")i.addNew||(V=new gn(r,r)),r=Ki(e,t,!0,!0),Q=-1;else{var de=yo(e,r,i.unit);i.extend?V=Ma(V,de.anchor,de.head,i.extend):V=de}i.addNew?Q==-1?(Q=te.length,Qn(P,bi(e,te.concat([V]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&i.unit=="char"&&!i.extend?(Qn(P,bi(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),ee=P.sel):Na(P,Q,V,_e):(Q=0,Qn(P,new fi([V],0),_e),ee=P.sel);var ye=r;function Ie(pt){if(Et(ye,pt)==0)return;if(ye=pt,i.unit=="rectangle"){for(var It=[],zt=e.options.tabSize,jt=W(st(P,r.line).text,r.ch,zt),en=W(st(P,pt.line).text,pt.ch,zt),Tn=Math.min(jt,en),zn=Math.max(jt,en),In=Math.min(r.line,pt.line),hi=Math.min(e.lastLine(),Math.max(r.line,pt.line));In<=hi;In++){var si=st(P,In).text,Fn=ve(si,Tn,zt);Tn==zn?It.push(new gn(Ue(In,Fn),Ue(In,Fn))):si.length>Fn&&It.push(new gn(Ue(In,Fn),Ue(In,ve(si,zn,zt))))}It.length||It.push(new gn(r,r)),Qn(P,bi(e,ee.ranges.slice(0,Q).concat(It),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(pt)}else{var oi=V,$n=yo(e,pt,i.unit),Hn=oi.anchor,Un;Et($n.anchor,Hn)>0?(Un=$n.head,Hn=yn(oi.from(),$n.anchor)):(Un=$n.anchor,Hn=Sn(oi.to(),$n.head));var kn=ee.ranges.slice(0);kn[Q]=Xl(e,new gn(T(P,Hn),Un)),Qn(P,bi(e,kn,Q),_e)}}var Re=f.wrapper.getBoundingClientRect(),Ge=0;function Qe(pt){var It=++Ge,zt=Ki(e,pt,!0,i.unit=="rectangle");if(!zt)return;if(Et(zt,ye)!=0){e.curOp.focus=N(),Ie(zt);var jt=Xr(f,P);(zt.line>=jt.to||zt.line<jt.from)&&setTimeout(Wn(e,function(){Ge==It&&Qe(pt)}),150)}else{var en=pt.clientY<Re.top?-20:pt.clientY>Re.bottom?20:0;en&&setTimeout(Wn(e,function(){if(Ge!=It)return;f.scroller.scrollTop+=en,Qe(pt)}),50)}}function rt(pt){e.state.selectingText=!1,Ge=Infinity,pt&&(re(pt),f.input.focus()),mt(f.wrapper.ownerDocument,"mousemove",ft),mt(f.wrapper.ownerDocument,"mouseup",St),P.history.lastSelOrigin=null}var ft=Wn(e,function(pt){pt.buttons===0||!Pe(pt)?rt(pt):Qe(pt)}),St=Wn(e,rt);e.state.selectingText=St,Me(f.wrapper.ownerDocument,"mousemove",ft),Me(f.wrapper.ownerDocument,"mouseup",St)}function Xl(e,t){var r=t.anchor,i=t.head,f=st(e.doc,r.line);if(Et(r,i)==0&&r.sticky==i.sticky)return t;var P=it(f);if(!P)return t;var V=nt(P,r.ch,r.sticky),Q=P[V];if(Q.from!=r.ch&&Q.to!=r.ch)return t;var ee=V+(Q.from==r.ch==(Q.level!=1)?0:1);if(ee==0||ee==P.length)return t;var te;if(i.line!=r.line)te=(i.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var de=nt(P,i.ch,i.sticky),ye=de-V||(i.ch-r.ch)*(Q.level==1?-1:1);de==ee-1||de==ee?te=ye<0:te=ye>0}var Ie=P[ee+(te?-1:0)],Re=te==(Ie.level==1),Ge=Re?Ie.from:Ie.to,Qe=Re?"after":"before";return r.ch==Ge&&r.sticky==Qe?t:new gn(new Ue(r.line,Ge,Qe),i)}function bo(e,t,r,i){var f,P;if(t.touches)f=t.touches[0].clientX,P=t.touches[0].clientY;else try{f=t.clientX,P=t.clientY}catch(Ie){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&re(t);var V=e.display,Q=V.lineDiv.getBoundingClientRect();if(P>Q.bottom||!me(e,r))return ce(t);P-=Q.top-V.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var te=V.gutters.childNodes[ee];if(te&&te.getBoundingClientRect().right>=f){var de=Lt(e.doc,P),ye=e.display.gutterSpecs[ee];return Ne(e,r,e,de,ye.className,t),ce(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(Oi(e.display,t)||Yl(e,t))return;if(He(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return me(e,"gutterContextMenu")?bo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),_r(e)}var fr={toString:function(){return"CodeMirror.Init"}},xo={},sa={};function $l(e){var t=e.optionHandlers;function r(i,f,P,V){e.defaults[i]=f,P&&(t[i]=V?function(Q,ee,te){te!=fr&&P(Q,ee,te)}:P)}e.defineOption=r,e.Init=fr,r("value","",function(i,f){return i.setValue(f)},!0),r("mode",null,function(i,f){i.doc.modeOption=f,Da(i)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(i){Rr(i),_r(i),ri(i)},!0),r("lineSeparator",null,function(i,f){if(i.doc.lineSep=f,!f)return;var P=[],V=i.doc.first;i.doc.iter(function(ee){for(var te=0;;){var de=ee.text.indexOf(f,te);if(de==-1)break;te=de+f.length,P.push(Ue(V,de))}V++});for(var Q=P.length-1;Q>=0;Q--)ur(i.doc,f,P[Q],Ue(P[Q].line,P[Q].ch+f.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,f,P){i.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),P!=fr&&i.refresh()}),r("specialCharPlaceholder",fn,function(i){return i.refresh()},!0),r("electricChars",!0),r("inputStyle",h?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(i,f){return i.getInputField().spellcheck=f},!0),r("autocorrect",!1,function(i,f){return i.getInputField().autocorrect=f},!0),r("autocapitalize",!1,function(i,f){return i.getInputField().autocapitalize=f},!0),r("rtlMoveVisually",!R),r("wholeLineUpdateBefore",!0),r("theme","default",function(i){Eo(i),Ar(i)},!0),r("keyMap","default",function(i,f,P){var V=ra(f),Q=P!=fr&&ra(P);Q&&Q.detach&&Q.detach(i,V),V.attach&&V.attach(i,Q||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ql,!0),r("gutters",[],function(i,f){i.display.gutterSpecs=La(f,i.options.lineNumbers),Ar(i)},!0),r("fixedGutter",!0,function(i,f){i.display.gutters.style.left=f?_a(i.display)+"px":"0",i.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(i){return ar(i)},!0),r("scrollbarStyle","native",function(i){ws(i),ar(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),r("lineNumbers",!1,function(i,f){i.display.gutterSpecs=La(i.options.gutters,f),Ar(i)},!0),r("firstLineNumber",1,Ar,!0),r("lineNumberFormatter",function(i){return i},Ar,!0),r("showCursorWhenSelecting",!1,Er,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(i,f){f=="nocursor"&&(ir(i),i.display.input.blur()),i.display.input.readOnlyChanged(f)}),r("screenReaderLabel",null,function(i,f){f=f===""?null:f,i.display.input.screenReaderLabelChanged(f)}),r("disableInput",!1,function(i,f){f||i.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Er,!0),r("singleCursorHeightPerLine",!0,Er,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Rr,!0),r("addModeClass",!1,Rr,!0),r("pollInterval",100),r("undoDepth",200,function(i,f){return i.doc.history.undoDepth=f}),r("historyEventDelay",1250),r("viewportMargin",10,function(i){return i.refresh()},!0),r("maxHighlightLength",1e4,Rr,!0),r("moveInputWithCursor",!0,function(i,f){f||i.display.input.resetPosition()}),r("tabindex",null,function(i,f){return i.display.input.getField().tabIndex=f||""}),r("autofocus",null),r("direction","ltr",function(i,f){return i.doc.setDirection(f)},!0),r("phrases",null)}function Jl(e,t,r){var i=r&&r!=fr;if(!t!=!i){var f=e.display.dragFunctions,P=t?Me:mt;P(e.display.scroller,"dragstart",f.start),P(e.display.scroller,"dragenter",f.enter),P(e.display.scroller,"dragover",f.over),P(e.display.scroller,"dragleave",f.leave),P(e.display.scroller,"drop",f.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),qi(e)),Ea(e),ri(e),_r(e),setTimeout(function(){return ar(e)},100)}function On(e,t){var r=this;if(!(this instanceof On))return new On(e,t);this.options=t=t?E(t):{},E(xo,t,!1);var i=t.value;typeof i=="string"?i=new ai(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var f=new On.inputStyles[t.inputStyle](this),P=this.display=new hl(e,i,f,t);P.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ws(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 Z,keySeq:null,specialChars:null},t.autofocus&&!h&&P.input.focus(),z&&G<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Ol(),$i(this),this.curOp.forceUpdate=!0,ks(this,i),t.autofocus&&!h||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&wa(r)},20):ir(this);for(var V in sa)sa.hasOwnProperty(V)&&sa[V](this,t[V],fr);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ga.length;++Q)Ga[Q](this);Ji(this),n&&t.lineWrapping&&getComputedStyle(P.lineDiv).textRendering=="optimizelegibility"&&(P.lineDiv.style.textRendering="auto")}On.defaults=xo,On.optionHandlers=sa;function Zl(e){var t=e.display;Me(t.scroller,"mousedown",Wn(e,vo)),z&&G<11?Me(t.scroller,"dblclick",Wn(e,function(ee){if(He(e,ee))return;var te=Ki(e,ee);if(!te||Wa(e,ee)||Oi(e.display,ee))return;re(ee);var de=e.findWordAt(te);qr(e.doc,de.anchor,de.head)})):Me(t.scroller,"dblclick",function(ee){return He(e,ee)||re(ee)}),Me(t.scroller,"contextmenu",function(ee){return _o(e,ee)}),Me(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||_o(e,ee)});var r,i={end:0};function f(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function P(ee){if(ee.touches.length!=1)return!1;var te=ee.touches[0];return te.radiusX<=1&&te.radiusY<=1}function V(ee,te){if(te.left==null)return!0;var de=te.left-ee.left,ye=te.top-ee.top;return de*de+ye*ye>20*20}Me(t.scroller,"touchstart",function(ee){if(!He(e,ee)&&!P(ee)&&!Wa(e,ee)){t.input.ensurePolled(),clearTimeout(r);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-i.end<=300?i:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Me(t.scroller,"touchend",function(ee){var te=t.activeTouch;if(te&&!Oi(t,ee)&&te.left!=null&&!te.moved&&new Date-te.start<300){var de=e.coordsChar(t.activeTouch,"page"),ye;!te.prev||V(te,te.prev)?ye=new gn(de,de):!te.prev.prev||V(te,te.prev.prev)?ye=e.findWordAt(de):ye=new gn(Ue(de.line,0),T(e.doc,Ue(de.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),re(ee)}f()}),Me(t.scroller,"touchcancel",f),Me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(wr(e,t.scroller.scrollTop),Xi(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),Me(t.scroller,"mousewheel",function(ee){return Os(e,ee)}),Me(t.scroller,"DOMMouseScroll",function(ee){return Os(e,ee)}),Me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){He(e,ee)||pe(ee)},over:function(ee){He(e,ee)||(Rl(e,ee),pe(ee))},start:function(ee){return Al(e,ee)},drop:Wn(e,Cl),leave:function(ee){He(e,ee)||io(e)}};var Q=t.input.getField();Me(Q,"keyup",function(ee){return mo.call(e,ee)}),Me(Q,"keydown",Wn(e,po)),Me(Q,"keypress",Wn(e,go)),Me(Q,"focus",function(ee){return wa(e,ee)}),Me(Q,"blur",function(ee){return ir(e,ee)})}var Ga=[];On.defineInitHook=function(e){return Ga.push(e)};function Hr(e,t,r,i){var f=e.doc,P;r==null&&(r="add"),r=="smart"&&(f.mode.indent?P=je(e,t).state:r="prev");var V=e.options.tabSize,Q=st(f,t),ee=W(Q.text,null,V);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],de;if(!i&&!/\S/.test(Q.text))de=0,r="not";else if(r=="smart"&&(de=f.mode.indent(P,Q.text.slice(te.length),Q.text),de==we||de>150)){if(!i)return;r="prev"}r=="prev"?t>f.first?de=W(st(f,t-1).text,null,V):de=0:r=="add"?de=ee+e.options.indentUnit:r=="subtract"?de=ee-e.options.indentUnit:typeof r=="number"&&(de=ee+r),de=Math.max(0,de);var ye="",Ie=0;if(e.options.indentWithTabs)for(var Re=Math.floor(de/V);Re;--Re)Ie+=V,ye+=" ";if(Ie<de&&(ye+=le(de-Ie)),ye!=te)return ur(f,ye,Ue(t,0),Ue(t,te.length),"+input"),Q.stateAfter=null,!0;for(var Ge=0;Ge<f.sel.ranges.length;Ge++){var Qe=f.sel.ranges[Ge];if(Qe.head.line==t&&Qe.head.ch<te.length){var rt=Ue(t,te.length);Na(f,Ge,new gn(rt,rt));break}}}var _i=null;function oa(e){_i=e}function za(e,t,r,i,f){var P=e.doc;e.display.shift=!1,i||(i=P.sel);var V=+new Date-200,Q=f=="paste"||e.state.pasteIncoming>V,ee=ut(t),te=null;if(Q&&i.ranges.length>1)if(_i&&_i.text.join(`
|
|
`)==t){if(i.ranges.length%_i.text.length==0){te=[];for(var de=0;de<_i.text.length;de++)te.push(P.splitLines(_i.text[de]))}}else ee.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(te=Ye(ee,function(ft){return[ft]}));for(var ye=e.curOp.updateInput,Ie=i.ranges.length-1;Ie>=0;Ie--){var Re=i.ranges[Ie],Ge=Re.from(),Qe=Re.to();Re.empty()&&(r&&r>0?Ge=Ue(Ge.line,Ge.ch-r):e.state.overwrite&&!Q?Qe=Ue(Qe.line,Math.min(st(P,Qe.line).text.length,Qe.ch+Oe(ee).length)):Q&&_i&&_i.lineWise&&_i.text.join(`
|
|
`)==ee.join(`
|
|
`)&&(Ge=Qe=Ue(Ge.line,0)));var rt={from:Ge,to:Qe,text:te?te[Ie%te.length]:ee,origin:f||(Q?"paste":e.state.cutIncoming>V?"cut":"+input")};lr(e.doc,rt),Yn(e,"inputRead",e,rt)}t&&!Q&&To(e,t),rr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function wo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ui(t,function(){return za(t,r,0,null,"paste")}),!0}function To(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,i=r.ranges.length-1;i>=0;i--){var f=r.ranges[i];if(f.head.ch>100||i&&r.ranges[i-1].head.line==f.head.line)continue;var P=e.getModeAt(f.head),V=!1;if(P.electricChars){for(var Q=0;Q<P.electricChars.length;Q++)if(t.indexOf(P.electricChars.charAt(Q))>-1){V=Hr(e,f.head.line,"smart");break}}else P.electricInput&&(P.electricInput.test(st(e.doc,f.head.line).text.slice(0,f.head.ch))&&(V=Hr(e,f.head.line,"smart")));V&&Yn(e,"electricInput",e,f.head.line)}}function So(e){for(var t=[],r=[],i=0;i<e.doc.sel.ranges.length;i++){var f=e.doc.sel.ranges[i].head.line,P={anchor:Ue(f,0),head:Ue(f+1,0)};r.push(P),t.push(e.getRange(P.anchor,P.head))}return{text:t,ranges:r}}function Co(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=u("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=u("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),p&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,f){var P=this.options,V=P[i];if(P[i]==f&&i!="mode")return;P[i]=f,t.hasOwnProperty(i)&&Wn(this,t[i])(this,f,V),Ne(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,f){this.state.keyMaps[f?"push":"unshift"](ra(i))},removeKeyMap:function(i){for(var f=this.state.keyMaps,P=0;P<f.length;++P)if(f[P]==i||f[P].name==i)return f.splice(P,1),!0},addOverlay:qn(function(i,f){var P=i.token?i:e.getMode(this.options,i);if(P.startState)throw new Error("Overlays may not be stateful.");Ve(this.state.overlays,{mode:P,modeSpec:i,opaque:f&&f.opaque,priority:f&&f.priority||0},function(V){return V.priority}),this.state.modeGen++,ri(this)}),removeOverlay:qn(function(i){for(var f=this.state.overlays,P=0;P<f.length;++P){var V=f[P].modeSpec;if(V==i||typeof i=="string"&&V.name==i){f.splice(P,1),this.state.modeGen++,ri(this);return}}}),indentLine:qn(function(i,f,P){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Qt(this.doc,i)&&Hr(this,i,f,P)}),indentSelection:qn(function(i){for(var f=this.doc.sel.ranges,P=-1,V=0;V<f.length;V++){var Q=f[V];if(Q.empty())Q.head.line>P&&(Hr(this,Q.head.line,i,!0),P=Q.head.line,V==this.doc.sel.primIndex&&rr(this));else{var ee=Q.from(),te=Q.to(),de=Math.max(P,ee.line);P=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var ye=de;ye<P;++ye)Hr(this,ye,i);var Ie=this.doc.sel.ranges;ee.ch==0&&f.length==Ie.length&&Ie[V].from().ch>0&&Na(this.doc,V,new gn(ee,Ie[V].to()),fe)}}}),getTokenAt:function(i,f){return Ct(this,i,f)},getLineTokens:function(i,f){return Ct(this,Ue(i),f,!0)},getTokenTypeAt:function(i){i=T(this.doc,i);var f=ke(this,st(this.doc,i.line)),P=0,V=(f.length-1)/2,Q=i.ch,ee;if(Q==0)ee=f[2];else for(;;){var te=P+V>>1;if((te?f[te*2-1]:0)>=Q)V=te;else if(f[te*2+1]<Q)P=te+1;else{ee=f[te*2+2];break}}var de=ee?ee.indexOf("overlay "):-1;return de<0?ee:de==0?null:ee.slice(0,de-1)},getModeAt:function(i){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(i).state).mode:f},getHelper:function(i,f){return this.getHelpers(i,f)[0]},getHelpers:function(i,f){var P=[];if(!r.hasOwnProperty(f))return P;var V=r[f],Q=this.getModeAt(i);if(typeof Q[f]=="string")V[Q[f]]&&P.push(V[Q[f]]);else if(Q[f])for(var ee=0;ee<Q[f].length;ee++){var te=V[Q[f][ee]];te&&P.push(te)}else Q.helperType&&V[Q.helperType]?P.push(V[Q.helperType]):V[Q.name]&&P.push(V[Q.name]);for(var de=0;de<V._global.length;de++){var ye=V._global[de];ye.pred(Q,this)&&ne(P,ye.val)==-1&&P.push(ye.val)}return P},getStateAfter:function(i,f){var P=this.doc;return i=X(P,i==null?P.first+P.size-1:i),je(this,i+1,f).state},cursorCoords:function(i,f){var P,V=this.doc.sel.primary();return i==null?P=V.head:typeof i=="object"?P=T(this.doc,i):P=i?V.from():V.to(),yi(this,P,f||"page")},charCoords:function(i,f){return ma(this,T(this.doc,i),f||"page")},coordsChar:function(i,f){return i=ls(this,i,f||"page"),va(this,i.left,i.top)},lineAtHeight:function(i,f){return i=ls(this,{top:i,left:0},f||"page").top,Lt(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,f,P){var V=!1,Q;if(typeof i=="number"){var ee=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>ee&&(i=ee,V=!0),Q=st(this.doc,i)}else Q=i;return Gr(this,Q,{top:0,left:0},f||"page",P||V).top+(V?this.doc.height-Vn(Q):0)},defaultTextHeight:function(){return tr(this.display)},defaultCharWidth:function(){return nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,f,P,V,Q){var ee=this.display;i=yi(this,T(this.doc,i));var te=i.bottom,de=i.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),ee.sizer.appendChild(f),V=="over")te=i.top;else if(V=="above"||V=="near"){var ye=Math.max(ee.wrapper.clientHeight,this.doc.height),Ie=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(V=="above"||i.bottom+f.offsetHeight>ye)&&i.top>f.offsetHeight?te=i.top-f.offsetHeight:i.bottom+f.offsetHeight<=ye&&(te=i.bottom),de+f.offsetWidth>Ie&&(de=Ie-f.offsetWidth)}f.style.top=te+"px",f.style.left=f.style.right="",Q=="right"?(de=ee.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(Q=="left"?de=0:Q=="middle"&&(de=(ee.sizer.clientWidth-f.offsetWidth)/2),f.style.left=de+"px"),P&&Jo(this,{left:de,top:te,right:de+f.offsetWidth,bottom:te+f.offsetHeight})},triggerOnKeyDown:qn(po),triggerOnKeyPress:qn(go),triggerOnKeyUp:mo,triggerOnMouseDown:qn(vo),execCommand:function(i){if(Fr.hasOwnProperty(i))return Fr[i].call(null,this)},triggerElectric:qn(function(i){To(this,i)}),findPosH:function(i,f,P,V){var Q=1;f<0&&(Q=-1,f=-f);for(var ee=T(this.doc,i),te=0;te<f&&!(ee=Ka(this.doc,ee,Q,P,V),ee.hitSide);++te);return ee},moveH:qn(function(i,f){var P=this;this.extendSelectionsBy(function(V){return P.display.shift||P.doc.extend||V.empty()?Ka(P.doc,V.head,i,f,P.options.rtlMoveVisually):i<0?V.from():V.to()},Se)}),deleteH:qn(function(i,f){var P=this.doc.sel,V=this.doc;P.somethingSelected()?V.replaceSelection("",null,"+delete"):dr(this,function(Q){var ee=Ka(V,Q.head,i,f,!1);return i<0?{from:ee,to:Q.head}:{from:Q.head,to:ee}})}),findPosV:function(i,f,P,V){var Q=1,ee=V;f<0&&(Q=-1,f=-f);for(var te=T(this.doc,i),de=0;de<f;++de){var ye=yi(this,te,"div");if(ee==null?ee=ye.left:ye.left=ee,te=Ro(this,ye,Q,P),te.hitSide)break}return te},moveV:qn(function(i,f){var P=this,V=this.doc,Q=[],ee=!this.display.shift&&!V.extend&&V.sel.somethingSelected();if(V.extendSelectionsBy(function(de){if(ee)return i<0?de.from():de.to();var ye=yi(P,de.head,"div");de.goalColumn!=null&&(ye.left=de.goalColumn),Q.push(ye.left);var Ie=Ro(P,ye,i,f);return f=="page"&&de==V.sel.primary()&&Sa(P,ma(P,Ie,"div").top-ye.top),Ie},Se),Q.length)for(var te=0;te<V.sel.ranges.length;te++)V.sel.ranges[te].goalColumn=Q[te]}),findWordAt:function(i){var f=this.doc,P=st(f,i.line).text,V=i.ch,Q=i.ch;if(P){var ee=this.getHelper(i,"wordChars");(i.sticky=="before"||Q==P.length)&&V?--V:++Q;for(var te=P.charAt(V),de=qe(te,ee)?function(ye){return qe(ye,ee)}:/\s/.test(te)?function(ye){return/\s/.test(ye)}:function(ye){return!/\s/.test(ye)&&!qe(ye)};V>0&&de(P.charAt(V-1));)--V;for(;Q<P.length&&de(P.charAt(Q));)++Q}return new gn(Ue(i.line,V),Ue(i.line,Q))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):A(this.display.cursorDiv,"CodeMirror-overwrite"),Ne(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:qn(function(i,f){xr(this,i,f)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-wi(this)-this.display.barHeight,width:i.scrollWidth-wi(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Gi(this)}},scrollIntoView:qn(function(i,f){i==null?(i={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof i=="number"?i={from:Ue(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=f||0,i.from.line!=null?Qo(this,i):bs(this,i.from,i.to,i.margin)}),setSize:qn(function(i,f){var P=this,V=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};i!=null&&(this.display.wrapper.style.width=V(i)),f!=null&&(this.display.wrapper.style.height=V(f)),this.options.lineWrapping&&as(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(ee){if(ee.widgets){for(var te=0;te<ee.widgets.length;te++)if(ee.widgets[te].noHScroll){ki(P,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,Ne(this,"refresh",this)}),operation:function(i){return ui(this,i)},startOperation:function(){return $i(this)},endOperation:function(){return Ji(this)},refresh:qn(function(){var i=this.display.cachedTextHeight;ri(this),this.curOp.forceUpdate=!0,_r(this),xr(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(i==null||Math.abs(i-tr(this.display))>.5||this.options.lineWrapping)&&Ea(this),Ne(this,"refresh",this)}),swapDoc:qn(function(i){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,i),_r(this),this.display.input.reset(),xr(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Yn(this,"swapDoc",this,f),f}),phrase:function(i){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,i)?f[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ge(e),e.registerHelper=function(i,f,P){r.hasOwnProperty(i)||(r[i]=e[i]={_global:[]}),r[i][f]=P},e.registerGlobalHelper=function(i,f,P,V){e.registerHelper(i,f,V),r[i]._global.push({pred:P,val:V})}}function Ka(e,t,r,i,f){var P=t,V=r,Q=st(e,t.line),ee=f&&e.direction=="rtl"?-r:r;function te(){var St=t.line+ee;return St<e.first||St>=e.first+e.size?!1:(t=new Ue(St,t.ch,t.sticky),Q=st(e,St))}function de(St){var pt;if(i=="codepoint"){var It=Q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(It)?pt=null:pt=new Ue(t.line,Math.max(0,Math.min(Q.text.length,t.ch+r*(It>=55296&&It<56320?2:1))),-r)}else f?pt=Pl(e.cm,Q,t,r):pt=Ua(Q,t,r);if(pt==null)if(!St&&te())t=Ba(f,e.cm,Q,t.line,ee);else return!1;else t=pt;return!0}if(i=="char"||i=="codepoint")de();else if(i=="column")de(!0);else if(i=="word"||i=="group")for(var ye=null,Ie=i=="group",Re=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(r<0&&!de(!Ge));Ge=!1){var Qe=Q.text.charAt(t.ch)||`
|
|
`,rt=qe(Qe,Re)?"w":Ie&&Qe==`
|
|
`?"n":!Ie||/\s/.test(Qe)?null:"p";if(Ie&&!Ge&&!rt&&(rt="s"),ye&&ye!=rt){r<0&&(r=1,de(),t.sticky="after");break}if(rt&&(ye=rt),r>0&&!de(!Ge))break}var ft=ta(e,t,P,V,!0);return pn(P,ft)&&(ft.hitSide=!0),ft}function Ro(e,t,r,i){var f=e.doc,P=t.left,V;if(i=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(Q-.5*tr(e.display),3);V=(r>0?t.bottom:t.top)+r*ee}else i=="line"&&(V=r>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,P,V),!te.outside);){if(r<0?V<=0:V>=f.height){te.hitSide=!0;break}V+=r*5}return te}var _n=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};_n.prototype.init=function(e){var t=this,r=this,i=r.cm,f=r.div=e.lineDiv;Co(f,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function P(Q){for(var ee=Q.target;ee;ee=ee.parentNode){if(ee==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Me(f,"paste",function(Q){if(!P(Q)||He(i,Q)||wo(Q,i))return;G<=11&&setTimeout(Wn(i,function(){return t.updateFromDOM()}),20)}),Me(f,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Me(f,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Me(f,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Me(f,"touchstart",function(){return r.forceCompositionEnd()}),Me(f,"input",function(){t.composing||t.readFromDOMSoon()});function V(Q){if(!P(Q)||He(i,Q))return;if(i.somethingSelected())oa({lineWise:!1,text:i.getSelections()}),Q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var ee=So(i);oa({lineWise:!0,text:ee.text}),Q.type=="cut"&&i.operation(function(){i.setSelections(ee.ranges,0,fe),i.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=_i.text.join(`
|
|
`);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var de=Ao(),ye=de.firstChild;i.display.lineSpace.insertBefore(de,i.display.lineSpace.firstChild),ye.value=_i.text.join(`
|
|
`);var Ie=document.activeElement;U(ye),setTimeout(function(){i.display.lineSpace.removeChild(de),Ie.focus(),Ie==f&&r.showPrimarySelection()},50)}Me(f,"copy",V),Me(f,"cut",V)},_n.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},_n.prototype.prepareSelection=function(){var e=ps(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,r=t.doc.sel.primary(),i=r.from(),f=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||f.line<t.display.viewFrom){e.removeAllRanges();return}var P=la(t,e.anchorNode,e.anchorOffset),V=la(t,e.focusNode,e.focusOffset);if(P&&!P.bad&&V&&!V.bad&&Et(yn(P,V),i)==0&&Et(Sn(P,V),f)==0)return;var Q=t.display.view,ee=i.line>=t.display.viewFrom&&Oo(t,i)||{node:Q[0].measure.map[2],offset:0},te=f.line<t.display.viewTo&&Oo(t,f);if(!te){var de=Q[Q.length-1].measure,ye=de.maps?de.maps[de.maps.length-1]:de.map;te={node:ye[ye.length-1],offset:ye[ye.length-2]-ye[ye.length-3]}}if(!ee||!te){e.removeAllRanges();return}var Ie=e.rangeCount&&e.getRangeAt(0),Re;try{Re=a(ee.node,ee.offset,te.offset,te.node)}catch(Ge){}Re&&(!k&&t.state.focused?(e.collapse(ee.node,ee.offset),Re.collapsed||(e.removeAllRanges(),e.addRange(Re))):(e.removeAllRanges(),e.addRange(Re)),Ie&&e.anchorNode==null?e.addRange(Ie):k&&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){b(this.cm.display.cursorDiv,e.cursors),b(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 _(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():ui(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(l&&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 r=la(t,e.anchorNode,e.anchorOffset),i=la(t,e.focusNode,e.focusOffset);r&&i&&ui(t,function(){Qn(t.doc,Mi(r,i),fe),(r.bad||i.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,r=e.doc.sel.primary(),i=r.from(),f=r.to();if(i.ch==0&&i.line>e.firstLine()&&(i=Ue(i.line-1,st(e.doc,i.line-1).length)),f.ch==st(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=Ue(f.line+1,0)),i.line<t.viewFrom||f.line>t.viewTo-1)return!1;var P,V,Q;i.line==t.viewFrom||(P=Vi(e,i.line))==0?(V=_t(t.view[0].line),Q=t.view[0].node):(V=_t(t.view[P].line),Q=t.view[P-1].node.nextSibling);var ee=Vi(e,f.line),te,de;if(ee==t.view.length-1?(te=t.viewTo-1,de=t.lineDiv.lastChild):(te=_t(t.view[ee+1].line)-1,de=t.view[ee+1].node.previousSibling),!Q)return!1;for(var ye=e.doc.splitLines(tu(e,Q,de,V,te)),Ie=cn(e.doc,Ue(V,0),Ue(te,st(e.doc,te).text.length));ye.length>1&&Ie.length>1;)if(Oe(ye)==Oe(Ie))ye.pop(),Ie.pop(),te--;else if(ye[0]==Ie[0])ye.shift(),Ie.shift(),V++;else break;for(var Re=0,Ge=0,Qe=ye[0],rt=Ie[0],ft=Math.min(Qe.length,rt.length);Re<ft&&Qe.charCodeAt(Re)==rt.charCodeAt(Re);)++Re;for(var St=Oe(ye),pt=Oe(Ie),It=Math.min(St.length-(ye.length==1?Re:0),pt.length-(Ie.length==1?Re:0));Ge<It&&St.charCodeAt(St.length-Ge-1)==pt.charCodeAt(pt.length-Ge-1);)++Ge;if(ye.length==1&&Ie.length==1&&V==i.line)for(;Re&&Re>i.ch&&St.charCodeAt(St.length-Ge-1)==pt.charCodeAt(pt.length-Ge-1);)Re--,Ge++;ye[ye.length-1]=St.slice(0,St.length-Ge).replace(/^\u200b+/,""),ye[0]=ye[0].slice(Re).replace(/\u200b+$/,"");var zt=Ue(V,Re),jt=Ue(te,Ie.length?Oe(Ie).length-Ge:0);if(ye.length>1||ye[0]||Et(zt,jt))return ur(e.doc,ye,zt,jt,"+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())&&ui(this.cm,function(){return ri(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()||Wn(this.cm,za)(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 Oo(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var i=st(e.doc,t.line),f=es(r,i,t.line),P=it(i,e.doc.direction),V="left";if(P){var Q=nt(P,t.ch);V=Q%2?"right":"left"}var ee=is(f.map,t.ch,V);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function pr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,i,f){var P="",V=!1,Q=e.doc.lineSeparator(),ee=!1;function te(Re){return function(Ge){return Ge.id==Re}}function de(){V&&(P+=Q,ee&&(P+=Q),V=ee=!1)}function ye(Re){Re&&(de(),P+=Re)}function Ie(Re){if(Re.nodeType==1){var Ge=Re.getAttribute("cm-text");if(Ge){ye(Ge);return}var Qe=Re.getAttribute("cm-marker"),rt;if(Qe){var ft=e.findMarks(Ue(i,0),Ue(f+1,0),te(+Qe));ft.length&&(rt=ft[0].find(0))&&ye(cn(e.doc,rt.from,rt.to).join(Q));return}if(Re.getAttribute("contenteditable")=="false")return;var St=/^(pre|div|p|li|table|br)$/i.test(Re.nodeName);if(!/^br$/i.test(Re.nodeName)&&Re.textContent.length==0)return;St&&de();for(var pt=0;pt<Re.childNodes.length;pt++)Ie(Re.childNodes[pt]);/^(pre|p)$/i.test(Re.nodeName)&&(ee=!0),St&&(V=!0)}else Re.nodeType==3&&ye(Re.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ie(t),t==r);)t=t.nextSibling,ee=!1;return P}function la(e,t,r){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[r],!i)return pr(e.clipPos(Ue(e.display.viewTo-1)),!0);t=null,r=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var f=0;f<e.display.view.length;f++){var P=e.display.view[f];if(P.node==i)return nu(P,t,r)}}function nu(e,t,r){var i=e.text.firstChild,f=!1;if(!t||!_(i,t))return pr(Ue(_t(e.line),0),!0);if(t==i&&(f=!0,t=i.childNodes[r],r=0,!t)){var P=e.rest?Oe(e.rest):e.line;return pr(Ue(_t(P),P.text.length),f)}var V=t.nodeType==3?t:null,Q=t;for(!V&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(V=t.firstChild,r&&(r=V.nodeValue.length));Q.parentNode!=i;)Q=Q.parentNode;var ee=e.measure,te=ee.maps;function de(rt,ft,St){for(var pt=-1;pt<(te?te.length:0);pt++)for(var It=pt<0?ee.map:te[pt],zt=0;zt<It.length;zt+=3){var jt=It[zt+2];if(jt==rt||jt==ft){var en=_t(pt<0?e.line:e.rest[pt]),Tn=It[zt]+St;return(St<0||jt!=rt)&&(Tn=It[zt+(St?1:0)]),Ue(en,Tn)}}}var ye=de(V,Q,r);if(ye)return pr(ye,f);for(var Ie=Q.nextSibling,Re=V?V.nodeValue.length-r:0;Ie;Ie=Ie.nextSibling){if(ye=de(Ie,Ie.firstChild,0),ye)return pr(Ue(ye.line,ye.ch-Re),f);Re+=Ie.textContent.length}for(var Ge=Q.previousSibling,Qe=r;Ge;Ge=Ge.previousSibling){if(ye=de(Ge,Ge.firstChild,-1),ye)return pr(Ue(ye.line,ye.ch+Qe),f);Qe+=Ge.textContent.length}}var Nn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};Nn.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),p&&(f.style.width="0px"),Me(f,"input",function(){z&&G>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Me(f,"paste",function(V){if(He(i,V)||wo(V,i))return;i.state.pasteIncoming=+new Date,r.fastPoll()});function P(V){if(He(i,V))return;if(i.somethingSelected())oa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var Q=So(i);oa({lineWise:!0,text:Q.text}),V.type=="cut"?i.setSelections(Q.ranges,null,fe):(r.prevInput="",f.value=Q.text.join(`
|
|
`),U(f))}else return;V.type=="cut"&&(i.state.cutIncoming=+new Date)}Me(f,"cut",P),Me(f,"copy",P),Me(e.scroller,"paste",function(V){if(Oi(e,V)||He(i,V))return;if(!f.dispatchEvent){i.state.pasteIncoming=+new Date,r.focus();return}var Q=new Event("paste");Q.clipboardData=V.clipboardData,f.dispatchEvent(Q)}),Me(e.lineSpace,"selectstart",function(V){Oi(e,V)||re(V)}),Me(f,"compositionstart",function(){var V=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:V,range:i.markText(V,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Me(f,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Nn.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},Nn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Nn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,i=ps(e);if(e.options.moveInputWithCursor){var f=yi(e,r.sel.primary().head,"div"),P=t.wrapper.getBoundingClientRect(),V=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,f.top+V.top-P.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,f.left+V.left-P.left))}return i},Nn.prototype.showSelection=function(e){var t=this.cm,r=t.display;b(r.cursorDiv,e.cursors),b(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Nn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&U(this.textarea),z&&G>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",z&&G>=9&&(this.hasSelection=null))},Nn.prototype.getField=function(){return this.textarea},Nn.prototype.supportsTouch=function(){return!1},Nn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!h||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Nn.prototype.blur=function(){this.textarea.blur()},Nn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Nn.prototype.receivedFocus=function(){this.slowPoll()},Nn.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()})},Nn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},Nn.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Be(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var f=r.value;if(f==i&&!t.somethingSelected())return!1;if(z&&G>=9&&this.hasSelection===f||o&&/[\uf700-\uf7ff]/.test(f))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var P=f.charCodeAt(0);if(P==8203&&!i&&(i="\u200B"),P==8666)return this.reset(),this.cm.execCommand("undo")}for(var V=0,Q=Math.min(i.length,f.length);V<Q&&i.charCodeAt(V)==f.charCodeAt(V);)++V;return ui(t,function(){za(t,f.slice(V),i.length-V,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
|
|
`)>-1?r.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},Nn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Nn.prototype.onKeyPress=function(){z&&G>=9&&(this.hasSelection=null),this.fastPoll()},Nn.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,f=t.textarea;t.contextMenuPending&&t.contextMenuPending();var P=Ki(r,e),V=i.scroller.scrollTop;if(!P||g)return;var Q=r.options.resetSelectionOnContextMenu;Q&&r.doc.sel.contains(P)==-1&&Wn(r,Qn)(r.doc,Mi(P),fe);var ee=f.style.cssText,te=t.wrapper.style.cssText,de=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-de.top-5)+"px; left: "+(e.clientX-de.left-5)+`px;
|
|
z-index: 1000; background: `+(z?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;n&&(ye=window.scrollY),i.input.focus(),n&&window.scrollTo(null,ye),i.input.reset(),r.somethingSelected()||(f.value=t.prevInput=" "),t.contextMenuPending=Re,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll);function Ie(){if(f.selectionStart!=null){var Qe=r.somethingSelected(),rt="\u200B"+(Qe?f.value:"");f.value="\u21DA",f.value=rt,t.prevInput=Qe?"":"\u200B",f.selectionStart=1,f.selectionEnd=rt.length,i.selForContextMenu=r.doc.sel}}function Re(){if(t.contextMenuPending!=Re)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,f.style.cssText=ee,z&&G<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=V),f.selectionStart!=null){(!z||z&&G<9)&&Ie();var Qe=0,rt=function(){i.selForContextMenu==r.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&t.prevInput=="\u200B"?Wn(r,Vs)(r):Qe++<10?i.detectingSelectAll=setTimeout(rt,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(rt,200)}}if(z&&G>=9&&Ie(),L){pe(e);var Ge=function(){mt(window,"mouseup",Ge),setTimeout(Re,20)};Me(window,"mouseup",Ge)}else setTimeout(Re,50)},Nn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Nn.prototype.setUneditable=function(){},Nn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?E(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 r=N();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function i(){e.value=Q.getValue()}var f;if(e.form&&(Me(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var P=e.form;f=P.submit;try{var V=P.submit=function(){i(),P.submit=f,P.submit(),P.submit=V}}catch(ee){}}t.finishInit=function(ee){ee.save=i,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,i(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(mt(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var Q=On(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return Q}function ru(e){e.off=mt,e.on=Me,e.wheelEventPixels=cl,e.Doc=ai,e.splitLines=ut,e.countColumn=W,e.findColumn=ve,e.isWordChar=We,e.Pass=we,e.signal=Ne,e.Line=Ai,e.changeEnd=Ni,e.scrollbarModel=xs,e.Pos=Ue,e.cmpPos=Et,e.modes=qt,e.mimeModes=At,e.resolveMode=Le,e.getMode=vn,e.modeExtensions=yt,e.extendMode=xt,e.copyState=gt,e.startState=tn,e.innerMode=Vt,e.commands=Fr,e.keyMap=Li,e.keyName=lo,e.isModifierKey=so,e.lookupKey=cr,e.normalizeKeyMap=kl,e.StringStream=Mt,e.SharedTextMarker=Pr,e.TextMarker=Ui,e.LineWidget=kr,e.e_preventDefault=re,e.e_stopPropagation=se,e.e_stop=pe,e.addClass=F,e.contains=_,e.rmClass=A,e.keyNames=Bi}$l(On),ql(On);var au="iter insert remove copy getEditor constructor".split(" ");for(var ua in ai.prototype)ai.prototype.hasOwnProperty(ua)&&ne(au,ua)<0&&(On.prototype[ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(ai.prototype[ua]));return ge(ai),On.inputStyles={textarea:Nn,contenteditable:_n},On.defineMode=function(e){!On.defaults.mode&&e!="null"&&(On.defaults.mode=e),at.apply(this,arguments)},On.defineMIME=Ln,On.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),On.defineMIME("text/plain","null"),On.defineExtension=function(e,t){On.prototype[e]=t},On.defineDocExtension=function(e,t){ai.prototype[e]=t},On.fromTextArea=iu,ru(On),On.version="5.58.2",On})},Y1PL:function(dt,be,$){"use strict";$.r(be),$.d(be,"ResizableTextArea",function(){return ne});var ie=$("wx14"),J=$("1OyB"),k=$("vuIU"),Y=$("Ji7U"),j=$("LK+K"),B=$("q1tI"),z=$("VTBJ"),G=$("rePB"),n=$("Zm9Q"),D=$("Kwbf"),y=$("c+Xe"),g=$("m+aA"),m=$("bdgK"),c=new Map;function d(fe){fe.forEach(function(_e){var Se,ve=_e.target;(Se=c.get(ve))===null||Se===void 0||Se.forEach(function(ue){return ue(ve)})})}var p=new m.default(d),l=null,h=null;function o(fe,_e){c.has(fe)||(c.set(fe,new Set),p.observe(fe)),c.get(fe).add(_e)}function s(fe,_e){c.has(fe)&&(c.get(fe).delete(_e),c.get(fe).size||(p.unobserve(fe),c.delete(fe)))}var R=function(fe){Object(Y.a)(Se,fe);var _e=Object(j.a)(Se);function Se(){return Object(J.a)(this,Se),_e.apply(this,arguments)}return Object(k.a)(Se,[{key:"render",value:function(){return this.props.children}}]),Se}(B.Component),x=B.createContext(null);function C(fe){var _e=fe.children,Se=fe.onBatchResize,ve=B.useRef(0),ue=B.useRef([]),le=B.useContext(x),Oe=B.useCallback(function(Ye,Ve,$e){ve.current+=1;var Ze=ve.current;ue.current.push({size:Ye,element:Ve,data:$e}),Promise.resolve().then(function(){Ze===ve.current&&(Se==null||Se(ue.current),ue.current=[])}),le==null||le(Ye,Ve,$e)},[Se,le]);return B.createElement(x.Provider,{value:Oe},_e)}function L(fe){var _e=fe.children,Se=fe.disabled,ve=B.useRef(null),ue=B.useRef(null),le=B.useContext(x),Oe=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ye=B.isValidElement(_e)&&Object(y.c)(_e),Ve=Ye?_e.ref:null,$e=B.useMemo(function(){return Object(y.a)(Ve,ve)},[Ve,ve]),Ze=B.useRef(fe);Ze.current=fe;var Fe=B.useCallback(function(We){var qe=Ze.current,oe=qe.onResize,Ee=qe.data,Ce=We.getBoundingClientRect(),Ae=Ce.width,ze=Ce.height,Je=We.offsetWidth,tt=We.offsetHeight,nt=Math.floor(Ae),ht=Math.floor(ze);if(Oe.current.width!==nt||Oe.current.height!==ht||Oe.current.offsetWidth!==Je||Oe.current.offsetHeight!==tt){var it={width:nt,height:ht,offsetWidth:Je,offsetHeight:tt};Oe.current=it;var lt=Je===Math.round(Ae)?Ae:Je,Me=tt===Math.round(ze)?ze:tt,Tt=Object(z.a)(Object(z.a)({},it),{},{offsetWidth:lt,offsetHeight:Me});le==null||le(Tt,We,Ee),oe&&Promise.resolve().then(function(){oe(Tt,We)})}},[]);return B.useEffect(function(){var We=Object(g.a)(ve.current)||Object(g.a)(ue.current);return We&&!Se&&o(We,Fe),function(){return s(We,Fe)}},[ve.current,Se]),B.createElement(R,{ref:ue},Ye?B.cloneElement(_e,{ref:$e}):_e)}var O="rc-observer-key";function A(fe){var _e=fe.children,Se=Object(n.a)(_e);return Se.map(function(ve,ue){var le=(ve==null?void 0:ve.key)||"".concat(O,"-").concat(ue);return B.createElement(L,Object(ie.a)({},fe,{key:le}),ve)})}A.Collection=C;var w=A,b=$("bT9E"),u=$("TSYQ"),v=$.n(u),a=`
|
|
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
|
|
`,_=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},F;function S(fe){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=fe.getAttribute("id")||fe.getAttribute("data-reactid")||fe.getAttribute("name");if(_e&&N[Se])return N[Se];var ve=window.getComputedStyle(fe),ue=ve.getPropertyValue("box-sizing")||ve.getPropertyValue("-moz-box-sizing")||ve.getPropertyValue("-webkit-box-sizing"),le=parseFloat(ve.getPropertyValue("padding-bottom"))+parseFloat(ve.getPropertyValue("padding-top")),Oe=parseFloat(ve.getPropertyValue("border-bottom-width"))+parseFloat(ve.getPropertyValue("border-top-width")),Ye=_.map(function($e){return"".concat($e,":").concat(ve.getPropertyValue($e))}).join(";"),Ve={sizingStyle:Ye,paddingSize:le,borderSize:Oe,boxSizing:ue};return _e&&Se&&(N[Se]=Ve),Ve}function U(fe){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),fe.getAttribute("wrap")?F.setAttribute("wrap",fe.getAttribute("wrap")):F.removeAttribute("wrap");var ue=S(fe,_e),le=ue.paddingSize,Oe=ue.borderSize,Ye=ue.boxSizing,Ve=ue.sizingStyle;F.setAttribute("style","".concat(Ve,";").concat(a)),F.value=fe.value||fe.placeholder||"";var $e=Number.MIN_SAFE_INTEGER,Ze=Number.MAX_SAFE_INTEGER,Fe=F.scrollHeight,We;if(Ye==="border-box"?Fe+=Oe:Ye==="content-box"&&(Fe-=le),Se!==null||ve!==null){F.value=" ";var qe=F.scrollHeight-le;Se!==null&&($e=qe*Se,Ye==="border-box"&&($e=$e+le+Oe),Fe=Math.max($e,Fe)),ve!==null&&(Ze=qe*ve,Ye==="border-box"&&(Ze=Ze+le+Oe),We=Fe>Ze?"":"hidden",Fe=Math.min(Ze,Fe))}return{height:Fe,minHeight:$e,maxHeight:Ze,overflowY:We,resize:"none"}}var M=$("Gytx"),E=$.n(M),W;(function(fe){fe[fe.NONE=0]="NONE",fe[fe.RESIZING=1]="RESIZING",fe[fe.RESIZED=2]="RESIZED"})(W||(W={}));var Z=function(fe){Object(Y.a)(Se,fe);var _e=Object(j.a)(Se);function Se(ve){var ue;return Object(J.a)(this,Se),ue=_e.call(this,ve),ue.nextFrameActionId=void 0,ue.resizeFrameId=void 0,ue.textArea=void 0,ue.saveTextArea=function(le){ue.textArea=le},ue.handleResize=function(le){var Oe=ue.state.resizeStatus,Ye=ue.props,Ve=Ye.autoSize,$e=Ye.onResize;if(Oe!==W.NONE)return;typeof $e=="function"&&$e(le),Ve&&ue.resizeOnNextFrame()},ue.resizeOnNextFrame=function(){cancelAnimationFrame(ue.nextFrameActionId),ue.nextFrameActionId=requestAnimationFrame(ue.resizeTextarea)},ue.resizeTextarea=function(){var le=ue.props.autoSize;if(!le||!ue.textArea)return;var Oe=le.minRows,Ye=le.maxRows,Ve=U(ue.textArea,!1,Oe,Ye);ue.setState({textareaStyles:Ve,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(ue.resizeFrameId),ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:W.RESIZED},function(){ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:W.NONE}),ue.fixFirefoxAutoScroll()})})})})},ue.renderTextArea=function(){var le=ue.props,Oe=le.prefixCls,Ye=Oe===void 0?"rc-textarea":Oe,Ve=le.autoSize,$e=le.onResize,Ze=le.className,Fe=le.disabled,We=ue.state,qe=We.textareaStyles,oe=We.resizeStatus,Ee=Object(b.a)(ue.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ce=v()(Ye,Ze,Object(G.a)({},"".concat(Ye,"-disabled"),Fe));"value"in Ee&&(Ee.value=Ee.value||"");var Ae=Object(z.a)(Object(z.a)(Object(z.a)({},ue.props.style),qe),oe===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(w,{onResize:ue.handleResize,disabled:!(Ve||$e)},B.createElement("textarea",Object(ie.a)({},Ee,{className:Ce,style:Ae,ref:ue.saveTextArea})))},ue.state={textareaStyles:{},resizeStatus:W.NONE},ue}return Object(k.a)(Se,[{key:"componentDidUpdate",value:function(ue){(ue.value!==this.props.value||!E()(ue.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 ue=this.textArea.selectionStart,le=this.textArea.selectionEnd;this.textArea.setSelectionRange(ue,le)}}catch(Oe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Se}(B.Component),ne=Z,ae=function(fe){Object(Y.a)(Se,fe);var _e=Object(j.a)(Se);function Se(ve){var ue;Object(J.a)(this,Se),ue=_e.call(this,ve),ue.resizableTextArea=void 0,ue.focus=function(){ue.resizableTextArea.textArea.focus()},ue.saveTextArea=function(Oe){ue.resizableTextArea=Oe},ue.handleChange=function(Oe){var Ye=ue.props.onChange;ue.setValue(Oe.target.value,function(){ue.resizableTextArea.resizeTextarea()}),Ye&&Ye(Oe)},ue.handleKeyDown=function(Oe){var Ye=ue.props,Ve=Ye.onPressEnter,$e=Ye.onKeyDown;Oe.keyCode===13&&Ve&&Ve(Oe),$e&&$e(Oe)};var le=typeof ve.value=="undefined"||ve.value===null?ve.defaultValue:ve.value;return ue.state={value:le},ue}return Object(k.a)(Se,[{key:"setValue",value:function(ue,le){"value"in this.props||this.setState({value:ue},le)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(ne,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ue){return"value"in ue?{value:ue.value}:null}}]),Se}(B.Component),we=be.default=ae},ZW9T:function(dt,be,$){"use strict";$.d(be,"a",function(){return M});var ie=$("k1fw"),J=$("oBTY"),k=$("miYZ"),Y=$("tsqr"),j=$("rAM+"),B=$("tJVT"),z=$("PpiC"),G=$("q1tI"),n=$.n(G),D=$("bdgK"),y=$("9og8"),g=$("WmNS"),m=$.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"]},d={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"]},p={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(`
|
|
`)}]},l={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(`
|
|
`)}]},h=$("5VLF"),o=$.n(h),s={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(W,Z){return Z.map(function(ne){return{label:ne,kind:W.languages.CompletionItemKind.Keyword,insertText:ne}})},x=function(W){return Object.keys(s.tables).map(function(Z){return{label:Z,kind:W.languages.CompletionItemKind.Variable,insertText:Z}})},C=function(W,Z){var ne=s.tables[W];return ne?ne.map(function(ae){return{label:ae,kind:Z.languages.CompletionItemKind.Field,insertText:ae}}):[]};function L(E,W,Z,ne,ae){var we=W.getWordUntilPosition(Z),fe={startLineNumber:Z.lineNumber,endLineNumber:Z.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},_e=ne.map(function(Se){return{label:Se,kind:E.languages.CompletionItemKind.Keyword,insertText:Se,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}});return ae.map(function(Se){_e.push(Object(ie.a)(Object(ie.a)({},Se),{},{range:fe}))}),_e}var O=function(E){s.languages.map(function(ae){return E.languages.registerDocumentFormattingEditProvider(ae,{provideDocumentFormattingEdits:function(fe,_e,Se){return Object(y.a)(m.a.mark(function ve(){var ue;return m.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return ue=o()(fe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),Oe.abrupt("return",[{range:fe.getFullModelRange(),text:ue}]);case 2:case"end":return Oe.stop()}},ve)}))()}}),ae});var W=p.quickKey.map(function(ae){return{label:ae.label,kind:E.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=l.quickKey.map(function(ae){return{label:ae.label,kind:E.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=d.quickKey.map(function(ae){return{label:ae.label,kind:E.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet}});E.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(we,fe){var _e=we.getWordUntilPosition(fe),Se={startLineNumber:fe.lineNumber,endLineNumber:fe.lineNumber,startColumn:_e.startColumn,endColumn:_e.endColumn},ve=we.getLineContent(fe.lineNumber).substring(_e.startColumn-2,_e.endColumn);return{suggestions:[].concat(Object(J.a)(p.keywords.map(function(ue){return{label:ue,kind:E.languages.CompletionItemKind.Function,documentation:ue,insertText:ue,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})),Object(J.a)(p.quickKey.map(function(ue){return{label:ue.label,kind:E.languages.CompletionItemKind.Function,documentation:ue.content,insertText:ve.startsWith("#")?ue.content.replace(/#/,""):ue.content,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})))}}}),E.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(we,fe){var _e=we.getWordUntilPosition(fe),Se={startLineNumber:fe.lineNumber,endLineNumber:fe.lineNumber,startColumn:_e.startColumn,endColumn:_e.endColumn};return{suggestions:Object(J.a)(c.keywords.map(function(ve){return{label:ve,kind:E.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}}))}}}),E.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(we,fe){var _e=we.getWordUntilPosition(fe),Se={startLineNumber:fe.lineNumber,endLineNumber:fe.lineNumber,startColumn:_e.startColumn,endColumn:_e.endColumn},ve=we.getLineContent(fe.lineNumber).substring(_e.startColumn-2,_e.endColumn);return{suggestions:[].concat(Object(J.a)(d.keywords.map(function(ue){return{label:ue,kind:E.languages.CompletionItemKind.Function,documentation:ue,insertText:ue,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})),Object(J.a)(d.quickKey.map(function(ue){return{label:ue.label,kind:E.languages.CompletionItemKind.Function,documentation:ue.content,insertText:ve.startsWith("#")?ue.content.replace(/#/,""):ue.content,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})))}}}),E.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(we,fe){var _e=we.getWordUntilPosition(fe),Se={startLineNumber:fe.lineNumber,endLineNumber:fe.lineNumber,startColumn:_e.startColumn,endColumn:_e.endColumn},ve=we.getLineContent(fe.lineNumber).substring(_e.startColumn-2,_e.endColumn);return{suggestions:[].concat(Object(J.a)(l.keywords.map(function(ue){return{label:ue,kind:E.languages.CompletionItemKind.Function,documentation:ue,insertText:ue,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})),Object(J.a)(l.quickKey.map(function(ue){return{label:ue.label,kind:E.languages.CompletionItemKind.Function,documentation:ue.content,insertText:ve.startsWith("#")?ue.content.replace(/#/,""):ue.content,insertTextRules:E.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}})))}}})},A="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",w=$("fjLI"),b=$("LvDl"),u=$("+ua5");function v(E){return/^\d+$/.test(E)?"".concat(E,"px"):E}function a(){}var _=!1,N={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function F(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=E;if(Array.isArray(E)){for(var Z=0;Z<E.length;Z++){var ne=N[E[Z]];if(ne)return ne}return W[0]}return N[W]||W}var S=null,U=be.b=function(E){var W=E.width,Z=W===void 0?"100%":W,ne=E.height,ae=ne===void 0?"100%":ne,we=E.value,fe=E.language,_e=fe===void 0?"javascript":fe,Se=E.style,ve=Se===void 0?{}:Se,ue=E.options,le=ue===void 0?{}:ue,Oe=E.overrideServices,Ye=Oe===void 0?{}:Oe,Ve=E.theme,$e=Ve===void 0?"vs-dark":Ve,Ze=E.onEditBlur,Fe=E.onSave,We=E.autoHeight,qe=We===void 0?!1:We,oe=E.forbidCopy,Ee=oe===void 0?!1:oe,Ce=E.onChange,Ae=Ce===void 0?a:Ce,ze=E.editorDidMount,Je=ze===void 0?a:ze,tt=E.onFocus,nt=tt===void 0?a:tt,ht=E.filename,it=ht===void 0?"educoder.txt":ht,lt=E.errorLine,Me=E.errorContent,Tt=Me===void 0?"":Me,mt=Object(z.a)(E,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ne=Object(G.useRef)(),He=Object(G.useRef)({}),Te=Object(G.useRef)(),me=Object(G.useRef)(),ge=Object(G.useRef)(!1),re=Object(G.useRef)(),se=Object(G.useState)(!1),ce=Object(B.a)(se,2),pe=ce[0],xe=ce[1];function Pe(){var yt;return Ne.current&&(yt=new D.default(function(xt){var gt=Object(j.a)(xt),Vt;try{for(gt.s();!(Vt=gt.n()).done;){var tn=Vt.value;(tn.target.offsetHeight>0||tn.target.offsetWidth>0)&&He.current.instance.layout()}}catch(Mt){gt.e(Mt)}finally{gt.f()}}),yt.observe(Ne.current)),yt}function Ke(){Y.b.warn(decodeURIComponent(A))}var vt=function(){var xt=He.current.instance;if(we!=null&&xt&&pe){var gt=xt.getModel();gt&&we!==gt.getValue()&&(_=!0,gt.setValue(we),xt.layout(),_=!1)}};Object(G.useEffect)(function(){me.current&&clearTimeout(me.current),me.current=setTimeout(function(){vt()},500)},[we,pe,He.current]),Object(G.useEffect)(function(){if(lt&&He.current&&He.current.instance){var yt=He.current.instance;yt.changeViewZones(function(gt){var Vt=document.createElement("div");Vt.style.padding="10px 20px",Vt.style.width="calc(100% - 20px)",Vt.className="my-error-line-wrp",Vt.innerHTML=Tt,gt.addZone({afterLineNumber:lt||11,heightInLines:3,domNode:Vt})});var xt={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}};yt.addOverlayWidget(xt),yt.revealPositionInCenter({lineNumber:20,column:1})}},[lt,He.current,pe]);function Ft(){var yt=He.current.instance;if(yt){var xt=yt.getSelection(),gt=He.current.pastePos||{},Vt=new S.Range(gt.startLineNumber||xt.endLineNumber,gt.startColumn||xt.endColumn,gt.endLineNumber||xt.endLineNumber,gt.endColumn||xt.endColumn);setTimeout(function(){yt.executeEdits("",[{range:Vt,text:""}])},300)}}function Dt(yt){(window.navigator.platform.match("Mac")?yt.metaKey:yt.ctrlKey)&&yt.keyCode==83&&(yt.preventDefault(),Fe())}var Kt=function(){if(qe&&He.current.instance){var xt=He.current.instance.getContentHeight();Le(xt<ae?ae:xt)}else Le(ae)};function ut(yt){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),yt.dispatchEvent(xt)}function Be(yt,xt){var gt=window.URL||window.webkitURL||window,Vt=new Blob([xt]),tn=document.createElementNS("http://www.w3.org/1999/xhtml","a");tn.href=gt.createObjectURL(Vt),tn.download=yt,ut(tn)}Object(G.useEffect)(function(){Kt()},[Kt]),Object(G.useEffect)(function(){Ne.current&&!pe&&Promise.all([$.e(16),$.e(28)]).then($.t.bind(null,"M/lh",7)).then(function(yt){try{S=yt,He.current.instance=S.editor.create(Ne.current,{value:we,language:F(_e),theme:$e,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ye);var xt=He.current.instance,gt=w.d._menuItems,Vt=Object(J.a)(gt).find(function(Gt){return Gt[0]._debugName=="EditorContext"}),tn=Vt[1],Mt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],st=function(Bt,_t){var Lt=Bt._first;do{var Qt,rn,Ue=_t.includes((Qt=Lt.element)===null||Qt===void 0||((rn=Qt.command)===null||rn===void 0)?void 0:rn.id);Ue&&Bt._remove(Lt)}while(Lt=Lt.next)};if(Je(xt,S),setTimeout(function(){Kt(),He.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Be(it||"educoder.txt",xt.getValue())}}),xt.getDomNode().addEventListener("input",function(){Te.current.autoFormat&&xt.getAction("editor.action.formatDocument").run()})},500),He.current.subscription=xt.onDidChangeModelContent(function(Gt){ge.current?clearTimeout(re.current):(Kt(),Ae(xt.getValue(),Gt)),re.current=setTimeout(function(){ge.current=!1},500)}),window.Monaco||O(S,F(_e)),Ee&&(st(tn,Mt),Ne.current.classList.add("noCopyPaste"),xt.onKeyDown(function(Gt){var Bt=Gt.keyCode,_t=Gt.ctrlKey,Lt=Gt.metaKey;(Bt===33||Bt===52)&&(Lt||_t)&&(Ke(),Gt.preventDefault())})),window.Monaco=S,Ze&&xt.onDidBlurEditorWidget(function(){Ze(xt.getValue())}),nt&&xt.onDidFocusEditorText(function(){nt(xt.getValue())}),Ee){xt.addCommand(S.KeyMod.CtrlCmd|S.KeyCode.KEY_V,function(){return Ke(),null}),xt.onDidPaste(function(Gt){He.current.pastePos=Gt});try{window.addEventListener("paste",Ft)}catch(Gt){}}var cn=Pe();return xe(!0),function(){var Gt=He.current.instance;Gt.dispose();var Bt=Gt.getModel();Bt&&Bt.dispose(),He.current.subscription&&He.current.subscription.dispose(),Ee&&window.removeEventListener("paste",Ft),cn.unobserve(Ne.current)}}catch(Gt){}})},[]),Object(G.useEffect)(function(){var yt=He.current.instance;if(yt&&pe)return document.addEventListener("keydown",Dt,!1),function(){document.removeEventListener("keydown",Dt)}},[Fe,pe]),Object(G.useEffect)(function(){var yt=He.current.instance;if(yt&&pe){var xt=F(_e);S.editor.setModelLanguage(yt.getModel(),xt),console.log("language:",_e,yt.getModel(),xt)}},[_e,pe]),Object(G.useEffect)(function(){var yt=He.current.instance;yt&&pe&&S.editor.setTheme($e)},[$e,pe]),Object(G.useEffect)(function(){var yt=He.current.instance;Te.current=le,yt&&pe&&(yt.updateOptions(Object(ie.a)({},le)),setTimeout(function(){yt.getModel().updateOptions(Object(ie.a)({},le))},200))},[JSON.stringify(le),pe]),Object(G.useEffect)(function(){var yt=He.current.instance;yt&&pe&&yt.layout()},[Z,ae,pe]);var kt=Object(G.useState)(v(Z)),Ot=Object(B.a)(kt,2),sn=Ot[0],qt=Ot[1],At=Object(G.useState)(v(ae)),at=Object(B.a)(At,2),Ln=at[0],Le=at[1],vn=Object(ie.a)(Object(ie.a)({},ve),{},{width:sn,height:Ln});return n.a.createElement("div",{className:"my-monaco-editor",ref:Ne,style:vn})};function M(E){var W=E.width,Z=W===void 0?"100%":W,ne=E.height,ae=ne===void 0?"100%":ne,we=E.original,fe=E.modified,_e=E.language,Se=E.options,ve=Se===void 0?{}:Se,ue=Object(G.useRef)(),le=Object(G.useState)(null),Oe=Object(B.a)(le,2),Ye=Oe[0],Ve=Oe[1];function $e(qe){var oe;return ue.current&&(oe=new D.default(function(Ee){var Ce=Object(j.a)(Ee),Ae;try{for(Ce.s();!(Ae=Ce.n()).done;){var ze=Ae.value;(ze.target.offsetHeight>0||ze.target.offsetWidth>0)&&qe.layout()}}catch(Je){Ce.e(Je)}finally{Ce.f()}}),oe.observe(ue.current)),oe}Object(G.useEffect)(function(){ue.current&&Promise.all([$.e(16),$.e(28)]).then($.t.bind(null,"M/lh",7)).then(function(qe){S=qe;var oe=S.editor.createDiffEditor(ue.current,Object(ie.a)(Object(ie.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},ve),{},{wordWrap:!0}));Ve(oe);var Ee=$e(oe);return function(){oe.dispose();var Ce=oe.getModel();Ce&&Ce.dispose(),Ee.unobserve(ue.current)}})},[]),Object(G.useEffect)(function(){Ye&&Ye.setModel({original:S.editor.createModel(we,_e),modified:S.editor.createModel(fe,_e)})},[we,fe,_e,Ye]);var Ze=v(Z),Fe=v(ae),We={width:Ze,height:Fe};return n.a.createElement("div",{className:"my-diff-editor",ref:ue,style:We})}},ZpRC:function(dt,be,$){"use strict";function ie(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function J(y,g){return(!g||y!=="hidden")&&y!=="visible"&&y!=="clip"}function k(y,g){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var m=getComputedStyle(y,null);return J(m.overflowY,g)||J(m.overflowX,g)||function(c){var d=function(p){if(!p.ownerDocument||!p.ownerDocument.defaultView)return null;try{return p.ownerDocument.defaultView.frameElement}catch(l){return null}}(c);return!!d&&(d.clientHeight<c.scrollHeight||d.clientWidth<c.scrollWidth)}(y)}return!1}function Y(y,g,m,c,d,p,l,h){return p<y&&l>g||p>y&&l<g?0:p<=y&&h<=m||l>=g&&h>=m?p-y-c:l>g&&h<m||p<y&&h>m?l-g+d:0}var j=function(y,g){var m=window,c=g.scrollMode,d=g.block,p=g.inline,l=g.boundary,h=g.skipOverflowHiddenElements,o=typeof l=="function"?l:function(qe){return qe!==l};if(!ie(y))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,R=[],x=y;ie(x)&&o(x);){if((x=x.parentElement)===s){R.push(x);break}x!=null&&x===document.body&&k(x)&&!k(document.documentElement)||x!=null&&k(x,h)&&R.push(x)}for(var C=m.visualViewport?m.visualViewport.width:innerWidth,L=m.visualViewport?m.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,A=window.scrollY||pageYOffset,w=y.getBoundingClientRect(),b=w.height,u=w.width,v=w.top,a=w.right,_=w.bottom,N=w.left,F=d==="start"||d==="nearest"?v:d==="end"?_:v+b/2,S=p==="center"?N+u/2:p==="end"?a:N,U=[],M=0;M<R.length;M++){var E=R[M],W=E.getBoundingClientRect(),Z=W.height,ne=W.width,ae=W.top,we=W.right,fe=W.bottom,_e=W.left;if(c==="if-needed"&&v>=0&&N>=0&&_<=L&&a<=C&&v>=ae&&_<=fe&&N>=_e&&a<=we)return U;var Se=getComputedStyle(E),ve=parseInt(Se.borderLeftWidth,10),ue=parseInt(Se.borderTopWidth,10),le=parseInt(Se.borderRightWidth,10),Oe=parseInt(Se.borderBottomWidth,10),Ye=0,Ve=0,$e="offsetWidth"in E?E.offsetWidth-E.clientWidth-ve-le:0,Ze="offsetHeight"in E?E.offsetHeight-E.clientHeight-ue-Oe:0;if(s===E)Ye=d==="start"?F:d==="end"?F-L:d==="nearest"?Y(A,A+L,L,ue,Oe,A+F,A+F+b,b):F-L/2,Ve=p==="start"?S:p==="center"?S-C/2:p==="end"?S-C:Y(O,O+C,C,ve,le,O+S,O+S+u,u),Ye=Math.max(0,Ye+A),Ve=Math.max(0,Ve+O);else{Ye=d==="start"?F-ae-ue:d==="end"?F-fe+Oe+Ze:d==="nearest"?Y(ae,fe,Z,ue,Oe+Ze,F,F+b,b):F-(ae+Z/2)+Ze/2,Ve=p==="start"?S-_e-ve:p==="center"?S-(_e+ne/2)+$e/2:p==="end"?S-we+le+$e:Y(_e,we,ne,ve,le+$e,S,S+u,u);var Fe=E.scrollLeft,We=E.scrollTop;F+=We-(Ye=Math.max(0,Math.min(We+Ye,E.scrollHeight-Z+Ze))),S+=Fe-(Ve=Math.max(0,Math.min(Fe+Ve,E.scrollWidth-ne+$e)))}U.push({el:E,top:Ye,left:Ve})}return U};function B(y){return y===Object(y)&&Object.keys(y).length!==0}function z(y,g){g===void 0&&(g="auto");var m="scrollBehavior"in document.body.style;y.forEach(function(c){var d=c.el,p=c.top,l=c.left;d.scroll&&m?d.scroll({top:p,left:l,behavior:g}):(d.scrollTop=p,d.scrollLeft=l)})}function G(y){return y===!1?{block:"end",inline:"nearest"}:B(y)?y:{block:"start",inline:"nearest"}}function n(y,g){var m=!y.ownerDocument.documentElement.contains(y);if(B(g)&&typeof g.behavior=="function")return g.behavior(m?[]:j(y,g));if(m)return;var c=G(g);return z(j(y,c),c.behavior)}var D=be.a=n},bT9E:function(dt,be,$){"use strict";$.d(be,"a",function(){return J});var ie=$("VTBJ");function J(k,Y){var j=Object(ie.a)({},k);return Array.isArray(Y)&&Y.forEach(function(B){delete j[B]}),j}},c5Ni:function(dt,be,$){},dejd:function(dt,be,$){},dmUQ:function(dt,be,$){"use strict";var ie=$("Ff2n"),J=$("rePB"),k=$("1OyB"),Y=$("vuIU"),j=$("Ji7U"),B=$("md7G"),z=$("foSv"),G=$("q1tI"),n=$.n(G),D=$("TSYQ"),y=$.n(D),g=$("4IlW");function m(b,u){var v=Object.keys(b);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(b);u&&(a=a.filter(function(_){return Object.getOwnPropertyDescriptor(b,_).enumerable})),v.push.apply(v,a)}return v}function c(b){for(var u=1;u<arguments.length;u++){var v=arguments[u]!=null?arguments[u]:{};u%2?m(Object(v),!0).forEach(function(a){Object(J.a)(b,a,v[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(v)):m(Object(v)).forEach(function(a){Object.defineProperty(b,a,Object.getOwnPropertyDescriptor(v,a))})}return b}function d(b){var u=p();return function(){var a=Object(z.a)(b),_;if(u){var N=Object(z.a)(this).constructor;_=Reflect.construct(a,arguments,N)}else _=a.apply(this,arguments);return Object(B.a)(this,_)}}function p(){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(b){return!1}}function l(){}function h(b){b.preventDefault()}var o=function(u){return u.replace(/[^\w.-]+/g,"")},s=200,R=600,x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(u){return u!=null},L=function(u,v){return v===u||typeof v=="number"&&typeof u=="number"&&isNaN(v)&&isNaN(u)},O=function(b){Object(j.a)(v,b);var u=d(v);function v(a){var _;Object(k.a)(this,v),_=u.call(this,a),_.onKeyDown=function(S){var U=_.props,M=U.onKeyDown,E=U.onPressEnter;if(S.keyCode===g.a.UP){var W=_.getRatio(S);_.up(S,W,null),_.stop()}else if(S.keyCode===g.a.DOWN){var Z=_.getRatio(S);_.down(S,Z,null),_.stop()}else S.keyCode===g.a.ENTER&&E&&E(S);if(_.recordCursorPosition(),_.lastKeyCode=S.keyCode,M){for(var ne=arguments.length,ae=new Array(ne>1?ne-1:0),we=1;we<ne;we++)ae[we-1]=arguments[we];M.apply(void 0,[S].concat(ae))}},_.onKeyUp=function(S){var U=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),U){for(var M=arguments.length,E=new Array(M>1?M-1:0),W=1;W<M;W++)E[W-1]=arguments[W];U.apply(void 0,[S].concat(E))}},_.onChange=function(S){var U=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(S)),_.setState({inputValue:_.rawInput}),U(_.toNumber(_.rawInput))},_.onMouseUp=function(){var S=_.props.onMouseUp;_.recordCursorPosition(),S&&S.apply(void 0,arguments)},_.onFocus=function(){var S;_.setState({focused:!0}),(S=_.props).onFocus.apply(S,arguments)},_.onBlur=function(){var S=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var U=_.getCurrentValidValue(_.state.inputValue),M=_.setValue(U,l);if(S){var E=_.input.value,W=_.getInputDisplayValue({focus:!1,value:M});_.input.value=W&&Number(W),S.apply(void 0,arguments),_.input.value=E}},_.getRatio=function(S){var U=1;return S.metaKey||S.ctrlKey?U=.1:S.shiftKey&&(U=10),U},_.getFullNum=function(S){return isNaN(S)?S:/e/i.test(String(S))?Number(S).toFixed(18).replace(/\.?0+$/,""):S},_.getPrecision=function(S){if(C(_.props.precision))return _.props.precision;var U=String(S);if(U.indexOf("e-")>=0)return parseInt(U.slice(U.indexOf("e-")+2),10);var M=0;return U.indexOf(".")>=0&&(M=U.length-U.indexOf(".")-1),M},_.getInputDisplayValue=function(S){var U=S||_.state,M=U.focused,E=U.inputValue,W=U.value,Z;M?Z=E:Z=_.toPrecisionAsStep(W),Z==null&&(Z="");var ne=_.formatWrapper(Z);return C(_.props.decimalSeparator)&&(ne=ne.toString().replace(".",_.props.decimalSeparator)),ne},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(S){}},_.restoreByAfter=function(S){if(S===void 0)return!1;var U=_.input.value,M=U.lastIndexOf(S);if(M===-1)return!1;var E=_.cursorBefore.length;return _.lastKeyCode===g.a.DELETE&&_.cursorBefore.charAt(E-1)===S[0]?(_.fixCaret(E,E),!0):M+S.length===U.length?(_.fixCaret(M,M),!0):!1},_.partRestoreByAfter=function(S){return S===void 0?!1:Array.prototype.some.call(S,function(U,M){var E=S.substring(M);return _.restoreByAfter(E)})},_.isNotCompleteNumber=function(S){return isNaN(S)||S===""||S===null||S&&S.toString().indexOf(".")===S.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(S,U,M){_.pressingUpOrDown=!0,_.step("down",S,U,M)},_.up=function(S,U,M){_.pressingUpOrDown=!0,_.step("up",S,U,M)},_.saveInput=function(S){_.input=S};var N=a.value;N===void 0&&(N=a.defaultValue),_.state={focused:a.autoFocus};var F=_.getValidValue(_.toNumber(N));return _.state=c(c({},_.state),{},{inputValue:_.toPrecisionAsStep(F),value:F}),_}return Object(Y.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var N=this.props,F=N.value,S=N.onChange,U=N.max,M=N.min,E=this.state.focused;if(_){if(!L(_.value,F)||!L(_.max,U)||!L(_.min,M)){var W=E?F:this.getValidValue(F),Z;this.pressingUpOrDown?Z=W:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:Z})}var ne="value"in this.props?F:this.state.value;"max"in this.props&&_.max!==U&&typeof ne=="number"&&ne>U&&S&&S(U),"min"in this.props&&_.min!==M&&typeof ne=="number"&&ne<M&&S&&S(M)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ae=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?ae=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(ae=this.cursorStart):ae=this.input.value.length,this.fixCaret(ae,ae)}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(we){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(_){var N=_;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(_){var N=_.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(_){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,S=parseFloat(_);return isNaN(S)?_:(S<N&&(S=N),S>F&&(S=F),S)}},{key:"setValue",value:function(_,N){var F=this.props.precision,S=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),U=this.state.value,M=U===void 0?null:U,E=this.state.inputValue,W=E===void 0?null:E,Z=typeof S=="number"?S.toFixed(F):"".concat(S),ne=S!==M||Z!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},N)):this.setState({value:S,inputValue:this.toPrecisionAsStep(_)},N),ne&&this.props.onChange(S),S}},{key:"getMaxPrecision",value:function(_){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,S=F.precision,U=F.step;if(C(S))return S;var M=this.getPrecision(N),E=this.getPrecision(U),W=this.getPrecision(_);return _?Math.max(W,M+E):M+E}},{key:"getPrecisionFactor",value:function(_){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(_,N);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var N=Math.abs(this.getMaxPrecision(_));return isNaN(N)?_.toString():Number(_).toFixed(N)}},{key:"toNumber",value:function(_){var N=this.props.precision,F=this.state.focused,S=_&&_.length>16&&F;return this.isNotCompleteNumber(_)||S?_:C(N)?Math.round(_*Math.pow(10,N))/Math.pow(10,N):Number(_)}},{key:"upStep",value:function(_,N){var F=this.props.step,S=this.getPrecisionFactor(_,N),U=Math.abs(this.getMaxPrecision(_,N)),M=((S*_+S*F*N)/S).toFixed(U);return this.toNumber(M)}},{key:"downStep",value:function(_,N){var F=this.props.step,S=this.getPrecisionFactor(_,N),U=Math.abs(this.getMaxPrecision(_,N)),M=((S*_-S*F*N)/S).toFixed(U);return this.toNumber(M)}},{key:"step",value:function(_,N){var F=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,U=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var M=this.props;if(M.disabled)return;var E=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(E))return;var W=this["".concat(_,"Step")](E,S),Z=W>M.max||W<M.min;if(W>M.max?W=M.max:W<M.min&&(W=M.min),this.setValue(W,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){F[_](N,S,!0)},U?s:R)}},{key:"fixCaret",value:function(_,N){if(_===void 0||N===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,S=this.input.selectionEnd;(_!==F||N!==S)&&this.input.setSelectionRange(_,N)}catch(U){}}},{key:"render",value:function(){var _,N=this.props,F=N.prefixCls,S=N.disabled,U=N.readOnly,M=N.useTouch,E=N.autoComplete,W=N.upHandler,Z=N.downHandler,ne=N.className,ae=N.max,we=N.min,fe=N.style,_e=N.title,Se=N.onMouseEnter,ve=N.onMouseLeave,ue=N.onMouseOver,le=N.onMouseOut,Oe=N.required,Ye=N.onClick,Ve=N.tabIndex,$e=N.type,Ze=N.placeholder,Fe=N.id,We=N.inputMode,qe=N.pattern,oe=N.step,Ee=N.maxLength,Ce=N.autoFocus,Ae=N.name,ze=N.onPaste,Je=N.onInput,tt=Object(ie.a)(N,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),nt=this.state,ht=nt.value,it=nt.focused,lt=y()(F,(_={},Object(J.a)(_,ne,!!ne),Object(J.a)(_,"".concat(F,"-disabled"),S),Object(J.a)(_,"".concat(F,"-focused"),it),_)),Me={};Object.keys(tt).forEach(function(pe){(pe.substr(0,5)==="data-"||pe.substr(0,5)==="aria-"||pe==="role")&&(Me[pe]=tt[pe])});var Tt=!U&&!S,mt=this.getInputDisplayValue(null),Ne=(ht||ht===0)&&(isNaN(ht)||Number(ht)>=ae),He=(ht||ht===0)&&(isNaN(ht)||Number(ht)<=we),Te=Ne||S||U,me=He||S||U,ge=y()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(J.a)({},"".concat(F,"-handler-up-disabled"),Te)),re=y()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(J.a)({},"".concat(F,"-handler-down-disabled"),me)),se=M?{onTouchStart:Te?l:this.up,onTouchEnd:this.stop}:{onMouseDown:Te?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=M?{onTouchStart:me?l:this.down,onTouchEnd:this.stop}:{onMouseDown:me?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:lt,style:fe,title:_e,onMouseEnter:Se,onMouseLeave:ve,onMouseOver:ue,onMouseOut:le,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(F,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},se,{role:"button","aria-label":"Increase Value","aria-disabled":Te,className:ge}),W||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:h})),n.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":me,className:re}),Z||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:h}))),n.a.createElement("div",{className:"".concat(F,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":we,"aria-valuemax":ae,"aria-valuenow":ht,required:Oe,type:$e,placeholder:Ze,onPaste:ze,onClick:Ye,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:Ve,autoComplete:E,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Tt?this.onKeyDown:l,onKeyUp:Tt?this.onKeyUp:l,autoFocus:Ce,maxLength:Ee,readOnly:U,disabled:S,max:ae,min:we,step:oe,name:Ae,title:_e,id:Fe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(mt),pattern:qe,inputMode:We,onInput:Je},Me))))}}]),v}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:o,required:!1,autoComplete:"off"};var A=O,w=be.a=A},fcSX:function(dt,be,$){"use strict";var ie=$("Ff2n"),J=$("1OyB"),k=$("vuIU"),Y=$("Ji7U"),j=$("md7G"),B=$("foSv"),z=$("1W/9"),G=$("q1tI"),n=$("rePB"),D=$("JX7q"),y=$("TSYQ"),g=$.n(y),m=$("qx4F"),c=$("4IlW");function d(S){return Array.isArray(S)?S:[S]}var p={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(p).filter(function(S){if(typeof document=="undefined")return!1;var U=document.getElementsByTagName("html")[0];return S in(U?U.style:{})})[0],h=p[l];function o(S,U,M,E){S.addEventListener?S.addEventListener(U,M,E):S.attachEvent&&S.attachEvent("on".concat(U),M)}function s(S,U,M,E){S.removeEventListener?S.removeEventListener(U,M,E):S.attachEvent&&S.detachEvent("on".concat(U),M)}function R(S,U){var M=typeof S=="function"?S(U):S;return Array.isArray(M)?M.length===2?M:[M[0],M[1]]:[M]}var x=function(U){return!isNaN(parseFloat(U))&&isFinite(U)},C=!(typeof window!="undefined"&&window.document&&window.document.createElement),L=function S(U,M,E,W){if(!M||M===document||M instanceof Document)return!1;if(M===U.parentNode)return!0;var Z=Math.max(Math.abs(E),Math.abs(W))===Math.abs(W),ne=Math.max(Math.abs(E),Math.abs(W))===Math.abs(E),ae=M.scrollHeight-M.clientHeight,we=M.scrollWidth-M.clientWidth,fe=document.defaultView.getComputedStyle(M),_e=fe.overflowY==="auto"||fe.overflowY==="scroll",Se=fe.overflowX==="auto"||fe.overflowX==="scroll",ve=ae&&_e,ue=we&&Se;return Z&&(!ve||ve&&(M.scrollTop>=ae&&W<0||M.scrollTop<=0&&W>0))||ne&&(!ue||ue&&(M.scrollLeft>=we&&E<0||M.scrollLeft<=0&&E>0))?S(U,M.parentNode,E,W):!1};function O(S){var U=A();return function(){var E=Object(B.a)(S),W;if(U){var Z=Object(B.a)(this).constructor;W=Reflect.construct(E,arguments,Z)}else W=E.apply(this,arguments);return Object(j.a)(this,W)}}function A(){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(S){return!1}}var w={},b=function(S){Object(Y.a)(M,S);var U=O(M);function M(E){var W;return Object(J.a)(this,M),W=U.call(this,E),W.domFocus=function(){W.dom&&W.dom.focus()},W.removeStartHandler=function(Z){if(Z.touches.length>1)return;W.startPos={x:Z.touches[0].clientX,y:Z.touches[0].clientY}},W.removeMoveHandler=function(Z){if(Z.changedTouches.length>1)return;var ne=Z.currentTarget,ae=Z.changedTouches[0].clientX-W.startPos.x,we=Z.changedTouches[0].clientY-W.startPos.y;(ne===W.maskDom||ne===W.handlerDom||ne===W.contentDom&&L(ne,Z.target,ae,we))&&Z.cancelable&&Z.preventDefault()},W.transitionEnd=function(Z){var ne=Z.target;s(ne,h,W.transitionEnd),ne.style.transition=""},W.onKeyDown=function(Z){if(Z.keyCode===c.a.ESC){var ne=W.props.onClose;Z.stopPropagation(),ne&&ne(Z)}},W.onWrapperTransitionEnd=function(Z){var ne=W.props,ae=ne.open,we=ne.afterVisibleChange;Z.target===W.contentWrapper&&Z.propertyName.match(/transform$/)&&(W.dom.style.transition="",!ae&&W.getCurrentDrawerSome()&&(document.body.style.overflowX="",W.maskDom&&(W.maskDom.style.left="",W.maskDom.style.width="")),we&&we(!!ae))},W.openLevelTransition=function(){var Z=W.props,ne=Z.open,ae=Z.width,we=Z.height,fe=W.getHorizontalBoolAndPlacementName(),_e=fe.isHorizontal,Se=fe.placementName,ve=W.contentDom?W.contentDom.getBoundingClientRect()[_e?"width":"height"]:0,ue=(_e?ae:we)||ve;W.setLevelAndScrolling(ne,Se,ue)},W.setLevelTransform=function(Z,ne,ae,we){var fe=W.props,_e=fe.placement,Se=fe.levelMove,ve=fe.duration,ue=fe.ease,le=fe.showMask;W.levelDom.forEach(function(Oe){Oe.style.transition="transform ".concat(ve," ").concat(ue),o(Oe,h,W.transitionEnd);var Ye=Z?ae:0;if(Se){var Ve=R(Se,{target:Oe,open:Z});Ye=Z?Ve[0]:Ve[1]||0}var $e=typeof Ye=="number"?"".concat(Ye,"px"):Ye,Ze=_e==="left"||_e==="top"?$e:"-".concat($e);Ze=le&&_e==="right"&&we?"calc(".concat(Ze," + ").concat(we,"px)"):Ze,Oe.style.transform=Ye?"".concat(ne,"(").concat(Ze,")"):""})},W.setLevelAndScrolling=function(Z,ne,ae){var we=W.props.onChange;if(!C){var fe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(m.a)(!0):0;W.setLevelTransform(Z,ne,ae,fe),W.toggleScrollingToDrawerAndBody(fe)}we&&we(Z)},W.toggleScrollingToDrawerAndBody=function(Z){var ne=W.props,ae=ne.getOpenCount,we=ne.getContainer,fe=ne.showMask,_e=ne.open,Se=we&&we(),ve=ae&&ae();if(Se&&Se.parentNode===document.body&&fe){var ue=["touchstart"],le=[document.body,W.maskDom,W.handlerDom,W.contentDom];_e&&document.body.style.overflow!=="hidden"?(Z&&W.addScrollingEffect(Z),ve===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",le.forEach(function(Oe,Ye){if(!Oe)return;o(Oe,ue[Ye]||"touchmove",Ye?W.removeMoveHandler:W.removeStartHandler,W.passive)})):W.getCurrentDrawerSome()&&(ve||(document.body.style.overflow=""),document.body.style.touchAction="",Z&&W.remScrollingEffect(Z),le.forEach(function(Oe,Ye){if(!Oe)return;s(Oe,ue[Ye]||"touchmove",Ye?W.removeMoveHandler:W.removeStartHandler,W.passive)}))}},W.addScrollingEffect=function(Z){var ne=W.props,ae=ne.placement,we=ne.duration,fe=ne.ease,_e=ne.getOpenCount,Se=ne.switchScrollingEffect,ve=_e&&_e();ve===1&&Se();var ue="width ".concat(we," ").concat(fe),le="transform ".concat(we," ").concat(fe);W.dom.style.transition="none";switch(ae){case"right":W.dom.style.transform="translateX(-".concat(Z,"px)");break;case"top":case"bottom":W.dom.style.width="calc(100% - ".concat(Z,"px)"),W.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(le,",").concat(ue),W.dom.style.width="",W.dom.style.transform="")})},W.remScrollingEffect=function(Z){var ne=W.props,ae=ne.placement,we=ne.duration,fe=ne.ease,_e=ne.getOpenCount,Se=ne.switchScrollingEffect,ve=_e&&_e();ve||Se(!0),l&&(document.body.style.overflowX="hidden"),W.dom.style.transition="none";var ue,le="width ".concat(we," ").concat(fe),Oe="transform ".concat(we," ").concat(fe);switch(ae){case"left":{W.dom.style.width="100%",le="width 0s ".concat(fe," ").concat(we);break}case"right":{W.dom.style.transform="translateX(".concat(Z,"px)"),W.dom.style.width="100%",le="width 0s ".concat(fe," ").concat(we),W.maskDom&&(W.maskDom.style.left="-".concat(Z,"px"),W.maskDom.style.width="calc(100% + ".concat(Z,"px)"));break}case"top":case"bottom":{W.dom.style.width="calc(100% + ".concat(Z,"px)"),W.dom.style.height="100%",W.dom.style.transform="translateZ(0)",ue="height 0s ".concat(fe," ").concat(we);break}default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(Oe,",").concat(ue?"".concat(ue,","):"").concat(le),W.dom.style.transform="",W.dom.style.width="",W.dom.style.height="")})},W.getCurrentDrawerSome=function(){return!Object.keys(w).some(function(Z){return w[Z]})},W.getLevelDom=function(Z){var ne=Z.level,ae=Z.getContainer;if(C)return;var we=ae&&ae(),fe=we?we.parentNode:null;if(W.levelDom=[],ne==="all"){var _e=fe?Array.prototype.slice.call(fe.children):[];_e.forEach(function(Se){Se.nodeName!=="SCRIPT"&&Se.nodeName!=="STYLE"&&Se.nodeName!=="LINK"&&Se!==we&&W.levelDom.push(Se)})}else ne&&d(ne).forEach(function(Se){document.querySelectorAll(Se).forEach(function(ve){W.levelDom.push(ve)})})},W.getHorizontalBoolAndPlacementName=function(){var Z=W.props.placement,ne=Z==="left"||Z==="right",ae="translate".concat(ne?"X":"Y");return{isHorizontal:ne,placementName:ae}},W.state={_self:Object(D.a)(W)},W}return Object(k.a)(M,[{key:"componentDidMount",value:function(){var W=this;if(!C){var Z=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Z=!0,null}}))}catch(_e){}this.passive=Z?{passive:!1}:!1}var ne=this.props,ae=ne.open,we=ne.getContainer,fe=we&&we();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ae&&(fe&&fe.parentNode===document.body&&(w[this.drawerId]=ae),this.openLevelTransition(),this.forceUpdate(function(){W.domFocus()}))}},{key:"componentDidUpdate",value:function(W){var Z=this.props,ne=Z.open,ae=Z.getContainer,we=ae&&ae();ne!==W.open&&(ne&&this.domFocus(),we&&we.parentNode===document.body&&(w[this.drawerId]=!!ne),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var W=this.props,Z=W.getOpenCount,ne=W.open,ae=W.switchScrollingEffect,we=typeof Z=="function"&&Z();delete w[this.drawerId],ne&&(this.setLevelTransform(!1),document.body.style.touchAction=""),we||(document.body.style.overflow="",ae(!0))}},{key:"render",value:function(){var W,Z=this,ne=this.props,ae=ne.className,we=ne.children,fe=ne.style,_e=ne.width,Se=ne.height,ve=ne.defaultOpen,ue=ne.open,le=ne.prefixCls,Oe=ne.placement,Ye=ne.level,Ve=ne.levelMove,$e=ne.ease,Ze=ne.duration,Fe=ne.getContainer,We=ne.handler,qe=ne.onChange,oe=ne.afterVisibleChange,Ee=ne.showMask,Ce=ne.maskClosable,Ae=ne.maskStyle,ze=ne.onClose,Je=ne.onHandleClick,tt=ne.keyboard,nt=ne.getOpenCount,ht=ne.switchScrollingEffect,it=Object(ie.a)(ne,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),lt=this.dom?ue:!1,Me=g()(le,(W={},Object(n.a)(W,"".concat(le,"-").concat(Oe),!0),Object(n.a)(W,"".concat(le,"-open"),lt),Object(n.a)(W,ae||"",!!ae),Object(n.a)(W,"no-mask",!Ee),W)),Tt=this.getHorizontalBoolAndPlacementName(),mt=Tt.placementName,Ne=Oe==="left"||Oe==="top"?"-100%":"100%",He=lt?"":"".concat(mt,"(").concat(Ne,")"),Te=We&&G.cloneElement(We,{onClick:function(ge){We.props.onClick&&We.props.onClick(),Je&&Je(ge)},ref:function(ge){Z.handlerDom=ge}});return G.createElement("div",Object.assign({},it,{tabIndex:-1,className:Me,style:fe,ref:function(ge){Z.dom=ge},onKeyDown:lt&&tt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Ee&&G.createElement("div",{className:"".concat(le,"-mask"),onClick:Ce?ze:void 0,style:Ae,ref:function(ge){Z.maskDom=ge}}),G.createElement("div",{className:"".concat(le,"-content-wrapper"),style:{transform:He,msTransform:He,width:x(_e)?"".concat(_e,"px"):_e,height:x(Se)?"".concat(Se,"px"):Se},ref:function(ge){Z.contentWrapper=ge}},G.createElement("div",{className:"".concat(le,"-content"),ref:function(ge){Z.contentDom=ge},onTouchStart:lt&&Ee?this.removeStartHandler:void 0,onTouchMove:lt&&Ee?this.removeMoveHandler:void 0},we),Te))}}],[{key:"getDerivedStateFromProps",value:function(W,Z){var ne=Z.prevProps,ae=Z._self,we={prevProps:W};if(ne!==void 0){var fe=W.placement,_e=W.level;fe!==ne.placement&&(ae.contentDom=null),_e!==ne.level&&ae.getLevelDom(W)}return we}}]),M}(G.Component);b.defaultProps={switchScrollingEffect:function(){}};var u=b;function v(S){var U=a();return function(){var E=Object(B.a)(S),W;if(U){var Z=Object(B.a)(this).constructor;W=Reflect.construct(E,arguments,Z)}else W=E.apply(this,arguments);return Object(j.a)(this,W)}}function a(){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(S){return!1}}var _=function(S){Object(Y.a)(M,S);var U=v(M);function M(E){var W;Object(J.a)(this,M),W=U.call(this,E),W.onHandleClick=function(ne){var ae=W.props,we=ae.onHandleClick,fe=ae.open;if(we&&we(ne),typeof fe=="undefined"){var _e=W.state.open;W.setState({open:!_e})}},W.onClose=function(ne){var ae=W.props,we=ae.onClose,fe=ae.open;we&&we(ne),typeof fe=="undefined"&&W.setState({open:!1})};var Z=typeof E.open!="undefined"?E.open:!!E.defaultOpen;return W.state={open:Z},"onMaskClick"in E&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),W}return Object(k.a)(M,[{key:"render",value:function(){var W=this,Z=this.props,ne=Z.defaultOpen,ae=Z.getContainer,we=Z.wrapperClassName,fe=Z.forceRender,_e=Z.handler,Se=Object(ie.a)(Z,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),ve=this.state.open;if(!ae)return G.createElement("div",{className:we,ref:function(Oe){W.dom=Oe}},G.createElement(u,Object.assign({},Se,{open:ve,handler:_e,getContainer:function(){return W.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ue=!!_e||fe;return G.createElement(z.a,{visible:ve,forceRender:ue,getContainer:ae,wrapperClassName:we},function(le){var Oe=le.visible,Ye=le.afterClose,Ve=Object(ie.a)(le,["visible","afterClose"]);return G.createElement(u,Object.assign({},Se,Ve,{open:Oe!==void 0?Oe:ve,afterVisibleChange:Ye!==void 0?Ye:Se.afterVisibleChange,handler:_e,onClose:W.onClose,onHandleClick:W.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(W,Z){var ne=Z.prevProps,ae={prevProps:W};return typeof ne!="undefined"&&W.open!==ne.open&&(ae.open=W.open),ae}}]),M}(G.Component);_.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:G.createElement("div",{className:"drawer-handle"},G.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=_,F=be.a=N},fjLI:function(dt,be,$){"use strict";$.d(be,"f",function(){return m}),$.d(be,"b",function(){return c}),$.d(be,"a",function(){return d}),$.d(be,"d",function(){return p}),$.d(be,"e",function(){return l}),$.d(be,"c",function(){return h});var ie=$("8HAY"),J=$("Vhoy"),k=$("MI8n"),Y=$("JYp7"),j=$("pmY6"),B=$("24hK"),z=$("nnTU"),G=$("T8No"),n=$("Cg/j"),D=$("t9D7"),y=function(o,s,R,x){var C=arguments.length,L=C<3?s:x===null?x=Object.getOwnPropertyDescriptor(s,R):x,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(o,s,R,x);else for(var A=o.length-1;A>=0;A--)(O=o[A])&&(L=(C<3?O(L):C>3?O(s,R,L):O(s,R))||L);return C>3&&L&&Object.defineProperty(s,R,L),L},g=function(o,s){return function(R,x){s(R,x,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 d=Object(n.c)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new k.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:o=>o===c.CommandPalette}}addCommand(o){return this.addCommands(Y.a.single(o))}addCommands(o){for(const s of o)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let s=!1;for(const R of o)s=this._commands.delete(R.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((s,R)=>o.set(R,s)),o}appendMenuItem(o,s){return this.appendMenuItems(Y.a.single({id:o,item:s}))}appendMenuItems(o){const s=new Set,R=new B.a;for(const{id:x,item:C}of o){let L=this._menuItems.get(x);L||(L=new B.a,this._menuItems.set(x,L)),R.push(L.push(C)),s.add(x)}return this._onDidChangeMenu.fire(s),Object(j.i)(()=>{if(R.size>0){for(let x of R)x();this._onDidChangeMenu.fire(s),R.clear()}})}getMenuItems(o){let s;return this._menuItems.has(o)?s=[...this._menuItems.get(o)]:s=[],o===c.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(o){const s=new Set;for(const R of o)m(R)&&(s.add(R.command.id),R.alt&&s.add(R.alt.id));this._commands.forEach((R,x)=>{s.has(x)||o.push({command:R})})}};class l extends ie.e{constructor(o,s,R,x){super(`submenuitem.${o.submenu.id}`,typeof o.title=="string"?o.title:o.title.value,[],"submenu");this.item=o,this._menuService=s,this._contextKeyService=R,this._options=x}get actions(){const o=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=s.getActions(this._options);s.dispose();for(const[,x]of R)x.length>0&&(o.push(...x),o.push(new ie.d));return o.length&&o.pop(),o}}let h=class o{constructor(s,R,x,C,L){var O,A;if(this._commandService=L,this.id=s.id,this.label=(x==null?void 0:x.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(A=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&A!==void 0?A:"",this.enabled=!s.precondition||C.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const w=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=C.contextMatchesRules(w.condition),this.checked&&w.tooltip&&(this.tooltip=typeof w.tooltip=="string"?w.tooltip:w.tooltip.value),w.title&&(this.label=typeof w.title=="string"?w.title:w.title.value)}this.item=s,this.alt=R?new o(R,void 0,x,C,L):void 0,this._options=x,D.d.isThemeIcon(s.icon)&&(this.class=J.a.asClassName(s.icon))}dispose(){}run(...s){var R,x;let C=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(C=[...C,this._options.arg]),((x=this._options)===null||x===void 0?void 0:x.shouldForwardArgs)&&(C=[...C,...s]),this._commandService.executeCommand(this.id,...C)}};h=y([g(3,G.b),g(4,z.b)],h)},ic2d:function(dt,be,$){"use strict";$.d(be,"a",function(){return Y});var ie=$("FWmy"),J=$("746U");class k{constructor(){this.data=new Map}add(j,B){ie.a(J.l(j)),ie.a(J.k(B)),ie.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,B)}as(j){return this.data.get(j)||null}}const Y=new k},kSUc:function(dt,be,$){},kqOp:function(dt,be,$){"use strict";$.d(be,"a",function(){return D});var ie=$("0Owb"),J=$("fWQN"),k=$("mtLc"),Y=$("yKVA"),j=$("879j"),B=$("q1tI"),z=$.n(B),G=$("Ot1p"),n="\u2581",D=function(y){Object(Y.a)(m,y);var g=Object(j.a)(m);function m(){var c;Object(J.a)(this,m);for(var d=arguments.length,p=new Array(d),l=0;l<d;l++)p[l]=arguments[l];return c=g.call.apply(g,[this].concat(p)),c.getChCountBeforeCursor=function(h,o){for(var s=o.line,R=0,x=0;x<s;x++)R+=h.getLine(x).split(n).length-1;var C=h.getLine(s).substring(0,o.ch);return R+=C.split(n).length-1,R},c.onCMBeforeChange=function(h,o){var s=h.getRange(o.from,o.to),R=0;if(o.text.forEach(function(O){R+=O.split(n).length-1}),s&&s.indexOf(n)!=-1){var x=s.split(n).length-1,C=c.getChCountBeforeCursor(h,o.from);console.log("\u5220\u9664".concat(x,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(C,"\u4E2A\uFF0C\u65B0\u589E").concat(R,"\u4E2A")),c.props.deleteEmptyDisabled?o.cancel():c.props.onPlaceholderChange&&c.props.onPlaceholderChange(C,x,R)}else if(R){var L=c.getChCountBeforeCursor(h,o.from);console.log("\u65B0\u589E".concat(R,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(L,"\u4E2A")),c.props.onPlaceholderChange&&c.props.onPlaceholderChange(L,0,R)}},c}return Object(k.a)(m,[{key:"render",value:function(){return z.a.createElement(G.a,Object(ie.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),m}(B.Component)},lZu9:function(dt,be,$){(function(ie){ie($("VrN/"),$("1eCo"),$("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(J,k){var Y=ie.getMode(J,"text/html"),j=Y.name=="null";function B(M){if(ie.findModeByName){var E=ie.findModeByName(M);E&&(M=E.mime||E.mimes[0])}var W=ie.getMode(J,M);return W.name=="null"?null:W}k.highlightFormatting===void 0&&(k.highlightFormatting=!1),k.maxBlockquoteDepth===void 0&&(k.maxBlockquoteDepth=0),k.taskLists===void 0&&(k.taskLists=!1),k.strikethrough===void 0&&(k.strikethrough=!1),k.emoji===void 0&&(k.emoji=!1),k.fencedCodeBlockHighlighting===void 0&&(k.fencedCodeBlockHighlighting=!0),k.fencedCodeBlockDefaultMode===void 0&&(k.fencedCodeBlockDefaultMode="text/plain"),k.xml===void 0&&(k.xml=!0),k.tokenTypeOverrides===void 0&&(k.tokenTypeOverrides={});var z={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 G in z)z.hasOwnProperty(G)&&k.tokenTypeOverrides[G]&&(z[G]=k.tokenTypeOverrides[G]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,g=k.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,d=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,h=" ";function o(M,E,W){return E.f=E.inline=W,W(M,E)}function s(M,E,W){return E.f=E.block=W,W(M,E)}function R(M){return!M||!/\S/.test(M.string)}function x(M){if(M.linkTitle=!1,M.linkHref=!1,M.linkText=!1,M.em=!1,M.strong=!1,M.strikethrough=!1,M.quote=0,M.indentedCode=!1,M.f==L){var E=j;if(!E){var W=ie.innerMode(Y,M.htmlState);E=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}E&&(M.f=b,M.block=C,M.htmlState=null)}return M.trailingSpace=0,M.trailingSpaceNewLine=!1,M.prevLine=M.thisLine,M.thisLine={stream:null},null}function C(M,E){var W=M.column()===E.indentation,Z=R(E.prevLine.stream),ne=E.indentedCode,ae=E.prevLine.hr,we=E.list!==!1,fe=(E.listStack[E.listStack.length-1]||0)+3;E.indentedCode=!1;var _e=E.indentation;if(E.indentationDiff===null&&(E.indentationDiff=E.indentation,we)){for(E.list=null;_e<E.listStack[E.listStack.length-1];)E.listStack.pop(),E.listStack.length?E.indentation=E.listStack[E.listStack.length-1]:E.list=!1;E.list!==!1&&(E.indentationDiff=_e-E.listStack[E.listStack.length-1])}var Se=!Z&&!ae&&!E.prevLine.header&&(!we||!ne)&&!E.prevLine.fencedCodeEnd,ve=(E.list===!1||ae||Z)&&E.indentation<=fe&&M.match(n),ue=null;if(E.indentationDiff>=4&&(ne||E.prevLine.fencedCodeEnd||E.prevLine.header||Z))return M.skipToEnd(),E.indentedCode=!0,z.code;if(M.eatSpace())return null;if(W&&E.indentation<=fe&&(ue=M.match(g))&&ue[1].length<=6)return E.quote=0,E.header=ue[1].length,E.thisLine.header=!0,k.highlightFormatting&&(E.formatting="header"),E.f=E.inline,A(E);if(E.indentation<=fe&&M.eat(">"))return E.quote=W?1:E.quote+1,k.highlightFormatting&&(E.formatting="quote"),M.eatSpace(),A(E);if(!ve&&!E.setext&&W&&E.indentation<=fe&&(ue=M.match(D))){var le=ue[1]?"ol":"ul";return E.indentation=_e+M.current().length,E.list=!0,E.quote=0,E.listStack.push(E.indentation),E.em=!1,E.strong=!1,E.code=!1,E.strikethrough=!1,k.taskLists&&M.match(y,!1)&&(E.taskList=!0),E.f=E.inline,k.highlightFormatting&&(E.formatting=["list","list-"+le]),A(E)}else{if(W&&E.indentation<=fe&&(ue=M.match(d,!0)))return E.quote=0,E.fencedEndRE=new RegExp(ue[1]+"+ *$"),E.localMode=k.fencedCodeBlockHighlighting&&B(ue[2]||k.fencedCodeBlockDefaultMode),E.localMode&&(E.localState=ie.startState(E.localMode)),E.f=E.block=O,k.highlightFormatting&&(E.formatting="code-block"),E.code=-1,A(E);if(E.setext||(!Se||!we)&&!E.quote&&E.list===!1&&!E.code&&!ve&&!p.test(M.string)&&(ue=M.lookAhead(1))&&(ue=ue.match(m)))return E.setext?(E.header=E.setext,E.setext=0,M.skipToEnd(),k.highlightFormatting&&(E.formatting="header")):(E.header=ue[0].charAt(0)=="="?1:2,E.setext=E.header),E.thisLine.header=!0,E.f=E.inline,A(E);if(ve)return M.skipToEnd(),E.hr=!0,E.thisLine.hr=!0,z.hr;if(M.peek()==="[")return o(M,E,N)}return o(M,E,E.inline)}function L(M,E){var W=Y.token(M,E.htmlState);if(!j){var Z=ie.innerMode(Y,E.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||E.md_inside&&M.current().indexOf(">")>-1)&&(E.f=b,E.block=C,E.htmlState=null)}return W}function O(M,E){var W=E.listStack[E.listStack.length-1]||0,Z=E.indentation<W,ne=W+3;if(E.fencedEndRE&&E.indentation<=ne&&(Z||M.match(E.fencedEndRE))){k.highlightFormatting&&(E.formatting="code-block");var ae;return Z||(ae=A(E)),E.localMode=E.localState=null,E.block=C,E.f=b,E.fencedEndRE=null,E.code=0,E.thisLine.fencedCodeEnd=!0,Z?s(M,E,E.block):ae}else return E.localMode?E.localMode.token(M,E.localState):(M.skipToEnd(),z.code)}function A(M){var E=[];if(M.formatting){E.push(z.formatting),typeof M.formatting=="string"&&(M.formatting=[M.formatting]);for(var W=0;W<M.formatting.length;W++)E.push(z.formatting+"-"+M.formatting[W]),M.formatting[W]==="header"&&E.push(z.formatting+"-"+M.formatting[W]+"-"+M.header),M.formatting[W]==="quote"&&(!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=M.quote?E.push(z.formatting+"-"+M.formatting[W]+"-"+M.quote):E.push("error"))}if(M.taskOpen)return E.push("meta"),E.length?E.join(" "):null;if(M.taskClosed)return E.push("property"),E.length?E.join(" "):null;if(M.linkHref?E.push(z.linkHref,"url"):(M.strong&&E.push(z.strong),M.em&&E.push(z.em),M.strikethrough&&E.push(z.strikethrough),M.emoji&&E.push(z.emoji),M.linkText&&E.push(z.linkText),M.code&&E.push(z.code),M.image&&E.push(z.image),M.imageAltText&&E.push(z.imageAltText,"link"),M.imageMarker&&E.push(z.imageMarker)),M.header&&E.push(z.header,z.header+"-"+M.header),M.quote&&(E.push(z.quote),!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=M.quote?E.push(z.quote+"-"+M.quote):E.push(z.quote+"-"+k.maxBlockquoteDepth)),M.list!==!1){var Z=(M.listStack.length-1)%3;Z?Z===1?E.push(z.list2):E.push(z.list3):E.push(z.list1)}return M.trailingSpaceNewLine?E.push("trailing-space-new-line"):M.trailingSpace&&E.push("trailing-space-"+(M.trailingSpace%2?"a":"b")),E.length?E.join(" "):null}function w(M,E){return M.match(c,!0)?A(E):void 0}function b(M,E){var W=E.text(M,E);if(typeof W!="undefined")return W;if(E.list)return E.list=null,A(E);if(E.taskList){var Z=M.match(y,!0)[1]===" ";return Z?E.taskOpen=!0:E.taskClosed=!0,k.highlightFormatting&&(E.formatting="task"),E.taskList=!1,A(E)}if(E.taskOpen=!1,E.taskClosed=!1,E.header&&M.match(/^#+$/,!0))return k.highlightFormatting&&(E.formatting="header"),A(E);var ne=M.next();if(E.linkTitle){E.linkTitle=!1;var ae=ne;ne==="("&&(ae=")"),ae=(ae+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var we="^\\s*(?:[^"+ae+"\\\\]+|\\\\\\\\|\\\\.)"+ae;if(M.match(new RegExp(we),!0))return z.linkHref}if(ne==="`"){var fe=E.formatting;k.highlightFormatting&&(E.formatting="code"),M.eatWhile("`");var _e=M.current().length;if(E.code==0&&(!E.quote||_e==1))return E.code=_e,A(E);if(_e==E.code){var Se=A(E);return E.code=0,Se}else return E.formatting=fe,A(E)}else if(E.code)return A(E);if(ne==="\\"&&(M.next(),k.highlightFormatting)){var ve=A(E),ue=z.formatting+"-escape";return ve?ve+" "+ue:ue}if(ne==="!"&&M.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return E.imageMarker=!0,E.image=!0,k.highlightFormatting&&(E.formatting="image"),A(E);if(ne==="["&&E.imageMarker&&M.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return E.imageMarker=!1,E.imageAltText=!0,k.highlightFormatting&&(E.formatting="image"),A(E);if(ne==="]"&&E.imageAltText){k.highlightFormatting&&(E.formatting="image");var ve=A(E);return E.imageAltText=!1,E.image=!1,E.inline=E.f=v,ve}if(ne==="["&&!E.image)return E.linkText&&M.match(/^.*?\]/)||(E.linkText=!0,k.highlightFormatting&&(E.formatting="link")),A(E);if(ne==="]"&&E.linkText){k.highlightFormatting&&(E.formatting="link");var ve=A(E);return E.linkText=!1,E.inline=E.f=M.match(/\(.*?\)| ?\[.*?\]/,!1)?v:b,ve}if(ne==="<"&&M.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){E.f=E.inline=u,k.highlightFormatting&&(E.formatting="link");var ve=A(E);return ve?ve+=" ":ve="",ve+z.linkInline}if(ne==="<"&&M.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){E.f=E.inline=u,k.highlightFormatting&&(E.formatting="link");var ve=A(E);return ve?ve+=" ":ve="",ve+z.linkEmail}if(k.xml&&ne==="<"&&M.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var le=M.string.indexOf(">",M.pos);if(le!=-1){var Oe=M.string.substring(M.start,le);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Oe)&&(E.md_inside=!0)}return M.backUp(1),E.htmlState=ie.startState(Y),s(M,E,L)}if(k.xml&&ne==="<"&&M.match(/^\/\w*?>/))return E.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var Ye=1,Ve=M.pos==1?" ":M.string.charAt(M.pos-2);Ye<3&&M.eat(ne);)Ye++;var $e=M.peek()||" ",Ze=!/\s/.test($e)&&(!l.test($e)||/\s/.test(Ve)||l.test(Ve)),Fe=!/\s/.test(Ve)&&(!l.test(Ve)||/\s/.test($e)||l.test($e)),We=null,qe=null;if(Ye%2&&(!E.em&&Ze&&(ne==="*"||!Fe||l.test(Ve))?We=!0:E.em==ne&&Fe&&(ne==="*"||!Ze||l.test($e))&&(We=!1)),Ye>1&&(!E.strong&&Ze&&(ne==="*"||!Fe||l.test(Ve))?qe=!0:E.strong==ne&&Fe&&(ne==="*"||!Ze||l.test($e))&&(qe=!1)),qe!=null||We!=null){k.highlightFormatting&&(E.formatting=We==null?"strong":qe==null?"em":"strong em"),We===!0&&(E.em=ne),qe===!0&&(E.strong=ne);var Se=A(E);return We===!1&&(E.em=!1),qe===!1&&(E.strong=!1),Se}}else if(ne===" "&&(M.eat("*")||M.eat("_"))){if(M.peek()===" ")return A(E);M.backUp(1)}if(k.strikethrough){if(ne==="~"&&M.eatWhile(ne)){if(E.strikethrough){k.highlightFormatting&&(E.formatting="strikethrough");var Se=A(E);return E.strikethrough=!1,Se}else if(M.match(/^[^\s]/,!1))return E.strikethrough=!0,k.highlightFormatting&&(E.formatting="strikethrough"),A(E)}else if(ne===" "&&M.match(/^~~/,!0)){if(M.peek()===" ")return A(E);M.backUp(2)}}if(k.emoji&&ne===":"&&M.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){E.emoji=!0,k.highlightFormatting&&(E.formatting="emoji");var oe=A(E);return E.emoji=!1,oe}return ne===" "&&(M.match(/^ +$/,!1)?E.trailingSpace++:E.trailingSpace&&(E.trailingSpaceNewLine=!0)),A(E)}function u(M,E){var W=M.next();if(W===">"){E.f=E.inline=b,k.highlightFormatting&&(E.formatting="link");var Z=A(E);return Z?Z+=" ":Z="",Z+z.linkInline}return M.match(/^[^>]+/,!0),z.linkInline}function v(M,E){if(M.eatSpace())return null;var W=M.next();return W==="("||W==="["?(E.f=E.inline=_(W==="("?")":"]"),k.highlightFormatting&&(E.formatting="link-string"),E.linkHref=!0,A(E)):"error"}var a={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(M){return function(E,W){var Z=E.next();if(Z===M){W.f=W.inline=b,k.highlightFormatting&&(W.formatting="link-string");var ne=A(W);return W.linkHref=!1,ne}return E.match(a[M]),W.linkHref=!0,A(W)}}function N(M,E){return M.match(/^([^\]\\]|\\.)*\]:/,!1)?(E.f=F,M.next(),k.highlightFormatting&&(E.formatting="link"),E.linkText=!0,A(E)):o(M,E,b)}function F(M,E){if(M.match(/^\]:/,!0)){E.f=E.inline=S,k.highlightFormatting&&(E.formatting="link");var W=A(E);return E.linkText=!1,W}return M.match(/^([^\]\\]|\\.)+/,!0),z.linkText}function S(M,E){return M.eatSpace()?null:(M.match(/^[^\s]+/,!0),M.peek()===void 0?E.linkTitle=!0:M.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),E.f=E.inline=b,z.linkHref+" url")}var U={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:b,text:w,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(M){return{f:M.f,prevLine:M.prevLine,thisLine:M.thisLine,block:M.block,htmlState:M.htmlState&&ie.copyState(Y,M.htmlState),indentation:M.indentation,localMode:M.localMode,localState:M.localMode?ie.copyState(M.localMode,M.localState):null,inline:M.inline,text:M.text,formatting:!1,linkText:M.linkText,linkTitle:M.linkTitle,linkHref:M.linkHref,code:M.code,em:M.em,strong:M.strong,strikethrough:M.strikethrough,emoji:M.emoji,header:M.header,setext:M.setext,hr:M.hr,taskList:M.taskList,list:M.list,listStack:M.listStack.slice(0),quote:M.quote,indentedCode:M.indentedCode,trailingSpace:M.trailingSpace,trailingSpaceNewLine:M.trailingSpaceNewLine,md_inside:M.md_inside,fencedEndRE:M.fencedEndRE}},token:function(M,E){if(E.formatting=!1,M!=E.thisLine.stream){if(E.header=0,E.hr=!1,M.match(/^\s*$/,!0))return x(E),null;if(E.prevLine=E.thisLine,E.thisLine={stream:M},E.taskList=!1,E.trailingSpace=0,E.trailingSpaceNewLine=!1,!E.localState&&(E.f=E.block,E.f!=L)){var W=M.match(/^\s*/,!0)[0].replace(/\t/g,h).length;if(E.indentation=W,E.indentationDiff=null,W>0)return null}}return E.f(M,E)},innerMode:function(M){return M.block==L?{state:M.htmlState,mode:Y}:M.localState?{state:M.localState,mode:M.localMode}:{state:M,mode:U}},indent:function(M,E,W){return M.block==L&&Y.indent?Y.indent(M.htmlState,E,W):M.localState&&M.localMode.indent?M.localMode.indent(M.localState,E,W):ie.Pass},blankLine:x,getType:A,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return U},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},nEHx:function(dt,be,$){"use strict";$.d(be,"a",function(){return ie});var ie;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(ie||(ie={}))},nnTU:function(dt,be,$){"use strict";$.d(be,"b",function(){return z}),$.d(be,"a",function(){return G});var ie=$("MI8n"),J=$("JYp7"),k=$("pmY6"),Y=$("24hK"),j=$("746U"),B=$("Cg/j");const z=Object(B.c)("commandService"),G=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.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 d=[];for(let l of n.description.args)d.push(l.constraint);const p=n.handler;n.handler=function(l,...h){return Object(j.o)(h,d),p(l,...h)}}const{id:y}=n;let g=this._commands.get(y);g||(g=new Y.a,this._commands.set(y,g));let m=g.unshift(n),c=Object(k.i)(()=>{m();const d=this._commands.get(y);(d==null?void 0:d.isEmpty())&&this._commands.delete(y)});return this._onDidRegisterCommand.fire(y),c}registerCommandAlias(n,D){return G.registerCommand(n,(y,...g)=>y.get(z).executeCommand(D,...g))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:J.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}};G.registerCommand("noop",()=>{})},osHv:function(dt,be,$){(function(ie){ie($("VrN/"))})(function(ie){"use strict";var J=ie.Pos;function k(l,h){return l.line-h.line||l.ch-h.ch}var Y="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",j=Y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",B=new RegExp("<(/?)(["+Y+"]["+j+"]*)","g");function z(l,h,o,s){this.line=h,this.ch=o,this.cm=l,this.text=l.getLine(h),this.min=s?Math.max(s.from,l.firstLine()):l.firstLine(),this.max=s?Math.min(s.to-1,l.lastLine()):l.lastLine()}function G(l,h){var o=l.cm.getTokenTypeAt(J(l.line,h));return o&&/\btag\b/.test(o)}function n(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function D(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function y(l){for(;;){var h=l.text.indexOf(">",l.ch);if(h==-1){if(n(l))continue;return}if(!G(l,h+1)){l.ch=h+1;continue}var o=l.text.lastIndexOf("/",h),s=o>-1&&!/\S/.test(l.text.slice(o+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function g(l){for(;;){var h=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!G(l,h+1)){l.ch=h;continue}B.lastIndex=h,l.ch=h;var o=B.exec(l.text);if(o&&o.index==h)return o}}function m(l){for(;;){B.lastIndex=l.ch;var h=B.exec(l.text);if(!h){if(n(l))continue;return}if(!G(l,h.index+1)){l.ch=h.index+1;continue}return l.ch=h.index+h[0].length,h}}function c(l){for(;;){var h=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!G(l,h+1)){l.ch=h;continue}var o=l.text.lastIndexOf("/",h),s=o>-1&&!/\S/.test(l.text.slice(o+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function d(l,h){for(var o=[];;){var s=m(l),R,x=l.line,C=l.ch-(s?s[0].length:0);if(!s||!(R=y(l)))return;if(R=="selfClose")continue;if(s[1]){for(var L=o.length-1;L>=0;--L)if(o[L]==s[2]){o.length=L;break}if(L<0&&(!h||h==s[2]))return{tag:s[2],from:J(x,C),to:J(l.line,l.ch)}}else o.push(s[2])}}function p(l,h){for(var o=[];;){var s=c(l);if(!s)return;if(s=="selfClose"){g(l);continue}var R=l.line,x=l.ch,C=g(l);if(!C)return;if(C[1])o.push(C[2]);else{for(var L=o.length-1;L>=0;--L)if(o[L]==C[2]){o.length=L;break}if(L<0&&(!h||h==C[2]))return{tag:C[2],from:J(l.line,l.ch),to:J(R,x)}}}}ie.registerHelper("fold","xml",function(l,h){for(var o=new z(l,h.line,0);;){var s=m(o);if(!s||o.line!=h.line)return;var R=y(o);if(!R)return;if(!s[1]&&R!="selfClose"){var x=J(o.line,o.ch),C=d(o,s[2]);return C&&k(C.from,x)>0?{from:x,to:C.from}:null}}}),ie.findMatchingTag=function(l,h,o){var s=new z(l,h.line,h.ch,o);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var R=y(s),x=R&&J(s.line,s.ch),C=R&&g(s);if(!R||!C||k(s,h)>0)return;var L={from:J(s.line,s.ch),to:x,tag:C[2]};return R=="selfClose"?{open:L,close:null,at:"open"}:C[1]?{open:p(s,C[2]),close:L,at:"close"}:(s=new z(l,x.line,x.ch,o),{open:L,close:d(s,C[2]),at:"open"})},ie.findEnclosingTag=function(l,h,o,s){for(var R=new z(l,h.line,h.ch,o);;){var x=p(R,s);if(!x)break;var C=new z(l,h.line,h.ch,o),L=d(C,x.tag);if(L)return{open:x,close:L}}},ie.scanForClosingTag=function(l,h,o,s){var R=new z(l,h.line,h.ch,s?{from:0,to:s}:null);return d(R,o)}})},p5ED:function(dt,be,$){"use strict";var ie=$("+L6B"),J=$("2/Rp"),k=$("5Dmo"),Y=$("3S7+"),j=$("k1fw"),B=$("9og8"),z=$("tJVT"),G=$("WmNS"),n=$.n(G),D=$("q1tI"),y=$.n(D),g=$("vHTk"),m=$.n(g),c=$("yEEn"),d=$("ZW9T"),p=$("1vsH"),l=$("V0Rq"),h=$("m3rI");be.a=function(o){var s,R,x,C,L,O,A,w=o.editOffice,b=w===void 0?"view":w,u=o.data,v=o.theme,a=o.type,_=o.filename,N=o.monacoEditor,F=o.className,S=o.style,U=o.close,M=o.onClose,E=o.hasMask,W=o.disabledDownload,Z=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ne=Object(z.a)(Z,2),ae=ne[0],we=ne[1],fe=Object(D.useState)(""),_e=Object(z.a)(fe,2),Se=_e[0],ve=_e[1],ue=Object(D.useState)(),le=Object(z.a)(ue,2),Oe=le[0],Ye=le[1],Ve=window.ENV==="build"?"/react/build":"",$e=h.a.PROXY_SERVER||location.origin,Ze,Fe=1024*1024,We=10*Fe,qe=Object(D.useRef)();(s=u)!==null&&s!==void 0&&s.startsWith("/api")&&a!=="txt"&&(u=h.a.API_SERVER+u),a==="office"&&(Ze=Object(p.T)(u).filesize,Ze>We&&(a="other")),_&&N&&(N.filename=_),Object(D.useEffect)(function(){var Ae,ze,Je=(Ae=document.cookie)===null||Ae===void 0||((ze=Ae.replace(/\s/g,""))===null||ze===void 0)?void 0:ze.split(";");Je==null||Je.map(function(tt){var nt=tt.split("=");nt[0]==="_educoder_session"&&ve(nt[1])})},[]),Object(D.useEffect)(function(){a==="office"&&oe()},[a,u]);var oe=function(){var Ae=Object(B.a)(n.a.mark(function ze(){var Je,tt,nt;return n.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return console.log("data:",u),Je=u,u.startsWith("http")||(Je=location.origin+Je),tt=new URL(Je).pathname.split("/").pop(),it.next=6,Object(l.W)({attachment_id:tt});case 6:nt=it.sent,Ye(nt);case 8:case"end":return it.stop()}},ze)}));return function(){return Ae.apply(this,arguments)}}(),Ee=function(){if(u.startsWith("http")||u.startsWith("blob:")){Ce();return}Object(p.z)(_||"educoder",u,_)},Ce=function(){Object(p.x)(_||"educoder",decodeURIComponent(u))};return y.a.createElement("div",{style:Object(j.a)({},S||{}),className:"".concat(E&&m.a.bgBlack," ").concat(a?m.a.wrp:"hide")},U&&y.a.createElement("div",{className:m.a.close,ref:qe},!W&&y.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return qe.current}},y.a.createElement("span",{onClick:Ce},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return qe.current}},y.a.createElement("span",{className:"",onClick:M},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(m.a[F]," ").concat(F," ").concat(m.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&y.a.createElement(d.b,N)),a==="audio"&&y.a.createElement("audio",{src:"".concat(((R=u)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((x=u)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(u),autoPlay:!0}),a==="video"&&y.a.createElement(y.a.Fragment,null,((C=u)===null||C===void 0?void 0:C.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),a==="office"&&Oe&&y.a.createElement("iframe",{src:"".concat(Ve,"/office.html?key=").concat(Oe.key,"&url=").concat($e+Oe.url,"&callbackUrl=").concat($e+Oe.callbackUrl,"&fileType=").concat(Oe.fileType,"&title=").concat(Oe.title,"&model=").concat(b,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),a==="html"&&y.a.createElement("iframe",{src:u+"&disposition=inline"}),a==="pdf"&&y.a.createElement("iframe",{src:"".concat(Ve,"/js/pdfview/index.html?url=").concat(u,"&disabledDownload=").concat(!!W)}),a==="image"&&y.a.createElement("img",{src:"".concat(((L=u)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((O=u)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(A=u)!==null&&A!==void 0&&A.startsWith("/api")?"":"data:image/png;base64,").concat(u)}),a==="other"&&y.a.createElement("div",null,y.a.createElement(J.a,{type:"primary",size:"large",onClick:Ee},y.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),a==="download"&&y.a.createElement(J.a,{type:"primary",size:"large",onClick:Ee},y.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(dt,be,$){},pmY6:function(dt,be,$){"use strict";$.d(be,"h",function(){return D}),$.d(be,"g",function(){return g}),$.d(be,"f",function(){return m}),$.d(be,"e",function(){return c}),$.d(be,"i",function(){return d}),$.d(be,"b",function(){return p}),$.d(be,"a",function(){return l}),$.d(be,"d",function(){return h}),$.d(be,"c",function(){return o});var ie=$("C/vA"),J=$("JYp7");const k=!1;let Y=null;function j(s){Y=s}if(k){const s="__is_disposable_tracked__";j(new class{trackDisposable(R){const x=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[s]||console.log(x)},3e3)}setParent(R,x){if(R&&R!==l.None)try{R[s]=!0}catch(C){}}markAsDisposed(R){if(R&&R!==l.None)try{R[s]=!0}catch(x){}}markAsSingleton(R){}})}function B(s){return Y==null||Y.trackDisposable(s),s}function z(s){Y==null||Y.markAsDisposed(s)}function G(s,R){Y==null||Y.setParent(s,R)}function n(s,R){if(!Y)return;for(const x of s)Y.setParent(x,R)}function D(s){return Y==null||Y.markAsSingleton(s),s}class y extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function g(s){return typeof s.dispose=="function"&&s.dispose.length===0}function m(s){if(J.a.is(s)){let R=[];for(const x of s)if(x)try{x.dispose()}catch(C){R.push(C)}if(R.length===1)throw R[0];if(R.length>1)throw new y(R);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function c(...s){const R=d(()=>m(s));return n(s,R),R}function d(s){const R=B({dispose:Object(ie.a)(()=>{z(R),s()})});return R}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,B(this)}dispose(){if(this._isDisposed)return;z(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return G(s,this),this._isDisposed?p.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(s),s}}p.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new p,B(this),G(this._store,this)}dispose(){z(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}l.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,B(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var R;if(this._isDisposed||s===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),s&&G(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,z(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&G(s,null),s}}class o{constructor(s){this.object=s}dispose(){}}},pr0Y:function(dt,be,$){"use strict";$.r(be);var ie=$("+L6B"),J=$("2/Rp"),k=$("5NDa"),Y=$("5rEg"),j=$("5Dmo"),B=$("3S7+"),z=$("14J3"),G=$("BMrR"),n=$("jCWc"),D=$("kPKH"),y=$("sPJy"),g=$("bE4q"),m=$("/zsF"),c=$("PArb"),d=$("miYZ"),p=$("tsqr"),l=$("9og8"),h=$("k1fw"),o=$("oBTY"),s=$("y8nQ"),R=$("Vl3Y"),x=$("tJVT"),C=$("PpiC"),L=$("B9cy"),O=$("Ol7k"),A=$("lUTK"),w=$("BvKs"),b=$("WmNS"),u=$.n(b),v=$("q1tI"),a=$.n(v),_=$("Ty5D"),N=$("55Ip"),F=$("9kvl"),S=$("w5pM"),U=$("tgas"),M=$("giR+"),E=$("fyUT"),W=$("sRBo"),Z=$("kaz8"),ne=$("2qtc"),ae=$("kLXV"),we=$("V0Rq"),fe=$("Ot1p"),_e=$("9Bee"),Se=$("LuLp"),ve=$.n(Se),ue=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],le=function(Be,kt){var Ot=Be.problemset,sn=Be.globalSetting,qt=Be.loading,At=Be.dispatch,at=Be.onRef,Ln=at===void 0?function(){}:at,Le=Be.editData,vn=Object(C.a)(Be,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(v.useState)([]),xt=Object(x.a)(yt,2),gt=xt[0],Vt=xt[1],tn=Object(v.useState)(),Mt=Object(x.a)(tn,2),st=Mt[0],cn=Mt[1],Gt=Object(v.useState)([]),Bt=Object(x.a)(Gt,2),_t=Bt[0],Lt=Bt[1],Qt=Object(v.useState)(""),rn=Object(x.a)(Qt,2),Ue=rn[0],Et=rn[1],pn=Object(v.useState)(5),xn=Object(x.a)(pn,2),Sn=xn[0],yn=xn[1],X=Object(v.useState)(!1),T=Object(x.a)(X,2),I=T[0],H=T[1],q=Object(_.i)();Object(v.useEffect)(function(){Vt(["","","",""])},[]),Object(v.useEffect)(function(){if(!(Le!=null&&Le.question_choices)){H(!0);return}Et(Le==null?void 0:Le.question_title),yn(parseInt(Le==null?void 0:Le.question_score)),Vt(Le==null?void 0:Le.question_choices.map(function(et){return et.choice_text}));var De=[];Le==null||Le.standard_answer.map(function(et,Xe){De.push(et-1)}),Lt(De)},[Le]),Object(v.useImperativeHandle)(kt,function(){return{onSave:K,isEdit:I}});var K=function(){var De=Object(l.a)(u.a.mark(function et(){var Xe,Ct,wt;return u.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(Ue){Ut.next=3;break}return p.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ut.abrupt("return",!1);case 3:if(Xe=gt.findIndex(function(Xt){return!Xt}),!(Xe>-1)){Ut.next=7;break}return p.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ue[Xe]," \u9009\u9879\u7684\u5185\u5BB9")),Ut.abrupt("return",!1);case 7:if(_t.length){Ut.next=10;break}return p.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ut.abrupt("return",!1);case 10:if(!(_t.length<1)){Ut.next=13;break}return p.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ut.abrupt("return",!1);case 13:if(Ct=gt.map(function(Xt,bn){return{choice_text:Xt,is_answer:_t.includes(bn)?bn+1:0}}),!Le.question_id){Ut.next=20;break}return Ut.next=17,At({type:"exercise/editExerciseQuestion",payload:{id:Le.question_id,question_title:Ue,question_type:1,question_score:"5.0",question_choices:Ct.map(function(Xt){return Xt.choice_text}),standard_answers:Ct.filter(function(Xt){return Xt.is_answer}).map(function(Xt){return Xt.is_answer})}});case 17:wt=Ut.sent,Ut.next=23;break;case 20:return Ut.next=22,At({type:"exercise/addExerciseQuestion",payload:{categoryId:q.categoryId,question_title:Ue,question_type:1,question_score:"5.0",question_choices:Ct.map(function(Xt){return Xt.choice_text}),standard_answers:Ct.filter(function(Xt){return Xt.is_answer}).map(function(Xt){return Xt.is_answer})}});case 22:wt=Ut.sent;case 23:wt.status===0&&(p.b.success("\u4FDD\u5B58\u6210\u529F"),H(!1),At({type:"exercise/editExercise",payload:Object(h.a)({},q)}));case 24:case"end":return Ut.stop()}},et)}));return function(){return De.apply(this,arguments)}}(),he=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],ke=function(){var De=Object(l.a)(u.a.mark(function et(Xe){return u.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:wt.t0=Xe.id,wt.next=wt.t0==="del"?3:wt.t0==="up"||wt.t0==="down"?5:wt.t0==="edit"?9:11;break;case 3:return ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(l.a)(u.a.mark(function Ut(){return u.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(we.n)({id:Le.question_id});case 2:At({type:"exercise/editExercise",payload:Object(h.a)({},q)});case 3:case"end":return bn.stop()}},Ut)}))()}}),wt.abrupt("break",11);case 5:return wt.next=7,At({type:"exercise/exeriseMoveUpDown",payload:{id:Le.question_id,opr:Xe.id}});case 7:return At({type:"exercise/editExercise",payload:Object(h.a)({},q)}),wt.abrupt("break",11);case 9:return H(!0),wt.abrupt("break",11);case 11:case"end":return wt.stop()}},et)}));return function(Xe){return De.apply(this,arguments)}}(),je=function(){var et;return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},Le.key,"\u3001\u591A\u9009\u9898"),"\uFF08",Le.question_score,"\u5206\uFF09"),!Le.hideAction&&he.map(function(Xe,Ct){return Xe.id==="up"&&Le.key===1||Xe.id==="down"&&Le.key===Le.len?null:a.a.createElement(B.a,{key:Ct,placement:"bottom",title:Xe.name},a.a.createElement("span",{onClick:function(){return ke(Xe)},className:Xe.icon}))})),a.a.createElement("div",{className:"mt5"},a.a.createElement(_e.a,{value:Le.question_title})),a.a.createElement("div",{className:ve.a.questionChoices},Le==null||((et=Le.question_choices)===null||et===void 0)?void 0:et.map(function(Xe,Ct){return a.a.createElement(G.a,null,a.a.createElement(D.a,null,a.a.createElement(Z.a,{key:Ct,checked:Le.standard_answer.includes(Ct+1),disabled:!0},ue[Ct],".")),a.a.createElement(D.a,{flex:"1"},a.a.createElement("span",{className:"c-black font14"},a.a.createElement(_e.a,{value:Xe.choice_text}))))})))},ct=function(){return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),a.a.createElement("p",{className:ve.a.titleWrap},a.a.createElement("span",{className:ve.a.required},"*"),a.a.createElement("span",{className:ve.a.title},"\u9898\u5E72\uFF1A")),a.a.createElement(fe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ue,onChange:function(Xe){return Et(Xe)}}),gt.map(function(et,Xe){return a.a.createElement("div",{className:ve.a.choiceWrap,key:Xe},a.a.createElement(B.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},a.a.createElement("div",{className:"".concat(ve.a.answer," ").concat(_t.includes(Xe)?ve.a.activeAnswer:""),onClick:function(){_t.includes(Xe)?Lt(_t.filter(function(wt){return wt!==Xe})):Lt([].concat(Object(o.a)(_t),[Xe]))}},ue[Xe])),a.a.createElement("div",{className:ve.a.editorWrap},st===Xe?a.a.createElement(fe.a,{id:"single-question-option-".concat(Xe),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:et,onChange:function(wt){gt[Xe]=wt,Vt(gt)}}):a.a.createElement("div",{className:ve.a.htmlWrap,onClick:function(){return cn(Xe)}},a.a.createElement(_e.a,{value:et}))),Xe>1&&a.a.createElement(B.a,{title:"\u5220\u9664"},a.a.createElement("i",{className:"".concat(ve.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Vt(gt.filter(function(wt,dn){return dn!==Xe}))}})),Xe<7&&Xe===gt.length-1&&a.a.createElement(B.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},a.a.createElement("i",{className:"".concat(ve.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Vt([].concat(Object(o.a)(gt),[""]))}})))}),a.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),a.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",a.a.createElement(E.a,{value:Sn,max:1e4,min:-1,onChange:function(Xe){yn(Xe)}})," ","\u5206"),a.a.createElement("aside",{className:"tr"},Le.question_id&&a.a.createElement(J.a,{type:"default",onClick:function(){return H(!1)}},"\u53D6\u6D88"),a.a.createElement(J.a,{className:"ml20",type:"primary",onClick:function(){return K()}},"\u4FDD\u5B58")))};return a.a.createElement("section",{className:ve.a.wrap},!I&&je(),I&&ct())},Oe=Object(F.a)(function(ut){var Be=ut.problemset,kt=ut.loading,Ot=ut.globalSetting;return{problemset:Be,globalSetting:Ot,loading:kt.effects}},null,null,{forwardRef:!0})(Object(v.forwardRef)(le)),Ye=$("7Kak"),Ve=$("9yH6"),$e=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ze=function(Be,kt){var Ot=Be.problemset,sn=Be.globalSetting,qt=Be.loading,At=Be.dispatch,at=Be.onRef,Ln=at===void 0?function(){}:at,Le=Be.editData,vn=Object(C.a)(Be,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(v.useState)([]),xt=Object(x.a)(yt,2),gt=xt[0],Vt=xt[1],tn=Object(v.useState)(),Mt=Object(x.a)(tn,2),st=Mt[0],cn=Mt[1],Gt=Object(v.useState)([]),Bt=Object(x.a)(Gt,2),_t=Bt[0],Lt=Bt[1],Qt=Object(v.useState)(""),rn=Object(x.a)(Qt,2),Ue=rn[0],Et=rn[1],pn=Object(v.useState)(0),xn=Object(x.a)(pn,2),Sn=xn[0],yn=xn[1],X=Object(v.useState)(!1),T=Object(x.a)(X,2),I=T[0],H=T[1],q=Object(_.i)();Object(v.useEffect)(function(){Vt(["","","",""])},[]),Object(v.useEffect)(function(){if(!(Le!=null&&Le.question_choices)){H(!0);return}Et(Le==null?void 0:Le.question_title),yn(parseInt(Le==null?void 0:Le.question_score)),Vt(Le==null?void 0:Le.question_choices.map(function(et){return et.choice_text}));var De=[];Le==null||Le.standard_answer.map(function(et,Xe){De.push(et-1)}),Lt(De)},[Le]),Object(v.useImperativeHandle)(kt,function(){return{onSave:K,isEdit:I}});var K=function(){var De=Object(l.a)(u.a.mark(function et(){var Xe,Ct,wt;return u.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(Ue){Ut.next=3;break}return p.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ut.abrupt("return",!1);case 3:if(Xe=gt.findIndex(function(Xt){return!Xt}),!(Xe>-1)){Ut.next=7;break}return p.b.info("\u8BF7\u5148\u8F93\u5165 ".concat($e[Xe]," \u9009\u9879\u7684\u5185\u5BB9")),Ut.abrupt("return",!1);case 7:if(_t.length){Ut.next=10;break}return p.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ut.abrupt("return",!1);case 10:if(!(_t.length<1)){Ut.next=13;break}return p.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ut.abrupt("return",!1);case 13:if(Ct=gt.map(function(Xt,bn){return{choice_text:Xt,is_answer:_t.includes(bn)?bn+1:0}}),!Le.question_id){Ut.next=20;break}return Ut.next=17,Object(U.u)({id:Le.question_id,question_title:Ue,question_type:1,question_score:Sn,question_choices:Ct.map(function(Xt){return Xt.choice_text}),standard_answers:Ct.filter(function(Xt){return Xt.is_answer}).map(function(Xt){return Xt.is_answer})});case 17:wt=Ut.sent,Ut.next=23;break;case 20:return Ut.next=22,Object(U.a)({exercise_bank_id:q.topicId,question_title:Ue,question_type:1,question_score:"5.0",question_choices:Ct.map(function(Xt){return Xt.choice_text}),standard_answers:Ct.filter(function(Xt){return Xt.is_answer}).map(function(Xt){return Xt.is_answer})});case 22:wt=Ut.sent;case 23:return wt.status===0&&(p.b.success("\u4FDD\u5B58\u6210\u529F"),H(!1)),Ut.next=26,At({type:"polls/getExerciseBanks",payload:Object(h.a)({},q)});case 26:case"end":return Ut.stop()}},et)}));return function(){return De.apply(this,arguments)}}(),he=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],ke=function(){var De=Object(l.a)(u.a.mark(function et(Xe){return u.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:wt.t0=Xe.id,wt.next=wt.t0==="del"?3:wt.t0==="up"||wt.t0==="down"?5:wt.t0==="edit"?9:11;break;case 3:return ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(l.a)(u.a.mark(function Ut(){return u.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(U.e)({pollsId:Le.question_id});case 2:At({type:"polls/getExerciseBanks",payload:Object(h.a)({},q)});case 3:case"end":return bn.stop()}},Ut)}))()}}),wt.abrupt("break",11);case 5:return wt.next=7,Object(U.j)({exerciseId:Le==null?void 0:Le.question_id,opr:Xe.id});case 7:return At({type:"polls/getExerciseBanks",payload:Object(h.a)({},q)}),wt.abrupt("break",11);case 9:return H(!0),wt.abrupt("break",11);case 11:case"end":return wt.stop()}},et)}));return function(Xe){return De.apply(this,arguments)}}(),je=function(){var et;return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},Le.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Le.question_score,"\u5206\uFF09"),!Le.hideAction&&he.map(function(Xe,Ct){return Xe.id==="up"&&Le.key===1||Xe.id==="down"&&Le.key===Le.len?null:a.a.createElement(B.a,{key:Ct,placement:"bottom",title:Xe.name},a.a.createElement("span",{onClick:function(){return ke(Xe)},className:Xe.icon}))})),a.a.createElement("div",{className:"mt5"},a.a.createElement(_e.a,{value:Le.question_title})),a.a.createElement("div",{className:ve.a.questionChoices},Le==null||((et=Le.question_choices)===null||et===void 0)?void 0:et.map(function(Xe,Ct){return a.a.createElement(G.a,null,a.a.createElement(D.a,null,a.a.createElement(Ve.a,{key:Ct,checked:Le.standard_answer.includes(Ct+1),disabled:!0},$e[Ct],".")),a.a.createElement(D.a,{flex:"1"},a.a.createElement("span",{className:"c-black font14"},a.a.createElement(_e.a,{value:Xe.choice_text}))))})))},ct=function(){return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),a.a.createElement("p",{className:ve.a.titleWrap},a.a.createElement("span",{className:ve.a.required},"*"),a.a.createElement("span",{className:ve.a.title},"\u9898\u5E72\uFF1A")),a.a.createElement(fe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ue,onChange:function(Xe){return Et(Xe)}}),gt.map(function(et,Xe){return a.a.createElement("div",{className:ve.a.choiceWrap,key:Xe},a.a.createElement(B.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},a.a.createElement("div",{className:"".concat(ve.a.answer," ").concat(_t.includes(Xe)?ve.a.activeAnswer:""),onClick:function(){_t.includes(Xe)?Lt(_t.filter(function(wt){return wt!==Xe})):Lt([].concat(Object(o.a)(_t),[Xe]))}},$e[Xe])),a.a.createElement("div",{className:ve.a.editorWrap},st===Xe?a.a.createElement(fe.a,{id:"single-question-option-".concat(Xe),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:et,onChange:function(wt){gt[Xe]=wt,Vt(gt)}}):a.a.createElement("div",{className:ve.a.htmlWrap,onClick:function(){return cn(Xe)}},a.a.createElement(_e.a,{value:et}))),Xe>1&&a.a.createElement(B.a,{title:"\u5220\u9664"},a.a.createElement("i",{className:"".concat(ve.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Vt(gt.filter(function(wt,dn){return dn!==Xe}))}})),Xe<7&&Xe===gt.length-1&&a.a.createElement(B.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},a.a.createElement("i",{className:"".concat(ve.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Vt([].concat(Object(o.a)(gt),[""]))}})))}),a.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),a.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",a.a.createElement(E.a,{value:Sn,max:1e4,min:-1,onChange:function(Xe){yn(Xe)}})," ","\u5206"),a.a.createElement("aside",{className:"tr"},Le.question_id&&a.a.createElement(J.a,{type:"default",onClick:function(){return H(!1)}},"\u53D6\u6D88"),a.a.createElement(J.a,{className:"ml20",type:"primary",onClick:function(){return K()}},"\u4FDD\u5B58")))};return a.a.createElement("section",{className:ve.a.wrap},!I&&je(),I&&ct())},Fe=Object(F.a)(function(ut){var Be=ut.problemset,kt=ut.loading,Ot=ut.globalSetting;return{problemset:Be,globalSetting:Ot,loading:kt.effects}},null,null,{forwardRef:!0})(Object(v.forwardRef)(Ze)),We=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],qe=function(Be,kt){var Ot=Be.problemset,sn=Be.globalSetting,qt=Be.loading,At=Be.dispatch,at=Be.onRef,Ln=at===void 0?function(){}:at,Le=Be.editData,vn=Object(C.a)(Be,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(v.useState)(),xt=Object(x.a)(yt,2),gt=xt[0],Vt=xt[1],tn=Object(v.useState)(""),Mt=Object(x.a)(tn,2),st=Mt[0],cn=Mt[1],Gt=Object(v.useState)(!1),Bt=Object(x.a)(Gt,2),_t=Bt[0],Lt=Bt[1],Qt=Object(v.useState)(5),rn=Object(x.a)(Qt,2),Ue=rn[0],Et=rn[1],pn=Object(_.i)();Object(v.useEffect)(function(){if(!(Le!=null&&Le.question_choices)){Lt(!0);return}cn(Le==null?void 0:Le.question_title),Et(Le==null?void 0:Le.question_score),Vt(Le.standard_answer[0]+"")},[Le]),Object(v.useImperativeHandle)(kt,function(){return{onSave:xn,isEdit:_t}});var xn=function(){var I=Object(l.a)(u.a.mark(function H(){var q,K;return u.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:if(st){ke.next=3;break}return p.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),ke.abrupt("return",!1);case 3:if(gt){ke.next=6;break}return p.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),ke.abrupt("return",!1);case 6:if(q=[{choice_text:"\u6B63\u786E",is_answer:gt==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:gt==="2"?2:0}],!Le.question_id){ke.next=13;break}return ke.next=10,Object(U.u)({id:Le.question_id,question_title:st,question_type:2,question_score:Ue,question_choices:q.map(function(je){return je.choice_text}),standard_answers:q.filter(function(je){return je.is_answer}).map(function(je){return je.is_answer})});case 10:K=ke.sent,ke.next=16;break;case 13:return ke.next=15,Object(U.a)({exercise_bank_id:pn.topicId,question_title:st,question_type:2,question_score:Ue,question_choices:q.map(function(je){return je.choice_text}),standard_answers:q.filter(function(je){return je.is_answer}).map(function(je){return je.is_answer})});case 15:K=ke.sent;case 16:return K.status===0&&(p.b.success("\u4FDD\u5B58\u6210\u529F"),Lt(!1)),At({type:"polls/getExerciseBanks",payload:Object(h.a)({},pn)}),ke.abrupt("return",{name:st,choices:q});case 19:case"end":return ke.stop()}},H)}));return function(){return I.apply(this,arguments)}}(),Sn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],yn=function(){var I=Object(l.a)(u.a.mark(function H(q){return u.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:he.t0=q.id,he.next=he.t0==="del"?3:he.t0==="up"||he.t0==="down"?5:he.t0==="edit"?9:11;break;case 3:return ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(l.a)(u.a.mark(function je(){return u.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.next=2,Object(U.e)({pollsId:Le.question_id});case 2:At({type:"polls/getExerciseBanks",payload:Object(h.a)({},pn)});case 3:case"end":return De.stop()}},je)}))()}}),he.abrupt("break",11);case 5:return he.next=7,Object(U.j)({exerciseId:Le==null?void 0:Le.question_id,opr:q.id});case 7:return At({type:"polls/getExerciseBanks",payload:Object(h.a)({},pn)}),he.abrupt("break",11);case 9:return Lt(!0),he.abrupt("break",11);case 11:case"end":return he.stop()}},H)}));return function(q){return I.apply(this,arguments)}}(),X=function(){var H;return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},Le.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Le.question_score,"\u5206\uFF09"),!Le.hideAction&&Sn.map(function(q,K){return q.id==="up"&&Le.key===1||q.id==="down"&&Le.key===Le.len?null:a.a.createElement(B.a,{key:K,placement:"bottom",title:q.name},a.a.createElement("span",{onClick:function(){return yn(q)},className:q.icon}))})),a.a.createElement("div",{className:"mt5"},Le.question_title),a.a.createElement("div",{className:ve.a.questionChoices},Le==null||((H=Le.question_choices)===null||H===void 0)?void 0:H.map(function(q,K){return a.a.createElement(Ve.a,{key:K,checked:Le.standard_answer.includes(K+1),disabled:!0},We[K],"."," ",a.a.createElement("span",{className:"c-black font14"},q.choice_text))})))},T=function(){return a.a.createElement("aside",null,a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),a.a.createElement("p",{className:ve.a.titleWrap},a.a.createElement("span",{className:ve.a.required},"*"),a.a.createElement("span",{className:ve.a.title},"\u9898\u5E72\uFF1A")),a.a.createElement(fe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:st,onChange:function(q){return cn(q)}}),a.a.createElement("p",{className:ve.a.titleWrap},a.a.createElement("span",{className:ve.a.required},"*"),a.a.createElement("span",{className:ve.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",a.a.createElement("span",{className:ve.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),a.a.createElement(Ve.a.Group,{buttonStyle:"solid",value:gt,onChange:function(q){return Vt(q.target.value)}},a.a.createElement(Ve.a.Button,{value:"1",className:"".concat(ve.a.radio," mr40")},"\u6B63\u786E"),a.a.createElement(Ve.a.Button,{value:"2",className:ve.a.radio},"\u9519\u8BEF")),a.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),a.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",a.a.createElement(E.a,{value:Ue,max:1e4,min:-1,onChange:function(q){Et(q)}})," ","\u5206"),a.a.createElement("aside",{className:"tr"},Le.question_id&&a.a.createElement(J.a,{type:"default",onClick:function(){return Lt(!1)}},"\u53D6\u6D88"),a.a.createElement(J.a,{className:"ml20",type:"primary",onClick:function(){return xn()}},"\u4FDD\u5B58")))};return a.a.createElement("section",{className:ve.a.wrap},!_t&&X(),_t&&T())},oe=Object(F.a)(function(ut){var Be=ut.problemset,kt=ut.loading,Ot=ut.globalSetting;return{problemset:Be,globalSetting:Ot,loading:kt.effects}},null,null,{forwardRef:!0})(Object(v.forwardRef)(qe)),Ee=$("kqOp"),Ce=$("7qnI"),Ae=$("1vsH"),ze=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Je=function(Be,kt){var Ot=Be.problemset,sn=Be.globalSetting,qt=Be.loading,At=Be.dispatch,at=Be.editData,Ln=Object(C.a)(Be,["problemset","globalSetting","loading","dispatch","editData"]),Le=Object(v.useState)(""),vn=Object(x.a)(Le,2),yt=vn[0],xt=vn[1],gt=Object(v.useState)(""),Vt=Object(x.a)(gt,2),tn=Vt[0],Mt=Vt[1],st=Object(v.useState)([]),cn=Object(x.a)(st,2),Gt=cn[0],Bt=cn[1],_t=Object(v.useState)(""),Lt=Object(x.a)(_t,2),Qt=Lt[0],rn=Lt[1],Ue=Object(v.useState)(),Et=Object(x.a)(Ue,2),pn=Et[0],xn=Et[1],Sn=Object(v.useState)(!1),yn=Object(x.a)(Sn,2),X=yn[0],T=yn[1],I=Object(v.useState)(5),H=Object(x.a)(I,2),q=H[0],K=H[1],he=Object(v.useState)(!1),ke=Object(x.a)(he,2),je=ke[0],ct=ke[1],De=Object(_.i)();Object(v.useEffect)(function(){if(!(at!=null&&at.question_title)){ct(!0);return}xt(at==null?void 0:at.question_title),xn(at==null?void 0:at.is_ordered),K(at==null?void 0:at.question_score);var Zt=at==null?void 0:at.standard_answer.map(function(Rt){return Rt.answer_text});Bt(Zt)},[Ot.editData]),Object(v.useEffect)(function(){T(!1)},[je]),Object(v.useImperativeHandle)(kt,function(){return{onSave:et,isEdit:je}});var et=function(){var Zt=Object(l.a)(u.a.mark(function Rt(){var bt,Wt,Jt;return u.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(bt=[],Wt=!1,Gt.forEach(function(Bn,Pn){bt.push({choice_id:Pn+1,answer_text:[]}),Bn.forEach(function(ti,gi){bt[Pn].answer_text.push(ti),(!ti||!Object(Ae.db)(ti,1e4))&&(rn("".concat(Pn,"-").concat(gi)),p.b.info(ti?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Wt=!0)})}),!Wt){Ht.next=5;break}return Ht.abrupt("return",!1);case 5:if(!at.question_id){Ht.next=11;break}return Ht.next=8,Object(U.u)({id:at.question_id,question_title:yt,question_type:3,question_score:q,is_ordered:pn,standard_answers:bt});case 8:Jt=Ht.sent,Ht.next=14;break;case 11:return Ht.next=13,Object(U.a)({exercise_bank_id:De.topicId,question_title:yt,question_type:3,question_score:q,is_ordered:pn,standard_answers:bt});case 13:Jt=Ht.sent;case 14:return Jt.status===0&&(p.b.success("\u4FDD\u5B58\u6210\u529F"),ct(!1)),At({type:"polls/getExerciseBanks",payload:Object(h.a)({},De)}),Ht.abrupt("return",{name:yt,analysis:tn,standard_answers:bt,is_ordered:pn});case 17:case"end":return Ht.stop()}},Rt)}));return function(){return Zt.apply(this,arguments)}}(),Xe=function(Rt,bt,Wt){var Jt=Gt.slice();if(bt&&Jt.splice(Rt,bt),Wt&&X)for(var on=0;on<Wt;on++)Jt.splice(Rt+on,0,[""]);T(!0),Bt(Jt)},Ct=function(Rt,bt,Wt){rn("");var Jt=Gt.slice();Jt[Rt][bt]=Wt,Bt(Jt)},wt=function(Rt){var bt=Gt.slice();bt[Rt]=[].concat(Object(o.a)(bt[Rt]),[""]),Bt(bt)},dn=function(Rt,bt){var Wt=Gt.slice();if(!Wt[Rt][bt]){Wt[Rt]=Wt[Rt].filter(function(Jt,on){return on!==bt}),Bt(Wt);return}ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ve.a.modal,onOk:function(){Wt[Rt]=Wt[Rt].filter(function(on,Ht){return Ht!==bt}),Bt(Wt)}})},Ut=function(Rt){ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ve.a.modal,onOk:function(){var Wt=Gt.slice();Wt=Gt.filter(function(Jt,on){return Rt!==on}),Bt(Wt)}})},Xt=function(){return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),a.a.createElement("div",null,a.a.createElement(Ee.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:yt,onChange:function(bt){return xt(bt)},showNullButton:!0,onPlaceholderChange:Xe})),a.a.createElement("div",{className:"mt20"},Gt.map(function(Rt,bt){return a.a.createElement(Ce.a,{key:bt,answers:Rt,index:bt,is_md:!0,activeOptionErrorIndex:Qt,onAnswerChange:Ct,addChildAnswer:wt,deleteChildAnswer:dn,deleteChildAnswermain:Ut})})),a.a.createElement("div",{className:"mt20"},Gt.length>1&&a.a.createElement("span",null,a.a.createElement(Z.a,{checked:pn,onChange:function(bt){return xn(bt.target.checked)},className:"".concat(ve.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),a.a.createElement("span",{className:"".concat(ve.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),a.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",a.a.createElement(E.a,{value:q,max:1e4,min:-1,onChange:function(bt){K(bt)}})," ","\u5206"),a.a.createElement("aside",{className:"tr"},at.question_id&&a.a.createElement(J.a,{type:"default",onClick:function(){return ct(!1)}},"\u53D6\u6D88"),a.a.createElement(J.a,{className:"ml20",type:"primary",onClick:function(){return et()}},"\u4FDD\u5B58")))},bn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Cn=function(){var Zt=Object(l.a)(u.a.mark(function Rt(bt){return u.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:Jt.t0=bt.id,Jt.next=Jt.t0==="del"?3:Jt.t0==="up"||Jt.t0==="down"?5:Jt.t0==="edit"?9:11;break;case 3:return ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(l.a)(u.a.mark(function Ht(){return u.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(U.e)({pollsId:at.question_id});case 2:At({type:"polls/getExerciseBanks",payload:Object(h.a)({},De)});case 3:case"end":return Pn.stop()}},Ht)}))()}}),Jt.abrupt("break",11);case 5:return Jt.next=7,Object(U.j)({exerciseId:at==null?void 0:at.question_id,opr:bt.id});case 7:return At({type:"polls/getExerciseBanks",payload:Object(h.a)({},De)}),Jt.abrupt("break",11);case 9:return ct(!0),Jt.abrupt("break",11);case 11:case"end":return Jt.stop()}},Rt)}));return function(bt){return Zt.apply(this,arguments)}}(),En=function(){var Rt;return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},at.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",at.question_score,"\u5206\uFF09"),!at.hideAction&&bn.map(function(bt,Wt){return bt.id==="up"&&at.key===1||bt.id==="down"&&at.key===at.len?null:a.a.createElement(B.a,{key:Wt,placement:"bottom",title:bt.name},a.a.createElement("span",{onClick:function(){return Cn(bt)},className:bt.icon}))})),a.a.createElement("div",{className:"mt5"},at.question_title),a.a.createElement("div",{className:ve.a.questionChoices},at==null||((Rt=at.standard_answer)===null||Rt===void 0)?void 0:Rt.map(function(bt,Wt){return a.a.createElement(G.a,null,a.a.createElement(D.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",bt.choice_id,"\uFF09\uFF1A"),a.a.createElement(D.a,{flex:"1"},a.a.createElement(Y.a,{key:Wt,checked:at.standard_answer.includes(Wt),disabled:!0,value:bt.answer_text})))})))};return a.a.createElement("section",{className:ve.a.wrap},!je&&En(),je&&Xt())},tt=Object(F.a)(function(ut){var Be=ut.problemset,kt=ut.loading,Ot=ut.globalSetting;return{problemset:Be,globalSetting:Ot,loading:kt.effects}},null,null,{forwardRef:!0})(Object(v.forwardRef)(Je)),nt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ht=function(Be,kt){var Ot=Be.problemset,sn=Be.globalSetting,qt=Be.loading,At=Be.dispatch,at=Be.onRef,Ln=at===void 0?function(){}:at,Le=Be.editData,vn=Object(C.a)(Be,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(v.useState)(""),xt=Object(x.a)(yt,2),gt=xt[0],Vt=xt[1],tn=Object(v.useState)(""),Mt=Object(x.a)(tn,2),st=Mt[0],cn=Mt[1],Gt=Object(v.useState)(""),Bt=Object(x.a)(Gt,2),_t=Bt[0],Lt=Bt[1],Qt=Object(v.useState)(5),rn=Object(x.a)(Qt,2),Ue=rn[0],Et=rn[1],pn=Object(v.useState)(!1),xn=Object(x.a)(pn,2),Sn=xn[0],yn=xn[1],X=Object(_.i)();Object(v.useEffect)(function(){var he;if(!(Le!=null&&Le.question_title)){yn(!0);return}Vt(Le==null?void 0:Le.question_title),Lt(Le==null||((he=Le.standard_answer)===null||he===void 0)?void 0:he[0]),Et(Le==null?void 0:Le.question_score)},[Ot.editData]),Object(v.useImperativeHandle)(kt,function(){return{onSave:T,isEdit:Sn}});var T=function(){var he=Object(l.a)(u.a.mark(function ke(){var je;return u.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:if(gt){De.next=3;break}return p.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),De.abrupt("return",!1);case 3:if(!Le.question_id){De.next=9;break}return De.next=6,Object(U.u)({id:Le.question_id,question_title:gt,question_type:4,question_score:Ue,standard_answers:[_t]});case 6:je=De.sent,De.next=12;break;case 9:return De.next=11,Object(U.a)({exercise_bank_id:X.topicId,question_title:gt,question_type:4,question_score:Ue,standard_answers:[_t]});case 11:je=De.sent;case 12:return je.status===0&&(p.b.success("\u4FDD\u5B58\u6210\u529F"),yn(!1),At({type:"polls/getExerciseBanks",payload:Object(h.a)({},X)})),De.abrupt("return",{name:gt,answer_texts:[_t],analysis:st});case 14:case"end":return De.stop()}},ke)}));return function(){return he.apply(this,arguments)}}(),I=function(){return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},"\u7B80\u7B54\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),a.a.createElement(fe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:gt,onChange:function(je){return Vt(je)}}),a.a.createElement("p",{className:ve.a.titleWrap},a.a.createElement("span",{className:ve.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),a.a.createElement(fe.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:_t,onChange:function(je){return Lt(je)}}),a.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",a.a.createElement(E.a,{value:Ue,max:1e4,min:-1,onChange:function(je){Et(je)}})," ","\u5206"),a.a.createElement("aside",{className:"tr"},Le.question_id&&a.a.createElement(J.a,{type:"default",onClick:function(){return yn(!1)}},"\u53D6\u6D88"),a.a.createElement(J.a,{className:"ml20",type:"primary",onClick:function(){return T()}},"\u4FDD\u5B58")))},H=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],q=function(){var he=Object(l.a)(u.a.mark(function ke(je){return u.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:De.t0=je.id,De.next=De.t0==="del"?3:De.t0==="up"||De.t0==="down"?5:De.t0==="edit"?9:11;break;case 3:return ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(l.a)(u.a.mark(function Xe(){return u.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(U.e)({pollsId:Le.question_id});case 2:At({type:"polls/getExerciseBanks",payload:Object(h.a)({},X)});case 3:case"end":return wt.stop()}},Xe)}))()}}),De.abrupt("break",11);case 5:return De.next=7,Object(U.j)({exerciseId:Le==null?void 0:Le.question_id,opr:je.id});case 7:return At({type:"polls/getExerciseBanks",payload:Object(h.a)({},X)}),De.abrupt("break",11);case 9:return yn(!0),De.abrupt("break",11);case 11:case"end":return De.stop()}},ke)}));return function(je){return he.apply(this,arguments)}}(),K=function(){return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},Le.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Le.question_score,"\u5206\uFF09"),!Le.hideAction&&H.map(function(ke,je){return ke.id==="up"&&Le.key===1||ke.id==="down"&&Le.key===Le.len?null:a.a.createElement(B.a,{key:je,placement:"bottom",title:ke.name},a.a.createElement("span",{onClick:function(){return q(ke)},className:ke.icon}))})),a.a.createElement("div",{className:"mt5"},Le.question_title),a.a.createElement("div",{className:ve.a.questionChoices},a.a.createElement("p",null,a.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),a.a.createElement(_e.a,{value:_t})))};return a.a.createElement("section",{className:ve.a.wrap},!Sn&&K(),Sn&&I())},it=Object(F.a)(function(ut){var Be=ut.problemset,kt=ut.loading,Ot=ut.globalSetting;return{problemset:Be,globalSetting:Ot,loading:kt.effects}},null,null,{forwardRef:!0})(Object(v.forwardRef)(ht)),lt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Me=function(Be,kt){var Ot=Be.problemset,sn=Be.globalSetting,qt=Be.loading,At=Be.dispatch,at=Be.editData,Ln=Object(C.a)(Be,["problemset","globalSetting","loading","dispatch","editData"]),Le=Object(v.useState)(""),vn=Object(x.a)(Le,2),yt=vn[0],xt=vn[1],gt=Object(v.useState)(""),Vt=Object(x.a)(gt,2),tn=Vt[0],Mt=Vt[1],st=Object(v.useState)(""),cn=Object(x.a)(st,2),Gt=cn[0],Bt=cn[1],_t=Object(v.useState)([]),Lt=Object(x.a)(_t,2),Qt=Lt[0],rn=Lt[1],Ue=Object(v.useState)(""),Et=Object(x.a)(Ue,2),pn=Et[0],xn=Et[1],Sn=Object(v.useState)(),yn=Object(x.a)(Sn,2),X=yn[0],T=yn[1],I=Object(v.useState)(!1),H=Object(x.a)(I,2),q=H[0],K=H[1],he=Object(v.useState)([]),ke=Object(x.a)(he,2),je=ke[0],ct=ke[1],De=Object(v.useState)(!1),et=Object(x.a)(De,2),Xe=et[0],Ct=et[1],wt=Object(_.i)();Object(v.useEffect)(function(){var En;at.edit&&Ct(!0),xt(at.shixun_name),Mt(at.question_title);var Zt=[];(En=at.shixun)===null||En===void 0||En.map(function(Rt){Zt.push(Rt.challenge_score)}),ct(Zt)},[at]),Object(v.useEffect)(function(){K(!1)},[Xe]),Object(v.useImperativeHandle)(kt,function(){return{onSave:dn,isEdit:Xe}});var dn=function(){var En=Object(l.a)(u.a.mark(function Zt(){var Rt,bt,Wt;return u.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(Rt=[],bt=!1,!bt){on.next=4;break}return on.abrupt("return",!1);case 4:if(!at.question_id){on.next=10;break}return on.next=7,Object(U.u)({id:at.question_id,question_title:tn,shixun_name:yt,shixun_id:at.shixun_id,question_type:5,question_scores:je});case 7:Wt=on.sent,on.next=13;break;case 10:return on.next=12,Object(U.a)({exercise_bank_id:wt.topicId,question_title:tn,shixun_name:yt,shixun_id:at.shixun_id,question_type:5,question_scores:je});case 12:Wt=on.sent;case 13:return Wt.status===0&&(p.b.success("\u4FDD\u5B58\u6210\u529F"),Ct(!1)),on.next=16,At({type:"polls/getExerciseBanks",payload:Object(h.a)({},wt)});case 16:return on.abrupt("return",{name:tn,analysis:Gt,standard_answers:Rt,is_ordered:X});case 17:case"end":return on.stop()}},Zt)}));return function(){return En.apply(this,arguments)}}(),Ut=function(){var Zt;return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),a.a.createElement("div",{className:"mt10"},a.a.createElement(Y.a,{defaultValue:yt,onChange:function(bt){xt(bt.target.value)}})),a.a.createElement("div",{className:"mt10"},a.a.createElement(fe.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:tn,onChange:function(bt){Mt(bt)}})),a.a.createElement("div",{className:"mt20"},(Zt=at.shixun)===null||Zt===void 0?void 0:Zt.map(function(Rt,bt){return a.a.createElement(G.a,{gutter:[20,20]},a.a.createElement(D.a,{flex:"1"},bt+1,".",Rt.challenge_name),a.a.createElement(D.a,null,a.a.createElement(E.a,{defaultValue:je[bt],onChange:function(Jt){je[bt]=Jt,ct(je),console.log("srore:L",je[bt])}})))})),a.a.createElement("div",{className:"mt20"},Qt.length>1&&a.a.createElement("span",null,a.a.createElement(Z.a,{checked:X,onChange:function(bt){return T(bt.target.checked)},className:"".concat(ve.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),a.a.createElement("span",{className:"".concat(ve.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),a.a.createElement("aside",{className:"tr"},!(at!=null&&at.edit)&&a.a.createElement(J.a,{type:"default",onClick:function(){return Ct(!1)}},"\u53D6\u6D88"),a.a.createElement(J.a,{className:"ml20",type:"primary",onClick:function(){return dn()}},"\u4FDD\u5B58")))},Xt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],bn=function(){var En=Object(l.a)(u.a.mark(function Zt(Rt){return u.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:Wt.t0=Rt.id,Wt.next=Wt.t0==="del"?3:Wt.t0==="up"||Wt.t0==="down"?5:Wt.t0==="edit"?9:11;break;case 3:return ae.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(l.a)(u.a.mark(function on(){return u.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(U.e)({pollsId:at.question_id});case 2:At({type:"polls/getExerciseBanks",payload:Object(h.a)({},wt)});case 3:case"end":return Bn.stop()}},on)}))()}}),Wt.abrupt("break",11);case 5:return Wt.next=7,Object(U.j)({exerciseId:at==null?void 0:at.question_id,opr:Rt.id});case 7:return At({type:"polls/getExerciseBanks",payload:Object(h.a)({},wt)}),Wt.abrupt("break",11);case 9:return Ct(!0),Wt.abrupt("break",11);case 11:case"end":return Wt.stop()}},Zt)}));return function(Rt){return En.apply(this,arguments)}}(),Cn=function(){var Zt;return a.a.createElement("aside",null,a.a.createElement("div",{className:ve.a.questionType},a.a.createElement("div",null,a.a.createElement("span",{className:"font16 c-blue"},at.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",at.question_score,"\u5206\uFF09"),a.a.createElement("div",{className:"tr"},a.a.createElement(N.a,{target:"_blank",to:"/shixuns/".concat(at.shixun_identifier,"/challenges")},"\u5B9E\u8BAD\u8BE6\u60C5"),!at.hideAction&&Xt.map(function(Rt,bt){return Rt.id==="up"&&at.key===1||Rt.id==="down"&&at.key===at.len?null:a.a.createElement(B.a,{key:bt,placement:"bottom",title:Rt.name},a.a.createElement("span",{onClick:function(){return bn(Rt)},className:Rt.icon}))}))),a.a.createElement("div",{className:"font16"},at.shixun_name),a.a.createElement("div",{className:"mt30"}),(Zt=at.shixun)===null||Zt===void 0?void 0:Zt.map(function(Rt,bt){return a.a.createElement("div",{key:bt},"\u7B2C",bt+1,"\u5173"," ",a.a.createElement("span",{className:"ml10"},Rt.challenge_name)," ",a.a.createElement("span",{className:"ml10"},Rt.challenge_score))}))};return a.a.createElement("section",{className:ve.a.wrap},!Xe&&Cn(),Xe&&Ut())},Tt=Object(F.a)(function(ut){var Be=ut.problemset,kt=ut.loading,Ot=ut.globalSetting;return{problemset:Be,globalSetting:Ot,loading:kt.effects}},null,null,{forwardRef:!0})(Object(v.forwardRef)(Me)),mt=$("bbsP"),Ne=$("/wGt"),He=$("DjyN"),Te=$("NUBc"),me=$("uSYw"),ge=$.n(me),re=Y.a.Search,se=[{id:"type",name:"\u7B5B\u9009",children:[{name:"\u5168\u90E8\u5B9E\u8BAD",id:"all",type:"type"},{name:"\u6211\u7684\u5B9E\u8BAD",id:"mine",type:"type"}]},{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],ce=function(Be){var kt,Ot=Be.classroomList,sn=Be.loading,qt=Be.dispatch,At=Be.callback,at=Object(_.i)(),Ln=Object(_.h)(),Le=Ot.actionTabs,vn=R.a.useForm(),yt=Object(x.a)(vn,1),xt=yt[0],gt=Ot.shixunLists,Vt=Object(v.useState)([]),tn=Object(x.a)(Vt,2),Mt=tn[0],st=tn[1],cn=Object(v.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1}),Gt=Object(x.a)(cn,2),Bt=Gt[0],_t=Gt[1];return Object(v.useEffect)(function(){qt({type:"classroomList/getShixunLists",payload:Object(h.a)({},Bt)})},[at.categoryId]),Object(v.useEffect)(function(){st([])},[Ot.actionTabs.key]),Ot.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:a.a.createElement(Ne.a,{title:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",placement:"bottom",height:"100%",closable:!1,visible:Ot.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:ge.a.drawer,footer:a.a.createElement("div",{className:"tc"},a.a.createElement(J.a,{size:"large",onClick:function(){qt({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),a.a.createElement(J.a,{size:"large",onClick:Object(l.a)(u.a.mark(function Lt(){var Qt;return u.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:Mt.length>1?p.b.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"):Mt.length===0?p.b.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"):(At&&At(gt==null||((Qt=gt.shixun_list)===null||Qt===void 0)?void 0:Qt.filter(function(Et){return Et.id===Mt[0]})[0]),qt({type:"classroomList/setActionTabs",payload:{key:""}}));case 1:case"end":return Ue.stop()}},Lt)})),type:"primary"},"\u786E\u5B9A"))},a.a.createElement("section",{className:"tc"},a.a.createElement(re,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",className:ge.a.search,onSearch:function(Qt){Bt.keyword=Qt,qt({type:"classroomList/getShixunLists",payload:Object(h.a)({},Bt)})}})),a.a.createElement("section",{className:"edu-container"},se.map(function(Lt,Qt){var rn;return a.a.createElement("ul",{className:ge.a.menu,key:Qt},a.a.createElement("li",null,Lt.name),Lt==null||((rn=Lt.children)===null||rn===void 0)?void 0:rn.map(function(Ue,Et){return a.a.createElement("li",{key:Et,className:Bt[Lt.id]==Ue.id?ge.a.actived:"",onClick:function(){Bt[Lt.id]=Ue.id,_t(Object(h.a)({},Bt)),qt({type:"classroomList/getShixunLists",payload:Object(h.a)({},Bt)})}},a.a.createElement("strong",null,Ue.name))}))}),gt==null||((kt=gt.shixun_list)===null||kt===void 0)?void 0:kt.map(function(Lt,Qt){return a.a.createElement("div",{className:ge.a.listItem,key:Qt},a.a.createElement(Z.a,{checked:Mt.includes(Lt.id),value:Lt.id,onChange:function(Ue){var Et=Mt.indexOf(Lt.id);Mt.indexOf(Lt.id)>-1?st(Mt.filter(function(pn){return pn!==Lt.id})):st(Mt.concat(Lt.id))}}),a.a.createElement("div",{className:ge.a.info},a.a.createElement("div",{className:ge.a.title},a.a.createElement("div",{className:ge.a.titleLeft},a.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:Lt.title}}))),a.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},a.a.createElement("span",{className:ge.a.description,dangerouslySetInnerHTML:{__html:Lt.description}})),a.a.createElement("div",{className:" mt15"},Lt.challenge_names.map(function(rn,Ue){return a.a.createElement("span",{key:Ue,className:"mr30"},"\u7B2C",Ue+1,"\u5173 ",rn," ")})),a.a.createElement(c.a,{dashed:!0}),a.a.createElement("div",{className:"c-light-black mt20"},a.a.createElement("span",null,Lt.author_name),a.a.createElement("span",{className:"ml15 mr15"},"|"),a.a.createElement("span",null,Lt.author_school_name),a.a.createElement("span",{className:"ml15 mr15"},"|"),a.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570:",Lt.level),a.a.createElement("span",{className:"ml15 mr15"},"|"),a.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570:"),a.a.createElement("span",null,Lt.study_count))))}),a.a.createElement("p",null)),a.a.createElement("div",{className:"tc"},a.a.createElement(Te.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,total:gt==null?void 0:gt.shixuns_count,onChange:function(Qt){Bt.page=Qt,st([]),qt({type:"classroomList/getShixunLists",payload:Object(h.a)({},Bt)})}})))},pe=Object(F.a)(function(ut){var Be=ut.classroomList,kt=ut.loading;return{classroomList:Be,loading:kt}})(ce),xe=$("uLbx"),Pe=$.n(xe),Ke=w.a.SubMenu,vt=O.a.Content,Ft=O.a.Sider,Dt=function(Be){var kt,Ot,sn,qt,At,at,Ln,Le,vn,yt,xt,gt,Vt,tn,Mt,st,cn,Gt,Bt,_t,Lt,Qt,rn,Ue,Et,pn,xn,Sn,yn,X,T,I,H,q,K,he,ke,je,ct,De,et,Xe,Ct,wt,dn,Ut,Xt,bn,Cn,En,Zt,Rt,bt,Wt,Jt,on,Ht=Be.polls,Bn=Be.globalSetting,Pn=Be.loading,ti=Be.user,gi=Be.dispatch,Ci=Object(C.a)(Be,["polls","globalSetting","loading","user","dispatch"]),wn=Object(_.i)(),un=Object(_.h)(),An=ti.userInfo,nn=R.a.useForm(),Dn=Object(x.a)(nn,1),hn=Dn[0],pi=Object(v.useState)([]),Mn=Object(x.a)(pi,2),Rn=Mn[0],Ei=Mn[1],xi=Object(v.useState)(!1),Di=Object(x.a)(xi,2),vi=Di[0],ci=Di[1],Hi=[{name:"\u9009\u62E9\u9898",id:0},{name:"\u5224\u65AD\u9898",id:2},{name:"\u586B\u7A7A\u9898",id:3},{name:"\u7B80\u7B54\u9898",id:4},{name:"\u5B9E\u8BAD\u9898",id:5}],Vn=Object(v.useRef)();Object(v.useEffect)(function(){var Xn;if((Xn=Ht.exerciseBanks)!==null&&Xn!==void 0&&Xn.exercise_questions){var ot,Nt,Pt,Yt,$t;Ei(Object(o.a)((ot=Ht.exerciseBanks)===null||ot===void 0?void 0:ot.exercise_questions)),hn.setFieldsValue({exercise_name:(Nt=Ht.exerciseBanks)===null||Nt===void 0||((Pt=Nt.exercise)===null||Pt===void 0)?void 0:Pt.exercise_name,exercise_description:(Yt=Ht.exerciseBanks)===null||Yt===void 0||(($t=Yt.exercise)===null||$t===void 0)?void 0:$t.exercise_description})}},[Ht.exerciseBanks]),Object(v.useEffect)(function(){gi({type:"polls/getExerciseBanks",payload:Object(h.a)({},wn)})},[wn.categoryId]);var Wi=function(){var Xn=Object(l.a)(u.a.mark(function ot(){var Nt,Pt,Yt;return u.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,hn.validateFields();case 2:return Yt=hn.getFieldValue(),Yt.is_md=!0,Yt.topicId=(Nt=Ht.exerciseBanks)===null||Nt===void 0||((Pt=Nt.exercise)===null||Pt===void 0)?void 0:Pt.id,ci(!1),fn.next=8,Object(U.v)(Object(h.a)({},Yt));case 8:gi({type:"polls/getExerciseBanks",payload:Object(h.a)({},wn)});case 9:case"end":return fn.stop()}},ot)}));return function(){return Xn.apply(this,arguments)}}(),qi=function(){var Xn=Object(l.a)(u.a.mark(function ot(Nt){var Pt;return u.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Vn==null?void 0:Vn.current;case 2:if(Pt=$t.sent,!(Pt!=null&&Pt.isEdit)){$t.next=6;break}return p.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),$t.abrupt("return");case 6:Nt===5?gi({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):Ei([].concat(Object(o.a)(Rn),[{question_type:Nt}]));case 7:case"end":return $t.stop()}},ot)}));return function(Nt){return Xn.apply(this,arguments)}}(),Ai=function(){return Rn==null?void 0:Rn.map(function(ot,Nt){if(ot.key=Nt+1,ot.len=Rn.length,ot.question_type===0)return a.a.createElement("aside",null,a.a.createElement(Fe,{ref:Vn,editData:ot}),a.a.createElement(c.a,null));if(ot.question_type===1)return a.a.createElement("aside",null,a.a.createElement(Oe,{ref:Vn,editData:ot}),a.a.createElement(c.a,null));if(ot.question_type===2)return a.a.createElement("aside",null,a.a.createElement(oe,{ref:Vn,editData:ot}),a.a.createElement(c.a,null));if(ot.question_type===3)return a.a.createElement("aside",null,a.a.createElement(tt,{editData:ot}),a.a.createElement(c.a,null));if(ot.question_type===4)return a.a.createElement("aside",null,a.a.createElement(it,{editData:ot}),a.a.createElement(c.a,null));if(ot.question_type===5)return a.a.createElement("aside",null,a.a.createElement(Tt,{editData:ot}),a.a.createElement(c.a,null))})};return a.a.createElement("section",{className:"edu-container"},a.a.createElement("section",{className:"animated fadeIn"},a.a.createElement("aside",{className:"mt10"},An&&a.a.createElement(g.a,{separator:">"},a.a.createElement(g.a.Item,null,a.a.createElement(N.a,{to:"/users/".concat(An.login,"/topics/personal")},"\u6211\u7684\u9898\u5E93")),a.a.createElement(g.a.Item,null,a.a.createElement(N.a,{to:"/users/".concat(An==null?void 0:An.login,"/topics/").concat(wn.topicId,"/").concat(wn.topictype,"/exercise/detail")},"\u8BE6\u60C5")),a.a.createElement(g.a.Item,null,"\u7F16\u8F91"))),a.a.createElement("aside",{className:[Pe.a.title,"mt20"].join(" ")},a.a.createElement(G.a,{style:{width:"100%"},align:"middle"},a.a.createElement(D.a,{flex:"1"},a.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377"),a.a.createElement(Ae.m,{status:[(kt=Ht.exerciseBanks)!==null&&kt!==void 0&&(Ot=kt.exercise)!==null&&Ot!==void 0&&Ot.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),a.a.createElement(D.a,null,a.a.createElement(N.a,{className:"font16 c-light-black",to:"/users/".concat(An.login,"/topics/personal")},"\u8FD4\u56DE"))))),a.a.createElement("section",{className:[Pe.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},!vi&&a.a.createElement("aside",null,a.a.createElement("div",{className:Pe.a.containerDesc},a.a.createElement("div",null,(sn=Ht.exerciseBanks)===null||sn===void 0||((qt=sn.exercise)===null||qt===void 0)?void 0:qt.exercise_name),a.a.createElement("div",null,a.a.createElement(B.a,{title:"\u7F16\u8F91"},a.a.createElement("span",{onClick:function(){return ci(!0)},className:"iconfont c-green ml30 icon-bianjishijuan3x"})))),a.a.createElement("div",{className:"c-light-black"},(At=Ht.exerciseBanks)===null||At===void 0||((at=At.exercise)===null||at===void 0)?void 0:at.exercise_description)),vi&&a.a.createElement(R.a,{layout:"vertical",form:hn},a.a.createElement(R.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},a.a.createElement(Y.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),a.a.createElement(R.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},a.a.createElement(Y.a.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),a.a.createElement(R.a.Item,{className:"tr"},a.a.createElement(J.a,{type:"primary",onClick:function(){Wi()}},"\u4FDD\u5B58")))),a.a.createElement("p",{className:"mt10",style:{display:"flex"}},a.a.createElement("span",{className:"fl",style:{flex:"1"}},!!((Ln=Ht.exerciseBanks)!==null&&Ln!==void 0&&(Le=Ln.exercise_types)!==null&&Le!==void 0&&Le.q_singles)&&a.a.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(vn=Ht.exerciseBanks)===null||vn===void 0||((yt=vn.exercise_types)===null||yt===void 0)?void 0:yt.q_singles,"\u9898\uFF0C\u5171",(xt=Ht.exerciseBanks)===null||xt===void 0||((gt=xt.exercise_types)===null||gt===void 0)?void 0:gt.q_singles_scores,"\u5206"),!!((Vt=Ht.exerciseBanks)!==null&&Vt!==void 0&&(tn=Vt.exercise_types)!==null&&tn!==void 0&&tn.q_doubles)&&a.a.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(Mt=Ht.exerciseBanks)===null||Mt===void 0||((st=Mt.exercise_types)===null||st===void 0)?void 0:st.q_doubles,"\u9898\uFF0C\u5171",(cn=Ht.exerciseBanks)===null||cn===void 0||((Gt=cn.exercise_types)===null||Gt===void 0)?void 0:Gt.q_doubles_scores,"\u5206"),!!((Bt=Ht.exerciseBanks)!==null&&Bt!==void 0&&(_t=Bt.exercise_types)!==null&&_t!==void 0&&_t.q_judges)&&a.a.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",(Lt=Ht.exerciseBanks)===null||Lt===void 0||((Qt=Lt.exercise_types)===null||Qt===void 0)?void 0:Qt.q_judges,"\u9898\uFF0C\u5171",(rn=Ht.exerciseBanks)===null||rn===void 0||((Ue=rn.exercise_types)===null||Ue===void 0)?void 0:Ue.q_judges_scores,"\u5206"),!!((Et=Ht.exerciseBanks)!==null&&Et!==void 0&&(pn=Et.exercise_types)!==null&&pn!==void 0&&pn.q_nulls)&&a.a.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(xn=Ht.exerciseBanks)===null||xn===void 0||((Sn=xn.exercise_types)===null||Sn===void 0)?void 0:Sn.q_nulls,"\u9898\uFF0C\u5171",(yn=Ht.exerciseBanks)===null||yn===void 0||((X=yn.exercise_types)===null||X===void 0)?void 0:X.q_nulls_scores,"\u5206"),!!((T=Ht.exerciseBanks)!==null&&T!==void 0&&(I=T.exercise_types)!==null&&I!==void 0&&I.q_mains)&&a.a.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(H=Ht.exerciseBanks)===null||H===void 0||((q=H.exercise_types)===null||q===void 0)?void 0:q.q_mains,"\u9898\uFF0C\u5171",(K=Ht.exerciseBanks)===null||K===void 0||((he=K.exercise_types)===null||he===void 0)?void 0:he.q_mains_scores,"\u5206"),!!((ke=Ht.exerciseBanks)!==null&&ke!==void 0&&(je=ke.exercise_types)!==null&&je!==void 0&&je.q_shixuns)&&a.a.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(ct=Ht.exerciseBanks)===null||ct===void 0||((De=ct.exercise_types)===null||De===void 0)?void 0:De.q_shixuns,"\u9898\uFF0C\u5171",(et=Ht.exerciseBanks)===null||et===void 0||((Xe=et.exercise_types)===null||Xe===void 0)?void 0:Xe.q_shixuns_scores,"\u5206"),!!((Ct=Ht.exerciseBanks)!==null&&Ct!==void 0&&(wt=Ct.exercise_types)!==null&&wt!==void 0&&wt.q_pros)&&a.a.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(dn=Ht.exerciseBanks)===null||dn===void 0||((Ut=dn.exercise_types)===null||Ut===void 0)?void 0:Ut.q_pros,"\u9898\uFF0C\u5171",(Xt=Ht.exerciseBanks)===null||Xt===void 0||((bn=Xt.exercise_types)===null||bn===void 0)?void 0:bn.q_pros_scores,"\u5206")),a.a.createElement("span",{className:"fr"},!!((Cn=Ht.exerciseBanks)!==null&&Cn!==void 0&&(En=Cn.exercise_types)!==null&&En!==void 0&&En.q_counts)&&a.a.createElement("span",null,"\u5408\u8BA1"," ",a.a.createElement("span",{className:"color-blue"},(Zt=Ht.exerciseBanks)===null||Zt===void 0||((Rt=Zt.exercise_types)===null||Rt===void 0)?void 0:Rt.q_counts)," ","\u9898\uFF0C \u5171"," ",a.a.createElement("span",{className:"".concat(((bt=Ht.exerciseBanks)===null||bt===void 0||((Wt=bt.exercise_types)===null||Wt===void 0)?void 0:Wt.q_scores)>100?"color-red font-bd":"color-orange")},(Jt=Ht.exerciseBanks)===null||Jt===void 0||((on=Jt.exercise_types)===null||on===void 0)?void 0:on.q_scores)," ","\u5206"))),Rn!=""&&a.a.createElement("section",{className:[Pe.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},Ai()),a.a.createElement("section",{style:{display:"flex"},className:[Pe.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},a.a.createElement("div",{style:{flex:"1"}},Hi.map(function(Xn,ot){return a.a.createElement(J.a,{className:"mr20",type:"primary",onClick:function(){return qi(Xn.id)}},a.a.createElement(S.a,{className:"mr5"}),Xn.name)}))),a.a.createElement(pe,{callback:function(ot){Rn.push({shixun:ot.challenge_names.map(function(Nt){return{challenge_name:Nt,challenge_score:5}}),shixun_name:ot.title,shixun_id:ot.id,question_type:5,edit:!0}),Ei(Object(o.a)(Rn))}}))},Kt=be.default=Object(F.a)(function(ut){var Be=ut.polls,kt=ut.loading,Ot=ut.user,sn=ut.globalSetting;return{polls:Be,globalSetting:sn,user:Ot,loading:kt.effects}})(Dt)},psGv:function(dt,be,$){var ie,J;(function(){var k;(function(){"use strict";var z=[,,function(y){function g(d){this.__parent=d,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 d=new g(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},g.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},g.prototype.has_match=function(d){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(d))return!0;return!1},g.prototype.set_indent=function(d,p){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=p||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 d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__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(d){this.__items.push(d);var p=d.lastIndexOf(`
|
|
`);p!==-1?this.__character_count=d.length-p:this.__character_count+=d.length},g.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},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 d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function m(d,p){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),p=p||"",d.indent_level>0&&(p=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}m.prototype.get_indent_size=function(d,p){var l=this.__base_string_length;return p=p||0,d<0&&(l=0),l+=d*this.__indent_size,l+=p,l},m.prototype.get_indent_string=function(d,p){var l=this.__base_string;return p=p||0,d<0&&(d=0,l=""),p+=d*this.__indent_size,this.__ensure_cache(p),l+=this.__cache[p],l},m.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var d=this.__cache.length,p=0,l="";this.__indent_size&&d>=this.__indent_size&&(p=Math.floor(d/this.__indent_size),d-=p*this.__indent_size,l=new Array(p+1).join(this.__indent_string)),d&&(l+=new Array(d+1).join(" ")),this.__cache.push(l)};function c(d,p){this.__indent_cache=new m(d,p),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.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(d,p){return this.__indent_cache.get_indent_string(d,p)},c.prototype.get_indent_size=function(d,p){return this.__indent_cache.get_indent_size(d,p)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(d){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
|
|
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(l=l.replace(/[\n]/g,d)),l},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(d,p){return d=d||0,p=p||0,this.next_line.set_indent(d,p),this.__lines.length>1?(this.current_line.set_indent(d,p),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(d){for(var p=0;p<d.newlines;p++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),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(d){for(var p=this.__lines.length;d<p;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&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(d,p){for(var l=this.__lines.length-2;l>=0;){var h=this.__lines[l];if(h.is_empty())break;if(h.item(0).indexOf(d)!==0&&h.item(-1)!==p){this.__lines.splice(l+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},y.exports.Output=c},function(y){function g(m,c,d,p){this.type=m,this.text=c,this.comments_before=null,this.newlines=d||0,this.whitespace_before=p||"",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(d,p){this.raw_options=m(d,p),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(d,p){var l=this.raw_options[d],h=p||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(h=l.concat()):typeof l=="string"&&(h=l.split(/[^a-zA-Z0-9_\/\-]+/)),h},g.prototype._get_boolean=function(d,p){var l=this.raw_options[d],h=l===void 0?!!p:!!l;return h},g.prototype._get_characters=function(d,p){var l=this.raw_options[d],h=p||"";return typeof l=="string"&&(h=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},g.prototype._get_number=function(d,p){var l=this.raw_options[d];p=parseInt(p,10),isNaN(p)&&(p=0);var h=parseInt(l,10);return isNaN(h)&&(h=p),h},g.prototype._get_selection=function(d,p,l){var h=this._get_selection_list(d,p,l);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+p+`
|
|
You passed in: '`+this.raw_options[d]+"'");return h[0]},g.prototype._get_selection_list=function(d,p,l){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[p[0]],!this._is_valid_selection(l,p))throw new Error("Invalid Default Value!");var h=this._get_array(d,l);if(!this._is_valid_selection(h,p))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+p+`
|
|
You passed in: '`+this.raw_options[d]+"'");return h},g.prototype._is_valid_selection=function(d,p){return d.length&&p.length&&!d.some(function(l){return p.indexOf(l)===-1})};function m(d,p){var l={};d=c(d);var h;for(h in d)h!==p&&(l[h]=d[h]);if(p&&d[p])for(h in d[p])l[h]=d[p][h];return l}function c(d){var p={},l;for(l in d){var h=l.replace(/-/g,"_");p[h]=d[l]}return p}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 d=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(d=this.__input.charAt(c)),d},m.prototype.__match=function(c,d){c.lastIndex=d;var p=c.exec(this.__input);return p&&!(g&&c.sticky)&&(p.index!==d&&(p=null)),p},m.prototype.test=function(c,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(c,d):!1},m.prototype.testChar=function(c,d){var p=this.peek(d);return c.lastIndex=0,p!==null&&c.test(p)},m.prototype.match=function(c){var d=this.__match(c,this.__position);return d?this.__position+=d[0].length:d=null,d},m.prototype.read=function(c,d,p){var l="",h;return c&&(h=this.match(c),h&&(l+=h[0])),d&&(h||!c)&&(l+=this.readUntil(d,p)),l},m.prototype.readUntil=function(c,d){var p="",l=this.__position;c.lastIndex=this.__position;var h=c.exec(this.__input);return h?(l=h.index,d&&(l+=h[0].length)):l=this.__input_length,p=this.__input.substring(this.__position,l),this.__position=l,p},m.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},m.prototype.get_regexp=function(c,d){var p=null,l="g";return d&&g&&(l="y"),typeof c=="string"&&c!==""?p=new RegExp(c,l):c&&(p=new RegExp(c.source,l)),p},m.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(c){var d=this.__position,p=this.readUntilAfter(c);return this.__position=d,p},m.prototype.lookBack=function(c){var d=this.__position-1;return d>=c.length&&this.__input.substring(d-c.length,d).toLowerCase()===c},y.exports.InputScanner=m},function(y,g,m){var c=m(8).InputScanner,d=m(3).Token,p=m(10).TokenStream,l=m(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(s,R){this._input=new c(s),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var s,R=new d(h.START,""),x=null,C=[],L=new p;R.type!==h.EOF;){for(s=this._get_next_token(R,x);this._is_comment(s);)L.add(s),s=this._get_next_token(R,x);L.isEmpty()||(s.comments_before=L,L=new p),s.parent=x,this._is_opening(s)?(C.push(x),x=s):x&&this._is_closing(s,x)&&(s.opened=x,x.closed=s,x=C.pop(),s.parent=x),s.previous=R,R.next=s,this.__tokens.add(s),R=s}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(s,R){this._readWhitespace();var x=this._input.read(/.+/g);return x?this._create_token(h.RAW,x):this._create_token(h.EOF,"")},o.prototype._is_comment=function(s){return!1},o.prototype._is_opening=function(s){return!1},o.prototype._is_closing=function(s,R){return!1},o.prototype._create_token=function(s,R){var x=new d(s,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return x},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=o,y.exports.TOKEN=h},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 d(p,l){c.call(this,p,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}d.prototype=new c,d.prototype.__set_whitespace_patterns=function(p,l){p+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},d.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var l=this.__split(this._newline_regexp,p);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return p},d.prototype.matching=function(p,l){var h=this._create();return h.__set_whitespace_patterns(p,l),h._update(),h},d.prototype._create=function(){return new d(this._input,this)},d.prototype.__split=function(p,l){p.lastIndex=0;for(var h=0,o=[],s=p.exec(l);s;)o.push(l.substring(h,s.index)),h=s.index+s[0].length,s=p.exec(l);return h<l.length?o.push(l.substring(h,l.length)):o.push(""),o},y.exports.WhitespacePattern=d},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 d=this.__directive_pattern.exec(m);d;)c[d[1]]=d[2],d=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,d={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(l,h){c.call(this,l,h),this.__template_pattern=null,this._disabled=Object.assign({},d),this._excluded=Object.assign({},d),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var o=new c(l);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}p.prototype=new c,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(l){var h=this._create();return h._disabled[l]=!0,h._update(),h},p.prototype.read_options=function(l){var h=this._create();for(var o in d)h._disabled[o]=l.templating.indexOf(o)===-1;return h._update(),h},p.prototype.exclude=function(l){var h=this._create();return h._excluded[l]=!0,h._update(),h},p.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),l+=h,h=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},p.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},p.prototype._read_template=function(){var l="",h=this._input.peek();if(h==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},y.exports.TemplatablePattern=p},,,,function(y,g,m){var c=m(19).Beautifier,d=m(20).Options;function p(l,h,o,s){var R=new c(l,h,o,s);return R.beautify()}y.exports=p,y.exports.defaultOptions=function(){return new d}},function(y,g,m){var c=m(20).Options,d=m(2).Output,p=m(21).Tokenizer,l=m(21).TOKEN,h=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,s=function(v,a){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=v.max_preserve_newlines,this.preserve_newlines=v.preserve_newlines,this._output=new d(v,a)};s.prototype.current_line_has_match=function(v){return this._output.current_line.has_match(v)},s.prototype.set_space_before_token=function(v,a){this._output.space_before_token=v,this._output.non_breaking_space=a},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(v){this._output.add_raw_token(v)},s.prototype.print_preserved_newlines=function(v){var a=0;v.type!==l.TEXT&&v.previous.type!==l.TEXT&&(a=v.newlines?1:0),this.preserve_newlines&&(a=v.newlines<this.max_preserve_newlines+1?v.newlines:this.max_preserve_newlines+1);for(var _=0;_<a;_++)this.print_newline(_>0);return a!==0},s.prototype.traverse_whitespace=function(v){return v.whitespace_before||v.newlines?(this.print_preserved_newlines(v)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(v){this._output.add_new_line(v)},s.prototype.print_token=function(v){v.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(v.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(v){return v=this.indent_level+(v||0),v<1?"":this._output.get_indent_string(v)};var R=function(v){for(var a=null,_=v.next;_.type!==l.EOF&&v.closed!==_;){if(_.type===l.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===l.EQUALS&&_.next.next&&_.next.next.type===l.VALUE&&(a=_.next.next.text);break}_=_.next}return a},x=function(v,a){var _=null,N=null;return a.closed?(v==="script"?_="text/javascript":v==="style"&&(_="text/css"),_=R(a)||_,_.search("text/css")>-1?N="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":_.search(/test\/null/)>-1&&(N="null"),N):null};function C(v,a){return a.indexOf(v)!==-1}function L(v,a,_){this.parent=v||null,this.tag=a?a.tag_name:"",this.indent_level=_||0,this.parser_token=a||null}function O(v){this._printer=v,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(v){var a=new L(this._current_frame,v,this._printer.indent_level);this._current_frame=a},O.prototype._try_pop_frame=function(v){var a=null;return v&&(a=v.parser_token,this._printer.indent_level=v.indent_level,this._current_frame=v.parent),a},O.prototype._get_frame=function(v,a){for(var _=this._current_frame;_&&!(v.indexOf(_.tag)!==-1);){if(a&&a.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},O.prototype.try_pop=function(v,a){var _=this._get_frame([v],a);return this._try_pop_frame(_)},O.prototype.indent_to_tag=function(v){var a=this._get_frame(v);a&&(this._printer.indent_level=a.indent_level)};function A(v,a,_,N){this._source_text=v||"",a=a||{},this._js_beautify=_,this._css_beautify=N,this._tag_stack=null;var F=new c(a,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}A.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,a=this._options.eol;this._options.eol==="auto"&&(a=`
|
|
`,v&&h.test(v)&&(a=v.match(h)[0])),v=v.replace(o,`
|
|
`);var _=v.match(/^[\t ]*/)[0],N={text:"",type:""},F=new w,S=new s(this._options,_),U=new p(v,this._options).tokenize();this._tag_stack=new O(S);for(var M=null,E=U.next();E.type!==l.EOF;)E.type===l.TAG_OPEN||E.type===l.COMMENT?(M=this._handle_tag_open(S,E,F,N),F=M):E.type===l.ATTRIBUTE||E.type===l.EQUALS||E.type===l.VALUE||E.type===l.TEXT&&!F.tag_complete?M=this._handle_inside_tag(S,E,F,U):E.type===l.TAG_CLOSE?M=this._handle_tag_close(S,E,F):E.type===l.TEXT?M=this._handle_text(S,E,F):S.add_raw_token(E),N=M,E=U.next();var W=S._output.get_code(a);return W},A.prototype._handle_tag_close=function(v,a,_){var N={text:a.text,type:a.type};return v.alignment_size=0,_.tag_complete=!0,v.set_space_before_token(a.newlines||a.whitespace_before!=="",!0),_.is_unformatted?v.add_raw_token(a):(_.tag_start_char==="<"&&(v.set_space_before_token(a.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&v.print_newline(!1)),v.print_token(a)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(v.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&v.set_wrap_point(),N},A.prototype._handle_inside_tag=function(v,a,_,N){var F=_.has_wrapped_attrs,S={text:a.text,type:a.type};if(v.set_space_before_token(a.newlines||a.whitespace_before!=="",!0),_.is_unformatted)v.add_raw_token(a);else if(_.tag_start_char==="{"&&a.type===l.TEXT)v.print_preserved_newlines(a)?(a.newlines=0,v.add_raw_token(a)):v.print_token(a);else{if(a.type===l.ATTRIBUTE?(v.set_space_before_token(!0),_.attr_count+=1):(a.type===l.EQUALS||a.type===l.VALUE&&a.previous.type===l.EQUALS)&&v.set_space_before_token(!1),a.type===l.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(v.traverse_whitespace(a),F=F||a.newlines!==0),this._is_wrap_attributes_force)){var U=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var M=!0,E=0,W;do{if(W=N.peek(E),W.type===l.ATTRIBUTE){M=!1;break}E+=1}while(E<4&&W.type!==l.EOF&&W.type!==l.TAG_CLOSE);U=!M}U&&(v.print_newline(!1),F=!0)}v.print_token(a),F=F||v.previous_token_wrapped(),_.has_wrapped_attrs=F}return S},A.prototype._handle_text=function(v,a,_){var N={text:a.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(v,a,_):_.is_unformatted||_.is_content_unformatted?v.add_raw_token(a):(v.traverse_whitespace(a),v.print_token(a)),N},A.prototype._print_custom_beatifier_text=function(v,a,_){var N=this;if(a.text!==""){var F=a.text,S,U=1,M="",E="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?S=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?S=this._css_beautify:_.custom_beautifier_name==="html"&&(S=function(fe,_e){var Se=new A(fe,_e,N._js_beautify,N._css_beautify);return Se.beautify()}),this._options.indent_scripts==="keep"?U=0:this._options.indent_scripts==="separate"&&(U=-v.indent_level);var W=v.get_full_indent(U);if(F=F.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var Z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!Z){v.add_raw_token(a);return}M=W+Z[1]+`
|
|
`,F=Z[4],Z[5]&&(E=W+Z[5]),F=F.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(`
|
|
`)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(a.whitespace_before=Z[0]))}if(F)if(S){var ne=function(){this.eol=`
|
|
`};ne.prototype=this._options.raw_options;var ae=new ne;F=S(W+F,ae)}else{var we=a.whitespace_before;we&&(F=F.replace(new RegExp(`
|
|
(`+we+")?","g"),`
|
|
`)),F=W+F.replace(/\n/g,`
|
|
`+W)}M&&(F?F=M+F+`
|
|
`+E:F=M+E),v.print_newline(!1),F&&(a.text=F,a.whitespace_before="",a.newlines=0,v.add_raw_token(a),v.print_newline(!0))}},A.prototype._handle_tag_open=function(v,a,_,N){var F=this._get_tag_open_token(a);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&a.type===l.TAG_OPEN&&a.text.indexOf("</")===0?(v.add_raw_token(a),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(v.traverse_whitespace(a),this._set_tag_position(v,a,F,_,N),F.is_inline_element||v.set_wrap_point(),v.print_token(a)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=a.text.length+1),!F.tag_complete&&!F.is_unformatted&&(v.alignment_size=F.alignment_size),F};var w=function(v,a){if(this.parent=v||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="",!a)this.tag_complete=!0;else{var _;this.tag_start_char=a.text[0],this.text=a.text,this.tag_start_char==="<"?(_=a.text.match(/^<([^\s>]*)/),this.tag_check=_?_[1]:""):(_=a.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(a.text.startsWith("{{#>")||a.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&a.next!==null?this.tag_check=a.next.text.split(" ")[0]:this.tag_check=a.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),a.type===l.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||a.closed&&a.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};A.prototype._get_tag_open_token=function(v){var a=new w(this._tag_stack.get_parser_token(),v);return a.alignment_size=this._options.wrap_attributes_indent_size,a.is_end_tag=a.is_end_tag||C(a.tag_check,this._options.void_elements),a.is_empty_element=a.tag_complete||a.is_start_tag&&a.is_end_tag,a.is_unformatted=!a.tag_complete&&C(a.tag_check,this._options.unformatted),a.is_content_unformatted=!a.is_empty_element&&C(a.tag_check,this._options.content_unformatted),a.is_inline_element=C(a.tag_name,this._options.inline)||a.tag_name.includes("-")||a.tag_start_char==="{",a},A.prototype._set_tag_position=function(v,a,_,N,F){if(_.is_empty_element||(_.is_end_tag?_.start_tag_token=this._tag_stack.try_pop(_.tag_name):(this._do_optional_end_element(_)&&(_.is_inline_element||v.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=x(_.tag_check,a)))),C(_.tag_check,this._options.extra_liners)&&(v.print_newline(!1),v._output.just_added_blankline()||v.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var S=v.current_line_has_match(/{{#if/);S||v.print_newline(!1)}_.tag_name==="!--"&&F.type===l.TAG_CLOSE&&N.is_end_tag&&_.text.indexOf(`
|
|
`)===-1||(_.is_inline_element||_.is_unformatted||v.print_newline(!1),this._calcluate_parent_multiline(v,_))}else if(_.is_end_tag){var U=!1;U=_.start_tag_token&&_.start_tag_token.multiline_content,U=U||!_.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(F.type===l.TAG_CLOSE&&_.start_tag_token===N)&&F.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&(U=!1),U&&v.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(F.type!=="TK_CONTENT"||_.is_content_unformatted)&&v.print_newline(!1),this._calcluate_parent_multiline(v,_)},A.prototype._calcluate_parent_multiline=function(v,a){a.parent&&v._output.just_added_newline()&&!((a.is_inline_element||a.is_unformatted)&&a.parent.is_inline_element)&&(a.parent.multiline_content=!0)};var b=["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"],u=["a","audio","del","ins","map","noscript","video"];A.prototype._do_optional_end_element=function(v){var a=null;if(v.is_empty_element||!v.is_start_tag||!v.parent)return;if(v.tag_name==="body")a=a||this._tag_stack.try_pop("head");else if(v.tag_name==="li")a=a||this._tag_stack.try_pop("li",["ol","ul"]);else if(v.tag_name==="dd"||v.tag_name==="dt")a=a||this._tag_stack.try_pop("dt",["dl"]),a=a||this._tag_stack.try_pop("dd",["dl"]);else if(v.parent.tag_name==="p"&&b.indexOf(v.tag_name)!==-1){var _=v.parent.parent;(!_||u.indexOf(_.tag_name)===-1)&&(a=a||this._tag_stack.try_pop("p"))}else v.tag_name==="rp"||v.tag_name==="rt"?(a=a||this._tag_stack.try_pop("rt",["ruby","rtc"]),a=a||this._tag_stack.try_pop("rp",["ruby","rtc"])):v.tag_name==="optgroup"?a=a||this._tag_stack.try_pop("optgroup",["select"]):v.tag_name==="option"?a=a||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):v.tag_name==="colgroup"?a=a||this._tag_stack.try_pop("caption",["table"]):v.tag_name==="thead"?(a=a||this._tag_stack.try_pop("caption",["table"]),a=a||this._tag_stack.try_pop("colgroup",["table"])):v.tag_name==="tbody"||v.tag_name==="tfoot"?(a=a||this._tag_stack.try_pop("caption",["table"]),a=a||this._tag_stack.try_pop("colgroup",["table"]),a=a||this._tag_stack.try_pop("thead",["table"]),a=a||this._tag_stack.try_pop("tbody",["table"])):v.tag_name==="tr"?(a=a||this._tag_stack.try_pop("caption",["table"]),a=a||this._tag_stack.try_pop("colgroup",["table"]),a=a||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(v.tag_name==="th"||v.tag_name==="td")&&(a=a||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),a=a||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return v.parent=this._tag_stack.get_parser_token(),a},y.exports.Beautifier=A},function(y,g,m){var c=m(6).Options;function d(p){c.call(this,p,"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"])}d.prototype=new c,y.exports.Options=d},function(y,g,m){var c=m(9).Tokenizer,d=m(9).TOKEN,p=m(13).Directives,l=m(14).TemplatablePattern,h=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:d.START,RAW:d.RAW,EOF:d.EOF},s=new p(/<\!--/,/-->/),R=function(x,C){c.call(this,x,C),this._current_tag_name="";var L=new l(this._input).read_options(this._options),O=new h(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var A=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(A).until_after(A)}};R.prototype=new c,R.prototype._is_comment=function(x){return!1},R.prototype._is_opening=function(x){return x.type===o.TAG_OPEN},R.prototype._is_closing=function(x,C){return x.type===o.TAG_CLOSE&&C&&((x.text===">"||x.text==="/>")&&C.text[0]==="<"||x.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(x,C){var L=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(o.EOF,""):(L=L||this._read_open_handlebars(O,C),L=L||this._read_attribute(O,x,C),L=L||this._read_close(O,C),L=L||this._read_raw_content(O,x,C),L=L||this._read_content_word(O),L=L||this._read_comment_or_cdata(O),L=L||this._read_processing(O),L=L||this._read_open(O,C),L=L||this._create_token(o.UNKNOWN,this._input.next()),L)},R.prototype._read_comment_or_cdata=function(x){var C=null,L=null,O=null;if(x==="<"){var A=this._input.peek(1);A==="!"&&(L=this.__patterns.comment.read(),L?(O=s.get_directives(L),O&&O.ignore==="start"&&(L+=s.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(C=this._create_token(o.COMMENT,L),C.directives=O)}return C},R.prototype._read_processing=function(x){var C=null,L=null,O=null;if(x==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(C=this._create_token(o.COMMENT,L),C.directives=O)}return C},R.prototype._read_open=function(x,C){var L=null,O=null;return C||x==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),O=this._create_token(o.TAG_OPEN,L)),O},R.prototype._read_open_handlebars=function(x,C){var L=null,O=null;return C||this._options.indent_handlebars&&x==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),O=this._create_token(o.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),O=this._create_token(o.TAG_OPEN,L))),O},R.prototype._read_close=function(x,C){var L=null,O=null;return C&&(C.text[0]==="<"&&(x===">"||x==="/"&&this._input.peek(1)===">")?(L=this._input.next(),x==="/"&&(L+=this._input.next()),O=this._create_token(o.TAG_CLOSE,L)):C.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(o.TAG_CLOSE,"}}"))),O},R.prototype._read_attribute=function(x,C,L){var O=null,A="";if(L&&L.text[0]==="<")if(x==="=")O=this._create_token(o.EQUALS,this._input.next());else if(x==='"'||x==="'"){var w=this._input.next();x==='"'?w+=this.__patterns.double_quote.read():w+=this.__patterns.single_quote.read(),O=this._create_token(o.VALUE,w)}else A=this.__patterns.attribute.read(),A&&(C.type===o.EQUALS?O=this._create_token(o.VALUE,A):O=this._create_token(o.ATTRIBUTE,A));return O},R.prototype._is_content_unformatted=function(x){return this._options.void_elements.indexOf(x)===-1&&(this._options.content_unformatted.indexOf(x)!==-1||this._options.unformatted.indexOf(x)!==-1)},R.prototype._read_raw_content=function(x,C,L){var O="";if(L&&L.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(C.type===o.TAG_CLOSE&&C.opened.text[0]==="<"&&C.text[0]!=="/"){var A=C.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var w=this._read_comment_or_cdata(x);if(w)return w.type=o.TEXT,w;O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(A)&&(O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(o.TEXT,O):null},R.prototype._read_content_word=function(x){var C="";if(this._options.unformatted_content_delimiter&&(x===this._options.unformatted_content_delimiter[0]&&(C=this.__patterns.unformatted_content_delimiter.read())),C||(C=this.__patterns.word.read()),C)return this._create_token(o.TEXT,C)},y.exports.Tokenizer=R,y.exports.TOKEN=o}],G={};function n(y){var g=G[y];if(g!==void 0)return g.exports;var m=G[y]={exports:{}};return z[y](m,m.exports,n),m.exports}var D=n(18);k=D})();var Y=k;if(!0)!(ie=[$,$("6UM0"),$("TXwP")],J=function(z){var G=$("6UM0"),n=$("TXwP");return{html_beautify:function(D,y){return Y(D,y,G.js_beautify,n.css_beautify)}}}.apply(be,ie),J!==void 0&&(dt.exports=J));else var j,B})()},"rAM+":function(dt,be,$){"use strict";$.d(be,"a",function(){return J});var ie=$("Qw5x");function J(k,Y){var j;if(typeof Symbol=="undefined"||k[Symbol.iterator]==null){if(Array.isArray(k)||(j=Object(ie.a)(k))||Y&&k&&typeof k.length=="number"){j&&(k=j);var B=0,z=function(){};return{s:z,n:function(){return B>=k.length?{done:!0}:{done:!1,value:k[B++]}},e:function(g){throw g},f:z}}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 G=!0,n=!1,D;return{s:function(){j=k[Symbol.iterator]()},n:function(){var g=j.next();return G=g.done,g},e:function(g){n=!0,D=g},f:function(){try{!G&&j.return!=null&&j.return()}finally{if(n)throw D}}}}},rUJ1:function(dt,be){const $=/[&<>"']/,ie=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&","<":"<",">":">",'"':""","'":"'"},j=O=>Y[O];function B(O,A){if(A){if($.test(O))return O.replace(ie,j)}else if(J.test(O))return O.replace(k,j);return O}const z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(O){return O.replace(z,(A,w)=>(w=w.toLowerCase(),w==="colon"?":":w.charAt(0)==="#"?w.charAt(1)==="x"?String.fromCharCode(parseInt(w.substring(2),16)):String.fromCharCode(+w.substring(1)):""))}const n=/(^|[^\[])\^/g;function D(O,A){O=O.source||O,A=A||"";const w={replace:(b,u)=>(u=u.source||u,u=u.replace(n,"$1"),O=O.replace(b,u),w),getRegex:()=>new RegExp(O,A)};return w}const y=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(O,A,w){if(O){let b;try{b=decodeURIComponent(G(w)).replace(y,"").toLowerCase()}catch(u){return null}if(b.indexOf("javascript:")===0||b.indexOf("vbscript:")===0||b.indexOf("data:")===0)return null}A&&!g.test(w)&&(w=h(A,w));try{w=encodeURI(w).replace(/%25/g,"%")}catch(b){return null}return w}const c={},d=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(O,A){c[" "+O]||(d.test(O)?c[" "+O]=O+"/":c[" "+O]=x(O,"/",!0)),O=c[" "+O];const w=O.indexOf(":")===-1;return A.substring(0,2)==="//"?w?A:O.replace(p,"$1")+A:A.charAt(0)==="/"?w?A:O.replace(l,"$1")+A:O+A}const o={exec:function(){}};function s(O){let A=1,w,b;for(;A<arguments.length;A++){w=arguments[A];for(b in w)Object.prototype.hasOwnProperty.call(w,b)&&(O[b]=w[b])}return O}function R(O,A){const w=O.replace(/\|/g,(v,a,_)=>{let N=!1,F=a;for(;--F>=0&&_[F]==="\\";)N=!N;return N?"|":" |"}),b=w.split(/ \|/);let u=0;if(b.length>A)b.splice(A);else for(;b.length<A;)b.push("");for(;u<b.length;u++)b[u]=b[u].trim().replace(/\\\|/g,"|");return b}function x(O,A,w){const b=O.length;if(b===0)return"";let u=0;for(;u<b;){const v=O.charAt(b-u-1);if(v===A&&!w)u++;else if(v!==A&&w)u++;else break}return O.substr(0,b-u)}function C(O,A){if(O.indexOf(A[1])===-1)return-1;const w=O.length;let b=0,u=0;for(;u<w;u++)if(O[u]==="\\")u++;else if(O[u]===A[0])b++;else if(O[u]===A[1]&&(b--,b<0))return u;return-1}function L(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}dt.exports={escape:B,unescape:G,edit:D,cleanUrl:m,resolveUrl:h,noopTest:o,merge:s,splitCells:R,rtrim:x,findClosingBracket:C,checkSanitizeDeprecation:L}},t9D7:function(dt,be,$){"use strict";$.d(be,"b",function(){return z}),$.d(be,"g",function(){return n}),$.d(be,"d",function(){return D}),$.d(be,"e",function(){return y}),$.d(be,"a",function(){return g}),$.d(be,"f",function(){return d}),$.d(be,"c",function(){return p});var ie=$("Vhoy"),J=$("MI8n"),k=$("pmY6"),Y=$("Cg/j"),j=$("ic2d"),B=$("nEHx");const z=Object(Y.c)("themeService");var G;(function(l){function h(o){return o&&typeof o=="object"&&typeof o.id=="string"}l.isThemeColor=h})(G||(G={}));function n(l){return{id:l}}var D;(function(l){function h(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||G.isThemeColor(L.color))}l.isThemeIcon=h;const o=new RegExp(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function s(L){const O=o.exec(L);if(!O)return;let[,A]=O;return{id:A}}l.fromString=s;function R(L,O){let A=L.id;const w=A.lastIndexOf("~");return w!==-1&&(A=A.substring(0,w)),O&&(A=`${A}~${O}`),{id:A}}l.modify=R;function x(L,O){var A,w;return L.id===O.id&&((A=L.color)===null||A===void 0?void 0:A.id)===((w=O.color)===null||w===void 0?void 0:w.id)}l.isEqual=x;function C(L,O){return{id:L.id,color:O?n(O):void 0}}l.asThemeIcon=C,l.asClassNameArray=ie.a.asClassNameArray,l.asClassName=ie.a.asClassName,l.asCSSSelector=ie.a.asCSSSelector})(D||(D={}));function y(l){switch(l){case B.a.DARK:return"vs-dark";case B.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 J.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(k.i)(()=>{const h=this.themingParticipants.indexOf(l);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new m;j.a.add(g.ThemingContribution,c);function d(l){return c.onColorThemeChange(l)}class p extends k.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},uLbx:function(dt,be,$){dt.exports={flex_box_center:"flex_box_center___1paSn",flex_space_between:"flex_space_between___36S3i",flex_box_vertical_center:"flex_box_vertical_center___3ccMy",flex_box_center_end:"flex_box_center_end___31AGp",flex_box_column:"flex_box_column___1cfjg",bg:"bg___1_34e",containerTitle:"containerTitle___3x8NS",containerDesc:"containerDesc___j5b4j",listItem:"listItem___3eFKb",info:"info___1lfiH",title:"title___1_ERY",titleLeft:"titleLeft___MRBRV",titleRight:"titleRight___XliYN",acitons:"acitons___3Fqbt"}},uSYw:function(dt,be,$){dt.exports={flex_box_center:"flex_box_center___1Yp6V",flex_space_between:"flex_space_between___15-lw",flex_box_vertical_center:"flex_box_vertical_center___3Z69M",flex_box_center_end:"flex_box_center_end___mA7IH",flex_box_column:"flex_box_column___3xASj",wrp:"wrp___2ltDQ",drawer:"drawer___3_MCx",menu:"menu___aAo09",actived:"actived___3DNqM",actived2:"actived2___3JLKu",listItem:"listItem___39GLP",info:"info___1GUGE",title:"title___1wRiz",titleLeft:"titleLeft___1BA1e",titleRight:"titleRight___2w3Ba",search:"search___vFEeF",description:"description___29YXF",menuCourse:"menuCourse___2vc01"}},ulZh:function(dt,be,$){typeof window!="undefined"&&function(J,k){dt.exports=k()}(this,function(){return function(ie){var J={};function k(Y){if(J[Y])return J[Y].exports;var j=J[Y]={i:Y,l:!1,exports:{}};return ie[Y].call(j.exports,j,j.exports,k),j.l=!0,j.exports}return k.m=ie,k.c=J,k.d=function(Y,j,B){k.o(Y,j)||Object.defineProperty(Y,j,{enumerable:!0,get:B})},k.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},k.t=function(Y,j){if(j&1&&(Y=k(Y)),j&8)return Y;if(j&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var B=Object.create(null);if(k.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:Y}),j&2&&typeof Y!="string")for(var z in Y)k.d(B,z,function(G){return Y[G]}.bind(null,z));return B},k.n=function(Y){var j=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return k.d(j,"a",j),j},k.o=function(Y,j){return Object.prototype.hasOwnProperty.call(Y,j)},k.p="/dist/",k(k.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,J,k){"use strict";var Y=Object.prototype.hasOwnProperty,j="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(j=!1));function z(y,g,m){this.fn=y,this.context=g,this.once=m||!1}function G(y,g,m,c,d){if(typeof m!="function")throw new TypeError("The listener must be a function");var p=new z(m,c||y,d),l=j?j+g:g;return y._events[l]?y._events[l].fn?y._events[l]=[y._events[l],p]:y._events[l].push(p):(y._events[l]=p,y._eventsCount++),y}function n(y,g){--y._eventsCount===0?y._events=new B:delete y._events[g]}function D(){this._events=new B,this._eventsCount=0}D.prototype.eventNames=function(){var g=[],m,c;if(this._eventsCount===0)return g;for(c in m=this._events)Y.call(m,c)&&g.push(j?c.slice(1):c);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(m)):g},D.prototype.listeners=function(g){var m=j?j+g:g,c=this._events[m];if(!c)return[];if(c.fn)return[c.fn];for(var d=0,p=c.length,l=new Array(p);d<p;d++)l[d]=c[d].fn;return l},D.prototype.listenerCount=function(g){var m=j?j+g:g,c=this._events[m];return c?c.fn?1:c.length:0},D.prototype.emit=function(g,m,c,d,p,l){var h=j?j+g:g;if(!this._events[h])return!1;var o=this._events[h],s=arguments.length,R,x;if(o.fn){o.once&&this.removeListener(g,o.fn,void 0,!0);switch(s){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,d),!0;case 5:return o.fn.call(o.context,m,c,d,p),!0;case 6:return o.fn.call(o.context,m,c,d,p,l),!0}for(x=1,R=new Array(s-1);x<s;x++)R[x-1]=arguments[x];o.fn.apply(o.context,R)}else{var C=o.length,L;for(x=0;x<C;x++){o[x].once&&this.removeListener(g,o[x].fn,void 0,!0);switch(s){case 1:o[x].fn.call(o[x].context);break;case 2:o[x].fn.call(o[x].context,m);break;case 3:o[x].fn.call(o[x].context,m,c);break;case 4:o[x].fn.call(o[x].context,m,c,d);break;default:if(!R)for(L=1,R=new Array(s-1);L<s;L++)R[L-1]=arguments[L];o[x].fn.apply(o[x].context,R)}}}return!0},D.prototype.on=function(g,m,c){return G(this,g,m,c,!1)},D.prototype.once=function(g,m,c){return G(this,g,m,c,!0)},D.prototype.removeListener=function(g,m,c,d){var p=j?j+g:g;if(!this._events[p])return this;if(!m)return n(this,p),this;var l=this._events[p];if(l.fn)l.fn===m&&(!d||l.once)&&(!c||l.context===c)&&n(this,p);else{for(var h=0,o=[],s=l.length;h<s;h++)(l[h].fn!==m||d&&!l[h].once||c&&l[h].context!==c)&&o.push(l[h]);o.length?this._events[p]=o.length===1?o[0]:o:n(this,p)}return this},D.prototype.removeAllListeners=function(g){var m;return g?(m=j?j+g:g,this._events[m]&&n(this,m)):(this._events=new B,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=j,D.EventEmitter=D,ie.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,J,k){(function(Y){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,B=/^([^\/?#]*)([^]*)$/,z=/(?:\/|^)\.(?=\/)/g,G=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/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 d=n.parseURL(D);if(!d)throw new Error("Error trying to parse base URL.");if(!d.netLoc&&d.path&&d.path[0]!=="/"){var p=B.exec(d.path);d.netLoc=p[1],d.path=p[2]}d.netLoc&&!d.path&&(d.path="/");var l={scheme:d.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(l.netLoc=d.netLoc,c.path[0]!=="/"))if(!c.path)l.path=d.path,c.params||(l.params=d.params,c.query||(l.query=d.query));else{var h=d.path,o=h.substring(0,h.lastIndexOf("/")+1)+c.path;l.path=n.normalizePath(o)}return l.path===null&&(l.path=g.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(l)},parseURL:function(D){var y=j.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(z,"");D.length!==(D=D.replace(G,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};ie.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,J,k){function Y(g){var m={};function c(p){if(m[p])return m[p].exports;var l=m[p]={i:p,l:!1,exports:{}};return g[p].call(l.exports,l,l.exports,c),l.l=!0,l.exports}c.m=g,c.c=m,c.i=function(p){return p},c.d=function(p,l,h){c.o(p,l)||Object.defineProperty(p,l,{configurable:!1,enumerable:!0,get:h})},c.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},c.n=function(p){var l=p&&p.__esModule?function(){return p.default}:function(){return p};return c.d(l,"a",l),l},c.o=function(p,l){return Object.prototype.hasOwnProperty.call(p,l)},c.p="/",c.oe=function(p){throw console.error(p),p};var d=c(c.s=ENTRY_MODULE);return d.default||d}var j="[\\.|\\-|\\+|\\w|/|@]+",B="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function z(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function G(g){return!isNaN(1*g)}function n(g,m,c){var d={};d[c]=[];var p=m.toString(),l=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return d;for(var h=l[1],o=new RegExp("(\\\\n|\\W)"+z(h)+B,"g"),s;s=o.exec(p);){if(s[3]==="dll-reference")continue;d[c].push(s[3])}for(o=new RegExp("\\("+z(h)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+B,"g");s=o.exec(p);)g[s[2]]||(d[c].push(s[1]),g[s[2]]=k(s[1]).m),d[s[2]]=d[s[2]]||[],d[s[2]].push(s[4]);for(var R=Object.keys(d),x=0;x<R.length;x++)for(var C=0;C<d[R[x]].length;C++)G(d[R[x]][C])&&(d[R[x]][C]=1*d[R[x]][C]);return d}function D(g){var m=Object.keys(g);return m.reduce(function(c,d){return c||g[d].length>0},!1)}function y(g,m){for(var c={main:[m]},d={main:[]},p={main:{}};D(c);)for(var l=Object.keys(c),h=0;h<l.length;h++){var o=l[h],s=c[o],R=s.pop();if(p[o]=p[o]||{},p[o][R]||!g[o][R])continue;p[o][R]=!0,d[o]=d[o]||[],d[o].push(R);for(var x=n(g,g[o][R],o),C=Object.keys(x),L=0;L<C.length;L++)c[C[L]]=c[C[L]]||[],c[C[L]]=c[C[L]].concat(x[C[L]])}return d}ie.exports=function(g,m){m=m||{};var c={main:k.m},d=m.all?{main:Object.keys(c.main)}:y(c,g),p="";Object.keys(d).filter(function(R){return R!=="main"}).forEach(function(R){for(var x=0;d[R][x];)x++;d[R].push(x),c[R][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+R+" = ("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+d[R].map(function(C){return""+JSON.stringify(C)+": "+c[R][C].toString()}).join(",")+`});
|
|
`}),p=p+"new (("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+d.main.map(function(R){return""+JSON.stringify(R)+": "+c.main[R].toString()}).join(",")+"}))(self);";var l=new window.Blob([p],{type:"text/javascript"});if(m.bare)return l;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,o=h.createObjectURL(l),s=new window.Worker(o);return s.objectURL=o,s}},"./src/config.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"hlsDefaultConfig",function(){return L}),k.d(J,"mergeConfig",function(){return A}),k.d(J,"enableStreamingMode",function(){return w});var Y=k("./src/controller/abr-controller.ts"),j=k("./src/controller/audio-stream-controller.ts"),B=k("./src/controller/audio-track-controller.ts"),z=k("./src/controller/subtitle-stream-controller.ts"),G=k("./src/controller/subtitle-track-controller.ts"),n=k("./src/controller/buffer-controller.ts"),D=k("./src/controller/timeline-controller.ts"),y=k("./src/controller/cap-level-controller.ts"),g=k("./src/controller/fps-controller.ts"),m=k("./src/controller/eme-controller.ts"),c=k("./src/controller/cmcd-controller.ts"),d=k("./src/utils/xhr-loader.ts"),p=k("./src/utils/fetch-loader.ts"),l=k("./src/utils/cues.ts"),h=k("./src/utils/mediakeys-helper.ts"),o=k("./src/utils/logger.ts");function s(){return s=Object.assign||function(b){for(var u=1;u<arguments.length;u++){var v=arguments[u];for(var a in v)Object.prototype.hasOwnProperty.call(v,a)&&(b[a]=v[a])}return b},s.apply(this,arguments)}function R(b,u){var v=Object.keys(b);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(b);u&&(a=a.filter(function(_){return Object.getOwnPropertyDescriptor(b,_).enumerable})),v.push.apply(v,a)}return v}function x(b){for(var u=1;u<arguments.length;u++){var v=arguments[u]!=null?arguments[u]:{};u%2?R(Object(v),!0).forEach(function(a){C(b,a,v[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(v)):R(Object(v)).forEach(function(a){Object.defineProperty(b,a,Object.getOwnPropertyDescriptor(v,a))})}return b}function C(b,u,v){return u in b?Object.defineProperty(b,u,{value:v,enumerable:!0,configurable:!0,writable:!0}):b[u]=v,b}var L=x(x({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:d.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Y.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:h.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:z.SubtitleStreamController,subtitleTrackController:G.default,timelineController:D.TimelineController,audioStreamController:j.default,audioTrackController:B.default,emeController:m.default,cmcdController:c.default});function O(){return{cueHandler:l.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 A(b,u){if((u.liveSyncDurationCount||u.liveMaxLatencyDurationCount)&&(u.liveSyncDuration||u.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(u.liveMaxLatencyDurationCount!==void 0&&(u.liveSyncDurationCount===void 0||u.liveMaxLatencyDurationCount<=u.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(u.liveMaxLatencyDuration!==void 0&&(u.liveSyncDuration===void 0||u.liveMaxLatencyDuration<=u.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},b,u)}function w(b){var u=b.loader;if(u!==p.default&&u!==d.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),b.progressive=!1;else{var v=Object(p.fetchSupported)();v&&(b.loader=p.default,b.progressive=!0,b.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/polyfills/number.ts"),j=k("./src/utils/ewma-bandwidth-estimator.ts"),B=k("./src/events.ts"),z=k("./src/utils/buffer-helper.ts"),G=k("./src/errors.ts"),n=k("./src/types/loader.ts"),D=k("./src/utils/logger.ts");function y(c,d){for(var p=0;p<d.length;p++){var l=d[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function g(c,d,p){return d&&y(c.prototype,d),p&&y(c,p),c}var m=function(){function c(p){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=p;var l=p.config;this.bwEstimator=new j.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var d=c.prototype;return d.registerListeners=function(){var l=this.hls;l.on(B.Events.FRAG_LOADING,this.onFragLoading,this),l.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(B.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var l=this.hls;l.off(B.Events.FRAG_LOADING,this.onFragLoading,this),l.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(B.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},d.onFragLoading=function(l,h){var o=h.frag;if(o.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=o,this.partCurrent=(s=h.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},d.onLevelLoaded=function(l,h){var o=this.hls.config;h.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},d._abandonRulesCheck=function(){var l=this.fragCurrent,h=this.partCurrent,o=this.hls,s=o.autoLevelEnabled,R=o.config,x=o.media;if(!l||!x)return;var C=h?h.stats:l.stats,L=h?h.duration:l.duration;if(C.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||x.paused||!x.playbackRate||!x.readyState)return;var O=performance.now()-C.loading.start,A=Math.abs(x.playbackRate);if(O<=500*L/A)return;var w=o.levels,b=o.minAutoLevel,u=w[l.level],v=C.total||Math.max(C.loaded,Math.round(L*u.maxBitrate/8)),a=Math.max(1,C.bwEstimate?C.bwEstimate/8:C.loaded*1e3/O),_=(v-C.loaded)/a,N=x.currentTime,F=(z.BufferHelper.bufferInfo(x,N,R.maxBufferHole).end-N)/A;if(F>=2*L/A||_<=F)return;var S=Number.POSITIVE_INFINITY,U;for(U=l.level-1;U>b;U--){var M=w[U].maxBitrate;if(S=L*M/(8*.8*a),S<F)break}if(S>=_)return;var E=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+l.sn+(h?" part "+h.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+U+`
|
|
Current BW estimate: `+(Object(Y.isFiniteNumber)(E)?(E/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+_.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+S.toFixed(3)+` s
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),o.nextLoadLevel=U,this.bwEstimator.sample(O,C.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),o.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:h,stats:C})},d.onFragLoaded=function(l,h){var o=h.frag,s=h.part;if(o.type===n.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(o.sn)){var R=s?s.stats:o.stats,x=s?s.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var C=this.hls.levels[o.level],L=(C.loaded?C.loaded.bytes:0)+R.loaded,O=(C.loaded?C.loaded.duration:0)+x;C.loaded={bytes:L,duration:O},C.realBitrate=Math.round(8*L/O)}if(o.bitrateTest){var A={stats:R,frag:o,part:s,id:o.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,A),o.bitrateTest=!1}}},d.onFragBuffered=function(l,h){var o=h.frag,s=h.part,R=s?s.stats:o.stats;if(R.aborted)return;if(o.type!==n.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var x=R.parsing.end-R.loading.start;this.bwEstimator.sample(x,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},d.onError=function(l,h){switch(h.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},d.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},d.getNextABRAutoLevel=function(){var l=this.fragCurrent,h=this.partCurrent,o=this.hls,s=o.maxAutoLevel,R=o.config,x=o.minAutoLevel,C=o.media,L=h?h.duration:l?l.duration:0,O=C?C.currentTime:0,A=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,w=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,b=(z.BufferHelper.bufferInfo(C,O,R.maxBufferHole).end-O)/A,u=this.findBestLevel(w,x,s,b,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(u>=0)return u;D.logger.trace((b?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=L?Math.min(L,R.maxStarvationDelay):R.maxStarvationDelay,a=R.abrBandWidthFactor,_=R.abrBandWidthUpFactor;if(!b){var N=this.bitrateTestDelay;if(N){var F=L?Math.min(L,R.maxLoadingDelay):R.maxLoadingDelay;v=F-N,D.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),a=_=1}}return u=this.findBestLevel(w,x,s,b+v,a,_),Math.max(u,0)},d.findBestLevel=function(l,h,o,s,R,x){for(var C,L=this.fragCurrent,O=this.partCurrent,A=this.lastLoadedFragLevel,w=this.hls.levels,b=w[A],u=!!(b!=null&&(C=b.details)!==null&&C!==void 0&&C.live),v=b==null?void 0:b.codecSet,a=O?O.duration:L?L.duration:0,_=o;_>=h;_--){var N=w[_];if(!N||v&&N.codecSet!==v)continue;var F=N.details,S=(O?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||a,U=void 0;_<=A?U=R*l:U=x*l;var M=w[_].maxBitrate,E=M*S/U;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(U)+"/"+M+"/"+S+"/"+s+"/"+E),U>M&&(!E||u&&!this.bitrateTestDelay||E<s))return _}return-1},g(c,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,h=this.bwEstimator;if(l!==-1&&(!h||!h.canEstimate()))return l;var o=this.getNextABRAutoLevel();return l!==-1&&(o=Math.min(l,o)),o},set:function(l){this._nextAutoLevel=l}}]),c}();J.default=m},"./src/controller/audio-stream-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/polyfills/number.ts"),j=k("./src/controller/base-stream-controller.ts"),B=k("./src/events.ts"),z=k("./src/utils/buffer-helper.ts"),G=k("./src/controller/fragment-tracker.ts"),n=k("./src/types/level.ts"),D=k("./src/types/loader.ts"),y=k("./src/loader/fragment.ts"),g=k("./src/demux/chunk-cache.ts"),m=k("./src/demux/transmuxer-interface.ts"),c=k("./src/types/transmuxer.ts"),d=k("./src/controller/fragment-finders.ts"),p=k("./src/utils/discontinuities.ts"),l=k("./src/errors.ts"),h=k("./src/utils/logger.ts");function o(){return o=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var w in A)Object.prototype.hasOwnProperty.call(A,w)&&(L[w]=A[w])}return L},o.apply(this,arguments)}function s(L,O){L.prototype=Object.create(O.prototype),L.prototype.constructor=L,R(L,O)}function R(L,O){return R=Object.setPrototypeOf||function(w,b){return w.__proto__=b,w},R(L,O)}var x=100,C=function(L){s(O,L);function O(w,b){var u;return u=L.call(this,w,b,"[audio-stream-controller]")||this,u.videoBuffer=null,u.videoTrackCC=-1,u.waitingVideoCC=-1,u.audioSwitch=!1,u.trackId=-1,u.waitingData=null,u.mainDetails=null,u.bufferFlushed=!1,u._registerListeners(),u}var A=O.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var b=this.hls;b.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),b.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),b.on(B.Events.ERROR,this.onError,this),b.on(B.Events.BUFFER_RESET,this.onBufferReset,this),b.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),b.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var b=this.hls;b.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),b.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),b.off(B.Events.ERROR,this.onError,this),b.off(B.Events.BUFFER_RESET,this.onBufferReset,this),b.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),b.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onInitPtsFound=function(b,u){var v=u.frag,a=u.id,_=u.initPTS;if(a==="main"){var N=v.cc;this.initPTS[v.cc]=_,this.log("InitPTS for cc: "+N+" found from main: "+_),this.videoTrackCC=N,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},A.startLoad=function(b){if(!this.levels){this.startPosition=b,this.state=j.State.STOPPED;return}var u=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,u>0&&b===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var b,u=this.levels,v=this.trackId,a=u==null||((b=u[v])===null||b===void 0)?void 0:b.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var _,N=performance.now(),F=this.retryDate;(!F||N>=F||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var S=this.waitingData;if(S){var U=S.frag,M=S.part,E=S.cache,W=S.complete;if(this.initPTS[U.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var Z=E.flush(),ne={frag:U,part:M,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(ne),W&&L.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)h.logger.log("Waiting fragment cc ("+U.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ae=this.getLoadPosition(),we=z.BufferHelper.bufferInfo(this.mediaBuffer,ae,this.config.maxBufferHole),fe=Object(d.fragmentWithinToleranceTest)(we.end,this.config.maxFragLookUpTolerance,U);fe<0&&(h.logger.log("Waiting fragment cc ("+U.cc+") @ "+U.start+" cancelled because another fragment at "+we.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var b=this.waitingData;b&&(this.fragmentTracker.removeFragment(b.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},A.onTickEnd=function(){var b=this.media;if(!b||!b.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:b,v=u.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=b.currentTime},A.doTickIdle=function(){var b,u,v=this.hls,a=this.levels,_=this.media,N=this.trackId,F=v.config;if(!a||!a[N])return;if(!_&&(this.startFragRequested||!F.startFragPrefetch))return;var S=a[N],U=S.details;if(!U||U.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(U)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(M===null)return;var E=M.len,W=this.getMaxBufferLength(),Z=this.audioSwitch;if(E>=W&&!Z)return;if(!Z&&this._streamEnded(M,U)){v.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ne=U.fragments,ae=ne[0].start,we=M.end;if(Z){var fe=this.getLoadPosition();we=fe,U.PTSKnown&&fe<ae&&((M.end>ae||M.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=ae+.05))}var _e=this.getNextFragment(we,U);if(!_e){this.bufferFlushed=!0;return}((b=_e.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((u=_e.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(_e,U):this.loadFragment(_e,U,we)},A.getMaxBufferLength=function(){var b=L.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return u===null?b:Math.max(b,u.len)},A.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(b,u){var v=u.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(a){return new n.Level(a)})},A.onAudioTrackSwitching=function(b,u){var v=!!u.url;this.trackId=u.id;var a=this.fragCurrent;a!=null&&a.loader&&a.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(x):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(b,u){this.mainDetails=u.details},A.onAudioTrackLoaded=function(b,u){var v,a=this.levels,_=u.details,N=u.id;if(!a){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var F=a[N],S=0;if(_.live||(v=F.details)!==null&&v!==void 0&&v.live){var U=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!U)return;!F.details&&_.hasProgramDateTime&&U.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(_,U),S=_.fragments[0].start):S=this.alignPlaylists(_,F.details)}F.details=_,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(F.details,S),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=j.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(b){var u,v=b.frag,a=b.part,_=b.payload,N=this.config,F=this.trackId,S=this.levels;if(!S){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var U=S[F];console.assert(U,"Audio track is defined on fragment load progress");var M=U.details;console.assert(M,"Audio track details are defined on fragment load progress");var E=N.defaultAudioCodec||U.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new m.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[v.cc],ne=(u=v.initSegment)===null||u===void 0?void 0:u.data;if(Z!==void 0){var ae=!1,we=a?a.index:-1,fe=we!==-1,_e=new c.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,_.byteLength,we,fe);W.push(_,ne,E,"",v,a,M.totalduration,ae,_e,Z)}else{h.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+M.startSN+" ,"+M.endSN+"],track "+F);var Se=this.waitingData=this.waitingData||{frag:v,part:a,cache:new g.default,complete:!1},ve=Se.cache;ve.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(b){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,b)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(b,u){var v=u.tracks.audio;v&&(this.mediaBuffer=v.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},A.onFragBuffered=function(b,u){var v=u.frag,a=u.part;if(v.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(a?" p: "+a.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,a)},A.onError=function(b,u){switch(u.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,u);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=u.fatal?j.State.ERROR:j.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var v=!0,a=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);a&&a.len>.5&&(v=!this.reduceMaxBufferLength(a.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},A.onBufferFlushed=function(b,u){var v=u.type;v===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(b){var u,v="audio",a=this.hls,_=b.remuxResult,N=b.chunkMeta,F=this.getCurrentContext(N);if(!F){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var S=F.frag,U=F.part,M=_.audio,E=_.text,W=_.id3,Z=_.initSegment;if(this.fragContextChanged(S))return;if(this.state=j.State.PARSING,this.audioSwitch&&M&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,S,N),a.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:v,tracks:Z.tracks})),M){var ne=M.startPTS,ae=M.endPTS,we=M.startDTS,fe=M.endDTS;U&&(U.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:ae,startDTS:we,endDTS:fe}),S.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,ne,ae,we,fe),this.bufferFragmentData(M,S,U,N)}if(W!=null&&(u=W.samples)!==null&&u!==void 0&&u.length){var _e=o({frag:S,id:v},W);a.trigger(B.Events.FRAG_PARSING_METADATA,_e)}if(E){var Se=o({frag:S,id:v},E);a.trigger(B.Events.FRAG_PARSING_USERDATA,Se)}},A._bufferInitSegment=function(b,u,v){if(this.state!==j.State.PARSING)return;b.video&&delete b.video;var a=b.audio;if(!a)return;a.levelCodec=a.codec,a.id="audio",this.log("Init audio buffer, container:"+a.container+", codecs[parsed]=["+a.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,b);var _=a.initSegment;if(_!=null&&_.byteLength){var N={type:"audio",frag:u,part:null,chunkMeta:v,parent:u.type,data:_};this.hls.trigger(B.Events.BUFFER_APPENDING,N)}this.tick()},A.loadFragment=function(b,u,v){var a=this.fragmentTracker.getState(b);this.fragCurrent=b,(this.audioSwitch||a===G.FragmentState.NOT_LOADED||a===G.FragmentState.PARTIAL)&&(b.sn==="initSegment"?this._loadInitSegment(b):u.live&&!Object(Y.isFiniteNumber)(this.initPTS[b.cc])?(this.log("Waiting for video PTS in continuity counter "+b.cc+" of live stream before loading audio fragment "+b.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,b,u,v)))},A.completeAudioSwitch=function(){var b=this.hls,u=this.media,v=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,b.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:v})},O}(j.default);J.default=C},"./src/controller/audio-track-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/events.ts"),j=k("./src/errors.ts"),B=k("./src/controller/base-playlist-controller.ts"),z=k("./src/types/loader.ts");function G(m,c){for(var d=0;d<c.length;d++){var p=c[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(m,p.key,p)}}function n(m,c,d){return c&&G(m.prototype,c),d&&G(m,d),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(p,l){return p.__proto__=l,p},y(m,c)}var g=function(m){D(c,m);function c(p){var l;return l=m.call(this,p,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var d=c.prototype;return d.registerListeners=function(){var l=this.hls;l.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(Y.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var l=this.hls;l.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(Y.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(l,h){this.tracks=h.audioTracks||[]},d.onAudioTrackLoaded=function(l,h){var o=h.id,s=h.details,R=this.tracksInGroup[o];if(!R){this.warn("Invalid audio track id "+o);return}var x=R.details;R.details=h.details,this.log("audioTrack "+o+" loaded ["+s.startSN+"-"+s.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,h,x))},d.onLevelLoading=function(l,h){this.switchLevel(h.level)},d.onLevelSwitching=function(l,h){this.switchLevel(h.level)},d.switchLevel=function(l){var h=this.hls.levels[l];if(!(h!=null&&h.audioGroupIds))return;var o=h.audioGroupIds[h.urlId];if(this.groupId!==o){this.groupId=o;var s=this.tracks.filter(function(x){return!o||x.groupId===o});this.selectDefaultTrack&&!s.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var R={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(Y.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},d.onError=function(l,h){if(m.prototype.onError.call(this,l,h),h.fatal||!h.context)return;h.context.type===z.PlaylistContextType.AUDIO_TRACK&&h.context.id===this.trackId&&h.context.groupId===this.groupId&&this.retryLoadingOrFail(h)},d.setAudioTrack=function(l){var h=this.tracksInGroup;if(l<0||l>=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=h[this.trackId];this.log("Now switching to audio-track index "+l);var s=h[l],R=s.id,x=s.groupId,C=x===void 0?"":x,L=s.name,O=s.type,A=s.url;if(this.trackId=l,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:C,name:L,type:O,url:A}),s.details&&!s.details.live)return;var w=this.switchParams(s.url,o==null?void 0:o.details);this.loadPlaylist(w)},d.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var h=this.trackName,o=this.findTrackId(h)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.findTrackId=function(l){for(var h=this.tracksInGroup,o=0;o<h.length;o++){var s=h[o];if((!this.selectDefaultTrack||s.default)&&(!l||l===s.name))return s.id}return-1},d.loadPlaylist=function(l){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var o=h.id,s=h.groupId,R=h.url;if(l)try{R=l.addDirectives(R)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(Y.Events.AUDIO_TRACK_LOADING,{url:R,id:o,groupId:s,deliveryDirectives:l||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),c}(B.default);J.default=g},"./src/controller/base-playlist-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return n});var Y=k("./src/polyfills/number.ts"),j=k("./src/types/level.ts"),B=k("./src/controller/level-helper.ts"),z=k("./src/utils/logger.ts"),G=k("./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=z.logger.log.bind(z.logger,m+":"),this.warn=z.logger.warn.bind(z.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===G.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 d=c==null?void 0:c.renditionReports;if(d)for(var p=0;p<d.length;p++){var l=d[p],h=""+l.URI;if(h===m.substr(-h.length)){var o=parseInt(l["LAST-MSN"]),s=parseInt(l["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var R=Math.min(c.age-c.partTarget,c.targetduration);s!==void 0&&R>c.partTarget&&(s+=1)}if(Object(Y.isFiniteNumber)(o))return new j.HlsUrlParameters(o,Object(Y.isFiniteNumber)(s)?s:void 0,j.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,d){var p=this,l=c.details,h=c.stats,o=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(l.advancedDateTime=Date.now()-o,l.live||d!=null&&d.live){if(l.reloaded(d),d&&this.log("live playlist "+m+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),d&&l.fragments.length>0&&Object(B.mergeDetails)(d,l),!this.canLoad||!l.live)return;var s,R=void 0,x=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var C=this.hls.config.lowLatencyMode,L=l.lastPartSn,O=l.endSN,A=l.lastPartIndex,w=A!==-1,b=L===O,u=C?0:A;w?(R=b?O+1:L,x=b?u:A+1):R=O+1;var v=l.age,a=v+l.ageHeader,_=Math.min(a-l.partTarget,l.targetduration*1.5);if(_>0){if(d&&_>d.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+d.tuneInGoal+" to: "+_+" with playlist age: "+l.age),_=0;else{var N=Math.floor(_/l.targetduration);if(R+=N,x!==void 0){var F=Math.round(_%l.targetduration/l.partTarget);x+=F}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+_+" skip sn "+N+" to part "+x)}l.tuneInGoal=_}if(s=this.getDeliveryDirectives(l,c.deliveryDirectives,R,x),C||!b){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(l,c.deliveryDirectives,R,x);var S=Object(B.computeReloadInterval)(l,h);R!==void 0&&l.canBlockReload&&(S-=l.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(S)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(s)},S)}else this.clearTimer()},y.getDeliveryDirectives=function(m,c,d,p){var l=Object(j.getSkipValue)(m,d);return c!=null&&c.skip&&m.deltaUpdateFailed&&(d=c.msn,p=c.part,l=j.HlsSkip.No),new j.HlsUrlParameters(d,p,l)},y.retryLoadingOrFail=function(m){var c=this,d=this.hls.config,p=this.retryCount<d.levelLoadingMaxRetry;if(p){var l;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(l=m.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var h=Math.min(Math.pow(2,this.retryCount)*d.levelLoadingRetryDelay,d.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},h),this.warn("retry playlist loading #"+this.retryCount+" in "+h+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return p},D}()},"./src/controller/base-stream-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"State",function(){return O}),k.d(J,"default",function(){return A});var Y=k("./src/polyfills/number.ts"),j=k("./src/task-loop.ts"),B=k("./src/controller/fragment-tracker.ts"),z=k("./src/utils/buffer-helper.ts"),G=k("./src/utils/logger.ts"),n=k("./src/events.ts"),D=k("./src/errors.ts"),y=k("./src/types/transmuxer.ts"),g=k("./src/utils/mp4-tools.ts"),m=k("./src/utils/discontinuities.ts"),c=k("./src/controller/fragment-finders.ts"),d=k("./src/controller/level-helper.ts"),p=k("./src/loader/fragment-loader.ts"),l=k("./src/crypt/decrypter.ts"),h=k("./src/utils/time-ranges.ts"),o=k("./src/types/loader.ts");function s(w,b){for(var u=0;u<b.length;u++){var v=b[u];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}function R(w,b,u){return b&&s(w.prototype,b),u&&s(w,u),w}function x(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function C(w,b){w.prototype=Object.create(b.prototype),w.prototype.constructor=w,L(w,b)}function L(w,b){return L=Object.setPrototypeOf||function(v,a){return v.__proto__=a,v},L(w,b)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},A=function(w){C(b,w);function b(v,a,_){var N;return N=w.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=O.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=_,N.log=G.logger.log.bind(G.logger,_+":"),N.warn=G.logger.warn.bind(G.logger,_+":"),N.hls=v,N.fragmentLoader=new p.default(v.config),N.fragmentTracker=a,N.config=v.config,N.decrypter=new l.default(v,v.config),v.on(n.Events.KEY_LOADED,N.onKeyLoaded,x(N)),N}var u=b.prototype;return u.doTick=function(){this.onTickEnd()},u.onTickEnd=function(){},u.startLoad=function(a){},u.stopLoad=function(){this.fragmentLoader.abort();var a=this.fragCurrent;a&&this.fragmentTracker.removeFragment(a),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},u._streamEnded=function(a,_){var N=this.fragCurrent,F=this.fragmentTracker;if(!_.live&&N&&N.sn===_.endSN&&!a.nextStart){var S=F.getState(N);return S===B.FragmentState.PARTIAL||S===B.FragmentState.OK}return!1},u.onMediaAttached=function(a,_){var N=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(F.startPosition)},u.onMediaDetaching=function(){var a=this.media;a!=null&&a.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),a&&(a.removeEventListener("seeking",this.onvseeking),a.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onMediaSeeking=function(){var a=this.config,_=this.fragCurrent,N=this.media,F=this.mediaBuffer,S=this.state,U=N?N.currentTime:0,M=z.BufferHelper.bufferInfo(F||N,U,a.maxBufferHole);if(this.log("media seeking to "+(Object(Y.isFiniteNumber)(U)?U.toFixed(3):U)+", state: "+S),S===O.ENDED)this.resetLoadingState();else if(_&&!M.len){var E=a.maxFragLookUpTolerance,W=_.start-E,Z=_.start+_.duration+E,ne=U>Z;(U<W||ne)&&(ne&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=U),!this.loadedmetadata&&!M.len&&(this.nextLoadPosition=this.startPosition=U),this.tickImmediate()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onKeyLoaded=function(a,_){if(this.state!==O.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var N=this.levels[_.frag.level].details;N&&this.loadFragment(_.frag,N,_.frag.start)},u.onHandlerDestroying=function(){this.stopLoad(),w.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,w.prototype.onHandlerDestroyed.call(this)},u.loadKey=function(a,_){this.log("Loading key for "+a.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+a.level),this.state=O.KEY_LOADING,this.fragCurrent=a,this.hls.trigger(n.Events.KEY_LOADING,{frag:a})},u.loadFragment=function(a,_,N){this._loadFragForPlayback(a,_,N)},u._loadFragForPlayback=function(a,_,N){var F=this,S=function(M){if(F.fragContextChanged(a)){F.warn("Fragment "+a.sn+(M.part?" p: "+M.part.index:"")+" of level "+a.level+" was dropped during download."),F.fragmentTracker.removeFragment(a);return}a.stats.chunkCount++,F._handleFragmentLoadProgress(M)};this._doFragLoad(a,_,N,S).then(function(U){if(!U)return;F.fragLoadError=0;var M=F.state;if(F.fragContextChanged(a)){(M===O.FRAG_LOADING||M===O.BACKTRACKING||!F.fragCurrent&&M===O.PARSING)&&(F.fragmentTracker.removeFragment(a),F.state=O.IDLE);return}if("payload"in U&&(F.log("Loaded fragment "+a.sn+" of level "+a.level),F.hls.trigger(n.Events.FRAG_LOADED,U),F.state===O.BACKTRACKING)){F.fragmentTracker.backtrack(a,U),F.resetFragmentLoading(a);return}F._handleFragmentLoadComplete(U)}).catch(function(U){F.warn(U),F.resetFragmentLoading(a)})},u.flushMainBuffer=function(a,_,N){if(N===void 0&&(N=null),!(a-_))return;var F={startOffset:a,endOffset:_,type:N};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,F)},u._loadInitSegment=function(a){var _=this;this._doFragLoad(a).then(function(N){if(!N||_.fragContextChanged(a)||!_.levels)throw new Error("init load aborted");return N}).then(function(N){var F=_.hls,S=N.payload,U=a.decryptdata;if(S&&S.byteLength>0&&U&&U.key&&U.iv&&U.method==="AES-128"){var M=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(S),U.key.buffer,U.iv.buffer).then(function(E){var W=self.performance.now();return F.trigger(n.Events.FRAG_DECRYPTED,{frag:a,payload:E,stats:{tstart:M,tdecrypt:W}}),N.payload=E,N})}return N}).then(function(N){var F=_.fragCurrent,S=_.hls,U=_.levels;if(!U)throw new Error("init load aborted, missing levels");var M=U[a.level].details;console.assert(M,"Level details are defined when init segment is loaded");var E=a.stats;_.state=O.IDLE,_.fragLoadError=0,a.data=new Uint8Array(N.payload),E.parsing.start=E.buffering.start=self.performance.now(),E.parsing.end=E.buffering.end=self.performance.now(),N.frag===F&&S.trigger(n.Events.FRAG_BUFFERED,{stats:E,frag:F,part:null,id:a.type}),_.tick()}).catch(function(N){_.warn(N),_.resetFragmentLoading(a)})},u.fragContextChanged=function(a){var _=this.fragCurrent;return!a||!_||a.level!==_.level||a.sn!==_.sn||a.urlId!==_.urlId},u.fragBufferedComplete=function(a,_){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+a.type+" sn: "+a.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+a.level+" "+h.default.toString(z.BufferHelper.getBuffered(N))),this.state=O.IDLE,this.tick()},u._handleFragmentLoadComplete=function(a){var _=this.transmuxer;if(!_)return;var N=a.frag,F=a.part,S=a.partsLoaded,U=!S||S.length===0||S.some(function(E){return!E}),M=new y.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,F?F.index:-1,!U);_.flush(M)},u._handleFragmentLoadProgress=function(a){},u._doFragLoad=function(a,_,N,F){var S=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(a.start,N||0),this.config.lowLatencyMode&&_){var U=_.partList;if(U&&F){N>a.end&&_.fragmentHint&&(a=_.fragmentHint);var M=this.getNextPart(U,a,N);if(M>-1){var E=U[M];return this.log("Loading part sn: "+a.sn+" p: "+E.index+" cc: "+a.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+M+"-"+(U.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+a.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=E.start+E.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:a,part:U[M],targetBufferTime:N}),this.doFragPartsLoad(a,U,M,F).catch(function(W){return S.handleFragLoadError(W)})}else if(!a.url||this.loadedEndOfParts(U,N))return Promise.resolve(null)}}return this.log("Loading fragment "+a.sn+" cc: "+a.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+a.level+", target: "+parseFloat(N.toFixed(3))),Object(Y.isFiniteNumber)(a.sn)&&!this.bitrateTest&&(this.nextLoadPosition=a.start+a.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:a,targetBufferTime:N}),this.fragmentLoader.load(a,F).catch(function(W){return S.handleFragLoadError(W)})},u.doFragPartsLoad=function(a,_,N,F){var S=this;return new Promise(function(U,M){var E=[],W=function Z(ne){var ae=_[ne];S.fragmentLoader.loadPart(a,ae,F).then(function(we){E[ae.index]=we;var fe=we.part;S.hls.trigger(n.Events.FRAG_LOADED,we);var _e=_[ne+1];if(_e&&_e.fragment===a)Z(ne+1);else return U({frag:a,part:fe,partsLoaded:E})}).catch(M)};W(N)})},u.handleFragLoadError=function(a){var _=a.data;return _&&_.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(n.Events.ERROR,_),null},u._handleTransmuxerFlush=function(a){var _=this.getCurrentContext(a);if(!_||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var N=_.frag,F=_.part,S=_.level,U=self.performance.now();N.stats.parsing.end=U,F&&(F.stats.parsing.end=U),this.updateLevelTiming(N,F,S,a.partial)},u.getCurrentContext=function(a){var _=this.levels,N=a.level,F=a.sn,S=a.part;if(!_||!_[N])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+N+". The current chunk will not be buffered."),null;var U=_[N],M=S>-1?Object(d.getPartWith)(U,F,S):null,E=M?M.fragment:Object(d.getFragmentWithSN)(U,F,this.fragCurrent);return E?{frag:E,part:M,level:U}:null},u.bufferFragmentData=function(a,_,N,F){if(!a||this.state!==O.PARSING)return;var S=a.data1,U=a.data2,M=S;if(S&&U&&(M=Object(g.appendUint8Array)(S,U)),!M||!M.length)return;var E={type:a.type,frag:_,part:N,chunkMeta:F,parent:_.type,data:M};this.hls.trigger(n.Events.BUFFER_APPENDING,E),a.dropped&&a.independent&&!N&&this.flushBufferGap(_)},u.flushBufferGap=function(a){var _=this.media;if(!_)return;if(!z.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,a.start);return}var N=_.currentTime,F=z.BufferHelper.bufferInfo(_,N,0),S=a.duration,U=Math.min(this.config.maxFragLookUpTolerance*2,S*.25),M=Math.max(Math.min(a.start-U,F.end-U),N+U);a.start-M>U&&this.flushMainBuffer(M,a.start)},u.getFwdBufferInfo=function(a,_){var N=this.config,F=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(F))return null;var S=z.BufferHelper.bufferInfo(a,F,N.maxBufferHole);if(S.len===0&&S.nextStart!==void 0){var U=this.fragmentTracker.getBufferedFrag(F,_);if(U&&S.nextStart<U.end)return z.BufferHelper.bufferInfo(a,F,Math.max(S.nextStart,N.maxBufferHole))}return S},u.getMaxBufferLength=function(a){var _=this.config,N;return a?N=Math.max(8*_.maxBufferSize/a,_.maxBufferLength):N=_.maxBufferLength,Math.min(N,_.maxMaxBufferLength)},u.reduceMaxBufferLength=function(a){var _=this.config,N=a||_.maxBufferLength;return _.maxMaxBufferLength>=N?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(a,_){var N,F,S=_.fragments,U=S.length;if(!U)return null;var M=this.config,E=S[0].start,W;if(_.live){var Z=M.initialLiveManifestSize;if(U<Z)return this.warn("Not enough fragments to start playback (have: "+U+", need: "+Z+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(_,S),this.startPosition=W?this.hls.liveSyncPosition||W.start:a)}else a<=E&&(W=S[0]);if(!W){var ne=M.lowLatencyMode?_.partEnd:_.fragmentEnd;W=this.getFragmentAtPosition(a,ne,_)}return(N=W)!==null&&N!==void 0&&N.initSegment&&!((F=W)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},u.getNextPart=function(a,_,N){for(var F=-1,S=!1,U=!0,M=0,E=a.length;M<E;M++){var W=a[M];if(U=U&&!W.independent,F>-1&&N<W.start)break;var Z=W.loaded;!Z&&(S||W.independent||U)&&W.fragment===_&&(F=M),S=Z}return F},u.loadedEndOfParts=function(a,_){var N=a[a.length-1];return N&&_>N.start&&N.loaded},u.getInitialLiveFragment=function(a,_){var N=this.fragPrevious,F=null;if(N){if(a.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),F=Object(c.findFragmentByPDT)(_,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var S=N.sn+1;if(S>=a.startSN&&S<=a.endSN){var U=_[S-a.startSN];N.cc===U.cc&&(F=U,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(c.findFragWithCC)(_,N.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var M=this.hls.liveSyncPosition;M!==null&&(F=this.getFragmentAtPosition(M,this.bitrateTest?a.fragmentEnd:a.edge,a))}return F},u.getFragmentAtPosition=function(a,_,N){var F=this.config,S=this.fragPrevious,U=N.fragments,M=N.endSN,E=N.fragmentHint,W=F.maxFragLookUpTolerance,Z=!!(F.lowLatencyMode&&N.partList&&E);Z&&E&&!this.bitrateTest&&(U=U.concat(E),M=E.sn);var ne;if(a<_){var ae=a>_-W?0:W;ne=Object(c.findFragmentByPTS)(S,U,a,ae)}else ne=U[U.length-1];if(ne){var we=ne.sn-N.startSN,fe=S&&ne.level===S.level,_e=U[we+1],Se=this.fragmentTracker.getState(ne);if(Se===B.FragmentState.BACKTRACKED){ne=null;for(var ve=we;U[ve]&&this.fragmentTracker.getState(U[ve])===B.FragmentState.BACKTRACKED;)S?ne=U[ve--]:ne=U[--ve];ne||(ne=_e)}else S&&ne.sn===S.sn&&!Z&&(fe&&(ne.sn<M&&this.fragmentTracker.getState(_e)!==B.FragmentState.OK?(this.log("SN "+ne.sn+" just loaded, load next one: "+_e.sn),ne=_e):ne=null))}return ne},u.synchronizeToLiveEdge=function(a){var _=this.config,N=this.media;if(!N)return;var F=this.hls.liveSyncPosition,S=N.currentTime,U=a.fragments[0].start,M=a.edge,E=S>=U-_.maxFragLookUpTolerance&&S<=M;if(F!==null&&N.duration>F&&(S<F||!E)){var W=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*a.targetduration;(!E&&N.readyState<4||S<M-W)&&(this.loadedmetadata||(this.nextLoadPosition=F),N.readyState&&(this.warn("Playback: "+S.toFixed(3)+" is located too far from the end of live sliding playlist: "+M+", reset currentTime to : "+F.toFixed(3)),N.currentTime=F))}},u.alignPlaylists=function(a,_){var N=this.levels,F=this.levelLastLoaded,S=this.fragPrevious,U=F!==null?N[F]:null,M=a.fragments.length;if(!M)return this.warn("No fragments in live playlist"),0;var E=a.fragments[0].start,W=!_,Z=a.alignedSliding&&Object(Y.isFiniteNumber)(E);if(W||!Z&&!E){Object(m.alignStream)(S,U,a);var ne=a.fragments[0].start;return this.log("Live playlist sliding: "+ne.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+a.startSN+" prev-sn: "+(S?S.sn:"na")+" fragments: "+M),ne}return E},u.waitForCdnTuneIn=function(a){var _=3;return a.live&&a.canBlockReload&&a.tuneInGoal>Math.max(a.partHoldBack,a.partTarget*_)},u.setStartPosition=function(a,_){var N=this.startPosition;if(N<_&&(N=-1),N===-1||this.lastCurrentTime===-1){var F=a.startTimeOffset;Object(Y.isFiniteNumber)(F)?(N=_+F,F<0&&(N+=a.totalduration),N=Math.min(Math.max(_,N),_+a.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+N),this.startPosition=N):a.live?N=this.hls.liveSyncPosition||_:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},u.getLoadPosition=function(){var a=this.media,_=0;return this.loadedmetadata&&a?_=a.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},u.handleFragLoadAborted=function(a,_){this.transmuxer&&a.sn!=="initSegment"&&a.stats.aborted&&(this.warn("Fragment "+a.sn+(_?" part"+_.index:"")+" of level "+a.level+" was aborted"),this.resetFragmentLoading(a))},u.resetFragmentLoading=function(a){(!this.fragCurrent||!this.fragContextChanged(a))&&(this.state=O.IDLE)},u.onFragmentOrKeyLoadError=function(a,_){if(_.fatal)return;var N=_.frag;if(!N||N.type!==a)return;var F=this.fragCurrent;console.assert(F&&N.sn===F.sn&&N.level===F.level&&N.urlId===F.urlId,"Frag load error must match current frag to retry");var S=this.config;if(this.fragLoadError+1<=S.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var U=Math.min(Math.pow(2,this.fragLoadError)*S.fragLoadingRetryDelay,S.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+a+" "+N.level+" failed to load, retrying in "+U+"ms"),this.retryDate=self.performance.now()+U,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(a===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(G.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},u.afterBufferFlushed=function(a,_,N){if(!a)return;var F=z.BufferHelper.getBuffered(a);this.fragmentTracker.detectEvictedFragments(_,F,N),this.state===O.ENDED&&this.resetLoadingState()},u.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},u.resetLiveStartWhenNotLoaded=function(a){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[a].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},u.updateLevelTiming=function(a,_,N,F){var S=this,U=N.details;console.assert(!!U,"level.details must be defined");var M=Object.keys(a.elementaryStreams).reduce(function(E,W){var Z=a.elementaryStreams[W];if(Z){var ne=Z.endPTS-Z.startPTS;if(ne<=0)return S.warn("Could not parse fragment "+a.sn+" "+W+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),S.resetTransmuxer(),E||!1;var ae=F?0:Object(d.updateFragPTSDTS)(U,a,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return S.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:U,level:N,drift:ae,type:W,frag:a,start:Z.startPTS,end:Z.endPTS}),!0}return E},!1);M?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:a,part:_})):this.resetLoadingState()},u.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(b,[{key:"state",get:function(){return this._state},set:function(a){var _=this._state;_!==a&&(this._state=a,this.log(_+"->"+a))}}]),b}(j.default)},"./src/controller/buffer-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return c});var Y=k("./src/polyfills/number.ts"),j=k("./src/events.ts"),B=k("./src/utils/logger.ts"),z=k("./src/errors.ts"),G=k("./src/utils/buffer-helper.ts"),n=k("./src/utils/mediasource-helper.ts"),D=k("./src/loader/fragment.ts"),y=k("./src/controller/buffer-operation-queue.ts"),g=Object(n.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function d(l){var h=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=h.hls,s=h.media,R=h.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),s&&(h.updateMediaElementDuration(),o.trigger(j.Events.MEDIA_ATTACHED,{media:s})),R&&R.removeEventListener("sourceopen",h._onMediaSourceOpen),h.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var p=d.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null},p.registerListeners=function(){var h=this.hls;h.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(j.Events.BUFFER_RESET,this.onBufferReset,this),h.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(j.Events.BUFFER_EOS,this.onBufferEos,this),h.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(j.Events.FRAG_PARSED,this.onFragParsed,this),h.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var h=this.hls;h.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(j.Events.BUFFER_RESET,this.onBufferReset,this),h.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(j.Events.BUFFER_EOS,this.onBufferEos,this),h.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(j.Events.FRAG_PARSED,this.onFragParsed,this),h.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},p.onManifestParsed=function(h,o){var s=2;(o.audio&&!o.video||!o.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(h,o){var s=this.media=o.media;if(s&&g){var R=this.mediaSource=new g;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(R),this._objectUrl=s.src}},p.onMediaDetaching=function(){var h=this.media,o=this.mediaSource,s=this._objectUrl;if(o){if(B.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(R){B.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(s&&self.URL.revokeObjectURL(s),h.src===s?(h.removeAttribute("src"),h.load()):B.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(j.Events.MEDIA_DETACHED,void 0)},p.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(o){var s=h.sourceBuffer[o];try{s&&(h.removeBufferListeners(o),h.mediaSource&&h.mediaSource.removeSourceBuffer(s),h.sourceBuffer[o]=void 0)}catch(R){B.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",R)}}),this._initSourceBuffer()},p.onBufferCodecs=function(h,o){var s=this,R=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(x){if(R){var C=s.tracks[x];if(C&&typeof C.buffer.changeType=="function"){var L=o[x],O=L.codec,A=L.levelCodec,w=L.container,b=(C.levelCodec||C.codec).replace(m,"$1"),u=(A||O).replace(m,"$1");if(b!==u){var v=w+";codecs="+(A||O);s.appendChangeType(x,v)}}}else s.pendingTracks[x]=o[x]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},p.appendChangeType=function(h,o){var s=this,R=this.operationQueue,x={execute:function(){var L=s.sourceBuffer[h];L&&(B.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+o),L.changeType(o)),R.shiftAndExecuteNext(h)},onStart:function(){},onComplete:function(){},onError:function(L){B.logger.warn("[buffer-controller]: Failed to change "+h+" SourceBuffer type",L)}};R.append(x,h)},p.onBufferAppending=function(h,o){var s=this,R=this.hls,x=this.operationQueue,C=this.tracks,L=o.data,O=o.type,A=o.frag,w=o.part,b=o.chunkMeta,u=b.buffering[O],v=self.performance.now();u.start=v;var a=A.stats.buffering,_=w?w.stats.buffering:null;a.start===0&&(a.start=v),_&&_.start===0&&(_.start=v);var N=C.audio,F=O==="audio"&&b.id===1&&(N==null?void 0:N.container)==="audio/mpeg",S={execute:function(){if(u.executeStart=self.performance.now(),F){var M=s.sourceBuffer[O];if(M){var E=A.start-M.timestampOffset;Math.abs(E)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+A.start+" (delta: "+E+") sn: "+A.sn+")"),M.timestampOffset=A.start)}}s.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var M=self.performance.now();u.executeEnd=u.end=M,a.first===0&&(a.first=M),_&&_.first===0&&(_.first=M);var E=s.sourceBuffer,W={};for(var Z in E)W[Z]=G.BufferHelper.getBuffered(E[Z]);s.appendError=0,s.hls.trigger(j.Events.BUFFER_APPENDED,{type:O,frag:A,part:w,chunkMeta:b,parent:A.type,timeRanges:W})},onError:function(M){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",M);var E={type:z.ErrorTypes.MEDIA_ERROR,parent:A.type,details:z.ErrorDetails.BUFFER_APPEND_ERROR,err:M,fatal:!1};M.code===DOMException.QUOTA_EXCEEDED_ERR?E.details=z.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,E.details=z.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>R.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),E.fatal=!0)),R.trigger(j.Events.ERROR,E)}};x.append(S,O)},p.onBufferFlushing=function(h,o){var s=this,R=this.operationQueue,x=function(L){return{execute:s.removeExecutor.bind(s,L,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(j.Events.BUFFER_FLUSHED,{type:L})},onError:function(A){B.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",A)}}};o.type?R.append(x(o.type),o.type):this.getSourceBufferTypes().forEach(function(C){R.append(x(C),C)})},p.onFragParsed=function(h,o){var s=this,R=o.frag,x=o.part,C=[],L=x?x.elementaryStreams:R.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?C.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&C.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&C.push("video"));var O=function(){var w=self.performance.now();R.stats.buffering.end=w,x&&(x.stats.buffering.end=w);var b=x?x.stats:R.stats;s.hls.trigger(j.Events.FRAG_BUFFERED,{frag:R,part:x,stats:b,id:R.type})};C.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(O,C)},p.onFragChanged=function(h,o){this.flushBackBuffer()},p.onBufferEos=function(h,o){var s=this,R=this.getSourceBufferTypes().reduce(function(x,C){var L=s.sourceBuffer[C];return(!o.type||o.type===C)&&(L&&!L.ended&&(L.ended=!0,B.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),x&&!!(!L||L.ended)},!0);R&&this.blockBuffers(function(){var x=s.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},p.onLevelUpdated=function(h,o){var s=o.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},p.flushBackBuffer=function(){var h=this.hls,o=this.details,s=this.media,R=this.sourceBuffer;if(!s||o===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var C=o.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object(Y.isFiniteNumber)(C)||C<0)return;var L=s.currentTime,O=o.levelTargetDuration,A=Math.max(C,O),w=Math.floor(L/O)*O-A;x.forEach(function(b){var u=R[b];if(u){var v=G.BufferHelper.getBuffered(u);v.length>0&&w>v.start(0)&&(h.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:w}),o.live&&h.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:w}),h.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:w,type:b}))}})},p.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,o=this.hls,s=this.media,R=this.mediaSource,x=h.fragments[0].start+h.totalduration,C=s.duration,L=Object(Y.isFiniteNumber)(R.duration)?R.duration:0;h.live&&o.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(h)):(x>L&&x>C||!Object(Y.isFiniteNumber)(C))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),R.duration=x)},p.updateSeekableRange=function(h){var o=this.mediaSource,s=h.fragments,R=s.length;if(R&&h.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var x=Math.max(0,s[0].start),C=Math.max(x,x+h.totalduration);o.setLiveSeekableRange(x,C)}},p.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,o=this.operationQueue,s=this.pendingTracks,R=Object.keys(s).length;if(R&&!h||R===2){this.createSourceBuffers(s),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(C){o.executeNext(C)})}},p.createSourceBuffers=function(h){var o=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var x in h)if(!o[x]){var C=h[x];if(!C)throw Error("source buffer exists for track "+x+", however track does not");var L=C.levelCodec||C.codec,O=C.container+";codecs="+L;B.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var A=o[x]=s.addSourceBuffer(O),w=x;this.addBufferListener(w,"updatestart",this._onSBUpdateStart),this.addBufferListener(w,"updateend",this._onSBUpdateEnd),this.addBufferListener(w,"error",this._onSBUpdateError),this.tracks[x]={buffer:A,codec:L,container:C.container,levelCodec:C.levelCodec,id:C.id},R++}catch(b){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+b.message),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:b,mimeType:O})}}R&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(h){var o=this.operationQueue,s=o.current(h);s.onStart()},p._onSBUpdateEnd=function(h){var o=this.operationQueue,s=o.current(h);s.onComplete(),o.shiftAndExecuteNext(h)},p._onSBUpdateError=function(h,o){B.logger.error("[buffer-controller]: "+h+" SourceBuffer error",o),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(h);s&&s.onError(o)},p.removeExecutor=function(h,o,s){var R=this.media,x=this.mediaSource,C=this.operationQueue,L=this.sourceBuffer,O=L[h];if(!R||!x||!O){B.logger.warn("[buffer-controller]: Attempting to remove from the "+h+" SourceBuffer, but it does not exist"),C.shiftAndExecuteNext(h);return}var A=Object(Y.isFiniteNumber)(R.duration)?R.duration:Infinity,w=Object(Y.isFiniteNumber)(x.duration)?x.duration:Infinity,b=Math.max(0,o),u=Math.min(s,A,w);u>b?(B.logger.log("[buffer-controller]: Removing ["+b+","+u+"] from the "+h+" SourceBuffer"),console.assert(!O.updating,h+" sourceBuffer must not be updating"),O.remove(b,u)):C.shiftAndExecuteNext(h)},p.appendExecutor=function(h,o){var s=this.operationQueue,R=this.sourceBuffer,x=R[o];if(!x){B.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(o);return}x.ended=!1,console.assert(!x.updating,o+" sourceBuffer must not be updating"),x.appendBuffer(h)},p.blockBuffers=function(h,o){var s=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var R=this.operationQueue,x=o.map(function(C){return R.appendBlocker(C)});Promise.all(x).then(function(){h(),o.forEach(function(C){var L=s.sourceBuffer[C];(!L||!L.updating)&&R.shiftAndExecuteNext(C)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(h,o,s){var R=this.sourceBuffer[h];if(!R)return;var x=s.bind(this,h);this.listeners[h].push({event:o,listener:x}),R.addEventListener(o,x)},p.removeBufferListeners=function(h){var o=this.sourceBuffer[h];if(!o)return;this.listeners[h].forEach(function(s){o.removeEventListener(s.event,s.listener)})},d}()},"./src/controller/buffer-operation-queue.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return j});var Y=k("./src/utils/logger.ts"),j=function(){function B(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var z=B.prototype;return z.append=function(n,D){var y=this.queues[D];y.push(n),y.length===1&&this.buffers[D]&&this.executeNext(D)},z.insertAbort=function(n,D){var y=this.queues[D];y.unshift(n),this.executeNext(D)},z.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},z.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(d){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(d),(!g||!g.updating)&&(m.shift(),this.executeNext(n))}}},z.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},z.current=function(n){return this.queues[n][0]},B}()},"./src/controller/cap-level-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/events.ts");function j(G,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(G,y.key,y)}}function B(G,n,D){return n&&j(G.prototype,n),D&&j(G,D),G}var z=function(){function G(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=G.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(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var y=this.hls;y.off(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(y,g){G.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(d,p){return G.isLevelAllowed(p,g.restrictedLevels)&&p<=y});return this.clientRect=null,G.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},G.isLevelAllowed=function(y,g){return g===void 0&&(g=[]),g.indexOf(y)===-1},G.getMaxLevelByMediaSize=function(y,g,m){if(!y||!y.length)return-1;for(var c=function(o,s){return s?o.width!==s.width||o.height!==s.height:!0},d=y.length-1,p=0;p<y.length;p+=1){var l=y[p];if((l.width>=g||l.height>=m)&&c(l,y[p+1])){d=p;break}}return d},B(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(g){}return y}}]),G}();J.default=z},"./src/controller/cmcd-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return c});var Y=k("./src/events.ts"),j=k("./src/types/cmcd.ts"),B=k("./src/utils/buffer-helper.ts"),z=k("./src/utils/logger.ts");function G(d,p){for(var l=0;l<p.length;l++){var h=p[l];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function n(d,p,l){return p&&G(d.prototype,p),l&&G(d,l),d}function D(d,p){var l=typeof Symbol!="undefined"&&d[Symbol.iterator]||d["@@iterator"];if(l)return(l=l.call(d)).next.bind(l);if(Array.isArray(d)||(l=y(d))||p&&d&&typeof d.length=="number"){l&&(d=l);var h=0;return function(){return h>=d.length?{done:!0}:{done:!1,value:d[h++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(d,p){if(!d)return;if(typeof d=="string")return g(d,p);var l=Object.prototype.toString.call(d).slice(8,-1);if(l==="Object"&&d.constructor&&(l=d.constructor.name),l==="Map"||l==="Set")return Array.from(d);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return g(d,p)}function g(d,p){(p==null||p>d.length)&&(p=d.length);for(var l=0,h=new Array(p);l<p;l++)h[l]=d[l];return h}function m(){return m=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(d[h]=l[h])}return d},m.apply(this,arguments)}var c=function(){function d(l){var h=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(){h.initialized&&(h.starved=!0),h.buffering=!0},this.onPlaying=function(){h.initialized||(h.initialized=!0),h.buffering=!1},this.applyPlaylistData=function(R){try{h.apply(R,{ot:j.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(x){z.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(R){try{var x=R.frag,C=h.hls.levels[x.level],L=h.getObjectType(x),O={d:x.duration*1e3,ot:L};(L===j.CMCDObjectType.VIDEO||L===j.CMCDObjectType.AUDIO||L==j.CMCDObjectType.MUXED)&&(O.br=C.bitrate/1e3,O.tb=h.getTopBandwidth(L),O.bl=h.getBufferLength(L)),h.apply(R,O)}catch(A){z.logger.warn("Could not generate segment CMCD data.",A)}},this.hls=l;var o=this.config=l.config,s=o.cmcd;s!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||d.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var p=d.prototype;return p.registerListeners=function(){var h=this.hls;h.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this)},p.unregisterListeners=function(){var h=this.hls;h.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.off(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},p.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},p.onMediaAttached=function(h,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},p.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},p.onBufferCreated=function(h,o){var s,R;this.audioBuffer=(s=o.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(R=o.tracks.video)===null||R===void 0?void 0:R.buffer},p.createData=function(){var h;return{v:j.CMCDVersion,sf:j.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(h=this.media)===null||h===void 0?void 0:h.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},p.apply=function(h,o){o===void 0&&(o={}),m(o,this.createData());var s=o.ot===j.CMCDObjectType.INIT||o.ot===j.CMCDObjectType.VIDEO||o.ot===j.CMCDObjectType.MUXED;if(this.starved&&s&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var R=d.toHeaders(o);if(!Object.keys(R).length)return;h.headers||(h.headers={}),m(h.headers,R)}else{var x=d.toQuery(o);if(!x)return;h.url=d.appendQueryToUri(h.url,x)}},p.getObjectType=function(h){var o=h.type;return o==="subtitle"?j.CMCDObjectType.TIMED_TEXT:h.sn==="initSegment"?j.CMCDObjectType.INIT:o==="audio"?j.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},p.getTopBandwidth=function(h){for(var o=0,s=h===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=D(s),x;!(x=R()).done;){var C=x.value;C.bitrate>o&&(o=C.bitrate)}return o>0?o:NaN},p.getBufferLength=function(h){var o=this.hls.media,s=h===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!o)return NaN;var R=B.BufferHelper.bufferInfo(s,o.currentTime,this.config.maxBufferHole);return R.len*1e3},p.createPlaylistLoader=function(){var h=this.config.pLoader,o=this.applyPlaylistData,s=h||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new s(C)}var x=R.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(L,O,A){o(L),this.loader.load(L,O,A)},n(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},p.createFragmentLoader=function(){var h=this.config.fLoader,o=this.applyFragmentData,s=h||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new s(C)}var x=R.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(L,O,A){o(L),this.loader.load(L,O,A)},n(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},d.uuid=function(){var h=URL.createObjectURL(new Blob),o=h.toString();return URL.revokeObjectURL(h),o.substr(o.lastIndexOf("/")+1)},d.serialize=function(h){for(var o=[],s=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},R=function(F){return Math.round(F)},x=function(F){return R(F/100)*100},C=function(F){return encodeURIComponent(F)},L={br:R,d:R,bl:x,dl:x,mtp:x,nor:C,rtp:x,tb:R},O=Object.keys(h||{}).sort(),A=D(O),w;!(w=A()).done;){var b=w.value,u=h[b];if(!s(u))continue;if(b==="v"&&u===1)continue;if(b=="pr"&&u===1)continue;var v=L[b];v&&(u=v(u));var a=typeof u,_=void 0;b==="ot"||b==="sf"||b==="st"?_=b+"="+u:a==="boolean"?_=b:a==="number"?_=b+"="+u:_=b+"="+JSON.stringify(u),o.push(_)}return o.join(",")},d.toHeaders=function(h){for(var o=Object.keys(h),s={},R=["Object","Request","Session","Status"],x=[{},{},{},{}],C={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},L=0,O=o;L<O.length;L++){var A=O[L],w=C[A]!=null?C[A]:1;x[w][A]=h[A]}for(var b=0;b<x.length;b++){var u=d.serialize(x[b]);u&&(s["CMCD-"+R[b]]=u)}return s},d.toQuery=function(h){return"CMCD="+encodeURIComponent(d.serialize(h))},d.appendQueryToUri=function(h,o){if(!o)return h;var s=h.includes("?")?"&":"?";return""+h+s+o},d}()},"./src/controller/eme-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/events.ts"),j=k("./src/errors.ts"),B=k("./src/utils/logger.ts"),z=k("./src/utils/mediakeys-helper.ts");function G(c,d){for(var p=0;p<d.length;p++){var l=d[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,d,p){return d&&G(c.prototype,d),p&&G(c,p),c}var D=3,y=function(d,p,l){var h={audioCapabilities:[],videoCapabilities:[]};return d.forEach(function(o){h.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:l.audioRobustness||""})}),p.forEach(function(o){h.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:l.videoRobustness||""})}),[h]},g=function(d,p,l,h){switch(d){case z.KeySystems.WIDEVINE:return y(p,l,h);default:throw new Error("Unknown key-system: "+d)}},m=function(){function c(p){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=p,this._config=p.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 d=c.prototype;return d.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},d._registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},d._unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},d.getLicenseServerUrl=function(l){switch(l){case z.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},d._attemptKeySystemAccess=function(l,h,o){var s=this,R=g(l,h,o,this._drmSystemOptions);B.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(l,R);this.mediaKeysPromise=x.then(function(C){return s._onMediaKeySystemAccessObtained(l,C)}),x.catch(function(C){B.logger.error('Failed to obtain key-system "'+l+'" access:',C)})},d._onMediaKeySystemAccessObtained=function(l,h){var o=this;B.logger.log('Access for key-system "'+l+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:h,mediaKeySystemDomain:l};this._mediaKeysList.push(s);var R=Promise.resolve().then(function(){return h.createMediaKeys()}).then(function(x){return s.mediaKeys=x,B.logger.log('Media-keys created for key-system "'+l+'"'),o._onMediaKeysCreated(),x});return R.catch(function(x){B.logger.error("Failed to create media-keys:",x)}),R},d._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(h){h.mediaKeysSession||(h.mediaKeysSession=h.mediaKeys.createSession(),l._onNewMediaKeySession(h.mediaKeysSession))})},d._onNewMediaKeySession=function(l){var h=this;B.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(o){h._onKeySessionMessage(l,o.message)},!1)},d._onKeySessionMessage=function(l,h){B.logger.log("Got EME message event, creating license request"),this._requestLicense(h,function(o){B.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),l.update(o)})},d.onMediaEncrypted=function(l){var h=this;if(B.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(R){if(!h._media)return;h._attemptSetMediaKeys(R),h._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(o).catch(o)},d._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var h=this._mediaKeysList[0];if(!h||!h.mediaKeys){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}B.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(h.mediaKeys),this._hasSetMediaKeys=!0}},d._generateRequestWithPreferredKeySession=function(l,h){var o=this,s=this._mediaKeysList[0];if(!s){B.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){B.logger.warn("Key-Session already initialized but requested again");return}var R=s.mediaKeysSession;if(!R){B.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!h){B.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}B.logger.log('Generating key-session request for "'+l+'" init data type'),s.mediaKeysSessionInitialized=!0,R.generateRequest(l,h).then(function(){B.logger.debug("Key-session generation succeeded")}).catch(function(x){B.logger.error("Error generating key-session request:",x),o.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},d._createLicenseXhr=function(l,h,o){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,l,h,o);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,s,l),R=void 0}catch(x){B.logger.error(x)}try{s.readyState||s.open("POST",l,!0),R&&R.call(this.hls,s,l)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return s},d._onLicenseRequestReadyStageChange=function(l,h,o,s){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,B.logger.log("License request succeeded");var R=l.response,x=this._licenseResponseCallback;if(x)try{R=x.call(this.hls,l,h)}catch(L){B.logger.error(L)}s(R)}else{if(B.logger.error("License Request XHR failed ("+h+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var C=D-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(o,s)}break}},d._generateLicenseRequestChallenge=function(l,h){switch(l.mediaKeySystemDomain){case z.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},d._requestLicense=function(l,h){B.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(o.mediaKeySystemDomain),R=this._createLicenseXhr(s,l,h);B.logger.log("Sending license request to URL: "+s);var x=this._generateLicenseRequestChallenge(o,l);R.send(x)}catch(C){B.logger.error("Failure requesting DRM license: "+C),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},d.onMediaAttached=function(l,h){if(!this._emeEnabled)return;var o=h.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},d.onMediaDetached=function(){var l=this._media,h=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},d.onManifestParsed=function(l,h){if(!this._emeEnabled)return;var o=h.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),s=h.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(z.KeySystems.WIDEVINE,o,s)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();J.default=m},"./src/controller/fps-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/events.ts"),j=k("./src/utils/logger.ts"),B=function(){function z(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 G=z.prototype;return G.setStreamController=function(D){this.streamController=D},G.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.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)}},G.checkFPS=function(D,y,g){var m=performance.now();if(y){if(this.lastTime){var c=m-this.lastTime,d=g-this.lastDroppedFrames,p=y-this.lastDecodedFrames,l=1e3*d/c,h=this.hls;if(h.trigger(Y.Events.FPS_DROP,{currentDropped:d,currentDecoded:p,totalDroppedFrames:g}),l>0&&d>h.config.fpsDroppedMonitoringThreshold*p){var o=h.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=o)&&(o=o-1,h.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:h.currentLevel}),h.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=g,this.lastDecodedFrames=y}},G.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)},z}();J.default=B},"./src/controller/fragment-finders.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"findFragmentByPDT",function(){return B}),k.d(J,"findFragmentByPTS",function(){return z}),k.d(J,"fragmentWithinToleranceTest",function(){return G}),k.d(J,"pdtWithinToleranceTest",function(){return n}),k.d(J,"findFragWithCC",function(){return D});var Y=k("./src/polyfills/number.ts"),j=k("./src/utils/binary-search.ts");function B(y,g,m){if(g===null||!Array.isArray(y)||!y.length||!Object(Y.isFiniteNumber)(g))return null;var c=y[0].programDateTime;if(g<(c||0))return null;var d=y[y.length-1].endProgramDateTime;if(g>=(d||0))return null;m=m||0;for(var p=0;p<y.length;++p){var l=y[p];if(n(g,m,l))return l}return null}function z(y,g,m,c){m===void 0&&(m=0),c===void 0&&(c=0);var d=null;if(y?d=g[y.sn-g[0].sn+1]||null:m===0&&g[0].start===0&&(d=g[0]),d&&G(m,c,d)===0)return d;var p=j.default.search(g,G.bind(null,m,c));return p||d}function G(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,d=m.endProgramDateTime||0;return d-c>y}function D(y,g){return j.default.search(y,function(m){return m.cc<g?1:m.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"FragmentState",function(){return B}),k.d(J,"FragmentTracker",function(){return z});var Y=k("./src/events.ts"),j=k("./src/types/loader.ts"),B;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(B||(B={}));var z=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(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var m=this.hls;m.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(m,c){if(c===j.PlaylistLevelType.MAIN){var d=this.activeFragment,p=this.activeParts;if(!d)return null;if(p)for(var l=p.length;l--;){var h=p[l],o=h?h.end:d.appendedPTS;if(h.start<=m&&o!==void 0&&m<=o)return l>9&&(this.activeParts=p.slice(l-9)),h}else if(d.start<=m&&d.appendedPTS!==void 0&&m<=d.appendedPTS)return d}return this.getBufferedFrag(m,c)},y.getBufferedFrag=function(m,c){for(var d=this.fragments,p=Object.keys(d),l=p.length;l--;){var h=d[p[l]];if((h==null?void 0:h.body.type)===c&&h.buffered){var o=h.body;if(o.start<=m&&m<=o.end)return o}}return null},y.detectEvictedFragments=function(m,c,d){var p=this;Object.keys(this.fragments).forEach(function(l){var h=p.fragments[l];if(!h)return;if(!h.buffered){h.body.type===d&&p.removeFragment(h.body);return}var o=h.range[m];if(!o)return;o.time.some(function(s){var R=!p.isTimeBuffered(s.startPTS,s.endPTS,c);return R&&p.removeFragment(h.body),R})})},y.detectPartialFragments=function(m){var c=this,d=this.timeRanges,p=m.frag,l=m.part;if(!d||p.sn==="initSegment")return;var h=n(p),o=this.fragments[h];if(!o)return;Object.keys(d).forEach(function(s){var R=p.elementaryStreams[s];if(!R)return;var x=d[s],C=l!==null||R.partial===!0;o.range[s]=c.getBufferedTimes(p,l,C,x)}),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),d=this.fragments[c];d&&(d.backtrack=d.loaded=null,d.buffered=!0)},y.getBufferedTimes=function(m,c,d,p){for(var l={time:[],partial:d},h=c?c.start:m.start,o=c?c.end:m.end,s=m.minEndPTS||o,R=m.maxStartPTS||h,x=0;x<p.length;x++){var C=p.start(x)-this.bufferPadding,L=p.end(x)+this.bufferPadding;if(R>=C&&s<=L){l.time.push({startPTS:Math.max(h,p.start(x)),endPTS:Math.min(o,p.end(x))});break}else if(h<L&&o>C)l.partial=!0,l.time.push({startPTS:Math.max(h,p.start(x)),endPTS:Math.min(o,p.end(x))});else if(o<=C)break}return l},y.getPartialFragment=function(m){var c=null,d,p,l,h=0,o=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(R){var x=s[R];if(!x)return;G(x)&&(p=x.body.start-o,l=x.body.end+o,m>=p&&m<=l&&(d=Math.min(m-p,l-m),h<=d&&(c=x.body,h=d)))}),c},y.getState=function(m){var c=n(m),d=this.fragments[c];return d?d.buffered?G(d)?B.PARTIAL:B.OK:d.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},y.backtrack=function(m,c){var d=n(m),p=this.fragments[d];if(!p||p.backtrack)return null;var l=p.backtrack=c||p.loaded;return p.loaded=null,l},y.getBacktrackData=function(m){var c=n(m),d=this.fragments[c];if(d){var p,l=d.backtrack;if(l!=null&&(p=l.payload)!==null&&p!==void 0&&p.byteLength)return l;this.removeFragment(m)}return null},y.isTimeBuffered=function(m,c,d){for(var p,l,h=0;h<d.length;h++){if(p=d.start(h)-this.bufferPadding,l=d.end(h)+this.bufferPadding,m>=p&&c<=l)return!0;if(c<=p)return!1}return!1},y.onFragLoaded=function(m,c){var d=c.frag,p=c.part;if(d.sn==="initSegment"||d.bitrateTest||p)return;var l=n(d);this.fragments[l]={body:d,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(m,c){var d=this,p=c.frag,l=c.part,h=c.timeRanges;if(p.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=p,l){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(l)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(s){var R=h[s];if(d.detectEvictedFragments(s,R),!l)for(var x=0;x<R.length;x++)p.appendedPTS=Math.max(R.end(x),p.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,d){var p=this;Object.keys(this.fragments).forEach(function(l){var h=p.fragments[l];if(!h)return;if(h.buffered){var o=h.body;o.type===d&&o.start<c&&o.end>m&&p.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 G(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(ie,J,k){"use strict";k.r(J),k.d(J,"STALL_MINIMUM_DURATION_MS",function(){return G}),k.d(J,"MAX_START_GAP_JUMP",function(){return n}),k.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),k.d(J,"SKIP_BUFFER_RANGE_START",function(){return y}),k.d(J,"default",function(){return g});var Y=k("./src/utils/buffer-helper.ts"),j=k("./src/errors.ts"),B=k("./src/events.ts"),z=k("./src/utils/logger.ts"),G=250,n=2,D=.1,y=.05,g=function(){function m(d,p,l,h){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=d,this.media=p,this.fragmentTracker=l,this.hls=h}var c=m.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(p){var l=this.config,h=this.media,o=this.stalled,s=h.currentTime,R=h.seeking,x=this.seeking&&!R,C=!this.seeking&&R;if(this.seeking=R,s!==p){if(this.moved=!0,o!==null){if(this.stallReported){var L=self.performance.now()-o;z.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||x)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!Y.BufferHelper.getBuffered(h).length)return;var O=Y.BufferHelper.bufferInfo(h,s,0),A=O.len>0,w=O.nextStart||0;if(!A&&!w)return;if(R){var b=O.len>n,u=!w||w-s>n&&!this.fragmentTracker.getPartialFragment(s);if(b||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,a=Math.max(w,O.start||0)-s,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=_==null||((v=_.details)===null||v===void 0)?void 0:v.live,F=N?_.details.targetduration*2:n;if(a>0&&a<=F){this._trySkipBufferHole(null);return}}var S=self.performance.now();if(o===null){this.stalled=S;return}var U=S-o;!R&&U>=G&&this._reportStall(O.len);var M=Y.BufferHelper.bufferInfo(h,s,l.maxBufferHole);this._tryFixBufferStall(M,U)},c._tryFixBufferStall=function(p,l){var h=this.config,o=this.fragmentTracker,s=this.media,R=s.currentTime,x=o.getPartialFragment(R);if(x){var C=this._trySkipBufferHole(x);if(C)return}p.len>h.maxBufferHole&&l>h.highBufferWatchdogPeriod*1e3&&(z.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(p){var l=this.hls,h=this.media,o=this.stallReported;o||(this.stallReported=!0,z.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+p+")"),l.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},c._trySkipBufferHole=function(p){for(var l=this.config,h=this.hls,o=this.media,s=o.currentTime,R=0,x=Y.BufferHelper.getBuffered(o),C=0;C<x.length;C++){var L=x.start(C);if(s+l.maxBufferHole>=R&&s<L){var O=Math.max(L+y,o.currentTime+D);return z.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+O),this.moved=!0,this.stalled=null,o.currentTime=O,p&&h.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+O,frag:p}),O}R=x.end(C)}return 0},c._tryNudgeBuffer=function(){var p=this.config,l=this.hls,h=this.media,o=h.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<p.nudgeMaxRetry){var R=o+s*p.nudgeOffset;z.logger.warn("Nudging 'currentTime' from "+o+" to "+R),h.currentTime=R,l.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else z.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+p.nudgeMaxRetry+" nudges"),l.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/events.ts"),j=k("./src/utils/texttrack-utils.ts"),B=k("./src/demux/id3.ts"),z=.25,G=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(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var g=this.hls;g.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(g,m){this.media=m.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.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(j.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(g,m){if(!this.media)return;var c=m.frag,d=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var p=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<d.length;l++){var h=B.getID3Frames(d[l].data);if(h){var o=d[l].pts,s=l<d.length-1?d[l+1].pts:c.end,R=s-o;R<=0&&(s=o+z);for(var x=0;x<h.length;x++){var C=h[x];if(!B.isTimeStampFrame(C)){var L=new p(o,s,"");L.value=C,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(g,m){var c=m.startOffset,d=m.endOffset,p=m.type;if(!p||p==="audio"){var l=this.id3Track;l&&Object(j.removeCuesInRange)(l,c,d)}},n}();J.default=G},"./src/controller/latency-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return n});var Y=k("./src/errors.ts"),j=k("./src/events.ts"),B=k("./src/utils/logger.ts");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 G(D,y,g){return y&&z(D.prototype,y),g&&z(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(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(j.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(j.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(j.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 d=c.details;this.levelDetails=d,d.advanced&&this.timeupdate(),!d.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(m,c){if(c.details!==Y.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,B.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 d=this.computeLatency();if(d===null)return;this._latency=d;var p=this.config,l=p.lowLatencyMode,h=p.maxLiveSyncPlaybackRate;if(!l||h===1)return;var o=this.targetLatency;if(o===null)return;var s=d-o,R=Math.min(this.maxLatency,o+c.targetduration),x=s<R;if(c.live&&x&&s>.05&&this.forwardBufferLength>1){var C=Math.min(2,Math.max(1,h)),L=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;m.playbackRate=Math.min(C,Math.max(1,L))}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},G(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,d=m.partHoldBack,p=m.targetduration,l=this.config,h=l.liveSyncDuration,o=l.liveSyncDurationCount,s=l.lowLatencyMode,R=this.hls.userConfig,x=s&&d||c;(R.liveSyncDuration||R.liveSyncDurationCount||x===0)&&(x=h!==void 0?h:o*p);var C=p,L=1;return x+Math.min(this.stallCount*L,C)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),c=this.targetLatency,d=this.levelDetails;if(m===null||c===null||d===null)return null;var p=d.edge,l=m-c-this.edgeStalled,h=p-d.totalduration,o=p-(this.config.lowLatencyMode&&d.partTarget||d.targetduration);return Math.min(Math.max(h,l),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 d=m.buffered.length;return d?m.buffered.end(d-1):c.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return l});var Y=k("./src/types/level.ts"),j=k("./src/events.ts"),B=k("./src/errors.ts"),z=k("./src/utils/codecs.ts"),G=k("./src/controller/level-helper.ts"),n=k("./src/controller/base-playlist-controller.ts"),D=k("./src/types/loader.ts");function y(){return y=Object.assign||function(h){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var R in s)Object.prototype.hasOwnProperty.call(s,R)&&(h[R]=s[R])}return h},y.apply(this,arguments)}function g(h,o){for(var s=0;s<o.length;s++){var R=o[s];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(h,R.key,R)}}function m(h,o,s){return o&&g(h.prototype,o),s&&g(h,s),h}function c(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,d(h,o)}function d(h,o){return d=Object.setPrototypeOf||function(R,x){return R.__proto__=x,R},d(h,o)}var p=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(h){c(o,h);function o(R){var x;return x=h.call(this,R,"[level-controller]")||this,x._levels=[],x._firstLevel=-1,x._startLevel=void 0,x.currentLevelIndex=-1,x.manualLevelIndex=-1,x.onParsedComplete=void 0,x._registerListeners(),x}var s=o.prototype;return s._registerListeners=function(){var x=this.hls;x.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),x.on(j.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var x=this.hls;x.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(j.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},s.startLoad=function(){var x=this._levels;x.forEach(function(C){C.loadError=0}),h.prototype.startLoad.call(this)},s.onManifestLoaded=function(x,C){var L=[],O=[],A=[],w,b={},u,v=!1,a=!1,_=!1;if(C.levels.forEach(function(U){var M=U.attrs;v=v||!!(U.width&&U.height),a=a||!!U.videoCodec,_=_||!!U.audioCodec,p&&U.audioCodec&&U.audioCodec.indexOf("mp4a.40.34")!==-1&&(U.audioCodec=void 0);var E=U.bitrate+"-"+U.attrs.RESOLUTION+"-"+U.attrs.CODECS;u=b[E],u?u.url.push(U.url):(u=new Y.Level(U),b[E]=u,L.push(u)),M&&(M.AUDIO&&Object(G.addGroupId)(u,"audio",M.AUDIO),M.SUBTITLES&&Object(G.addGroupId)(u,"text",M.SUBTITLES))}),(v||a)&&_&&(L=L.filter(function(U){var M=U.videoCodec,E=U.width,W=U.height;return!!M||!!(E&&W)})),L=L.filter(function(U){var M=U.audioCodec,E=U.videoCodec;return(!M||Object(z.isCodecSupportedInMp4)(M,"audio"))&&(!E||Object(z.isCodecSupportedInMp4)(E,"video"))}),C.audioTracks&&(O=C.audioTracks.filter(function(U){return!U.audioCodec||Object(z.isCodecSupportedInMp4)(U.audioCodec,"audio")}),Object(G.assignTrackIdsByGroup)(O)),C.subtitles&&(A=C.subtitles,Object(G.assignTrackIdsByGroup)(A)),L.length>0){w=L[0].bitrate,L.sort(function(U,M){return U.bitrate-M.bitrate}),this._levels=L;for(var N=0;N<L.length;N++)if(L[N].bitrate===w){this._firstLevel=N,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+w);break}var F=_&&!a,S={levels:L,audioTracks:O,subtitleTracks:A,firstLevel:this._firstLevel,stats:C.stats,audio:_,video:a,altAudio:!F&&O.some(function(U){return!!U.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,S),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:C.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(x,C){if(h.prototype.onError.call(this,x,C),C.fatal)return;var L=C.context,O=this._levels[this.currentLevelIndex];if(L&&(L.type===D.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&L.groupId===O.audioGroupIds[O.urlId]||L.type===D.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&L.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var A=!1,w=!0,b;switch(C.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:case B.ErrorDetails.KEY_LOAD_ERROR:case B.ErrorDetails.KEY_LOAD_TIMEOUT:if(C.frag){var u=this._levels[C.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(b=C.frag.level)):b=C.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(w=!1),b=L.level),A=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:b=C.level,A=!0;break}b!==void 0&&this.recoverLevel(C,b,A,w)},s.recoverLevel=function(x,C,L,O){var A=x.details,w=this._levels[C];if(w.loadError++,L){var b=this.retryLoadingOrFail(x);if(b)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var u=w.url.length;if(u>1&&w.loadError<u)x.levelRetry=!0,this.redundantFailover(C);else if(this.manualLevelIndex===-1){var v=C===0?this._levels.length-1:C-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(A+": switch to "+v),x.levelRetry=!0,this.hls.nextAutoLevel=v)}}},s.redundantFailover=function(x){var C=this._levels[x],L=C.url.length;if(L>1){var O=(C.urlId+1)%L;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(A){A.urlId=O}),this.level=x}},s.onFragLoaded=function(x,C){var L=C.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var O=this._levels[L.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},s.onLevelLoaded=function(x,C){var L,O=C.level,A=C.details,w=this._levels[O];if(!w){var b;this.warn("Invalid level index "+O),(b=C.deliveryDirectives)!==null&&b!==void 0&&b.skip&&(A.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(w.fragmentError===0&&(w.loadError=0,this.retryCount=0),this.playlistLoaded(O,C,w.details)):(L=C.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(A.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(x,C){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var O=-1,A=this.hls.audioTracks[C.id].groupId,w=0;w<L.audioGroupIds.length;w++)if(L.audioGroupIds[w]===A){O=w;break}O!==L.urlId&&(L.urlId=O,this.startLoad())}},s.loadPlaylist=function(x){var C=this.currentLevelIndex,L=this._levels[C];if(this.canLoad&&L&&L.url.length>0){var O=L.urlId,A=L.url[O];if(x)try{A=x.addDirectives(A)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Attempt loading level index "+C+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+O+" "+A),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:A,level:C,id:O,deliveryDirectives:x||null})}},s.removeLevel=function(x,C){var L=function(w,b){return b!==C},O=this._levels.filter(function(A,w){return w!==x?!0:A.url.length>1&&C!==void 0?(A.url=A.url.filter(L),A.audioGroupIds&&(A.audioGroupIds=A.audioGroupIds.filter(L)),A.textGroupIds&&(A.textGroupIds=A.textGroupIds.filter(L)),A.urlId=0,!0):!1}).map(function(A,w){var b=A.details;return b!=null&&b.fragments&&b.fragments.forEach(function(u){u.level=w}),A});this._levels=O,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:O})},m(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var C,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===x&&(C=L[x])!==null&&C!==void 0&&C.details)return;if(x<0||x>=L.length){var O=x<0;if(this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:O,reason:"invalid level idx"}),O)return;x=Math.min(x,L.length-1)}this.clearTimer();var A=this.currentLevelIndex,w=L[A],b=L[x];this.log("switching to level "+x+" from "+A),this.currentLevelIndex=x;var u=y({},b,{level:x,maxBitrate:b.maxBitrate,uri:b.uri,urlId:b.urlId});delete u._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,u);var v=b.details;if(!v||v.live){var a=this.switchParams(b.uri,w==null?void 0:w.details);this.loadPlaylist(a)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),o}(n.default)},"./src/controller/level-helper.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"addGroupId",function(){return B}),k.d(J,"assignTrackIdsByGroup",function(){return z}),k.d(J,"updatePTS",function(){return G}),k.d(J,"updateFragPTSDTS",function(){return D}),k.d(J,"mergeDetails",function(){return y}),k.d(J,"mapPartIntersection",function(){return g}),k.d(J,"mapFragmentIntersection",function(){return m}),k.d(J,"adjustSliding",function(){return c}),k.d(J,"addSliding",function(){return d}),k.d(J,"computeReloadInterval",function(){return p}),k.d(J,"getFragmentWithSN",function(){return l}),k.d(J,"getPartWith",function(){return h});var Y=k("./src/polyfills/number.ts"),j=k("./src/utils/logger.ts");function B(o,s,R){switch(s){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(R);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(R);break}}function z(o){var s={};o.forEach(function(R){var x=R.groupId||"";R.id=s[x]=s[x]||0,s[x]++})}function G(o,s,R){var x=o[s],C=o[R];n(x,C)}function n(o,s){var R=s.startPTS;if(Object(Y.isFiniteNumber)(R)){var x=0,C;s.sn>o.sn?(x=R-o.start,C=o):(x=o.start-R,C=s),C.duration!==x&&(C.duration=x)}else if(s.sn>o.sn){var L=o.cc===s.cc;L&&o.minEndPTS?s.start=o.start+(o.minEndPTS-o.start):s.start=o.start+o.duration}else s.start=Math.max(o.start-s.duration,0)}function D(o,s,R,x,C,L){var O=x-R;O<=0&&(j.logger.warn("Fragment should have a positive duration",s),x=R+s.duration,L=C+s.duration);var A=R,w=x,b=s.startPTS,u=s.endPTS;if(Object(Y.isFiniteNumber)(b)){var v=Math.abs(b-R);Object(Y.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(v,s.deltaPTS):s.deltaPTS=v,A=Math.max(R,b),R=Math.min(R,b),C=Math.min(C,s.startDTS),w=Math.min(x,u),x=Math.max(x,u),L=Math.max(L,s.endDTS)}s.duration=x-R;var a=R-s.start;s.appendedPTS=x,s.start=s.startPTS=R,s.maxStartPTS=A,s.startDTS=C,s.endPTS=x,s.minEndPTS=w,s.endDTS=L;var _=s.sn;if(!o||_<o.startSN||_>o.endSN)return 0;var N,F=_-o.startSN,S=o.fragments;for(S[F]=s,N=F;N>0;N--)n(S[N],S[N-1]);for(N=F;N<S.length-1;N++)n(S[N],S[N+1]);return o.fragmentHint&&n(S[S.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,a}function y(o,s){for(var R=null,x=o.fragments,C=x.length-1;C>=0;C--){var L=x[C].initSegment;if(L){R=L;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var O=0,A;if(m(o,s,function(N,F){N.relurl&&(O=N.cc-F.cc),Object(Y.isFiniteNumber)(N.startPTS)&&Object(Y.isFiniteNumber)(N.endPTS)&&(F.start=F.startPTS=N.startPTS,F.startDTS=N.startDTS,F.appendedPTS=N.appendedPTS,F.maxStartPTS=N.maxStartPTS,F.endPTS=N.endPTS,F.endDTS=N.endDTS,F.minEndPTS=N.minEndPTS,F.duration=N.endPTS-N.startPTS,F.duration&&(A=F),s.PTSKnown=s.alignedSliding=!0),F.elementaryStreams=N.elementaryStreams,F.loader=N.loader,F.stats=N.stats,F.urlId=N.urlId,N.initSegment&&(F.initSegment=N.initSegment,R=N.initSegment)}),R){var w=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;w.forEach(function(N){var F;(!N.initSegment||N.initSegment.relurl===((F=R)===null||F===void 0?void 0:F.relurl))&&(N.initSegment=R)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(N){return!N}),s.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var b=s.skippedSegments;b--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var u=s.fragments;if(O){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<u.length;v++)u[v].cc+=O}s.skippedSegments&&(s.startCC=s.fragments[0].cc),g(o.partList,s.partList,function(N,F){F.elementaryStreams=N.elementaryStreams,F.stats=N.stats}),A?D(s,A,A.startPTS,A.endPTS,A.startDTS,A.endDTS):c(o,s),u.length&&(s.totalduration=s.edge-u[0].start),s.driftStartTime=o.driftStartTime,s.driftStart=o.driftStart;var a=s.advancedDateTime;if(s.advanced&&a){var _=s.edge;s.driftStart||(s.driftStartTime=a,s.driftStart=_),s.driftEndTime=a,s.driftEnd=_}else s.driftEndTime=o.driftEndTime,s.driftEnd=o.driftEnd,s.advancedDateTime=o.advancedDateTime}function g(o,s,R){if(o&&s)for(var x=0,C=0,L=o.length;C<=L;C++){var O=o[C],A=s[C+x];O&&A&&O.index===A.index&&O.fragment.sn===A.fragment.sn?R(O,A):x--}}function m(o,s,R){for(var x=s.skippedSegments,C=Math.max(o.startSN,s.startSN)-s.startSN,L=(o.fragmentHint?1:0)+(x?s.endSN:Math.min(o.endSN,s.endSN))-s.startSN,O=s.startSN-o.startSN,A=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,w=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,b=C;b<=L;b++){var u=w[O+b],v=A[b];x&&!v&&b<x&&(v=s.fragments[b]=u),u&&v&&R(u,v)}}function c(o,s){var R=s.startSN+s.skippedSegments-o.startSN,x=o.fragments;if(R<0||R>=x.length)return;d(s,x[R].start)}function d(o,s){if(s){for(var R=o.fragments,x=o.skippedSegments;x<R.length;x++)R[x].start+=s;o.fragmentHint&&(o.fragmentHint.start+=s)}}function p(o,s){var R=1e3*o.levelTargetDuration,x=R/2,C=o.age,L=C>0&&C<R*3,O=s.loading.end-s.loading.start,A,w=o.availabilityDelay;if(o.updated===!1)if(L){var b=333*o.misses;A=Math.max(Math.min(x,O*2),b),o.availabilityDelay=(o.availabilityDelay||0)+A}else A=x;else L?(w=Math.min(w||R/2,C),o.availabilityDelay=w,A=w+R-C):A=R-O;return Math.round(A)}function l(o,s,R){if(!o||!o.details)return null;var x=o.details,C=x.fragments[s-x.startSN];return C||(C=x.fragmentHint,C&&C.sn===s?C:s<x.startSN&&R&&R.sn===s?R:null)}function h(o,s,R){if(!o||!o.details)return null;var x=o.details.partList;if(x)for(var C=x.length;C--;){var L=x[C];if(L.index===R&&L.fragment.sn===s)return L}return null}},"./src/controller/stream-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return x});var Y=k("./src/polyfills/number.ts"),j=k("./src/controller/base-stream-controller.ts"),B=k("./src/is-supported.ts"),z=k("./src/events.ts"),G=k("./src/utils/buffer-helper.ts"),n=k("./src/controller/fragment-tracker.ts"),D=k("./src/types/loader.ts"),y=k("./src/loader/fragment.ts"),g=k("./src/demux/transmuxer-interface.ts"),m=k("./src/types/transmuxer.ts"),c=k("./src/controller/gap-controller.ts"),d=k("./src/errors.ts"),p=k("./src/utils/logger.ts");function l(C,L){for(var O=0;O<L.length;O++){var A=L[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(C,A.key,A)}}function h(C,L,O){return L&&l(C.prototype,L),O&&l(C,O),C}function o(C,L){C.prototype=Object.create(L.prototype),C.prototype.constructor=C,s(C,L)}function s(C,L){return s=Object.setPrototypeOf||function(A,w){return A.__proto__=w,A},s(C,L)}var R=100,x=function(C){o(L,C);function L(A,w){var b;return b=C.call(this,A,w,"[stream-controller]")||this,b.audioCodecSwap=!1,b.gapController=null,b.level=-1,b._forceStartLoad=!1,b.altAudio=!1,b.audioOnly=!1,b.fragPlaying=null,b.onvplaying=null,b.onvseeked=null,b.fragLastKbps=0,b.stalled=!1,b.couldBacktrack=!1,b.audioCodecSwitch=!1,b.videoBuffer=null,b._registerListeners(),b}var O=L.prototype;return O._registerListeners=function(){var w=this.hls;w.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),w.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.on(z.Events.ERROR,this.onError,this),w.on(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.on(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this),w.on(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.on(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var w=this.hls;w.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),w.off(z.Events.ERROR,this.onError,this),w.off(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.off(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),w.off(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.off(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),w.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(w){if(this.levels){var b=this.lastCurrentTime,u=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=u.startLevel;v===-1&&(u.config.testBandwidth?(v=0,this.bitrateTest=!0):v=u.nextAutoLevel),this.level=u.nextLoadLevel=v,this.loadedmetadata=!1}b>0&&w===-1&&(this.log("Override startPosition with lastCurrentTime @"+b.toFixed(3)),w=b),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=w,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var w,b=this.levels,u=this.level,v=b==null||((w=b[u])===null||w===void 0)?void 0:w.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var a,_=self.performance.now(),N=this.retryDate;(!N||_>=N||(a=this.media)!==null&&a!==void 0&&a.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var w,b,u=this.hls,v=this.levelLastLoaded,a=this.levels,_=this.media,N=u.config,F=u.nextLoadLevel;if(v===null||!_&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!a||!a[F])return;var S=a[F];this.level=u.nextLoadLevel=F;var U=S.details;if(!U||this.state===j.State.WAITING_LEVEL||U.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,D.PlaylistLevelType.MAIN);if(M===null)return;var E=M.len,W=this.getMaxBufferLength(S.maxBitrate);if(E>=W)return;if(this._streamEnded(M,U)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(z.Events.BUFFER_EOS,Z),this.state=j.State.ENDED;return}var ne=M.end,ae=this.getNextFragment(ne,U);if(this.couldBacktrack&&!this.fragPrevious&&ae&&ae.sn!=="initSegment"){var we=ae.sn-U.startSN;we>1&&(ae=U.fragments[we-1],this.fragmentTracker.removeFragment(ae))}if(ae&&this.fragmentTracker.getState(ae)===n.FragmentState.OK&&this.nextLoadPosition>ne){var fe=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,fe,D.PlaylistLevelType.MAIN),ae=this.getNextFragment(this.nextLoadPosition,U)}if(!ae)return;ae.initSegment&&!ae.initSegment.data&&!this.bitrateTest&&(ae=ae.initSegment),((w=ae.decryptdata)===null||w===void 0?void 0:w.keyFormat)==="identity"&&!((b=ae.decryptdata)!==null&&b!==void 0&&b.key)?this.loadKey(ae,U):this.loadFragment(ae,U,ne)},O.loadFragment=function(w,b,u){var v,a=this.fragmentTracker.getState(w);if(this.fragCurrent=w,a===n.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(w);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else a=n.FragmentState.NOT_LOADED}a===n.FragmentState.NOT_LOADED||a===n.FragmentState.PARTIAL?w.sn==="initSegment"?this._loadInitSegment(w):this.bitrateTest?(w.bitrateTest=!0,this.log("Fragment "+w.sn+" of level "+w.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(w)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,w,b,u)):a===n.FragmentState.APPENDING?this.reduceMaxBufferLength(w.duration)&&this.fragmentTracker.removeFragment(w):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(w){var b=this.fragmentTracker.getAppendedFrag(w,D.PlaylistLevelType.MAIN);return b&&"fragment"in b?b.fragment:b},O.getBufferedFrag=function(w){return this.fragmentTracker.getBufferedFrag(w,D.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(w){return w?this.getBufferedFrag(w.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var w=this.levels,b=this.media;if(b!=null&&b.readyState){var u,v=this.getAppendedFrag(b.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!b.paused&&w){var a=this.hls.nextLoadLevel,_=w[a],N=this.fragLastKbps;N&&this.fragCurrent?u=this.fragCurrent.duration*_.maxBitrate/(1e3*N)+1:u=0}else u=0;var F=this.getBufferedFrag(b.currentTime+u);if(F){var S=this.followingBufferedFrag(F);if(S){this.abortCurrentFrag();var U=S.maxStartPTS?S.maxStartPTS:S.start,M=S.duration,E=Math.max(F.end,U+Math.min(Math.max(M-this.config.maxFragLookUpTolerance,M*.5),M*.75));this.flushMainBuffer(E,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var w=this.fragCurrent;this.fragCurrent=null,w!=null&&w.loader&&w.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(w,b){C.prototype.flushMainBuffer.call(this,w,b,this.altAudio?"video":null)},O.onMediaAttached=function(w,b){C.prototype.onMediaAttached.call(this,w,b);var u=b.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,u,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var w=this.media;w&&(w.removeEventListener("playing",this.onvplaying),w.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var w=this.media,b=w?w.currentTime:null;Object(Y.isFiniteNumber)(b)&&this.log("Media seeked to "+b.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(z.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(w,b){var u=!1,v=!1,a;b.levels.forEach(function(_){a=_.audioCodec,a&&(a.indexOf("mp4a.40.2")!==-1&&(u=!0),a.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=u&&v&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=b.levels,this.startFragRequested=!1},O.onLevelLoading=function(w,b){var u=this.levels;if(!u||this.state!==j.State.IDLE)return;var v=u[b.level];(!v.details||v.details.live&&this.levelLastLoaded!==b.level||this.waitForCdnTuneIn(v.details))&&(this.state=j.State.WAITING_LEVEL)},O.onLevelLoaded=function(w,b){var u,v=this.levels,a=b.level,_=b.details,N=_.totalduration;if(!v){this.warn("Levels were reset while loading level "+a);return}this.log("Level "+a+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+N);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==b.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var S=v[a],U=0;if(_.live||(u=S.details)!==null&&u!==void 0&&u.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;U=this.alignPlaylists(_,S.details)}if(S.details=_,this.levelLastLoaded=a,this.hls.trigger(z.Events.LEVEL_UPDATED,{details:_,level:a}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=j.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,U),this.tick()},O._handleFragmentLoadProgress=function(w){var b,u=w.frag,v=w.part,a=w.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var N=_[u.level],F=N.details;if(!F){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var S=N.videoCodec,U=F.PTSKnown||!F.live,M=(b=u.initSegment)===null||b===void 0?void 0:b.data,E=this._getAudioCodec(N),W=this.transmuxer=this.transmuxer||new g.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=v?v.index:-1,ne=Z!==-1,ae=new m.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,a.byteLength,Z,ne),we=this.initPTS[u.cc];W.push(a,M,E,S,u,v,F.totalduration,U,ae,we)},O.onAudioTrackSwitching=function(w,b){var u=this.altAudio,v=!!b.url,a=b.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;u&&N.trigger(z.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(z.Events.AUDIO_TRACK_SWITCHED,{id:a})}},O.onAudioTrackSwitched=function(w,b){var u=b.id,v=!!this.hls.audioTracks[u].url;if(v){var a=this.videoBuffer;a&&this.mediaBuffer!==a&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=a)}this.altAudio=v,this.tick()},O.onBufferCreated=function(w,b){var u=b.tracks,v,a,_=!1;for(var N in u){var F=u[N];if(F.id==="main"){if(a=N,v=F,N==="video"){var S=u[N];S&&(this.videoBuffer=S.buffer)}}else _=!0}_&&v?(this.log("Alternate track found, use "+a+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(w,b){var u=b.frag,v=b.part;if(u&&u.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(v?" p: "+v.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var a=v?v.stats:u.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,v)},O.onError=function(w,b){switch(b.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,b);break;case d.ErrorDetails.LEVEL_LOAD_ERROR:case d.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(b.fatal?(this.warn(""+b.details),this.state=j.State.ERROR):!b.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(b.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var u=!0,v=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);v&&v.len>.5&&(u=!this.reduceMaxBufferLength(v.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var w=this.media,b=this.gapController;if(!w||!b||!w.readyState)return;var u=G.BufferHelper.getBuffered(w);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):b.poll(this.lastCurrentTime),this.lastCurrentTime=w.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(w,b){var u=b.type;if(u!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(u===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,u,D.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(w,b){this.levels=b.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var w=this.media,b=w.currentTime,u=this.startPosition;if(u>=0&&b<u){if(w.seeking){p.logger.log("could not seek to "+u+", already seeking at "+b);return}var v=G.BufferHelper.getBuffered(w),a=v.length?v.start(0):0,_=a-u;_>0&&(_<this.config.maxBufferHole||_<this.config.maxFragLookUpTolerance)&&(p.logger.log("adjusting start position by "+_+" to match buffer start"),u+=_,this.startPosition=u),this.log("seek to target start position "+u+" from current time "+b),w.currentTime=u}},O._getAudioCodec=function(w){var b=this.config.defaultAudioCodec||w.audioCodec;return this.audioCodecSwap&&b&&(this.log("Swapping audio codec"),b.indexOf("mp4a.40.5")!==-1?b="mp4a.40.2":b="mp4a.40.5"),b},O._loadBitrateTestFrag=function(w){var b=this;this._doFragLoad(w).then(function(u){var v=b.hls;if(!u||v.nextLoadLevel||b.fragContextChanged(w))return;b.fragLoadError=0,b.state=j.State.IDLE,b.startFragRequested=!1,b.bitrateTest=!1;var a=w.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),v.trigger(z.Events.FRAG_LOADED,u)})},O._handleTransmuxComplete=function(w){var b,u="main",v=this.hls,a=w.remuxResult,_=w.chunkMeta,N=this.getCurrentContext(_);if(!N){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var F=N.frag,S=N.part,U=N.level,M=a.video,E=a.text,W=a.id3,Z=a.initSegment,ne=this.altAudio?void 0:a.audio;if(this.fragContextChanged(F))return;if(this.state=j.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(U,Z.tracks,F,_),v.trigger(z.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:u,tracks:Z.tracks}));var ae=Z.initPTS,we=Z.timescale;Object(Y.isFiniteNumber)(ae)&&(this.initPTS[F.cc]=ae,v.trigger(z.Events.INIT_PTS_FOUND,{frag:F,id:u,initPTS:ae,timescale:we}))}if(M&&a.independent!==!1){if(U.details){var fe=M.startPTS,_e=M.endPTS,Se=M.startDTS,ve=M.endDTS;if(S)S.elementaryStreams[M.type]={startPTS:fe,endPTS:_e,startDTS:Se,endDTS:ve};else if(M.firstKeyFrame&&M.independent&&(this.couldBacktrack=!0),M.dropped&&M.independent){var ue=this.getLoadPosition()+this.config.maxBufferHole;if(ue<fe){this.backtrack(F);return}F.setElementaryStreamInfo(M.type,F.start,_e,F.start,ve,!0)}F.setElementaryStreamInfo(M.type,fe,_e,Se,ve),this.bufferFragmentData(M,F,S,_)}}else if(a.independent===!1){this.backtrack(F);return}if(ne){var le=ne.startPTS,Oe=ne.endPTS,Ye=ne.startDTS,Ve=ne.endDTS;S&&(S.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:Oe,startDTS:Ye,endDTS:Ve}),F.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,le,Oe,Ye,Ve),this.bufferFragmentData(ne,F,S,_)}if(W!=null&&(b=W.samples)!==null&&b!==void 0&&b.length){var $e={frag:F,id:u,samples:W.samples};v.trigger(z.Events.FRAG_PARSING_METADATA,$e)}if(E){var Ze={frag:F,id:u,samples:E.samples};v.trigger(z.Events.FRAG_PARSING_USERDATA,Ze)}},O._bufferInitSegment=function(w,b,u,v){var a=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!b.audio&&!b.video,this.altAudio&&!this.audioOnly&&delete b.audio;var _=b.audio,N=b.video,F=b.audiovideo;if(_){var S=w.audioCodec,U=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(S&&(S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),_.metadata.channelCount!==1&&U.indexOf("firefox")===-1&&(S="mp4a.40.5")),U.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(S="mp4a.40.2",this.log("Android: force audio codec to "+S)),w.audioCodec&&w.audioCodec!==S&&this.log('Swapping manifest audio codec "'+w.audioCodec+'" for "'+S+'"'),_.levelCodec=S,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(S||"")+"/"+(w.audioCodec||"")+"/"+_.codec+"]")}N&&(N.levelCodec=w.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(w.videoCodec||"")+"/"+N.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(w.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(z.Events.BUFFER_CODECS,b),Object.keys(b).forEach(function(M){var E=b[M],W=E.initSegment;W!=null&&W.byteLength&&a.hls.trigger(z.Events.BUFFER_APPENDING,{type:M,data:W,frag:u,part:null,chunkMeta:v,parent:u.type})}),this.tick()},O.backtrack=function(w){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(w);var b=this.fragmentTracker.backtrack(w);this.fragPrevious=null,this.nextLoadPosition=w.start,b?this.resetFragmentLoading(w):this.state=j.State.BACKTRACKING},O.checkFragmentChanged=function(){var w=this.media,b=null;if(w&&w.readyState>1&&w.seeking===!1){var u=w.currentTime;if(G.BufferHelper.isBuffered(w,u)?b=this.getAppendedFrag(u):G.BufferHelper.isBuffered(w,u+.1)&&(b=this.getAppendedFrag(u+.1)),b){var v=this.fragPlaying,a=b.level;(!v||b.sn!==v.sn||v.level!==a||b.urlId!==v.urlId)&&(this.hls.trigger(z.Events.FRAG_CHANGED,{frag:b}),(!v||v.level!==a)&&this.hls.trigger(z.Events.LEVEL_SWITCHED,{level:a}),this.fragPlaying=b)}}},h(L,[{key:"nextLevel",get:function(){var w=this.nextBufferedFrag;return w?w.level:-1}},{key:"currentLevel",get:function(){var w=this.media;if(w){var b=this.getAppendedFrag(w.currentTime);if(b)return b.level}return-1}},{key:"nextBufferedFrag",get:function(){var w=this.media;if(w){var b=this.getAppendedFrag(w.currentTime);return this.followingBufferedFrag(b)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"SubtitleStreamController",function(){return o});var Y=k("./src/events.ts"),j=k("./src/utils/logger.ts"),B=k("./src/utils/buffer-helper.ts"),z=k("./src/controller/fragment-finders.ts"),G=k("./src/utils/discontinuities.ts"),n=k("./src/controller/level-helper.ts"),D=k("./src/controller/fragment-tracker.ts"),y=k("./src/controller/base-stream-controller.ts"),g=k("./src/types/loader.ts"),m=k("./src/types/level.ts");function c(s,R){for(var x=0;x<R.length;x++){var C=R[x];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(s,C.key,C)}}function d(s,R,x){return R&&c(s.prototype,R),x&&c(s,x),s}function p(s,R){s.prototype=Object.create(R.prototype),s.prototype.constructor=s,l(s,R)}function l(s,R){return l=Object.setPrototypeOf||function(C,L){return C.__proto__=L,C},l(s,R)}var h=500,o=function(s){p(R,s);function R(C,L){var O;return O=s.call(this,C,L,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var x=R.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var L=this.hls;L.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(Y.Events.ERROR,this.onError,this),L.on(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var L=this.hls;L.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(Y.Events.ERROR,this.onError,this),L.off(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(h),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(L,O){this.mainDetails=O.details},x.onSubtitleFragProcessed=function(L,O){var A=O.frag,w=O.success;if(this.fragPrevious=A,this.state=y.State.IDLE,!w)return;var b=this.tracksBuffered[this.currentTrackId];if(!b)return;for(var u,v=A.start,a=0;a<b.length;a++)if(v>=b[a].start&&v<=b[a].end){u=b[a];break}var _=A.start+A.duration;u?u.end=_:(u={start:v,end:_},b.push(u)),this.fragmentTracker.fragBuffered(A)},x.onBufferFlushing=function(L,O){var A=O.startOffset,w=O.endOffset;if(A===0&&w!==Number.POSITIVE_INFINITY){var b=this.currentTrackId,u=this.levels;if(!u.length||!u[b]||!u[b].details)return;var v=u[b].details,a=v.targetduration,_=w-a;if(_<=0)return;O.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(N){for(var F=0;F<N.length;){if(N[F].end<=_){N.shift();continue}else if(N[F].start<_)N[F].start=_;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(A,_,g.PlaylistLevelType.SUBTITLE)}},x.onError=function(L,O){var A,w=O.frag;if(!w||w.type!==g.PlaylistLevelType.SUBTITLE)return;(A=this.fragCurrent)!==null&&A!==void 0&&A.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},x.onSubtitleTracksUpdated=function(L,O){var A=this,w=O.subtitleTracks;this.tracksBuffered=[],this.levels=w.map(function(b){return new m.Level(b)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(b){A.tracksBuffered[b.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(L,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var A=this.levels[this.currentTrackId];A!=null&&A.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,A&&this.setInterval(h)},x.onSubtitleTrackLoaded=function(L,O){var A,w=O.details,b=O.id,u=this.currentTrackId,v=this.levels;if(!v.length)return;var a=v[u];if(b>=v.length||b!==u||!a)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,w.live||(A=a.details)!==null&&A!==void 0&&A.live){var _=this.mainDetails;if(w.deltaUpdateFailed||!_)return;var N=_.fragments[0];if(!a.details)w.hasProgramDateTime&&_.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(w,_):N&&Object(n.addSliding)(w,N.start);else{var F=this.alignPlaylists(w,a.details);F===0&&N&&Object(n.addSliding)(w,N.start)}}if(a.details=w,this.levelLastLoaded=b,this.tick(),w.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var S=Object(z.findFragmentByPTS)(null,w.fragments,this.media.currentTime,0);S||(this.warn("Subtitle playlist not aligned with playback"),a.details=void 0)}},x._handleFragmentLoadComplete=function(L){var O=L.frag,A=L.payload,w=O.decryptdata,b=this.hls;if(this.fragContextChanged(O))return;if(A&&A.byteLength>0&&w&&w.key&&w.iv&&w.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(A),w.key.buffer,w.iv.buffer).then(function(v){var a=performance.now();b.trigger(Y.Events.FRAG_DECRYPTED,{frag:O,payload:v,stats:{tstart:u,tdecrypt:a}})})}},x.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var L,O=this.currentTrackId,A=this.levels;if(!A.length||!A[O]||!A[O].details)return;var w=A[O].details,b=w.targetduration,u=this.config,v=this.media,a=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-b,u.maxBufferHole),_=a.end,N=a.len,F=this.getMaxBufferLength()+b;if(N>F)return;console.assert(w,"Subtitle track details are defined on idle subtitle stream controller tick");var S=w.fragments,U=S.length,M=w.edge,E,W=this.fragPrevious;if(_<M){var Z=u.maxFragLookUpTolerance;W&&w.hasProgramDateTime&&(E=Object(z.findFragmentByPDT)(S,W.endProgramDateTime,Z)),E||(E=Object(z.findFragmentByPTS)(W,S,_,Z),!E&&W&&W.start<S[0].start&&(E=S[0]))}else E=S[U-1];(L=E)!==null&&L!==void 0&&L.encrypted?(j.logger.log("Loading key for "+E.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(Y.Events.KEY_LOADING,{frag:E})):E&&this.fragmentTracker.getState(E)===D.FragmentState.NOT_LOADED&&this.loadFragment(E,w,_)}},x.loadFragment=function(L,O,A){this.fragCurrent=L,s.prototype.loadFragment.call(this,L,O,A)},d(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(y.default)},"./src/controller/subtitle-track-controller.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/events.ts"),j=k("./src/utils/texttrack-utils.ts"),B=k("./src/controller/base-playlist-controller.ts"),z=k("./src/types/loader.ts");function G(c,d){for(var p=0;p<d.length;p++){var l=d[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,d,p){return d&&G(c.prototype,d),p&&G(c,p),c}function D(c,d){c.prototype=Object.create(d.prototype),c.prototype.constructor=c,y(c,d)}function y(c,d){return y=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},y(c,d)}var g=function(c){D(d,c);function d(l){var h;return h=c.call(this,l,"[subtitle-track-controller]")||this,h.media=null,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.selectDefaultTrack=!0,h.queuedDefaultTrack=-1,h.trackChangeListener=function(){return h.onTextTracksChanged()},h.asyncPollTrackChange=function(){return h.pollTrackChange(0)},h.useTextTrackPolling=!1,h.subtitlePollingInterval=-1,h.subtitleDisplay=!0,h.registerListeners(),h}var p=d.prototype;return p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},p.registerListeners=function(){var h=this.hls;h.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.on(Y.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var h=this.hls;h.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.off(Y.Events.ERROR,this.onError,this)},p.onMediaAttached=function(h,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)},p.pollTrackChange=function(h){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,h)},p.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 h=m(this.media.textTracks);h.forEach(function(o){Object(j.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(h,o){this.tracks=o.subtitleTracks},p.onSubtitleTrackLoaded=function(h,o){var s=o.id,R=o.details,x=this.trackId,C=this.tracksInGroup[x];if(!C){this.warn("Invalid subtitle track id "+s);return}var L=C.details;C.details=o.details,this.log("subtitle track "+s+" loaded ["+R.startSN+"-"+R.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,o,L))},p.onLevelLoading=function(h,o){this.switchLevel(o.level)},p.onLevelSwitching=function(h,o){this.switchLevel(o.level)},p.switchLevel=function(h){var o=this.hls.levels[h];if(!(o!=null&&o.textGroupIds))return;var s=o.textGroupIds[o.urlId];if(this.groupId!==s){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=x;var C=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=s;var L={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(Y.Events.SUBTITLE_TRACKS_UPDATED,L),C!==-1&&this.setSubtitleTrack(C,R)}},p.findTrackId=function(h){for(var o=this.tracksInGroup,s=0;s<o.length;s++){var R=o[s];if((!this.selectDefaultTrack||R.default)&&(!h||h===R.name))return R.id}return-1},p.onError=function(h,o){if(c.prototype.onError.call(this,h,o),o.fatal||!o.context)return;o.context.type===z.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},p.loadPlaylist=function(h){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var s=o.id,R=o.groupId,x=o.url;if(h)try{x=h.addDirectives(x)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(Y.Events.SUBTITLE_TRACK_LOADING,{url:x,id:s,groupId:R,deliveryDirectives:h||null})}},p.toggleTrackModes=function(h){var o=this,s=this.media,R=this.subtitleDisplay,x=this.trackId;if(!s)return;var C=m(s.textTracks),L=C.filter(function(w){return w.groupId===o.groupId});if(h===-1)[].slice.call(C).forEach(function(w){w.mode="disabled"});else{var O=L[x];O&&(O.mode="disabled")}var A=L[h];A&&(A.mode=R?"showing":"hidden")},p.setSubtitleTrack=function(h,o){var s,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=h;return}if(this.trackId!==h&&this.toggleTrackModes(h),this.trackId===h&&(h===-1||(s=R[h])!==null&&s!==void 0&&s.details)||h<-1||h>=R.length)return;this.clearTimer();var x=R[h];if(this.log("Switching to subtitle track "+h),this.trackId=h,x){var C=x.id,L=x.groupId,O=L===void 0?"":L,A=x.name,w=x.type,b=x.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:O,name:A,type:w,url:b});var u=this.switchParams(x.url,o==null?void 0:o.details);this.loadPlaylist(u)}else this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:h})},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var h=-1,o=m(this.media.textTracks),s=0;s<o.length;s++)if(o[s].mode==="hidden")h=s;else if(o[s].mode==="showing"){h=s;break}this.subtitleTrack!==h&&(this.subtitleTrack=h)},n(d,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(h,o)}}]),d}(B.default);function m(c){for(var d=[],p=0;p<c.length;p++){var l=c[p];l.kind==="subtitles"&&l.label&&d.push(c[p])}return d}J.default=g},"./src/controller/timeline-controller.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"TimelineController",function(){return m});var Y=k("./src/polyfills/number.ts"),j=k("./src/events.ts"),B=k("./src/utils/cea-608-parser.ts"),z=k("./src/utils/output-filter.ts"),G=k("./src/utils/webvtt-parser.ts"),n=k("./src/utils/texttrack-utils.ts"),D=k("./src/utils/imsc1-ttml-parser.ts"),y=k("./src/types/loader.ts"),g=k("./src/utils/logger.ts"),m=function(){function l(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=p(),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 s=new z.default(this,"textTrack1"),R=new z.default(this,"textTrack2"),x=new z.default(this,"textTrack3"),C=new z.default(this,"textTrack4");this.cea608Parser1=new B.default(1,s,R),this.cea608Parser2=new B.default(3,x,C)}o.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(j.Events.FRAG_LOADING,this.onFragLoading,this),o.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var h=l.prototype;return h.destroy=function(){var s=this.hls;s.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(j.Events.FRAG_LOADING,this.onFragLoading,this),s.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},h.addCues=function(s,R,x,C,L){for(var O=!1,A=L.length;A--;){var w=L[A],b=d(w[0],w[1],R,x);if(b>=0&&(w[0]=Math.min(w[0],R),w[1]=Math.max(w[1],x),O=!0,b/(x-R)>.5))return}if(O||L.push([R,x]),this.config.renderTextTracksNatively){var u=this.captionsTracks[s];this.Cues.newCue(u,R,x,C)}else{var v=this.Cues.newCue(null,R,x,C);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:v,track:s})}},h.onInitPtsFound=function(s,R){var x=this,C=R.frag,L=R.id,O=R.initPTS,A=R.timescale,w=this.unparsedVttFrags;L==="main"&&(this.initPTS[C.cc]=O,this.timescale[C.cc]=A),w.length&&(this.unparsedVttFrags=[],w.forEach(function(b){x.onFragLoaded(j.Events.FRAG_LOADED,b)}))},h.getExistingTrack=function(s){var R=this.media;if(R)for(var x=0;x<R.textTracks.length;x++){var C=R.textTracks[x];if(C[s])return C}return null},h.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},h.createNativeTrack=function(s){if(this.captionsTracks[s])return;var R=this.captionsProperties,x=this.captionsTracks,C=this.media,L=R[s],O=L.label,A=L.languageCode,w=this.getExistingTrack(s);if(w)x[s]=w,Object(n.clearCurrentCues)(x[s]),Object(n.sendAddTrackEvent)(x[s],C);else{var b=this.createTextTrack("captions",O,A);b&&(b[s]=!0,x[s]=b)}},h.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var R=this.captionsProperties[s];if(!R)return;var x=R.label,C={_id:s,label:x,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[s]=C,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[C]})},h.createTextTrack=function(s,R,x){var C=this.media;return C?C.addTextTrack(s,R,x):void 0},h.onMediaAttaching=function(s,R){this.media=R.media,this._cleanTracks()},h.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(R){Object(n.clearCurrentCues)(s[R]),delete s[R]}),this.nonNativeCaptionsTracks={}},h.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),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())},h._cleanTracks=function(){var s=this.media;if(!s)return;var R=s.textTracks;if(R)for(var x=0;x<R.length;x++)Object(n.clearCurrentCues)(R[x])},h.onSubtitleTracksUpdated=function(s,R){var x=this;this.textTracks=[];var C=R.subtitleTracks||[],L=C.some(function(b){return b.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var O=this.tracks&&C&&this.tracks.length===C.length;if(this.tracks=C||[],this.config.renderTextTracksNatively){var A=this.media?this.media.textTracks:[];this.tracks.forEach(function(b,u){var v;if(u<A.length){for(var a=null,_=0;_<A.length;_++)if(c(A[_],b)){a=A[_];break}a&&(v=a)}v?Object(n.clearCurrentCues)(v):(v=x.createTextTrack("subtitles",b.name,b.lang),v&&(v.mode="disabled")),v&&(v.groupId=b.groupId,x.textTracks.push(v))})}else if(!O&&this.tracks&&this.tracks.length){var w=this.tracks.map(function(b){return{label:b.name,kind:b.type.toLowerCase(),default:b.default,subtitleTrack:b}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:w})}}},h.onManifestLoaded=function(s,R){var x=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(C){var L=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(!L)return;var O="textTrack"+L[1],A=x.captionsProperties[O];if(!A)return;A.label=C.name,C.lang&&(A.languageCode=C.lang),A.media=C})},h.onFragLoading=function(s,R){var x=this.cea608Parser1,C=this.cea608Parser2,L=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(x&&C))return;if(R.frag.type===y.PlaylistLevelType.MAIN){var A,w,b=R.frag.sn,u=(A=R==null||((w=R.part)===null||w===void 0)?void 0:w.index)!=null?A:-1;b===L+1||b===L&&u===O+1||(x.reset(),C.reset()),this.lastSn=b,this.lastPartIndex=u}},h.onFragLoaded=function(s,R){var x=R.frag,C=R.payload,L=this.initPTS,O=this.unparsedVttFrags;if(x.type===y.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!Object(Y.isFiniteNumber)(L[x.cc])){O.push(R),L.length&&this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Missing initial subtitle PTS")});return}var A=x.decryptdata;if(A==null||A.key==null||A.method!=="AES-128"){var w=this.tracks[x.level],b=this.vttCCs;b[x.cc]||(b[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),w&&w.textCodec===D.IMSC1_CODEC?this._parseIMSC1(x,C):this._parseVTTs(x,C,b)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},h._parseIMSC1=function(s,R){var x=this,C=this.hls;Object(D.parseIMSC1)(R,this.initPTS[s.cc],this.timescale[s.cc],function(L){x._appendCues(L,s.level),C.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(L){g.logger.log("Failed to parse IMSC1: "+L),C.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:L})})},h._parseVTTs=function(s,R,x){var C=this,L=this.hls;Object(G.parseWebVTT)(R,this.initPTS[s.cc],this.timescale[s.cc],x,s.cc,s.start,function(O){C._appendCues(O,s.level),L.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(O){C._fallbackToIMSC1(s,R),g.logger.log("Failed to parse VTT cue: "+O),L.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:O})})},h._fallbackToIMSC1=function(s,R){var x=this,C=this.tracks[s.level];C.textCodec||Object(D.parseIMSC1)(R,this.initPTS[s.cc],this.timescale[s.cc],function(){C.textCodec=D.IMSC1_CODEC,x._parseIMSC1(s,R)},function(){C.textCodec="wvtt"})},h._appendCues=function(s,R){var x=this.hls;if(this.config.renderTextTracksNatively){var C=this.textTracks[R];if(C.mode==="disabled")return;s.forEach(function(A){return Object(n.addCueToTrack)(C,A)})}else{var L=this.tracks[R],O=L.default?"default":"subtitles"+R;x.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:s,track:O})}},h.onFragDecrypted=function(s,R){var x=R.frag;if(x.type===y.PlaylistLevelType.SUBTITLE){if(!Object(Y.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(j.Events.FRAG_LOADED,R)}},h.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},h.onFragParsingUserdata=function(s,R){var x=this.cea608Parser1,C=this.cea608Parser2;if(!this.enabled||!(x&&C))return;for(var L=0;L<R.samples.length;L++){var O=R.samples[L].bytes;if(O){var A=this.extractCea608Data(O);x.addData(R.samples[L].pts,A[0]),C.addData(R.samples[L].pts,A[1])}}},h.onBufferFlushing=function(s,R){var x=R.startOffset,C=R.endOffset,L=R.endOffsetSubtitles,O=R.type,A=this.media;if(!A||A.currentTime<C)return;if(!O||O==="video"){var w=this.captionsTracks;Object.keys(w).forEach(function(u){return Object(n.removeCuesInRange)(w[u],x,C)})}if(this.config.renderTextTracksNatively&&(x===0&&L!==void 0)){var b=this.textTracks;Object.keys(b).forEach(function(u){return Object(n.removeCuesInRange)(b[u],x,L)})}},h.extractCea608Data=function(s){for(var R=s[0]&31,x=2,C=[[],[]],L=0;L<R;L++){var O=s[x++],A=127&s[x++],w=127&s[x++],b=(4&O)!==0,u=3&O;if(A===0&&w===0)continue;b&&((u===0||u===1)&&(C[u].push(A),C[u].push(w)))}return C},l}();function c(l,h){return l&&l.label===h.name&&!(l.textTrack1||l.textTrack2)}function d(l,h,o,s){return Math.min(h,s)-Math.max(l,o)}function p(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return Y});var Y=function(){function j(z,G){this.subtle=void 0,this.aesIV=void 0,this.subtle=z,this.aesIV=G}var B=j.prototype;return B.decrypt=function(G,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,G)},j}()},"./src/crypt/aes-decryptor.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"removePadding",function(){return j}),k.d(J,"default",function(){return B});var Y=k("./src/utils/typed-array.ts");function j(z){var G=z.byteLength,n=G&&new DataView(z.buffer).getUint8(G-1);return n?Object(Y.sliceUint8)(z,0,G-n):z}var B=function(){function z(){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 G=z.prototype;return G.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},G.initTable=function(){var D=this.sBox,y=this.invSBox,g=this.subMix,m=g[0],c=g[1],d=g[2],p=g[3],l=this.invSubMix,h=l[0],o=l[1],s=l[2],R=l[3],x=new Uint32Array(256),C=0,L=0,O=0;for(O=0;O<256;O++)O<128?x[O]=O<<1:x[O]=O<<1^283;for(O=0;O<256;O++){var A=L^L<<1^L<<2^L<<3^L<<4;A=A>>>8^A&255^99,D[C]=A,y[A]=C;var w=x[C],b=x[w],u=x[b],v=x[A]*257^A*16843008;m[C]=v<<24|v>>>8,c[C]=v<<16|v>>>16,d[C]=v<<8|v>>>24,p[C]=v,v=u*16843009^b*65537^w*257^C*16843008,h[A]=v<<24|v>>>8,o[A]=v<<16|v>>>16,s[A]=v<<8|v>>>24,R[A]=v,C?(C=w^x[x[x[u^w]]],L^=x[x[L]]):C=L=1}},G.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 d=this.ksRows=(c+6+1)*4,p,l,h=this.keySchedule=new Uint32Array(d),o=this.invKeySchedule=new Uint32Array(d),s=this.sBox,R=this.rcon,x=this.invSubMix,C=x[0],L=x[1],O=x[2],A=x[3],w,b;for(p=0;p<d;p++){if(p<c){w=h[p]=y[p];continue}b=w,p%c===0?(b=b<<8|b>>>24,b=s[b>>>24]<<24|s[b>>>16&255]<<16|s[b>>>8&255]<<8|s[b&255],b^=R[p/c|0]<<24):c>6&&p%c===4&&(b=s[b>>>24]<<24|s[b>>>16&255]<<16|s[b>>>8&255]<<8|s[b&255]),h[p]=w=(h[p-c]^b)>>>0}for(l=0;l<d;l++)p=d-l,l&3?b=h[p]:b=h[p-4],l<4||p<=4?o[l]=b:o[l]=C[s[b>>>24]]^L[s[b>>>16&255]]^O[s[b>>>8&255]]^A[s[b&255]],o[l]=o[l]>>>0},G.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},G.decrypt=function(D,y,g){for(var m=this.keySize+6,c=this.invKeySchedule,d=this.invSBox,p=this.invSubMix,l=p[0],h=p[1],o=p[2],s=p[3],R=this.uint8ArrayToUint32Array_(g),x=R[0],C=R[1],L=R[2],O=R[3],A=new Int32Array(D),w=new Int32Array(A.length),b,u,v,a,_,N,F,S,U,M,E,W,Z,ne,ae=this.networkToHostOrderSwap;y<A.length;){for(U=ae(A[y]),M=ae(A[y+1]),E=ae(A[y+2]),W=ae(A[y+3]),_=U^c[0],N=W^c[1],F=E^c[2],S=M^c[3],Z=4,ne=1;ne<m;ne++)b=l[_>>>24]^h[N>>16&255]^o[F>>8&255]^s[S&255]^c[Z],u=l[N>>>24]^h[F>>16&255]^o[S>>8&255]^s[_&255]^c[Z+1],v=l[F>>>24]^h[S>>16&255]^o[_>>8&255]^s[N&255]^c[Z+2],a=l[S>>>24]^h[_>>16&255]^o[N>>8&255]^s[F&255]^c[Z+3],_=b,N=u,F=v,S=a,Z=Z+4;b=d[_>>>24]<<24^d[N>>16&255]<<16^d[F>>8&255]<<8^d[S&255]^c[Z],u=d[N>>>24]<<24^d[F>>16&255]<<16^d[S>>8&255]<<8^d[_&255]^c[Z+1],v=d[F>>>24]<<24^d[S>>16&255]<<16^d[_>>8&255]<<8^d[N&255]^c[Z+2],a=d[S>>>24]<<24^d[_>>16&255]<<16^d[N>>8&255]<<8^d[F&255]^c[Z+3],w[y]=ae(b^x),w[y+1]=ae(a^C),w[y+2]=ae(v^L),w[y+3]=ae(u^O),x=U,C=M,L=E,O=W,y=y+4}return w.buffer},z}()},"./src/crypt/decrypter.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return y});var Y=k("./src/crypt/aes-crypto.ts"),j=k("./src/crypt/fast-aes-key.ts"),B=k("./src/crypt/aes-decryptor.ts"),z=k("./src/utils/logger.ts"),G=k("./src/utils/mp4-tools.ts"),n=k("./src/utils/typed-array.ts"),D=16,y=function(){function g(c,d,p){var l=p===void 0?{}:p,h=l.removePKCS7Padding,o=h===void 0?!0:h;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=d,this.removePKCS7Padding=o,o)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(R){}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 d=this.currentResult;if(!d){this.reset();return}var p=new Uint8Array(d);return this.reset(),this.removePKCS7Padding?Object(B.removePadding)(p):p},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(d,p,l,h){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(d),p,l);var o=this.flush();o&&h(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(d),p,l).then(h)},m.softwareDecrypt=function(d,p,l){var h=this.currentIV,o=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(d=Object(G.appendUint8Array)(s,d),this.remainderData=null);var R=this.getValidChunk(d);if(!R.length)return null;h&&(l=h);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new B.default),x.expandKey(p);var C=o;return this.currentResult=x.decrypt(R.buffer,0,l),this.currentIV=Object(n.sliceUint8)(R,-16).buffer,C||null},m.webCryptoDecrypt=function(d,p,l){var h=this,o=this.subtle;return(this.key!==p||!this.fastAesKey)&&(this.key=p,this.fastAesKey=new j.default(o,p)),this.fastAesKey.expandKey().then(function(s){if(!o)return Promise.reject(new Error("web crypto not initialized"));var R=new Y.default(o,l);return R.decrypt(d.buffer,s)}).catch(function(s){return h.onWebCryptoError(s,d,p,l)})},m.onWebCryptoError=function(d,p,l,h){return z.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",d),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(p,l,h)},m.getValidChunk=function(d){var p=d,l=d.length-d.length%D;return l!==d.length&&(p=Object(n.sliceUint8)(d,0,l),this.remainderData=Object(n.sliceUint8)(d,l)),p},m.logOnce=function(d){if(!this.logEnabled)return;z.logger.log("[decrypter.ts]: "+d),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return Y});var Y=function(){function j(z,G){this.subtle=void 0,this.key=void 0,this.subtle=z,this.key=G}var B=j.prototype;return B.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/demux/base-audio-demuxer.ts"),j=k("./src/demux/adts.ts"),B=k("./src/utils/logger.ts"),z=k("./src/demux/id3.ts");function G(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,d){return c.__proto__=d,c},n(y,g)}var D=function(y){G(g,y);function g(c,d){var p;return p=y.call(this)||this,p.observer=void 0,p.config=void 0,p.observer=c,p.config=d,p}var m=g.prototype;return m.resetInitSegment=function(d,p,l){y.prototype.resetInitSegment.call(this,d,p,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:d,duration:l,inputTimeScale:9e4,dropped:0}},g.probe=function(d){if(!d)return!1;for(var p=z.getID3Data(d,0)||[],l=p.length,h=d.length;l<h;l++)if(j.probe(d,l))return B.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(d,p){return j.canParse(d,p)},m.appendFrame=function(d,p,l){j.initTrackConfig(d,this.observer,p,l,d.manifestCodec);var h=j.appendFrame(d,p,l,this.initPTS,this.frameIndex);if(h&&h.missing===0)return h},g}(Y.default);D.minProbeByteLength=9,J.default=D},"./src/demux/adts.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"getAudioConfig",function(){return z}),k.d(J,"isHeaderPattern",function(){return G}),k.d(J,"getHeaderLength",function(){return n}),k.d(J,"getFullFrameLength",function(){return D}),k.d(J,"canGetFrameLength",function(){return y}),k.d(J,"isHeader",function(){return g}),k.d(J,"canParse",function(){return m}),k.d(J,"probe",function(){return c}),k.d(J,"initTrackConfig",function(){return d}),k.d(J,"getFrameDuration",function(){return p}),k.d(J,"parseFrameHeader",function(){return l}),k.d(J,"appendFrame",function(){return h});var Y=k("./src/utils/logger.ts"),j=k("./src/errors.ts"),B=k("./src/events.ts");function z(o,s,R,x){var C,L,O,A,w=navigator.userAgent.toLowerCase(),b=x,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];C=((s[R+2]&192)>>>6)+1;var v=(s[R+2]&60)>>>2;if(v>u.length-1){o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return O=(s[R+2]&1)<<2,O|=(s[R+3]&192)>>>6,Y.logger.log("manifest codec:"+x+", ADTS type:"+C+", samplingIndex:"+v),/firefox/i.test(w)?v>=6?(C=5,A=new Array(4),L=v-3):(C=2,A=new Array(2),L=v):w.indexOf("android")!==-1?(C=2,A=new Array(2),L=v):(C=5,A=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&v>=6?L=v-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(v>=6&&O===1||/vivaldi/i.test(w))||!x&&O===1)&&(C=2,A=new Array(2)),L=v)),A[0]=C<<3,A[0]|=(v&14)>>1,A[1]|=(v&1)<<7,A[1]|=O<<3,C===5&&(A[1]|=(L&14)>>1,A[2]=(L&1)<<7,A[2]|=2<<2,A[3]=0),{config:A,samplerate:u[v],channelCount:O,codec:"mp4a.40."+C,manifestCodec:b}}function G(o,s){return o[s]===255&&(o[s+1]&246)===240}function n(o,s){return o[s+1]&1?7:9}function D(o,s){return(o[s+3]&3)<<11|o[s+4]<<3|(o[s+5]&224)>>>5}function y(o,s){return s+5<o.length}function g(o,s){return s+1<o.length&&G(o,s)}function m(o,s){return y(o,s)&&G(o,s)&&D(o,s)<=o.length-s}function c(o,s){if(g(o,s)){var R=n(o,s);if(s+R>=o.length)return!1;var x=D(o,s);if(x<=R)return!1;var C=s+x;return C===o.length||g(o,C)}return!1}function d(o,s,R,x,C){if(!o.samplerate){var L=z(s,R,x,C);if(!L)return;o.config=L.config,o.samplerate=L.samplerate,o.channelCount=L.channelCount,o.codec=L.codec,o.manifestCodec=L.manifestCodec,Y.logger.log("parsed codec:"+o.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function p(o){return 1024*9e4/o}function l(o,s,R,x,C){var L=n(o,s),O=D(o,s);if(O-=L,O>0){var A=R+x*C;return{headerLength:L,frameLength:O,stamp:A}}}function h(o,s,R,x,C){var L=p(o.samplerate),O=l(s,R,x,C,L);if(O){var A=O.frameLength,w=O.headerLength,b=O.stamp,u=w+A,v=Math.max(0,R+u-s.length),a;v?(a=new Uint8Array(u-w),a.set(s.subarray(R+w,s.length),0)):a=s.subarray(R+w,R+u);var _={unit:a,pts:b};return v||o.samples.push(_),{sample:_,length:u,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"initPTSFn",function(){return D});var Y=k("./src/polyfills/number.ts"),j=k("./src/demux/id3.ts"),B=k("./src/demux/dummy-demuxed-track.ts"),z=k("./src/utils/mp4-tools.ts"),G=k("./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,d,p){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,d){return!1},g.appendFrame=function(c,d,p){},g.demux=function(c,d){this.cachedData&&(c=Object(z.appendUint8Array)(this.cachedData,c),this.cachedData=null);var p=j.getID3Data(c,0),l=p?p.length:0,h,o,s=this._audioTrack,R=this._id3Track,x=p?j.getTimeStamp(p):void 0,C=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(x,d)),p&&p.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),o=this.initPTS;l<C;){if(this.canParse(c,l)){var L=this.appendFrame(s,c,l);L?(this.frameIndex++,o=L.sample.pts,l+=L.length,h=l):l=C}else j.canParse(c,l)?(p=j.getID3Data(c,l),R.samples.push({pts:o,dts:o,data:p}),l+=p.length,h=l):l++;if(l===C&&h!==C){var O=Object(G.sliceUint8)(c,h);this.cachedData?this.cachedData=Object(z.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:s,avcTrack:Object(B.dummyTrack)(),id3Track:R,textTrack:Object(B.dummyTrack)()}},g.demuxSampleAes=function(c,d,p){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(c){var d=this.cachedData;return d&&(this.cachedData=null,this.demux(d,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(B.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(B.dummyTrack)()}},g.destroy=function(){},y}(),D=function(g,m){return Object(Y.isFiniteNumber)(g)?g*90:m*9e4};J.default=n},"./src/demux/chunk-cache.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return Y});var Y=function(){function B(){this.chunks=[],this.dataLength=0}var z=B.prototype;return z.push=function(n){this.chunks.push(n),this.dataLength+=n.length},z.flush=function(){var n=this.chunks,D=this.dataLength,y;if(n.length)n.length===1?y=n[0]:y=j(n,D);else return new Uint8Array(0);return this.reset(),y},z.reset=function(){this.chunks.length=0,this.dataLength=0},B}();function j(B,z){for(var G=new Uint8Array(z),n=0,D=0;D<B.length;D++){var y=B[D];G.set(y,n),n+=y.length}return G}},"./src/demux/dummy-demuxed-track.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"dummyTrack",function(){return Y});function Y(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/utils/logger.ts"),j=function(){function B(G){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=G,this.bytesAvailable=G.byteLength,this.word=0,this.bitsAvailable=0}var z=B.prototype;return z.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},z.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)},z.readBits=function(n){var D=Math.min(this.bitsAvailable,n),y=this.word>>>32-D;return n>32&&Y.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},z.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()},z.skipUEG=function(){this.skipBits(1+this.skipLZ())},z.skipEG=function(){this.skipBits(1+this.skipLZ())},z.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},z.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},z.readBoolean=function(){return this.readBits(1)===1},z.readUByte=function(){return this.readBits(8)},z.readUShort=function(){return this.readBits(16)},z.readUInt=function(){return this.readBits(32)},z.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},z.readSPS=function(){var n=0,D=0,y=0,g=0,m,c,d,p=this.readUByte.bind(this),l=this.readBits.bind(this),h=this.readUEG.bind(this),o=this.readBoolean.bind(this),s=this.skipBits.bind(this),R=this.skipEG.bind(this),x=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);p();var L=p();if(l(5),s(3),p(),x(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var O=h();if(O===3&&s(1),x(),x(),s(1),o())for(c=O!==3?8:12,d=0;d<c;d++)o()&&(d<6?C(16):C(64))}x();var A=h();if(A===0)h();else if(A===1)for(s(1),R(),R(),m=h(),d=0;d<m;d++)R();x(),s(1);var w=h(),b=h(),u=l(1);u===0&&s(1),s(1),o()&&(n=h(),D=h(),y=h(),g=h());var v=[1,1];if(o()&&o()){var a=p();switch(a){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[p()<<8|p(),p()<<8|p()];break}}}return{width:Math.ceil((w+1)*16-n*2-D*2),height:(2-u)*(b+1)*16-(u?2:4)*(y+g),pixelRatio:v}},z.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},B}();J.default=j},"./src/demux/id3.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"isHeader",function(){return Y}),k.d(J,"isFooter",function(){return j}),k.d(J,"getID3Data",function(){return B}),k.d(J,"canParse",function(){return G}),k.d(J,"getTimeStamp",function(){return n}),k.d(J,"isTimeStampFrame",function(){return D}),k.d(J,"getID3Frames",function(){return g}),k.d(J,"decodeFrame",function(){return m}),k.d(J,"utf8ArrayToStr",function(){return h}),k.d(J,"testables",function(){return o});var Y=function(C,L){return L+10<=C.length&&(C[L]===73&&C[L+1]===68&&C[L+2]===51&&(C[L+3]<255&&C[L+4]<255&&(C[L+6]<128&&C[L+7]<128&&C[L+8]<128&&C[L+9]<128)))},j=function(C,L){return L+10<=C.length&&(C[L]===51&&C[L+1]===68&&C[L+2]===73&&(C[L+3]<255&&C[L+4]<255&&(C[L+6]<128&&C[L+7]<128&&C[L+8]<128&&C[L+9]<128)))},B=function(C,L){for(var O=L,A=0;Y(C,L);){A+=10;var w=z(C,L+6);A+=w,j(C,L+10)&&(A+=10),L+=A}return A>0?C.subarray(O,O+A):void 0},z=function(C,L){var O=0;return O=(C[L]&127)<<21,O|=(C[L+1]&127)<<14,O|=(C[L+2]&127)<<7,O|=C[L+3]&127,O},G=function(C,L){return Y(C,L)&&z(C,L+6)+10<=C.length-L},n=function(C){for(var L=g(C),O=0;O<L.length;O++){var A=L[O];if(D(A))return l(A)}return},D=function(C){return C&&C.key==="PRIV"&&C.info==="com.apple.streaming.transportStreamTimestamp"},y=function(C){var L=String.fromCharCode(C[0],C[1],C[2],C[3]),O=z(C,4),A=10;return{type:L,size:O,data:C.subarray(A,A+O)}},g=function(C){for(var L=0,O=[];Y(C,L);){var A=z(C,L+6);L+=10;for(var w=L+A;L+8<w;){var b=y(C.subarray(L)),u=m(b);u&&O.push(u),L+=b.size+10}j(C,L)&&(L+=10)}return O},m=function(C){return C.type==="PRIV"?c(C):C.type[0]==="W"?p(C):d(C)},c=function(C){if(C.size<2)return;var L=h(C.data,!0),O=new Uint8Array(C.data.subarray(L.length+1));return{key:C.type,info:L,data:O.buffer}},d=function(C){if(C.size<2)return;if(C.type==="TXXX"){var L=1,O=h(C.data.subarray(L),!0);L+=O.length+1;var A=h(C.data.subarray(L));return{key:C.type,info:O,data:A}}var w=h(C.data.subarray(1));return{key:C.type,data:w}},p=function(C){if(C.type==="WXXX"){if(C.size<2)return;var L=1,O=h(C.data.subarray(L),!0);L+=O.length+1;var A=h(C.data.subarray(L));return{key:C.type,info:O,data:A}}var w=h(C.data);return{key:C.type,data:w}},l=function(C){if(C.data.byteLength===8){var L=new Uint8Array(C.data),O=L[3]&1,A=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return A/=45,O&&(A+=4772185884e-2),Math.round(A)}return},h=function(C,L){L===void 0&&(L=!1);var O=R();if(O){var A=O.decode(C);if(L){var w=A.indexOf("\0");return w!==-1?A.substring(0,w):A}return A.replace(/\0/g,"")}for(var b=C.length,u,v,a,_="",N=0;N<b;){if(u=C[N++],u===0&&L)return _;if(u===0||u===3)continue;switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(u);break;case 12:case 13:v=C[N++],_+=String.fromCharCode((u&31)<<6|v&63);break;case 14:v=C[N++],a=C[N++],_+=String.fromCharCode((u&15)<<12|(v&63)<<6|(a&63)<<0);break;default:}}return _},o={decodeTextFrame:d},s;function R(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/demux/base-audio-demuxer.ts"),j=k("./src/demux/id3.ts"),B=k("./src/utils/logger.ts"),z=k("./src/demux/mpegaudio.ts");function G(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,d){return c.__proto__=d,c},n(y,g)}var D=function(y){G(g,y);function g(){return y.apply(this,arguments)||this}var m=g.prototype;return m.resetInitSegment=function(d,p,l){y.prototype.resetInitSegment.call(this,d,p,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:d,duration:l,inputTimeScale:9e4,dropped:0}},g.probe=function(d){if(!d)return!1;for(var p=j.getID3Data(d,0)||[],l=p.length,h=d.length;l<h;l++)if(z.probe(d,l))return B.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(d,p){return z.canParse(d,p)},m.appendFrame=function(d,p,l){return this.initPTS===null?void 0:z.appendFrame(d,p,l,this.initPTS,this.frameIndex)},g}(Y.default);D.minProbeByteLength=4,J.default=D},"./src/demux/mp4demuxer.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/utils/mp4-tools.ts"),j=k("./src/demux/dummy-demuxed-track.ts"),B=function(){function z(n,D){this.remainderData=null,this.config=void 0,this.config=D}var G=z.prototype;return G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.resetContiguity=function(){},z.probe=function(D){return Object(Y.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},G.demux=function(D){var y=D,g=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(Y.appendUint8Array)(this.remainderData,D));var m=Object(Y.segmentValidRange)(y);this.remainderData=m.remainder,g.samples=m.valid||new Uint8Array}else g.samples=y;return{audioTrack:Object(j.dummyTrack)(),avcTrack:g,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.flush=function(){var D=Object(j.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:D,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.demuxSampleAes=function(D,y,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},z}();B.minProbeByteLength=1024,J.default=B},"./src/demux/mpegaudio.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"appendFrame",function(){return n}),k.d(J,"parseHeader",function(){return D}),k.d(J,"isHeaderPattern",function(){return y}),k.d(J,"isHeader",function(){return g}),k.d(J,"canParse",function(){return m}),k.d(J,"probe",function(){return c});var Y=null,j=[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],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],z=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[0,1,1,4];function n(d,p,l,h,o){if(l+24>p.length)return;var s=D(p,l);if(s&&l+s.frameLength<=p.length){var R=s.samplesPerFrame*9e4/s.sampleRate,x=h+o*R,C={unit:p.subarray(l,l+s.frameLength),pts:x,dts:x};return d.config=[],d.channelCount=s.channelCount,d.samplerate=s.sampleRate,d.samples.push(C),{sample:C,length:s.frameLength,missing:0}}}function D(d,p){var l=d[p+1]>>3&3,h=d[p+1]>>1&3,o=d[p+2]>>4&15,s=d[p+2]>>2&3;if(l!==1&&o!==0&&o!==15&&s!==3){var R=d[p+2]>>1&1,x=d[p+3]>>6,C=l===3?3-h:h===3?3:4,L=j[C*14+o-1]*1e3,O=l===3?0:l===2?1:2,A=B[O*3+s],w=x===3?1:2,b=z[l][h],u=G[h],v=b*8*u,a=Math.floor(b*L/A+R)*u;if(Y===null){var _=navigator.userAgent||"",N=_.match(/Chrome\/(\d+)/i);Y=N?parseInt(N[1]):0}var F=!!Y&&Y<=87;return F&&h===2&&L>=224e3&&x===0&&(d[p+3]=d[p+3]|128),{sampleRate:A,channelCount:w,frameLength:a,samplesPerFrame:v}}}function y(d,p){return d[p]===255&&(d[p+1]&224)===224&&(d[p+1]&6)!==0}function g(d,p){return p+1<d.length&&y(d,p)}function m(d,p){var l=4;return y(d,p)&&l<=d.length-p}function c(d,p){if(p+1<d.length&&y(d,p)){var l=4,h=D(d,p),o=l;h!=null&&h.frameLength&&(o=h.frameLength);var s=p+o;return s===d.length||g(d,s)}return!1}},"./src/demux/sample-aes.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/crypt/decrypter.ts"),j=k("./src/demux/tsdemuxer.ts"),B=function(){function z(n,D,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new Y.default(n,D,{removePKCS7Padding:!1})}var G=z.prototype;return G.decryptBuffer=function(D,y){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,y)},G.decryptAacSample=function(D,y,g,m){var c=D[y].unit,d=c.subarray(16,c.length-c.length%16),p=d.buffer.slice(d.byteOffset,d.byteOffset+d.length),l=this;this.decryptBuffer(p,function(h){var o=new Uint8Array(h);c.set(o,16),m||l.decryptAacSamples(D,y+1,g)})},G.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}},G.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},G.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},G.decryptAvcSample=function(D,y,g,m,c,d){var p=Object(j.discardEPB)(c.data),l=this.getAvcEncryptedData(p),h=this;this.decryptBuffer(l.buffer,function(o){c.data=h.getAvcDecryptedUnit(p,o),d||h.decryptAvcSamples(D,y,g+1,m)})},G.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 d=c[g];if(d.data.length<=48||d.type!==1&&d.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(D,y,g,m,d,p),!p)return}}},z}();J.default=B},"./src/demux/transmuxer-interface.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return c});var Y=k("./node_modules/webworkify-webpack/index.js"),j=k.n(Y),B=k("./src/events.ts"),z=k("./src/demux/transmuxer.ts"),G=k("./src/utils/logger.ts"),n=k("./src/errors.ts"),D=k("./src/utils/mediasource-helper.ts"),y=k("./node_modules/eventemitter3/index.js"),g=k.n(y),m=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function d(l,h,o,s){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=h,this.onTransmuxComplete=o,this.onFlush=s;var x=l.config,C=function(b,u){u=u||{},u.frag=R.frag,u.id=R.id,l.trigger(b,u)};this.observer=new y.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,C),this.observer.on(B.Events.ERROR,C);var L={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var A;try{A=this.worker=Y("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),A.addEventListener("message",this.onwmsg),A.onerror=function(w){l.trigger(B.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(w.message+" ("+w.filename+":"+w.lineno+")")})},A.postMessage({cmd:"init",typeSupported:L,vendor:O,id:h,config:JSON.stringify(x)})}catch(w){G.logger.warn("Error in worker:",w),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new z.default(this.observer,L,x,O,h),this.worker=null}}else this.transmuxer=new z.default(this.observer,L,x,O,h)}var p=d.prototype;return p.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},p.push=function(h,o,s,R,x,C,L,O,A,w){var b=this;A.transmuxing.start=self.performance.now();var u=this.transmuxer,v=this.worker,a=C?C.start:x.start,_=x.decryptdata,N=this.frag,F=!(N&&x.cc===N.cc),S=!(N&&A.level===N.level),U=N?A.sn-N.sn:-1,M=this.part?A.part-this.part.index:1,E=!S&&(U===1||U===0&&M===1),W=self.performance.now();(S||U||x.stats.parsing.start===0)&&(x.stats.parsing.start=W),C&&(M||!E)&&(C.stats.parsing.start=W);var Z=new z.TransmuxState(F,E,O,S,a);if(!E||F){G.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+A.sn+" p: "+A.part+" level: "+A.level+" id: "+A.id+`
|
|
discontinuity: `+F+`
|
|
trackSwitch: `+S+`
|
|
contiguous: `+E+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+a);var ne=new z.TransmuxConfig(s,R,o,L,w);this.configureTransmuxer(ne)}if(this.frag=x,this.part=C,v)v.postMessage({cmd:"demux",data:h,decryptdata:_,chunkMeta:A,state:Z},h instanceof ArrayBuffer?[h]:[]);else if(u){var ae=u.push(h,_,A,Z);Object(z.isPromise)(ae)?ae.then(function(we){b.handleTransmuxComplete(we)}):this.handleTransmuxComplete(ae)}},p.flush=function(h){var o=this;h.transmuxing.start=self.performance.now();var s=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:h});else if(s){var x=s.flush(h);Object(z.isPromise)(x)?x.then(function(C){o.handleFlushResult(C,h)}):this.handleFlushResult(x,h)}},p.handleFlushResult=function(h,o){var s=this;h.forEach(function(R){s.handleTransmuxComplete(R)}),this.onFlush(o)},p.onWorkerMessage=function(h){var o=h.data,s=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,s.trigger(o.event,o.data);break}}},p.configureTransmuxer=function(h){var o=this.worker,s=this.transmuxer;o?o.postMessage({cmd:"configure",config:h}):s&&s.configure(h)},p.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},d}()},"./src/demux/transmuxer-worker.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return n});var Y=k("./src/demux/transmuxer.ts"),j=k("./src/events.ts"),B=k("./src/utils/logger.ts"),z=k("./node_modules/eventemitter3/index.js"),G=k.n(z);function n(c){var d=new z.EventEmitter,p=function(h,o){c.postMessage({event:h,data:o})};d.on(j.Events.FRAG_DECRYPTED,p),d.on(j.Events.ERROR,p),c.addEventListener("message",function(l){var h=l.data;switch(h.cmd){case"init":{var o=JSON.parse(h.config);c.transmuxer=new Y.default(d,h.typeSupported,o,h.vendor,h.id),Object(B.enableLogs)(o.debug),p("init",null);break}case"configure":{c.transmuxer.configure(h.config);break}case"demux":{var s=c.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object(Y.isPromise)(s)?s.then(function(C){D(c,C)}):D(c,s);break}case"flush":{var R=h.chunkMeta,x=c.transmuxer.flush(R);Object(Y.isPromise)(x)?x.then(function(C){g(c,C,R)}):g(c,x,R);break}default:break}})}function D(c,d){if(m(d.remuxResult))return;var p=[],l=d.remuxResult,h=l.audio,o=l.video;h&&y(p,h),o&&y(p,o),c.postMessage({event:"transmuxComplete",data:d},p)}function y(c,d){d.data1&&c.push(d.data1.buffer),d.data2&&c.push(d.data2.buffer)}function g(c,d,p){d.forEach(function(l){D(c,l)}),c.postMessage({event:"flush",data:p})}function m(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return o}),k.d(J,"isPromise",function(){return x}),k.d(J,"TransmuxConfig",function(){return C}),k.d(J,"TransmuxState",function(){return L});var Y=k("./src/events.ts"),j=k("./src/errors.ts"),B=k("./src/crypt/decrypter.ts"),z=k("./src/demux/aacdemuxer.ts"),G=k("./src/demux/mp4demuxer.ts"),n=k("./src/demux/tsdemuxer.ts"),D=k("./src/demux/mp3demuxer.ts"),y=k("./src/remux/mp4-remuxer.ts"),g=k("./src/remux/passthrough-remuxer.ts"),m=k("./src/demux/chunk-cache.ts"),c=k("./src/utils/mp4-tools.ts"),d=k("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(O){d.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var l=[{demux:n.default,remux:y.default},{demux:G.default,remux:g.default},{demux:z.default,remux:y.default},{demux:D.default,remux:y.default}],h=1024;l.forEach(function(O){var A=O.demux;h=Math.max(h,A.minProbeByteLength)});var o=function(){function O(w,b,u,v,a){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=w,this.typeSupported=b,this.config=u,this.vendor=v,this.id=a}var A=O.prototype;return A.configure=function(b){this.transmuxConfig=b,this.decrypter&&this.decrypter.reset()},A.push=function(b,u,v,a){var _=this,N=v.transmuxing;N.executeStart=p();var F=new Uint8Array(b),S=this.cache,U=this.config,M=this.currentTransmuxState,E=this.transmuxConfig;a&&(this.currentTransmuxState=a);var W=s(F,u);if(W&&W.method==="AES-128"){var Z=this.getDecrypter();if(U.enableSoftwareAES){var ne=Z.softwareDecrypt(F,W.key.buffer,W.iv.buffer);if(!ne)return N.executeEnd=p(),R(v);F=new Uint8Array(ne)}else return this.decryptionPromise=Z.webCryptoDecrypt(F,W.key.buffer,W.iv.buffer).then(function(We){var qe=_.push(We,null,v);return _.decryptionPromise=null,qe}),this.decryptionPromise}var ae=a||M,we=ae.contiguous,fe=ae.discontinuity,_e=ae.trackSwitch,Se=ae.accurateTimeOffset,ve=ae.timeOffset,ue=E.audioCodec,le=E.videoCodec,Oe=E.defaultInitPts,Ye=E.duration,Ve=E.initSegmentData;if((fe||_e)&&this.resetInitSegment(Ve,ue,le,Ye),fe&&this.resetInitialTimestamp(Oe),we||this.resetContiguity(),this.needsProbing(F,fe,_e)){if(S.dataLength){var $e=S.flush();F=Object(c.appendUint8Array)($e,F)}this.configureTransmuxer(F,E)}var Ze=this.transmux(F,W,ve,Se,v),Fe=this.currentTransmuxState;return Fe.contiguous=!0,Fe.discontinuity=!1,Fe.trackSwitch=!1,N.executeEnd=p(),Ze},A.flush=function(b){var u=this,v=b.transmuxing;v.executeStart=p();var a=this.decrypter,_=this.cache,N=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return u.flush(b)});var S=[],U=N.timeOffset;if(a){var M=a.flush();M&&S.push(this.push(M,null,b))}var E=_.dataLength;_.reset();var W=this.demuxer,Z=this.remuxer;if(!W||!Z)return E>=h&&this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=p(),[R(b)];var ne=W.flush(U);return x(ne)?ne.then(function(ae){return u.flushRemux(S,ae,b),S}):(this.flushRemux(S,ne,b),S)},A.flushRemux=function(b,u,v){var a=u.audioTrack,_=u.avcTrack,N=u.id3Track,F=u.textTrack,S=this.currentTransmuxState,U=S.accurateTimeOffset,M=S.timeOffset;d.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var E=this.remuxer.remux(a,_,N,F,M,U,!0,this.id);b.push({remuxResult:E,chunkMeta:v}),v.transmuxing.executeEnd=p()},A.resetInitialTimestamp=function(b){var u=this.demuxer,v=this.remuxer;if(!u||!v)return;u.resetTimeStamp(b),v.resetTimeStamp(b)},A.resetContiguity=function(){var b=this.demuxer,u=this.remuxer;if(!b||!u)return;b.resetContiguity(),u.resetNextTimestamp()},A.resetInitSegment=function(b,u,v,a){var _=this.demuxer,N=this.remuxer;if(!_||!N)return;_.resetInitSegment(u,v,a),N.resetInitSegment(b,u,v)},A.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},A.transmux=function(b,u,v,a,_){var N;return u&&u.method==="SAMPLE-AES"?N=this.transmuxSampleAes(b,u,v,a,_):N=this.transmuxUnencrypted(b,v,a,_),N},A.transmuxUnencrypted=function(b,u,v,a){var _=this.demuxer.demux(b,u,!1,!this.config.progressive),N=_.audioTrack,F=_.avcTrack,S=_.id3Track,U=_.textTrack,M=this.remuxer.remux(N,F,S,U,u,v,!1,this.id);return{remuxResult:M,chunkMeta:a}},A.transmuxSampleAes=function(b,u,v,a,_){var N=this;return this.demuxer.demuxSampleAes(b,u,v).then(function(F){var S=N.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,v,a,!1,N.id);return{remuxResult:S,chunkMeta:_}})},A.configureTransmuxer=function(b,u){for(var v=this.config,a=this.observer,_=this.typeSupported,N=this.vendor,F=u.audioCodec,S=u.defaultInitPts,U=u.duration,M=u.initSegmentData,E=u.videoCodec,W,Z=0,ne=l.length;Z<ne;Z++)if(l[Z].demux.probe(b)){W=l[Z];break}W||(d.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:G.default,remux:g.default});var ae=this.demuxer,we=this.remuxer,fe=W.remux,_e=W.demux;(!we||!(we instanceof fe))&&(this.remuxer=new fe(a,v,_,N)),(!ae||!(ae instanceof _e))&&(this.demuxer=new _e(a,v,_),this.probe=_e.probe),this.resetInitSegment(M,F,E,U),this.resetInitialTimestamp(S)},A.needsProbing=function(b,u,v){return!this.demuxer||!this.remuxer||u||v},A.getDecrypter=function(){var b=this.decrypter;return b||(b=this.decrypter=new B.default(this.observer,this.config)),b},O}();function s(O,A){var w=null;return O.byteLength>0&&A!=null&&A.key!=null&&A.iv!==null&&A.method!=null&&(w=A),w}var R=function(A){return{remuxResult:{},chunkMeta:A}};function x(O){return"then"in O&&O.then instanceof Function}var C=function(A,w,b,u,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=A,this.videoCodec=w,this.initSegmentData=b,this.duration=u,this.defaultInitPts=v},L=function(A,w,b,u,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=A,this.contiguous=w,this.accurateTimeOffset=b,this.trackSwitch=u,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"discardEPB",function(){return R});var Y=k("./src/demux/adts.ts"),j=k("./src/demux/mpegaudio.ts"),B=k("./src/demux/exp-golomb.ts"),z=k("./src/demux/id3.ts"),G=k("./src/demux/sample-aes.ts"),n=k("./src/events.ts"),D=k("./src/utils/mp4-tools.ts"),y=k("./src/utils/logger.ts"),g=k("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},c=function(){function x(L,O,A){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=L,this.config=O,this.typeSupported=A}x.probe=function(O){var A=x.syncOffset(O);return A<0?!1:(A&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},x.syncOffset=function(O){for(var A=Math.min(1e3,O.length-3*188),w=0;w<A;){if(O[w]===71&&O[w+188]===71&&O[w+2*188]===71)return w;w++}return-1},x.createTrack=function(O,A){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:m[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?A:void 0}};var C=x.prototype;return C.resetInitSegment=function(O,A,w){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",w),this._audioTrack=x.createTrack("audio",w),this._id3Track=x.createTrack("id3",w),this._txtTrack=x.createTrack("text",w),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=A,this._duration=w},C.resetTimeStamp=function(){},C.resetContiguity=function(){var O=this._audioTrack,A=this._avcTrack,w=this._id3Track;O&&(O.pesData=null),A&&(A.pesData=null),w&&(w.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},C.demux=function(O,A,w,b){w===void 0&&(w=!1),b===void 0&&(b=!1),w||(this.sampleAes=null);var u,v=this._avcTrack,a=this._audioTrack,_=this._id3Track,N=v.pid,F=v.pesData,S=a.pid,U=_.pid,M=a.pesData,E=_.pesData,W=!1,Z=this.pmtParsed,ne=this._pmtId,ae=O.length;if(this.remainderData&&(O=Object(D.appendUint8Array)(this.remainderData,O),ae=O.length,this.remainderData=null),ae<188&&!b)return this.remainderData=O,{audioTrack:a,avcTrack:v,id3Track:_,textTrack:this._txtTrack};var we=Math.max(0,x.syncOffset(O));ae-=(ae+we)%188,ae<O.byteLength&&!b&&(this.remainderData=new Uint8Array(O.buffer,ae,O.buffer.byteLength-ae));for(var fe=we;fe<ae;fe+=188)if(O[fe]===71){var _e=!!(O[fe+1]&64),Se=((O[fe+1]&31)<<8)+O[fe+2],ve=(O[fe+3]&48)>>4,ue=void 0;if(ve>1){if(ue=fe+5+O[fe+4],ue===fe+188)continue}else ue=fe+4;switch(Se){case N:_e&&(F&&(u=h(F))&&this.parseAVCPES(u,!1),F={data:[],size:0}),F&&(F.data.push(O.subarray(ue,fe+188)),F.size+=fe+188-ue);break;case S:_e&&(M&&(u=h(M))&&(a.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),M={data:[],size:0}),M&&(M.data.push(O.subarray(ue,fe+188)),M.size+=fe+188-ue);break;case U:_e&&(E&&(u=h(E))&&this.parseID3PES(u),E={data:[],size:0}),E&&(E.data.push(O.subarray(ue,fe+188)),E.size+=fe+188-ue);break;case 0:_e&&(ue+=O[ue]+1),ne=this._pmtId=p(O,ue);break;case ne:{_e&&(ue+=O[ue]+1);var le=l(O,ue,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,w);N=le.avc,N>0&&(v.pid=N),S=le.audio,S>0&&(a.pid=S,a.isAAC=le.isAAC),U=le.id3,U>0&&(_.pid=U),W&&!Z&&(y.logger.log("reparse from beginning"),W=!1,fe=we-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!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"});v.pesData=F,a.pesData=M,_.pesData=E;var Oe={audioTrack:a,avcTrack:v,id3Track:_,textTrack:this._txtTrack};return b&&this.extractRemainingSamples(Oe),Oe},C.flush=function(){var O=this.remainderData;this.remainderData=null;var A;return O?A=this.demux(O,-1,!1,!0):A={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(A),this.sampleAes?this.decrypt(A,this.sampleAes):A},C.extractRemainingSamples=function(O){var A=O.audioTrack,w=O.avcTrack,b=O.id3Track,u=w.pesData,v=A.pesData,a=b.pesData,_;u&&(_=h(u))?(this.parseAVCPES(_,!0),w.pesData=null):w.pesData=u,v&&(_=h(v))?(A.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),A.pesData=null):(v!=null&&v.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),A.pesData=v),a&&(_=h(a))?(this.parseID3PES(_),b.pesData=null):b.pesData=a},C.demuxSampleAes=function(O,A,w){var b=this.demux(O,w,!0,!this.config.progressive),u=this.sampleAes=new G.default(this.observer,this.config,A);return this.decrypt(b,u)},C.decrypt=function(O,A){return new Promise(function(w){var b=O.audioTrack,u=O.avcTrack;b.samples&&b.isAAC?A.decryptAacSamples(b.samples,0,function(){u.samples?A.decryptAvcSamples(u.samples,0,0,function(){w(O)}):w(O)}):u.samples&&A.decryptAvcSamples(u.samples,0,0,function(){w(O)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(O,A){var w=this,b=this._avcTrack,u=this.parseAVCNALu(O.data),v=!1,a=this.avcSample,_,N=!1;O.data=null,a&&u.length&&!b.audFound&&(o(a,b),a=this.avcSample=d(!1,O.pts,O.dts,"")),u.forEach(function(F){switch(F.type){case 1:{_=!0,a||(a=w.avcSample=d(!0,O.pts,O.dts,"")),v&&(a.debug+="NDR "),a.frame=!0;var S=F.data;if(N&&S.length>4){var U=new B.default(S).readSliceType();(U===2||U===4||U===7||U===9)&&(a.key=!0)}break}case 5:_=!0,a||(a=w.avcSample=d(!0,O.pts,O.dts,"")),v&&(a.debug+="IDR "),a.key=!0,a.frame=!0;break;case 6:{_=!0,v&&a&&(a.debug+="SEI ");var M=new B.default(R(F.data));M.readUByte();for(var E=0,W=0,Z=!1,ne=0;!Z&&M.bytesAvailable>1;){E=0;do ne=M.readUByte(),E+=ne;while(ne===255);W=0;do ne=M.readUByte(),W+=ne;while(ne===255);if(E===4&&M.bytesAvailable!==0){Z=!0;var ae=M.readUByte();if(ae===181){var we=M.readUShort();if(we===49){var fe=M.readUInt();if(fe===1195456820){var _e=M.readUByte();if(_e===3){for(var Se=M.readUByte(),ve=M.readUByte(),ue=31&Se,le=[Se,ve],Oe=0;Oe<ue;Oe++)le.push(M.readUByte()),le.push(M.readUByte()),le.push(M.readUByte());s(w._txtTrack.samples,{type:3,pts:O.pts,bytes:le})}}}}}else if(E===5&&M.bytesAvailable!==0){if(Z=!0,W>16){for(var Ye=[],Ve=0;Ve<16;Ve++)Ye.push(M.readUByte().toString(16)),(Ve===3||Ve===5||Ve===7||Ve===9)&&Ye.push("-");for(var $e=W-16,Ze=new Uint8Array($e),Fe=0;Fe<$e;Fe++)Ze[Fe]=M.readUByte();s(w._txtTrack.samples,{pts:O.pts,payloadType:E,uuid:Ye.join(""),userData:Object(z.utf8ArrayToStr)(Ze),userDataBytes:Ze})}}else if(W<M.bytesAvailable)for(var We=0;We<W;We++)M.readUByte()}break}case 7:if(_=!0,N=!0,v&&a&&(a.debug+="SPS "),!b.sps){var qe=new B.default(F.data),oe=qe.readSPS();b.width=oe.width,b.height=oe.height,b.pixelRatio=oe.pixelRatio,b.sps=[F.data],b.duration=w._duration;for(var Ee=F.data.subarray(1,4),Ce="avc1.",Ae=0;Ae<3;Ae++){var ze=Ee[Ae].toString(16);ze.length<2&&(ze="0"+ze),Ce+=ze}b.codec=Ce}break;case 8:_=!0,v&&a&&(a.debug+="PPS "),b.pps||(b.pps=[F.data]);break;case 9:_=!1,b.audFound=!0,a&&o(a,b),a=w.avcSample=d(!1,O.pts,O.dts,v?"AUD ":"");break;case 12:_=!1;break;default:_=!1,a&&(a.debug+="unknown NAL "+F.type+" ");break}if(a&&_){var Je=a.units;Je.push(F)}}),A&&a&&(o(a,b),this.avcSample=null)},C.getLastNalUnit=function(){var O,A=this.avcSample,w;if(!A||A.units.length===0){var b=this._avcTrack.samples;A=b[b.length-1]}if((O=A)!==null&&O!==void 0&&O.units){var u=A.units;w=u[u.length-1]}return w},C.parseAVCNALu=function(O){var A=O.byteLength,w=this._avcTrack,b=w.naluState||0,u=b,v=[],a=0,_,N,F,S=-1,U=0;for(b===-1&&(S=0,U=O[0]&31,b=0,a=1);a<A;){if(_=O[a++],!b){b=_?0:1;continue}if(b===1){b=_?0:2;continue}if(!_)b=3;else if(_===1){if(S>=0){var M={data:O.subarray(S,a-b-1),type:U};v.push(M)}else{var E=this.getLastNalUnit();if(E&&(u&&a<=4-u&&(E.state&&(E.data=E.data.subarray(0,E.data.byteLength-u))),N=a-b-1,N>0)){var W=new Uint8Array(E.data.byteLength+N);W.set(E.data,0),W.set(O.subarray(0,N),E.data.byteLength),E.data=W,E.state=0}}a<A?(F=O[a]&31,S=a,U=F,b=0):b=-1}else b=0}if(S>=0&&b>=0){var Z={data:O.subarray(S,A),type:U,state:b};v.push(Z)}if(v.length===0){var ne=this.getLastNalUnit();if(ne){var ae=new Uint8Array(ne.data.byteLength+O.byteLength);ae.set(ne.data,0),ae.set(O,ne.data.byteLength),ne.data=ae}}return w.naluState=b,v},C.parseAACPES=function(O){var A=0,w=this._audioTrack,b=this.aacOverFlow,u=O.data;if(b){this.aacOverFlow=null;var v=b.sample.unit.byteLength,a=Math.min(b.missing,v),_=v-a;b.sample.unit.set(u.subarray(0,a),_),w.samples.push(b.sample),A=b.missing}var N,F;for(N=A,F=u.length;N<F-1&&!Y.isHeader(u,N);N++);if(N!==A){var S,U;if(N<F-1?(S="AAC PES did not start with ADTS header,offset:"+N,U=!1):(S="no ADTS header found in AAC PES",U=!0),y.logger.warn("parsing error:"+S),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:U,reason:S}),U)return}Y.initTrackConfig(w,this.observer,u,N,this.audioCodec);var M;if(O.pts!==void 0)M=O.pts;else if(b){var E=Y.getFrameDuration(w.samplerate);M=b.sample.pts+E}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;N<F;)if(Y.isHeader(u,N)){if(N+5<F){var Z=Y.appendFrame(w,u,N,M,W);if(Z)if(Z.missing)this.aacOverFlow=Z;else{N+=Z.length,W++;continue}}break}else N++},C.parseMPEGPES=function(O){var A=O.data,w=A.length,b=0,u=0,v=O.pts;if(v===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;u<w;)if(j.isHeader(A,u)){var a=j.appendFrame(this._audioTrack,A,u,v,b);if(a)u+=a.length,b++;else break}else u++},C.parseID3PES=function(O){if(O.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},x}();c.minProbeByteLength=188;function d(x,C,L,O){return{key:x,frame:!1,pts:C,dts:L,units:[],debug:O,length:0}}function p(x,C){return(x[C+10]&31)<<8|x[C+11]}function l(x,C,L,O){var A={audio:-1,avc:-1,id3:-1,isAAC:!0},w=(x[C+1]&15)<<8|x[C+2],b=C+3+w-4,u=(x[C+10]&15)<<8|x[C+11];for(C+=12+u;C<b;){var v=(x[C+1]&31)<<8|x[C+2];switch(x[C]){case 207:if(!O){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:A.audio===-1&&(A.audio=v);break;case 21:A.id3===-1&&(A.id3=v);break;case 219:if(!O){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:A.avc===-1&&(A.avc=v);break;case 3:case 4:L?A.audio===-1&&(A.audio=v,A.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((x[C+3]&15)<<8|x[C+4])+5}return A}function h(x){var C=0,L,O,A,w,b,u=x.data;if(!x||x.size===0)return null;for(;u[0].length<19&&u.length>1;){var v=new Uint8Array(u[0].length+u[1].length);v.set(u[0]),v.set(u[1],u[0].length),u[0]=v,u.splice(1,1)}L=u[0];var a=(L[0]<<16)+(L[1]<<8)+L[2];if(a===1){if(O=(L[4]<<8)+L[5],O&&O>x.size-6)return null;var _=L[7];_&192&&(w=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,_&64?(b=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,w-b>60*9e4&&(y.logger.warn(Math.round((w-b)/9e4)+"s delta between PTS and DTS, align them"),w=b)):b=w),A=L[8];var N=A+9;if(x.size<=N)return null;x.size-=N;for(var F=new Uint8Array(x.size),S=0,U=u.length;S<U;S++){L=u[S];var M=L.byteLength;if(N)if(N>M){N-=M;continue}else L=L.subarray(N),M-=N,N=0;F.set(L,C),C+=M}return O&&(O-=A+3),{data:F,pts:w,dts:b,len:O}}return null}function o(x,C){if(x.units.length&&x.frame){if(x.pts===void 0){var L=C.samples,O=L.length;if(O){var A=L[O-1];x.pts=A.pts,x.dts=A.dts}else{C.dropped++;return}}C.samples.push(x)}x.debug.length&&y.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function s(x,C){var L=x.length;if(L>0){if(C.pts>=x[L-1].pts)x.push(C);else for(var O=L-1;O>=0;O--)if(C.pts<x[O].pts){x.splice(O,0,C);break}}else x.push(C)}function R(x){for(var C=x.byteLength,L=[],O=1;O<C-2;)x[O]===0&&x[O+1]===0&&x[O+2]===3?(L.push(O+2),O+=2):O++;if(L.length===0)return x;var A=C-L.length,w=new Uint8Array(A),b=0;for(O=0;O<A;b++,O++)b===L[0]&&(b++,L.shift()),w[O]=x[b];return w}J.default=c},"./src/errors.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"ErrorTypes",function(){return Y}),k.d(J,"ErrorDetails",function(){return j});var Y;(function(B){B.NETWORK_ERROR="networkError",B.MEDIA_ERROR="mediaError",B.KEY_SYSTEM_ERROR="keySystemError",B.MUX_ERROR="muxError",B.OTHER_ERROR="otherError"})(Y||(Y={}));var j;(function(B){B.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",B.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",B.KEY_SYSTEM_NO_SESSION="keySystemNoSession",B.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",B.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",B.MANIFEST_LOAD_ERROR="manifestLoadError",B.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",B.MANIFEST_PARSING_ERROR="manifestParsingError",B.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",B.LEVEL_EMPTY_ERROR="levelEmptyError",B.LEVEL_LOAD_ERROR="levelLoadError",B.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",B.LEVEL_SWITCH_ERROR="levelSwitchError",B.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",B.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",B.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",B.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",B.FRAG_LOAD_ERROR="fragLoadError",B.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",B.FRAG_DECRYPT_ERROR="fragDecryptError",B.FRAG_PARSING_ERROR="fragParsingError",B.REMUX_ALLOC_ERROR="remuxAllocError",B.KEY_LOAD_ERROR="keyLoadError",B.KEY_LOAD_TIMEOUT="keyLoadTimeOut",B.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",B.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",B.BUFFER_APPEND_ERROR="bufferAppendError",B.BUFFER_APPENDING_ERROR="bufferAppendingError",B.BUFFER_STALLED_ERROR="bufferStalledError",B.BUFFER_FULL_ERROR="bufferFullError",B.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",B.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",B.INTERNAL_EXCEPTION="internalException",B.INTERNAL_ABORTED="aborted",B.UNKNOWN="unknown"})(j||(j={}))},"./src/events.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"Events",function(){return Y});var Y;(function(j){j.MEDIA_ATTACHING="hlsMediaAttaching",j.MEDIA_ATTACHED="hlsMediaAttached",j.MEDIA_DETACHING="hlsMediaDetaching",j.MEDIA_DETACHED="hlsMediaDetached",j.BUFFER_RESET="hlsBufferReset",j.BUFFER_CODECS="hlsBufferCodecs",j.BUFFER_CREATED="hlsBufferCreated",j.BUFFER_APPENDING="hlsBufferAppending",j.BUFFER_APPENDED="hlsBufferAppended",j.BUFFER_EOS="hlsBufferEos",j.BUFFER_FLUSHING="hlsBufferFlushing",j.BUFFER_FLUSHED="hlsBufferFlushed",j.MANIFEST_LOADING="hlsManifestLoading",j.MANIFEST_LOADED="hlsManifestLoaded",j.MANIFEST_PARSED="hlsManifestParsed",j.LEVEL_SWITCHING="hlsLevelSwitching",j.LEVEL_SWITCHED="hlsLevelSwitched",j.LEVEL_LOADING="hlsLevelLoading",j.LEVEL_LOADED="hlsLevelLoaded",j.LEVEL_UPDATED="hlsLevelUpdated",j.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",j.LEVELS_UPDATED="hlsLevelsUpdated",j.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",j.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",j.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",j.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",j.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",j.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",j.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",j.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",j.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",j.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",j.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",j.CUES_PARSED="hlsCuesParsed",j.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",j.INIT_PTS_FOUND="hlsInitPtsFound",j.FRAG_LOADING="hlsFragLoading",j.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",j.FRAG_LOADED="hlsFragLoaded",j.FRAG_DECRYPTED="hlsFragDecrypted",j.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",j.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",j.FRAG_PARSING_METADATA="hlsFragParsingMetadata",j.FRAG_PARSED="hlsFragParsed",j.FRAG_BUFFERED="hlsFragBuffered",j.FRAG_CHANGED="hlsFragChanged",j.FPS_DROP="hlsFpsDrop",j.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",j.ERROR="hlsError",j.DESTROYING="hlsDestroying",j.KEY_LOADING="hlsKeyLoading",j.KEY_LOADED="hlsKeyLoaded",j.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",j.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Y||(Y={}))},"./src/hls.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return x});var Y=k("./node_modules/url-toolkit/src/url-toolkit.js"),j=k.n(Y),B=k("./src/loader/playlist-loader.ts"),z=k("./src/loader/key-loader.ts"),G=k("./src/controller/id3-track-controller.ts"),n=k("./src/controller/latency-controller.ts"),D=k("./src/controller/level-controller.ts"),y=k("./src/controller/fragment-tracker.ts"),g=k("./src/controller/stream-controller.ts"),m=k("./src/is-supported.ts"),c=k("./src/utils/logger.ts"),d=k("./src/config.ts"),p=k("./node_modules/eventemitter3/index.js"),l=k.n(p),h=k("./src/events.ts"),o=k("./src/errors.ts");function s(C,L){for(var O=0;O<L.length;O++){var A=L[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(C,A.key,A)}}function R(C,L,O){return L&&s(C.prototype,L),O&&s(C,O),C}var x=function(){C.isSupported=function(){return Object(m.isSupported)()};function C(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 A=this.config=Object(d.mergeConfig)(C.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(A.debug),this._autoLevelCapping=-1,A.progressive&&Object(d.enableStreamingMode)(A);var w=A.abrController,b=A.bufferController,u=A.capLevelController,v=A.fpsController,a=this.abrController=new w(this),_=this.bufferController=new b(this),N=this.capLevelController=new u(this),F=new v(this),S=new B.default(this),U=new z.default(this),M=new G.default(this),E=this.levelController=new D.default(this),W=new y.FragmentTracker(this),Z=this.streamController=new g.default(this,W);N.setStreamController(Z),F.setStreamController(Z);var ne=[E,Z];this.networkControllers=ne;var ae=[S,U,a,_,N,F,M,W];this.audioTrackController=this.createController(A.audioTrackController,null,ne),this.createController(A.audioStreamController,W,ne),this.subtitleTrackController=this.createController(A.subtitleTrackController,null,ne),this.createController(A.subtitleStreamController,W,ne),this.createController(A.timelineController,null,ae),this.emeController=this.createController(A.emeController,null,ae),this.cmcdController=this.createController(A.cmcdController,null,ae),this.latencyController=this.createController(n.default,null,ae),this.coreComponents=ae}var L=C.prototype;return L.createController=function(A,w,b){if(A){var u=w?new A(this,w):new A(this);return b&&b.push(u),u}return null},L.on=function(A,w,b){b===void 0&&(b=this),this._emitter.on(A,w,b)},L.once=function(A,w,b){b===void 0&&(b=this),this._emitter.once(A,w,b)},L.removeAllListeners=function(A){this._emitter.removeAllListeners(A)},L.off=function(A,w,b,u){b===void 0&&(b=this),this._emitter.off(A,w,b,u)},L.listeners=function(A){return this._emitter.listeners(A)},L.emit=function(A,w,b){return this._emitter.emit(A,w,b)},L.trigger=function(A,w){if(this.config.debug)return this.emit(A,A,w);try{return this.emit(A,A,w)}catch(b){c.logger.error("An internal error happened while handling event "+A+'. Error message: "'+b.message+'". Here is a stacktrace:',b),this.trigger(h.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:A,error:b})}return!1},L.listenerCount=function(A){return this._emitter.listenerCount(A)},L.destroy=function(){c.logger.log("destroy"),this.trigger(h.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(A){return A.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(A){return A.destroy()}),this.coreComponents.length=0},L.attachMedia=function(A){c.logger.log("attachMedia"),this._media=A,this.trigger(h.Events.MEDIA_ATTACHING,{media:A})},L.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(h.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(A){this.stopLoad();var w=this.media,b=this.url,u=this.url=Y.buildAbsoluteURL(self.location.href,A,{alwaysNormalize:!0});c.logger.log("loadSource:"+u),w&&b&&b!==u&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(w)),this.trigger(h.Events.MANIFEST_LOADING,{url:A})},L.startLoad=function(A){A===void 0&&(A=-1),c.logger.log("startLoad("+A+")"),this.networkControllers.forEach(function(w){w.startLoad(A)})},L.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(A){A.stopLoad()})},L.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){c.logger.log("recoverMediaError");var A=this._media;this.detachMedia(),A&&this.attachMedia(A)},L.removeLevel=function(A,w){w===void 0&&(w=0),this.levelController.removeLevel(A,w)},R(C,[{key:"levels",get:function(){var A=this.levelController.levels;return A||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(A){c.logger.log("set currentLevel:"+A),this.loadLevel=A,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(A){c.logger.log("set nextLevel:"+A),this.levelController.manualLevel=A,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(A){c.logger.log("set loadLevel:"+A),this.levelController.manualLevel=A}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(A){this.levelController.nextLoadLevel=A}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(A){c.logger.log("set firstLevel:"+A),this.levelController.firstLevel=A}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(A){c.logger.log("set startLevel:"+A),A!==-1&&(A=Math.max(A,this.minAutoLevel)),this.levelController.startLevel=A}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(A){var w=!!A;w!==this.config.capLevelToPlayerSize&&(w?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=w)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(A){this._autoLevelCapping!==A&&(c.logger.log("set autoLevelCapping:"+A),this._autoLevelCapping=A)}},{key:"bandwidthEstimate",get:function(){var A=this.abrController.bwEstimator;return A?A.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var A=this.levels,w=this.config.minAutoBitrate;if(!A)return 0;for(var b=A.length,u=0;u<b;u++)if(A[u].maxBitrate>w)return u;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,w=this.autoLevelCapping,b;return w===-1&&A&&A.length?b=A.length-1:b=w,b}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(A){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,A)}},{key:"audioTracks",get:function(){var A=this.audioTrackController;return A?A.audioTracks:[]}},{key:"audioTrack",get:function(){var A=this.audioTrackController;return A?A.audioTrack:-1},set:function(A){var w=this.audioTrackController;w&&(w.audioTrack=A)}},{key:"subtitleTracks",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTrack:-1},set:function(A){var w=this.subtitleTrackController;w&&(w.subtitleTrack=A)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var A=this.subtitleTrackController;return A?A.subtitleDisplay:!1},set:function(A){var w=this.subtitleTrackController;w&&(w.subtitleDisplay=A)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(A){this.config.lowLatencyMode=A}},{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 h.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:d.hlsDefaultConfig},set:function(A){C.defaultConfig=A}}]),C}();x.defaultConfig=void 0},"./src/is-supported.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"isSupported",function(){return B}),k.d(J,"changeTypeSupported",function(){return z});var Y=k("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var G=Object(Y.getMediaSource)();if(!G)return!1;var n=j(),D=G&&typeof G.isTypeSupported=="function"&&G.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 z(){var G,n=j();return typeof(n==null||((G=n.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return c}),k.d(J,"LoadError",function(){return p});var Y=k("./src/polyfills/number.ts"),j=k("./src/errors.ts");function B(l,h){l.prototype=Object.create(h.prototype),l.prototype.constructor=l,y(l,h)}function z(l){var h=typeof Map=="function"?new Map:void 0;return z=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(s))return h.get(s);h.set(s,R)}function R(){return G(s,arguments,g(this).constructor)}return R.prototype=Object.create(s.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),y(R,s)},z(l)}function G(l,h,o){return n()?G=Reflect.construct:G=function(R,x,C){var L=[null];L.push.apply(L,x);var O=Function.bind.apply(R,L),A=new O;return C&&y(A,C.prototype),A},G.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(l){return!1}}function D(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function y(l,h){return y=Object.setPrototypeOf||function(s,R){return s.__proto__=R,s},y(l,h)}function g(l){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},g(l)}var m=Math.pow(2,17),c=function(){function l(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var h=l.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(s,R){var x=this,C=s.url;if(!C)return Promise.reject(new p({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(C?"part list":"url")));this.abort();var L=this.config,O=L.fLoader,A=L.loader;return new Promise(function(w,b){x.loader&&x.loader.destroy();var u=x.loader=s.loader=O?new O(L):new A(L),v=d(s),a={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};s.stats=u.stats,u.load(v,a,{onSuccess:function(N,F,S,U){x.resetLoader(s,u),w({frag:s,part:null,payload:N.data,networkDetails:U})},onError:function(N,F,S){x.resetLoader(s,u),b(new p({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:N,networkDetails:S}))},onAbort:function(N,F,S){x.resetLoader(s,u),b(new p({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:S}))},onTimeout:function(N,F,S){x.resetLoader(s,u),b(new p({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:S}))},onProgress:function(N,F,S,U){R&&R({frag:s,part:null,payload:S,networkDetails:U})}})})},h.loadPart=function(s,R,x){var C=this;this.abort();var L=this.config,O=L.fLoader,A=L.loader;return new Promise(function(w,b){C.loader&&C.loader.destroy();var u=C.loader=s.loader=O?new O(L):new A(L),v=d(s,R),a={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};R.stats=u.stats,u.load(v,a,{onSuccess:function(N,F,S,U){C.resetLoader(s,u),C.updateStatsFromPart(s,R);var M={frag:s,part:R,payload:N.data,networkDetails:U};x(M),w(M)},onError:function(N,F,S){C.resetLoader(s,u),b(new p({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:R,response:N,networkDetails:S}))},onAbort:function(N,F,S){s.stats.aborted=R.stats.aborted,C.resetLoader(s,u),b(new p({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:R,networkDetails:S}))},onTimeout:function(N,F,S){C.resetLoader(s,u),b(new p({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:R,networkDetails:S}))}})})},h.updateStatsFromPart=function(s,R){var x=s.stats,C=R.stats,L=C.total;if(x.loaded+=C.loaded,L){var O=Math.round(s.duration/R.duration),A=Math.min(Math.round(x.loaded/L),O),w=O-A,b=w*Math.round(x.loaded/A);x.total=x.loaded+b}else x.total=Math.max(x.loaded,x.total);var u=x.loading,v=C.loading;u.start?u.first+=v.first-v.start:(u.start=v.start,u.first=v.first),u.end=v.end},h.resetLoader=function(s,R){s.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},l}();function d(l,h){h===void 0&&(h=null);var o=h||l,s={frag:l,part:h,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},R=o.byteRangeStartOffset,x=o.byteRangeEndOffset;return Object(Y.isFiniteNumber)(R)&&Object(Y.isFiniteNumber)(x)&&(s.rangeStart=R,s.rangeEnd=x),s}var p=function(l){B(h,l);function h(o){for(var s,R=arguments.length,x=new Array(R>1?R-1:0),C=1;C<R;C++)x[C-1]=arguments[C];return s=l.call.apply(l,[this].concat(x))||this,s.data=void 0,s.data=o,s}return h}(z(Error))},"./src/loader/fragment.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"ElementaryStreamTypes",function(){return c}),k.d(J,"BaseSegment",function(){return d}),k.d(J,"Fragment",function(){return p}),k.d(J,"Part",function(){return l});var Y=k("./src/polyfills/number.ts"),j=k("./node_modules/url-toolkit/src/url-toolkit.js"),B=k.n(j),z=k("./src/utils/logger.ts"),G=k("./src/loader/level-key.ts"),n=k("./src/loader/load-stats.ts");function D(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,y(h,o)}function y(h,o){return y=Object.setPrototypeOf||function(R,x){return R.__proto__=x,R},y(h,o)}function g(h,o){for(var s=0;s<o.length;s++){var R=o[s];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(h,R.key,R)}}function m(h,o,s){return o&&g(h.prototype,o),s&&g(h,s),h}var c;(function(h){h.AUDIO="audio",h.VIDEO="video",h.AUDIOVIDEO="audiovideo"})(c||(c={}));var d=function(){function h(s){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[c.AUDIO]=null,R[c.VIDEO]=null,R[c.AUDIOVIDEO]=null,R),this.baseurl=s}var o=h.prototype;return o.setByteRange=function(R,x){var C=R.split("@",2),L=[];C.length===1?L[0]=x?x.byteRangeEndOffset:0:L[0]=parseInt(C[1]),L[1]=parseInt(C[0])+L[0],this._byteRange=L},m(h,[{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(j.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),h}(),p=function(h){D(o,h);function o(R,x){var C;return C=h.call(this,x)||this,C._decryptdata=null,C.rawProgramDateTime=null,C.programDateTime=null,C.tagList=[],C.duration=0,C.sn=0,C.levelkey=void 0,C.type=void 0,C.loader=null,C.level=-1,C.cc=0,C.startPTS=void 0,C.endPTS=void 0,C.appendedPTS=void 0,C.startDTS=void 0,C.endDTS=void 0,C.start=0,C.deltaPTS=void 0,C.maxStartPTS=void 0,C.minEndPTS=void 0,C.stats=new n.LoadStats,C.urlId=0,C.data=void 0,C.bitrateTest=!1,C.title=null,C.initSegment=null,C.type=R,C}var s=o.prototype;return s.createInitializationVector=function(x){for(var C=new Uint8Array(16),L=12;L<16;L++)C[L]=x>>8*(15-L)&255;return C},s.setDecryptDataFromLevelKey=function(x,C){var L=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(L=G.LevelKey.fromURI(x.uri),L.method=x.method,L.iv=this.createInitializationVector(C),L.keyFormat="identity"),L},s.setElementaryStreamInfo=function(x,C,L,O,A,w){w===void 0&&(w=!1);var b=this.elementaryStreams,u=b[x];if(!u){b[x]={startPTS:C,endPTS:L,startDTS:O,endDTS:A,partial:w};return}u.startPTS=Math.min(u.startPTS,C),u.endPTS=Math.max(u.endPTS,L),u.startDTS=Math.min(u.startDTS,O),u.endDTS=Math.max(u.endDTS,A)},s.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[c.AUDIO]=null,x[c.VIDEO]=null,x[c.AUDIOVIDEO]=null},m(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&z.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Y.isFiniteNumber)(this.programDateTime))return null;var x=Object(Y.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),o}(d),l=function(h){D(o,h);function o(s,R,x,C,L){var O;O=h.call(this,x)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=R,O.index=C;var A=s.enumeratedString("BYTERANGE");return A&&O.setByteRange(A,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}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 R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),o}(d)},"./src/loader/key-loader.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return z});var Y=k("./src/events.ts"),j=k("./src/errors.ts"),B=k("./src/utils/logger.ts"),z=function(){function G(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=G.prototype;return n._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(Y.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,d=this.loaders[c];if(!m.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=m.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(d&&(B.logger.warn("abort previous key loader for type:"+c),d.abort()),!p){B.logger.warn("key uri is falsy");return}var h=l.loader,o=m.loader=this.loaders[c]=new h(l);this.decrypturl=p,this.decryptkey=null;var s={url:p,frag:m,responseType:"arraybuffer"},R={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(s,R,x)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:m}))},n.loadsuccess=function(y,g,m){var c=m.frag;if(!c.decryptdata){B.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(Y.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(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.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(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},G}()},"./src/loader/level-details.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"LevelDetails",function(){return G});var Y=k("./src/polyfills/number.ts");function j(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 B(n,D,y){return D&&j(n.prototype,D),y&&j(n,y),n}var z=10,G=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},B(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Y.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||z}},{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(ie,J,k){"use strict";k.r(J),k.d(J,"LevelKey",function(){return G});var Y=k("./node_modules/url-toolkit/src/url-toolkit.js"),j=k.n(Y);function B(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 z(n,D,y){return D&&B(n.prototype,D),y&&B(n,y),n}var G=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(Y.buildAbsoluteURL)(D,y,{alwaysNormalize:!0}):this._uri=D}return z(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"LoadStats",function(){return Y});var Y=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(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return o});var Y=k("./src/polyfills/number.ts"),j=k("./node_modules/url-toolkit/src/url-toolkit.js"),B=k.n(j),z=k("./src/loader/fragment.ts"),G=k("./src/loader/level-details.ts"),n=k("./src/loader/level-key.ts"),D=k("./src/utils/attr-list.ts"),y=k("./src/utils/logger.ts"),g=k("./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,d=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=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("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function h(L){var O,A;return l.test((O=(A=j.parseURL(L))===null||A===void 0?void 0:A.path)!=null?O:"")}var o=function(){function L(){}return L.findGroup=function(A,w){for(var b=0;b<A.length;b++){var u=A[b];if(u.id===w)return u}},L.convertAVC1ToAVCOTI=function(A){var w=A.split(".");if(w.length>2){var b=w.shift()+".";return b+=parseInt(w.shift()).toString(16),b+=("000"+parseInt(w.shift()).toString(16)).substr(-4),b}return A},L.resolve=function(A,w){return j.buildAbsoluteURL(w,A,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(A,w){var b=[],u={},v=!1;m.lastIndex=0;for(var a;(a=m.exec(A))!=null;)if(a[1]){var _=new D.AttrList(a[1]),N={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:L.resolve(a[2],w)},F=_.decimalResolution("RESOLUTION");F&&(N.width=F.width,N.height=F.height),s((_.CODECS||"").split(/[ ,]+/).filter(function(U){return U}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=L.convertAVC1ToAVCOTI(N.videoCodec)),b.push(N)}else if(a[3]){var S=new D.AttrList(a[3]);S["DATA-ID"]&&(v=!0,u[S["DATA-ID"]]=S)}return{levels:b,sessionData:v?u:null}},L.parseMasterPlaylistMedia=function(A,w,b,u){u===void 0&&(u=[]);var v,a=[],_=0;for(c.lastIndex=0;(v=c.exec(A))!==null;){var N=new D.AttrList(v[1]);if(N.TYPE===b){var F={attrs:N,bitrate:0,id:_++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:b,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?L.resolve(N.URI,w):""};if(u.length){var S=L.findGroup(u,F.groupId)||u[0];R(F,S,"audioCodec"),R(F,S,"textCodec")}a.push(F)}}return a},L.parseLevelPlaylist=function(A,w,b,u,v){var a=new G.LevelDetails(w),_=a.fragments,N=null,F=0,S=0,U=0,M=0,E=null,W=new z.Fragment(u,w),Z,ne,ae,we=-1,fe=!1;for(d.lastIndex=0,a.m3u8=A;(Z=d.exec(A))!==null;){fe&&(fe=!1,W=new z.Fragment(u,w),W.start=U,W.sn=F,W.cc=M,W.level=b,N&&(W.initSegment=N,W.rawProgramDateTime=N.rawProgramDateTime));var _e=Z[1];if(_e){W.duration=parseFloat(_e);var Se=(" "+Z[2]).slice(1);W.title=Se||null,W.tagList.push(Se?["INF",_e,Se]:["INF",_e])}else if(Z[3])Object(Y.isFiniteNumber)(W.duration)&&(W.start=U,ae&&(W.levelkey=ae),W.sn=F,W.level=b,W.cc=M,W.urlId=v,_.push(W),W.relurl=(" "+Z[3]).slice(1),C(W,E),E=W,U+=W.duration,F++,S=0,fe=!0);else if(Z[4]){var ve=(" "+Z[4]).slice(1);E?W.setByteRange(ve,E):W.setByteRange(ve)}else if(Z[5])W.rawProgramDateTime=(" "+Z[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),we===-1&&(we=_.length);else{if(Z=Z[0].match(p),!Z){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<Z.length&&!(typeof Z[ne]!="undefined");ne++);var ue=(" "+Z[ne]).slice(1),le=(" "+Z[ne+1]).slice(1),Oe=Z[ne+2]?(" "+Z[ne+2]).slice(1):"";switch(ue){case"PLAYLIST-TYPE":a.type=le.toUpperCase();break;case"MEDIA-SEQUENCE":F=a.startSN=parseInt(le);break;case"SKIP":{var Ye=new D.AttrList(le),Ve=Ye.decimalInteger("SKIPPED-SEGMENTS");if(Object(Y.isFiniteNumber)(Ve)){a.skippedSegments=Ve;for(var $e=Ve;$e--;)_.unshift(null);F+=Ve}var Ze=Ye.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ze&&(a.recentlyRemovedDateranges=Ze.split(" "));break}case"TARGETDURATION":a.targetduration=parseFloat(le);break;case"VERSION":a.version=parseInt(le);break;case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(le||Oe)&&W.tagList.push(Oe?[le,Oe]:[le]);break;case"DIS":M++;case"GAP":W.tagList.push([ue]);break;case"BITRATE":W.tagList.push([ue,le]);break;case"DISCONTINUITY-SEQ":M=parseInt(le);break;case"KEY":{var Fe,We=new D.AttrList(le),qe=We.enumeratedString("METHOD"),oe=We.URI,Ee=We.hexadecimalInteger("IV"),Ce=We.enumeratedString("KEYFORMATVERSIONS"),Ae=We.enumeratedString("KEYID"),ze=(Fe=We.enumeratedString("KEYFORMAT"))!=null?Fe:"identity",Je=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Je.indexOf(ze)>-1){y.logger.warn("Keyformat "+ze+" is not supported from the manifest");continue}else if(ze!=="identity")continue;qe&&(ae=n.LevelKey.fromURL(w,oe),oe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(qe)>=0&&(ae.method=qe,ae.keyFormat=ze,Ae&&(ae.keyID=Ae),Ce&&(ae.keyFormatVersions=Ce),ae.iv=Ee));break}case"START":{var tt=new D.AttrList(le),nt=tt.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(nt)&&(a.startTimeOffset=nt);break}case"MAP":{var ht=new D.AttrList(le);W.relurl=ht.URI,ht.BYTERANGE&&W.setByteRange(ht.BYTERANGE),W.level=b,W.sn="initSegment",ae&&(W.levelkey=ae),W.initSegment=null,N=W,fe=!0;break}case"SERVER-CONTROL":{var it=new D.AttrList(le);a.canBlockReload=it.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=it.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&it.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=it.optionalFloat("PART-HOLD-BACK",0),a.holdBack=it.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var lt=new D.AttrList(le);a.partTarget=lt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Me=a.partList;Me||(Me=a.partList=[]);var Tt=S>0?Me[Me.length-1]:void 0,mt=S++,Ne=new z.Part(new D.AttrList(le),W,w,mt,Tt);Me.push(Ne),W.duration+=Ne.duration;break}case"PRELOAD-HINT":{var He=new D.AttrList(le);a.preloadHint=He;break}case"RENDITION-REPORT":{var Te=new D.AttrList(le);a.renditionReports=a.renditionReports||[],a.renditionReports.push(Te);break}default:y.logger.warn("line parsed but not handled: "+Z);break}}}E&&!E.relurl?(_.pop(),U-=E.duration,a.partList&&(a.fragmentHint=E)):a.partList&&(C(W,E),W.cc=M,a.fragmentHint=W);var me=_.length,ge=_[0],re=_[me-1];if(U+=a.skippedSegments*a.targetduration,U>0&&me&&re){a.averagetargetduration=U/me;var se=re.sn;a.endSN=se!=="initSegment"?se:0,ge&&(a.startCC=ge.cc,ge.initSegment||a.fragments.every(function(ce){return ce.relurl&&h(ce.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new z.Fragment(u,w),W.relurl=re.relurl,W.level=b,W.sn="initSegment",ge.initSegment=W,a.needSidxRanges=!0))}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(U+=a.fragmentHint.duration),a.totalduration=U,a.endCC=M,we>0&&x(_,we),a},L}();function s(L,O){["video","audio","text"].forEach(function(A){var w=L.filter(function(u){return Object(g.isCodecType)(u,A)});if(w.length){var b=w.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});O[A+"Codec"]=b.length>0?b[0]:w[0],L=L.filter(function(u){return w.indexOf(u)===-1})}}),O.unknownCodecs=L}function R(L,O,A){var w=O[A];w&&(L[A]=w)}function x(L,O){for(var A=L[O],w=O;w--;){var b=L[w];if(!b)return;b.programDateTime=A.programDateTime-b.duration*1e3,A=b}}function C(L,O){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):O!=null&&O.programDateTime&&(L.programDateTime=O.endProgramDateTime),Object(Y.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/polyfills/number.ts"),j=k("./src/events.ts"),B=k("./src/errors.ts"),z=k("./src/utils/logger.ts"),G=k("./src/utils/mp4-tools.ts"),n=k("./src/loader/m3u8-parser.ts"),D=k("./src/types/loader.ts"),y=k("./src/utils/attr-list.ts");function g(d){var p=d.type;switch(p){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(d,p){var l=d.url;return(l===void 0||l.indexOf("data:")===0)&&(l=p.url),l}var c=function(){function d(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var p=d.prototype;return p.registerListeners=function(){var h=this.hls;h.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var h=this.hls;h.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(h){var o=this.hls.config,s=o.pLoader,R=o.loader,x=s||R,C=new x(o);return h.loader=C,this.loaders[h.type]=C,C},p.getInternalLoader=function(h){return this.loaders[h.type]},p.resetInternalLoader=function(h){this.loaders[h]&&delete this.loaders[h]},p.destroyInternalLoaders=function(){for(var h in this.loaders){var o=this.loaders[h];o&&o.destroy(),this.resetInternalLoader(h)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(h,o){var s=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},p.onLevelLoading=function(h,o){var s=o.id,R=o.level,x=o.url,C=o.deliveryDirectives;this.load({id:s,groupId:null,level:R,responseType:"text",type:D.PlaylistContextType.LEVEL,url:x,deliveryDirectives:C})},p.onAudioTrackLoading=function(h,o){var s=o.id,R=o.groupId,x=o.url,C=o.deliveryDirectives;this.load({id:s,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:C})},p.onSubtitleTrackLoading=function(h,o){var s=o.id,R=o.groupId,x=o.url,C=o.deliveryDirectives;this.load({id:s,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:C})},p.load=function(h){var o,s=this.hls.config,R=this.getInternalLoader(h);if(R){var x=R.context;if(x&&x.url===h.url){z.logger.trace("[playlist-loader]: playlist request ongoing");return}z.logger.log("[playlist-loader]: aborting previous loader for type: "+h.type),R.abort()}var C,L,O,A;switch(h.type){case D.PlaylistContextType.MANIFEST:C=s.manifestLoadingMaxRetry,L=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,A=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:C=0,L=s.levelLoadingTimeOut;break;default:C=s.levelLoadingMaxRetry,L=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,A=s.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(h),(o=h.deliveryDirectives)!==null&&o!==void 0&&o.part){var w;if(h.type===D.PlaylistContextType.LEVEL&&h.level!==null?w=this.hls.levels[h.level].details:h.type===D.PlaylistContextType.AUDIO_TRACK&&h.id!==null?w=this.hls.audioTracks[h.id].details:h.type===D.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(w=this.hls.subtitleTracks[h.id].details),w){var b=w.partTarget,u=w.targetduration;b&&u&&(L=Math.min(Math.max(b*3,u*.8)*1e3,L))}}var v={timeout:L,maxRetry:C,retryDelay:O,maxRetryDelay:A,highWaterMark:0},a={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(h,v,a)},p.loadsuccess=function(h,o,s,R){if(R===void 0&&(R=null),s.isSidxRequest){this.handleSidxRequest(h,s),this.handlePlaylistLoaded(h,o,s,R);return}this.resetInternalLoader(s.type);var x=h.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,s,"no EXTM3U delimiter",R);return}o.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,o,s,R):this.handleMasterPlaylist(h,o,s,R)},p.loaderror=function(h,o,s){s===void 0&&(s=null),this.handleNetworkError(o,s,!1,h)},p.loadtimeout=function(h,o,s){s===void 0&&(s=null),this.handleNetworkError(o,s,!0)},p.handleMasterPlaylist=function(h,o,s,R){var x=this.hls,C=h.data,L=m(h,s),O=n.default.parseMasterPlaylist(C,L),A=O.levels,w=O.sessionData;if(!A.length){this.handleManifestParsingError(h,s,"no level found in manifest",R);return}var b=A.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),u=A.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),v=n.default.parseMasterPlaylistMedia(C,L,"AUDIO",b),a=n.default.parseMasterPlaylistMedia(C,L,"SUBTITLES",u),_=n.default.parseMasterPlaylistMedia(C,L,"CLOSED-CAPTIONS");if(v.length){var N=v.some(function(F){return!F.url});!N&&A[0].audioCodec&&!A[0].attrs.AUDIO&&(z.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}x.trigger(j.Events.MANIFEST_LOADED,{levels:A,audioTracks:v,subtitles:a,captions:_,url:L,stats:o,networkDetails:R,sessionData:w})},p.handleTrackOrLevelPlaylist=function(h,o,s,R){var x=this.hls,C=s.id,L=s.level,O=s.type,A=m(h,s),w=Object(Y.isFiniteNumber)(C)?C:0,b=Object(Y.isFiniteNumber)(L)?L:w,u=g(s),v=n.default.parseLevelPlaylist(h.data,A,b,u,w);if(!v.fragments.length){x.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:A,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(O===D.PlaylistContextType.MANIFEST){var a={attrs:new y.AttrList({}),bitrate:0,details:v,name:"",url:A};x.trigger(j.Events.MANIFEST_LOADED,{levels:[a],audioTracks:[],url:A,stats:o,networkDetails:R,sessionData:null})}if(o.parsing.end=performance.now(),v.needSidxRanges){var _,N=(_=v.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:N,isSidxRequest:!0,type:O,level:L,levelDetails:v,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=v,this.handlePlaylistLoaded(h,o,s,R)},p.handleSidxRequest=function(h,o){var s=Object(G.parseSegmentIndex)(new Uint8Array(h.data));if(!s)return;var R=s.references,x=o.levelDetails;R.forEach(function(C,L){var O=C.info,A=x.fragments[L];A.byteRange.length===0&&A.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),A.initSegment&&A.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(h,o,s,R){this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===D.PlaylistContextType.MANIFEST,url:h.url,reason:s,response:h,context:o,networkDetails:R})},p.handleNetworkError=function(h,o,s,R){s===void 0&&(s=!1),z.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var x=B.ErrorDetails.UNKNOWN,C=!1,L=this.getInternalLoader(h);switch(h.type){case D.PlaylistContextType.MANIFEST:x=s?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case D.PlaylistContextType.LEVEL:x=s?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case D.PlaylistContextType.AUDIO_TRACK:x=s?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:x=s?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}L&&this.resetInternalLoader(h.type);var O={type:B.ErrorTypes.NETWORK_ERROR,details:x,fatal:C,url:h.url,loader:L,context:h,networkDetails:o};R&&(O.response=R),this.hls.trigger(j.Events.ERROR,O)},p.handlePlaylistLoaded=function(h,o,s,R){var x=s.type,C=s.level,L=s.id,O=s.groupId,A=s.loader,w=s.levelDetails,b=s.deliveryDirectives;if(!(w!=null&&w.targetduration)){this.handleManifestParsingError(h,s,"invalid target duration",R);return}if(!A)return;w.live&&(A.getCacheAge&&(w.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(w.ageHeader))&&(w.ageHeader=0));switch(x){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:w,level:C||0,id:L||0,stats:o,networkDetails:R,deliveryDirectives:b});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:w,id:L||0,groupId:O||"",stats:o,networkDetails:R,deliveryDirectives:b});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:w,id:L||0,groupId:O||"",stats:o,networkDetails:R,deliveryDirectives:b});break}},d}();J.default=c},"./src/polyfills/number.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"isFiniteNumber",function(){return Y}),k.d(J,"MAX_SAFE_INTEGER",function(){return j});var Y=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,J,k){"use strict";k.r(J);var Y=function(){function j(){}return j.getSilentFrame=function(z,G){switch(z){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===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(G===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(G===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(G===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(G===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},j}();J.default=Y},"./src/remux/mp4-generator.ts":function(ie,J,k){"use strict";k.r(J);var Y=Math.pow(2,32)-1,j=function(){function B(){}return B.init=function(){B.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 G;for(G in B.types)B.types.hasOwnProperty(G)&&(B.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.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]);B.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]);B.STTS=B.STSC=B.STCO=g,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.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]),d=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,m,d,m,c),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,y))},B.box=function(G){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 d=new Uint8Array(n);for(d[0]=n>>24&255,d[1]=n>>16&255,d[2]=n>>8&255,d[3]=n&255,d.set(G,4),m=0,n=8;m<c;m++)d.set(y[m],n),n+=y[m].byteLength;return d},B.hdlr=function(G){return B.box(B.types.hdlr,B.HDLR_TYPES[G])},B.mdat=function(G){return B.box(B.types.mdat,G)},B.mdhd=function(G,n){n*=G;var D=Math.floor(n/(Y+1)),y=Math.floor(n%(Y+1));return B.box(B.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&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]))},B.mdia=function(G){return B.box(B.types.mdia,B.mdhd(G.timescale,G.duration),B.hdlr(G.type),B.minf(G))},B.mfhd=function(G){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},B.minf=function(G){return G.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(G)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(G))},B.moof=function(G,n,D){return B.box(B.types.moof,B.mfhd(G),B.traf(D,n))},B.moov=function(G){for(var n=G.length,D=[];n--;)D[n]=B.trak(G[n]);return B.box.apply(null,[B.types.moov,B.mvhd(G[0].timescale,G[0].duration)].concat(D).concat(B.mvex(G)))},B.mvex=function(G){for(var n=G.length,D=[];n--;)D[n]=B.trex(G[n]);return B.box.apply(null,[B.types.mvex].concat(D))},B.mvhd=function(G,n){n*=G;var D=Math.floor(n/(Y+1)),y=Math.floor(n%(Y+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&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 B.box(B.types.mvhd,g)},B.sdtp=function(G){var n=G.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 B.box(B.types.sdtp,D)},B.stbl=function(G){return B.box(B.types.stbl,B.stsd(G),B.box(B.types.stts,B.STTS),B.box(B.types.stsc,B.STSC),B.box(B.types.stsz,B.STSZ),B.box(B.types.stco,B.STCO))},B.avc1=function(G){var n=[],D=[],y,g,m;for(y=0;y<G.sps.length;y++)g=G.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<G.pps.length;y++)g=G.pps[y],m=g.byteLength,D.push(m>>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(g));var c=B.box(B.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|G.sps.length].concat(n).concat([G.pps.length]).concat(D))),d=G.width,p=G.height,l=G.pixelRatio[0],h=G.pixelRatio[1];return B.box(B.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,d>>8&255,d&255,p>>8&255,p&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,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,h>>24,h>>16&255,h>>8&255,h&255])))},B.esds=function(G){var n=G.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(G.config).concat([6,1,2]))},B.mp4a=function(G){var n=G.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),B.box(B.types.esds,B.esds(G)))},B.mp3=function(G){var n=G.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},B.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(G)):B.box(B.types.stsd,B.STSD,B.mp4a(G)):B.box(B.types.stsd,B.STSD,B.avc1(G))},B.tkhd=function(G){var n=G.id,D=G.duration*G.timescale,y=G.width,g=G.height,m=Math.floor(D/(Y+1)),c=Math.floor(D%(Y+1));return B.box(B.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]))},B.traf=function(G,n){var D=B.sdtp(G),y=G.id,g=Math.floor(n/(Y+1)),m=Math.floor(n%(Y+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),B.box(B.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])),B.trun(G,D.length+16+20+8+16+8+8),D)},B.trak=function(G){return G.duration=G.duration||4294967295,B.box(B.types.trak,B.tkhd(G),B.mdia(G))},B.trex=function(G){var n=G.id;return B.box(B.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]))},B.trun=function(G,n){var D=G.samples||[],y=D.length,g=12+16*y,m=new Uint8Array(g),c,d,p,l,h,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++)d=D[c],p=d.duration,l=d.size,h=d.flags,o=d.cts,m.set([p>>>24&255,p>>>16&255,p>>>8&255,p&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*c);return B.box(B.types.trun,m)},B.initSegment=function(G){B.types||B.init();var n=B.moov(G),D=new Uint8Array(B.FTYP.byteLength+n.byteLength);return D.set(B.FTYP),D.set(n,B.FTYP.byteLength),D},B}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,J.default=j},"./src/remux/mp4-remuxer.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return o}),k.d(J,"normalizePts",function(){return s});var Y=k("./src/polyfills/number.ts"),j=k("./src/remux/aac-helper.ts"),B=k("./src/remux/mp4-generator.ts"),z=k("./src/events.ts"),G=k("./src/errors.ts"),n=k("./src/utils/logger.ts"),D=k("./src/types/loader.ts"),y=k("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var w in A)Object.prototype.hasOwnProperty.call(A,w)&&(L[w]=A[w])}return L},g.apply(this,arguments)}var m=10*1e3,c=1024,d=1152,p=null,l=null,h=!1,o=function(){function L(A,w,b,u){if(u===void 0&&(u=""),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=A,this.config=w,this.typeSupported=b,this.ISGenerated=!1,p===null){var v=navigator.userAgent||"",a=v.match(/Chrome\/(\d+)/i);p=a?parseInt(a[1]):0}if(l===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);l=_?parseInt(_[1]):0}h=!!p&&p<75||!!l&&l<600}var O=L.prototype;return O.destroy=function(){},O.resetTimeStamp=function(w){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=w},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(w){var b=!1,u=w.reduce(function(v,a){var _=a.pts-v;return _<-4294967296?(b=!0,s(v,a.pts)):_>0?v:a.pts},w[0].pts);return b&&n.logger.debug("PTS rollover detected"),u},O.remux=function(w,b,u,v,a,_,N,F){var S,U,M,E,W,Z,ne=a,ae=a,we=w.pid>-1,fe=b.pid>-1,_e=b.samples.length,Se=w.samples.length>0,ve=_e>1,ue=(!we||Se)&&(!fe||ve)||this.ISGenerated||N;if(ue){this.ISGenerated||(M=this.generateIS(w,b,a));var le=this.isVideoContiguous,Oe=-1;if(ve&&(Oe=R(b.samples),!le&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,Oe>0){n.logger.warn("[mp4-remuxer]: Dropped "+Oe+" out of "+_e+" video samples due to a missing keyframe");var Ye=this.getVideoStartPts(b.samples);b.samples=b.samples.slice(Oe),b.dropped+=Oe,ae+=(b.samples[0].pts-Ye)/(b.timescale||9e4)}else Oe===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+_e+" video samples"),Z=!1);if(this.ISGenerated){if(Se&&ve){var Ve=this.getVideoStartPts(b.samples),$e=s(w.samples[0].pts,Ve)-Ve,Ze=$e/b.inputTimeScale;ne+=Math.max(0,Ze),ae+=Math.max(0,-Ze)}if(Se){if(w.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),M=this.generateIS(w,b,a)),U=this.remuxAudio(w,ne,this.isAudioContiguous,_,fe||ve||F===D.PlaylistLevelType.AUDIO?ae:void 0),ve){var Fe=U?U.endPTS-U.startPTS:0;b.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),M=this.generateIS(w,b,a)),S=this.remuxVideo(b,ae,le,Fe)}}else ve&&(S=this.remuxVideo(b,ae,le,0));S&&(S.firstKeyFrame=Oe,S.independent=Oe!==-1)}}return this.ISGenerated&&(u.samples.length&&(W=this.remuxID3(u,a)),v.samples.length&&(E=this.remuxText(v,a))),{audio:U,video:S,initSegment:M,independent:Z,text:E,id3:W}},O.generateIS=function(w,b,u){var v=w.samples,a=b.samples,_=this.typeSupported,N={},F=!Object(Y.isFiniteNumber)(this._initPTS),S="audio/mp4",U,M,E;if(F&&(U=M=Infinity),w.config&&v.length&&(w.timescale=w.samplerate,w.isAAC||(_.mpeg?(S="audio/mpeg",w.codec=""):_.mp3&&(w.codec="mp3")),N.audio={id:"audio",container:S,codec:w.codec,initSegment:!w.isAAC&&_.mpeg?new Uint8Array(0):B.default.initSegment([w]),metadata:{channelCount:w.channelCount}},F&&(E=w.inputTimeScale,U=M=v[0].pts-Math.round(E*u))),b.sps&&b.pps&&a.length&&(b.timescale=b.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:b.codec,initSegment:B.default.initSegment([b]),metadata:{width:b.width,height:b.height}},F)){E=b.inputTimeScale;var W=this.getVideoStartPts(a),Z=Math.round(E*u);M=Math.min(M,s(a[0].dts,W)-Z),U=Math.min(U,W-Z)}if(Object.keys(N).length)return this.ISGenerated=!0,F&&(this._initPTS=U,this._initDTS=M),{tracks:N,initPTS:U,timescale:E}},O.remuxVideo=function(w,b,u,v){var a=w.inputTimeScale,_=w.samples,N=[],F=_.length,S=this._initPTS,U=this.nextAvcDts,M=8,E,W,Z,ne=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,we=0,fe=!1;if(!u||U===null){var _e=b*a,Se=_[0].pts-s(_[0].dts,_[0].pts);U=_e-Se}for(var ve=0;ve<F;ve++){var ue=_[ve];if(ue.pts=s(ue.pts-S,U),ue.dts=s(ue.dts-S,U),ue.dts>ue.pts){var le=9e4*.2;we=Math.max(Math.min(we,ue.pts-ue.dts),-1*le)}ue.dts<_[ve>0?ve-1:ve].dts&&(fe=!0)}fe&&_.sort(function(Kt,ut){var Be=Kt.dts-ut.dts,kt=Kt.pts-ut.pts;return Be||kt}),W=_[0].dts,Z=_[_.length-1].dts;var Oe=Math.round((Z-W)/(F-1));if(we<0){if(we<Oe*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-Oe,!0)+" ms");for(var Ye=we,Ve=0;Ve<F;Ve++)_[Ve].dts=Ye=Math.max(Ye,_[Ve].pts-Oe),_[Ve].pts=Math.max(Ye,_[Ve].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(we,!0)+" ms to overcome this issue");for(var $e=0;$e<F;$e++)_[$e].dts=_[$e].dts+we}W=_[0].dts}if(u){var Ze=W-U,Fe=Ze>Oe,We=Ze<-1;if(Fe||We){Fe?n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(Ze,!0)+" ms ("+Ze+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-Ze,!0)+" ms ("+Ze+"dts) overlapping between fragments detected"),W=U;var qe=_[0].pts-Ze;_[0].dts=W,_[0].pts=qe,n.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(qe,!0)+"/"+Object(y.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(Ze,!0)+" ms")}}h&&(W=Math.max(0,W));for(var oe=0,Ee=0,Ce=0;Ce<F;Ce++){for(var Ae=_[Ce],ze=Ae.units,Je=ze.length,tt=0,nt=0;nt<Je;nt++)tt+=ze[nt].data.length;Ee+=tt,oe+=Je,Ae.length=tt,Ae.dts=Math.max(Ae.dts,W),Ae.pts=Math.max(Ae.pts,Ae.dts,0),ne=Math.min(Ae.pts,ne),ae=Math.max(Ae.pts,ae)}Z=_[F-1].dts;var ht=Ee+4*oe+8,it;try{it=new Uint8Array(ht)}catch(Kt){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ht,reason:"fail allocating video mdat "+ht});return}var lt=new DataView(it.buffer);lt.setUint32(0,ht),it.set(B.default.types.mdat,4);for(var Me=0;Me<F;Me++){for(var Tt=_[Me],mt=Tt.units,Ne=0,He=0,Te=mt.length;He<Te;He++){var me=mt[He],ge=me.data,re=me.data.byteLength;lt.setUint32(M,re),M+=4,it.set(ge,M),M+=re,Ne+=4+re}if(Me<F-1)E=_[Me+1].dts-Tt.dts;else{var se=this.config,ce=Tt.dts-_[Me>0?Me-1:Me].dts;if(se.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(se.maxBufferHole*a),xe=(v?ne+v*a:this.nextAudioPts)-Tt.pts;xe>pe?(E=xe-ce,E<0&&(E=ce),n.logger.log("[mp4-remuxer]: It is approximately "+xe/90+" ms to the next segment; using duration "+E/90+" ms for the last video frame.")):E=ce}else E=ce}var Pe=Math.round(Tt.pts-Tt.dts);N.push(new x(Tt.key,E,Ne,Pe))}if(N.length&&p&&p<70){var Ke=N[0].flags;Ke.dependsOn=2,Ke.isNonSync=0}console.assert(E!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=U=Z+E,this.isVideoContiguous=!0;var vt=B.default.moof(w.sequenceNumber++,W,g({},w,{samples:N})),Ft="video",Dt={data1:vt,data2:it,startPTS:ne/a,endPTS:(ae+E)/a,startDTS:W/a,endDTS:U/a,type:Ft,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:w.dropped};return w.samples=[],w.dropped=0,console.assert(it.length,"MDAT length must not be zero"),Dt},O.remuxAudio=function(w,b,u,v,a){var _=w.inputTimeScale,N=w.samplerate?w.samplerate:_,F=_/N,S=w.isAAC?c:d,U=S*F,M=this._initPTS,E=!w.isAAC&&this.typeSupported.mpeg,W=[],Z=w.samples,ne=E?0:8,ae=this.nextAudioPts||-1,we=b*_;if(this.isAudioContiguous=u=u||Z.length&&ae>0&&(v&&Math.abs(we-ae)<9e3||Math.abs(s(Z[0].pts-M,we)-ae)<20*U),Z.forEach(function(ge){ge.pts=s(ge.pts-M,we)}),!u||ae<0){if(Z=Z.filter(function(ge){return ge.pts>=0}),!Z.length)return;a===0?ae=0:v?ae=Math.max(0,we):ae=Z[0].pts}if(w.isAAC)for(var fe=a!==void 0,_e=this.config.maxAudioFramesDrift,Se=0,ve=ae;Se<Z.length;Se++){var ue=Z[Se],le=ue.pts,Oe=le-ve,Ye=Math.abs(1e3*Oe/_);if(Oe<=-_e*U&&fe)Se===0&&(n.logger.warn("Audio frame @ "+(le/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Oe/_)+" ms."),this.nextAudioPts=ae=ve=le);else if(Oe>=_e*U&&Ye<m&&fe){var Ve=Math.round(Oe/U);ve=le-Ve*U,ve<0&&(Ve--,ve+=U),Se===0&&(this.nextAudioPts=ae=ve),n.logger.warn("[mp4-remuxer]: Injecting "+Ve+" audio frame @ "+(ve/_).toFixed(3)+"s due to "+Math.round(1e3*Oe/_)+" ms gap.");for(var $e=0;$e<Ve;$e++){var Ze=Math.max(ve,0),Fe=j.default.getSilentFrame(w.manifestCodec||w.codec,w.channelCount);Fe||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Fe=ue.unit.subarray()),Z.splice(Se,0,{unit:Fe,pts:Ze}),ve+=U,Se++}}ue.pts=ve,ve+=U}for(var We=null,qe=null,oe,Ee=0,Ce=Z.length;Ce--;)Ee+=Z[Ce].unit.byteLength;for(var Ae=0,ze=Z.length;Ae<ze;Ae++){var Je=Z[Ae],tt=Je.unit,nt=Je.pts;if(qe!==null){var ht=W[Ae-1];ht.duration=Math.round((nt-qe)/F)}else if(u&&w.isAAC&&(nt=ae),We=nt,Ee>0){Ee+=ne;try{oe=new Uint8Array(Ee)}catch(ge){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ee,reason:"fail allocating audio mdat "+Ee});return}if(!E){var it=new DataView(oe.buffer);it.setUint32(0,Ee),oe.set(B.default.types.mdat,4)}}else return;oe.set(tt,ne);var lt=tt.byteLength;ne+=lt,W.push(new x(!0,S,lt,0)),qe=nt}var Me=W.length;if(!Me)return;var Tt=W[W.length-1];this.nextAudioPts=ae=qe+F*Tt.duration;var mt=E?new Uint8Array(0):B.default.moof(w.sequenceNumber++,We/F,g({},w,{samples:W}));w.samples=[];var Ne=We/_,He=ae/_,Te="audio",me={data1:mt,data2:oe,startPTS:Ne,endPTS:He,startDTS:Ne,endDTS:He,type:Te,hasAudio:!0,hasVideo:!1,nb:Me};return this.isAudioContiguous=!0,console.assert(oe.length,"MDAT length must not be zero"),me},O.remuxEmptyAudio=function(w,b,u,v){var a=w.inputTimeScale,_=w.samplerate?w.samplerate:a,N=a/_,F=this.nextAudioPts,S=(F!==null?F:v.startDTS*a)+this._initDTS,U=v.endDTS*a+this._initDTS,M=N*c,E=Math.ceil((U-S)/M),W=j.default.getSilentFrame(w.manifestCodec||w.codec,w.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],ne=0;ne<E;ne++){var ae=S+ne*M;Z.push({unit:W,pts:ae,dts:ae})}return w.samples=Z,this.remuxAudio(w,b,u,!1)},O.remuxID3=function(w,b){var u=w.samples.length;if(!u)return;for(var v=w.inputTimeScale,a=this._initPTS,_=this._initDTS,N=0;N<u;N++){var F=w.samples[N];F.pts=s(F.pts-a,b*v)/v,F.dts=s(F.dts-_,b*v)/v}var S=w.samples;return w.samples=[],{samples:S}},O.remuxText=function(w,b){var u=w.samples.length;if(!u)return;for(var v=w.inputTimeScale,a=this._initPTS,_=0;_<u;_++){var N=w.samples[_];N.pts=s(N.pts-a,b*v)/v}w.samples.sort(function(S,U){return S.pts-U.pts});var F=w.samples;return w.samples=[],{samples:F}},L}();function s(L,O){var A;if(O===null)return L;for(O<L?A=-8589934592:A=8589934592;Math.abs(L-O)>4294967296;)L+=A;return L}function R(L){for(var O=0;O<L.length;O++)if(L[O].key)return O;return-1}var x=function(O,A,w,b){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=A,this.size=w,this.cts=b,this.flags=new C(O)},C=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/polyfills/number.ts"),j=k("./src/utils/mp4-tools.ts"),B=k("./src/loader/fragment.ts"),z=k("./src/utils/logger.ts"),G=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,d,p){this.audioCodec=d,this.videoCodec=p,this.generateInitSegment(c),this.emitInitSegment=!0},g.generateInitSegment=function(c){var d=this.audioCodec,p=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(j.parseInitSegment)(c);d||(d=D(l.audio,B.ElementaryStreamTypes.AUDIO)),p||(p=D(l.video,B.ElementaryStreamTypes.VIDEO));var h={};l.audio&&l.video?h.audiovideo={container:"video/mp4",codec:d+","+p,initSegment:c,id:"main"}:l.audio?h.audio={container:"audio/mp4",codec:d,initSegment:c,id:"audio"}:l.video?h.video={container:"video/mp4",codec:p,initSegment:c,id:"main"}:z.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=h},g.remux=function(c,d,p,l,h){var o=this.initPTS,s=this.lastEndDTS,R={audio:void 0,video:void 0,text:l,id3:p,initSegment:void 0};Object(Y.isFiniteNumber)(s)||(s=this.lastEndDTS=h||0);var x=d.samples;if(!x||!x.length)return R;var C={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(x),L=this.initData),!L||!L.length)return z.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(C.tracks=this.initTracks,this.emitInitSegment=!1),Object(Y.isFiniteNumber)(o)||(this.initPTS=C.initPTS=o=n(L,x,s));var O=Object(j.getDuration)(x,L),A=s,w=O+A;Object(j.offsetStartDTS)(L,x,o),O>0?this.lastEndDTS=w:(z.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var b=!!L.audio,u=!!L.video,v="";b&&(v+="audio"),u&&(v+="video");var a={data1:x,startPTS:A,startDTS:A,endPTS:w,endDTS:w,type:v,hasAudio:b,hasVideo:u,nb:1,dropped:0};return R.audio=a.type==="audio"?a:void 0,R.video=a.type!=="audio"?a:void 0,R.text=l,R.id3=p,R.initSegment=C,R},y}(),n=function(g,m,c){return Object(j.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===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=G},"./src/task-loop.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return Y});var Y=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=j.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"CMCDVersion",function(){return Y}),k.d(J,"CMCDObjectType",function(){return j}),k.d(J,"CMCDStreamingFormat",function(){return B}),k.d(J,"CMCDStreamType",function(){return z});var Y=1,j;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(j||(j={}));var B;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(B||(B={}));var z;(function(G){G.VOD="v",G.LIVE="l"})(z||(z={}))},"./src/types/level.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"HlsSkip",function(){return B}),k.d(J,"getSkipValue",function(){return z}),k.d(J,"HlsUrlParameters",function(){return G}),k.d(J,"Level",function(){return n});function Y(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 j(D,y,g){return y&&Y(D.prototype,y),g&&Y(D,g),D}var B;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(B||(B={}));function z(D,y){var g=D.canSkipUntil,m=D.canSkipDateRanges,c=D.endSN,d=y!==void 0?y-c:0;return g&&d<g?m?B.v2:B.Yes:B.No}var G=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 j(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(ie,J,k){"use strict";k.r(J),k.d(J,"PlaylistContextType",function(){return Y}),k.d(J,"PlaylistLevelType",function(){return j});var Y;(function(B){B.MANIFEST="manifest",B.LEVEL="level",B.AUDIO_TRACK="audioTrack",B.SUBTITLE_TRACK="subtitleTrack"})(Y||(Y={}));var j;(function(B){B.MAIN="main",B.AUDIO="audio",B.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"ChunkMetadata",function(){return Y});var Y=function(z,G,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=j(),this.buffering={audio:j(),video:j(),audiovideo:j()},this.level=z,this.sn=G,this.id=n,this.size=D,this.part=y,this.partial=g};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"AttrList",function(){return B});var Y=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,B=function(){function z(n){typeof n=="string"&&(n=z.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var G=z.prototype;return G.decimalInteger=function(D){var y=parseInt(this[D],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},G.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},G.hexadecimalIntegerAsNumber=function(D){var y=parseInt(this[D],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},G.decimalFloatingPoint=function(D){return parseFloat(this[D])},G.optionalFloat=function(D,y){var g=this[D];return g?parseFloat(g):y},G.enumeratedString=function(D){return this[D]},G.bool=function(D){return this[D]==="YES"},G.decimalResolution=function(D){var y=Y.exec(this[D]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},z.parseAttrList=function(D){var y,g={},m='"';for(j.lastIndex=0;(y=j.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},z}()},"./src/utils/binary-search.ts":function(ie,J,k){"use strict";k.r(J);var Y={search:function(B,z){for(var G=0,n=B.length-1,D=null,y=null;G<=n;){D=(G+n)/2|0,y=B[D];var g=z(y);if(g>0)G=D+1;else if(g<0)n=D-1;else return y}return null}};J.default=Y},"./src/utils/buffer-helper.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"BufferHelper",function(){return B});var Y=k("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function z(){}return z.isBuffered=function(n,D){try{if(n){for(var y=z.getBuffered(n),g=0;g<y.length;g++)if(D>=y.start(g)&&D<=y.end(g))return!0}}catch(m){}return!1},z.bufferInfo=function(n,D,y){try{if(n){var g=z.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(d){}return{len:0,start:D,end:D,nextStart:void 0}},z.bufferedInfo=function(n,D,y){D=Math.max(0,D),n.sort(function(C,L){var O=C.start-L.start;return O||L.end-C.end});var g=[];if(y)for(var m=0;m<n.length;m++){var c=g.length;if(c){var d=g[c-1].end;n[m].start-d<y?n[m].end>d&&(g[c-1].end=n[m].end):g.push(n[m])}else g.push(n[m])}else g=n;for(var p=0,l,h=D,o=D,s=0;s<g.length;s++){var R=g[s].start,x=g[s].end;if(D+y>=R&&D<x)h=R,o=x,p=o-D;else if(D+y<R){l=R;break}}return{len:p,start:h||0,end:o||0,nextStart:l}},z.getBuffered=function(n){try{return n.buffered}catch(D){return Y.logger.log("failed to get media.buffered",D),j}},z}()},"./src/utils/cea-608-parser.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"Row",function(){return o}),k.d(J,"CaptionScreen",function(){return s});var Y=k("./src/utils/logger.ts"),j={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},B=function(w){var b=w;return j.hasOwnProperty(w)&&(b=j[w]),String.fromCharCode(b)},z=15,G=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(A){A[A.ERROR=0]="ERROR",A[A.TEXT=1]="TEXT",A[A.WARNING=2]="WARNING",A[A.INFO=2]="INFO",A[A.DEBUG=3]="DEBUG",A[A.DATA=3]="DATA"})(c||(c={}));var d=function(){function A(){this.time=null,this.verboseLevel=c.ERROR}var w=A.prototype;return w.log=function(u,v){this.verboseLevel>=u&&Y.logger.log(this.time+" ["+u+"] "+v)},A}(),p=function(w){for(var b=[],u=0;u<w.length;u++)b.push(w[u].toString(16));return b},l=function(){function A(b,u,v,a,_){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=b||"white",this.underline=u||!1,this.italics=v||!1,this.background=a||"black",this.flash=_||!1}var w=A.prototype;return w.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},w.setStyles=function(u){for(var v=["foreground","underline","italics","background","flash"],a=0;a<v.length;a++){var _=v[a];u.hasOwnProperty(_)&&(this[_]=u[_])}},w.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},w.equals=function(u){return this.foreground===u.foreground&&this.underline===u.underline&&this.italics===u.italics&&this.background===u.background&&this.flash===u.flash},w.copy=function(u){this.foreground=u.foreground,this.underline=u.underline,this.italics=u.italics,this.background=u.background,this.flash=u.flash},w.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},A}(),h=function(){function A(b,u,v,a,_,N){this.uchar=void 0,this.penState=void 0,this.uchar=b||" ",this.penState=new l(u,v,a,_,N)}var w=A.prototype;return w.reset=function(){this.uchar=" ",this.penState.reset()},w.setChar=function(u,v){this.uchar=u,this.penState.copy(v)},w.setPenState=function(u){this.penState.copy(u)},w.equals=function(u){return this.uchar===u.uchar&&this.penState.equals(u.penState)},w.copy=function(u){this.uchar=u.uchar,this.penState.copy(u.penState)},w.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},A}(),o=function(){function A(b){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var u=0;u<G;u++)this.chars.push(new h);this.logger=b,this.pos=0,this.currPenState=new l}var w=A.prototype;return w.equals=function(u){for(var v=!0,a=0;a<G;a++)if(!this.chars[a].equals(u.chars[a])){v=!1;break}return v},w.copy=function(u){for(var v=0;v<G;v++)this.chars[v].copy(u.chars[v])},w.isEmpty=function(){for(var u=!0,v=0;v<G;v++)if(!this.chars[v].isEmpty()){u=!1;break}return u},w.setCursor=function(u){this.pos!==u&&(this.pos=u),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>G&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},w.moveCursor=function(u){var v=this.pos+u;if(u>1)for(var a=this.pos+1;a<v+1;a++)this.chars[a].setPenState(this.currPenState);this.setCursor(v)},w.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},w.insertChar=function(u){u>=144&&this.backSpace();var v=B(u);if(this.pos>=G){this.logger.log(c.ERROR,"Cannot insert "+u.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},w.clearFromPos=function(u){var v;for(v=u;v<G;v++)this.chars[v].reset()},w.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},w.clearToEndOfRow=function(){this.clearFromPos(this.pos)},w.getTextString=function(){for(var u=[],v=!0,a=0;a<G;a++){var _=this.chars[a].uchar;_!==" "&&(v=!1),u.push(_)}return v?"":u.join("")},w.setPenStyles=function(u){this.currPenState.setStyles(u);var v=this.chars[this.pos];v.setPenState(this.currPenState)},A}(),s=function(){function A(b){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var u=0;u<z;u++)this.rows.push(new o(b));this.logger=b,this.currRow=z-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var w=A.prototype;return w.reset=function(){for(var u=0;u<z;u++)this.rows[u].clear();this.currRow=z-1},w.equals=function(u){for(var v=!0,a=0;a<z;a++)if(!this.rows[a].equals(u.rows[a])){v=!1;break}return v},w.copy=function(u){for(var v=0;v<z;v++)this.rows[v].copy(u.rows[v])},w.isEmpty=function(){for(var u=!0,v=0;v<z;v++)if(!this.rows[v].isEmpty()){u=!1;break}return u},w.backSpace=function(){var u=this.rows[this.currRow];u.backSpace()},w.clearToEndOfRow=function(){var u=this.rows[this.currRow];u.clearToEndOfRow()},w.insertChar=function(u){var v=this.rows[this.currRow];v.insertChar(u)},w.setPen=function(u){var v=this.rows[this.currRow];v.setPenStyles(u)},w.moveCursor=function(u){var v=this.rows[this.currRow];v.moveCursor(u)},w.setCursor=function(u){this.logger.log(c.INFO,"setCursor: "+u);var v=this.rows[this.currRow];v.setCursor(u)},w.setPAC=function(u){this.logger.log(c.INFO,"pacData = "+JSON.stringify(u));var v=u.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var a=0;a<z;a++)this.rows[a].clear();var _=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var F=N.rows[_].cueStartTime,S=this.logger.time;if(F&&S!==null&&F<S)for(var U=0;U<this.nrRollUpRows;U++)this.rows[v-this.nrRollUpRows+U+1].copy(N.rows[_+U])}}this.currRow=v;var M=this.rows[this.currRow];if(u.indent!==null){var E=u.indent,W=Math.max(E-1,0);M.setCursor(u.indent),u.color=M.chars[W].penState.foreground}var Z={foreground:u.color,underline:u.underline,italics:u.italics,background:"black",flash:!1};this.setPen(Z)},w.setBkgData=function(u){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(u)),this.backSpace(),this.setPen(u),this.insertChar(32)},w.setRollUpRows=function(u){this.nrRollUpRows=u},w.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 u=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(u,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(c.INFO,"Rolling up")},w.getDisplayText=function(u){u=u||!1;for(var v=[],a="",_=-1,N=0;N<z;N++){var F=this.rows[N].getTextString();F&&(_=N+1,u?v.push("Row "+_+": '"+F+"'"):v.push(F.trim()))}return v.length>0&&(u?a="["+v.join(" | ")+"]":a=v.join(`
|
|
`)),a},w.getTextAndFormat=function(){return this.rows},A}(),R=function(){function A(b,u,v){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=b,this.outputFilter=u,this.mode=null,this.verbose=0,this.displayedMemory=new s(v),this.nonDisplayedMemory=new s(v),this.lastOutputScreen=new s(v),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var w=A.prototype;return w.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},w.getHandler=function(){return this.outputFilter},w.setHandler=function(u){this.outputFilter=u},w.setPAC=function(u){this.writeScreen.setPAC(u)},w.setBkgData=function(u){this.writeScreen.setBkgData(u)},w.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(c.INFO,"MODE="+u),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=u},w.insertChars=function(u){for(var v=0;v<u.length;v++)this.writeScreen.insertChar(u[v]);var a=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,a+": "+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())},w.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},w.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},w.ccAOF=function(){},w.ccAON=function(){},w.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},w.ccRU=function(u){this.logger.log(c.INFO,"RU("+u+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(u)},w.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},w.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},w.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},w.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},w.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},w.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},w.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},w.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var u=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=u,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},w.ccTO=function(u){this.logger.log(c.INFO,"TO("+u+") - Tab Offset"),this.writeScreen.moveCursor(u)},w.ccMIDROW=function(u){var v={flash:!1};if(v.underline=u%2===1,v.italics=u>=46,v.italics)v.foreground="white";else{var a=Math.floor(u/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=_[a]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},w.outputDataUpdate=function(u){u===void 0&&(u=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},w.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},A}(),x=function(){function A(b,u,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var a=new d;this.channels=[null,new R(b,u,a),new R(b+1,v,a)],this.cmdHistory=O(),this.logger=a}var w=A.prototype;return w.getHandler=function(u){return this.channels[u].getHandler()},w.setHandler=function(u,v){this.channels[u].setHandler(v)},w.addData=function(u,v){var a,_,N,F=!1;this.logger.time=u;for(var S=0;S<v.length;S+=2){if(_=v[S]&127,N=v[S+1]&127,_===0&&N===0)continue;if(this.logger.log(c.DATA,"["+p([v[S],v[S+1]])+"] -> ("+p([_,N])+")"),a=this.parseCmd(_,N),a||(a=this.parseMidrow(_,N)),a||(a=this.parsePAC(_,N)),a||(a=this.parseBackgroundAttributes(_,N)),!a&&(F=this.parseChars(_,N),F)){var U=this.currentChannel;if(U&&U>0){var M=this.channels[U];M.insertChars(F)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!a&&!F&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+p([_,N])+" orig: "+p([v[S],v[S+1]]))}},w.parseCmd=function(u,v){var a=this.cmdHistory,_=(u===20||u===28||u===21||u===29)&&v>=32&&v<=47,N=(u===23||u===31)&&v>=33&&v<=35;if(!(_||N))return!1;if(L(u,v,a))return C(null,null,a),this.logger.log(c.DEBUG,"Repeated command ("+p([u,v])+") is dropped"),!0;var F=u===20||u===21||u===23?1:2,S=this.channels[F];return u===20||u===21||u===28||u===29?v===32?S.ccRCL():v===33?S.ccBS():v===34?S.ccAOF():v===35?S.ccAON():v===36?S.ccDER():v===37?S.ccRU(2):v===38?S.ccRU(3):v===39?S.ccRU(4):v===40?S.ccFON():v===41?S.ccRDC():v===42?S.ccTR():v===43?S.ccRTD():v===44?S.ccEDM():v===45?S.ccCR():v===46?S.ccENM():v===47&&S.ccEOC():S.ccTO(v-32),C(u,v,a),this.currentChannel=F,!0},w.parseMidrow=function(u,v){var a=0;if((u===17||u===25)&&v>=32&&v<=47){if(u===17?a=1:a=2,a!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[a];return _?(_.ccMIDROW(v),this.logger.log(c.DEBUG,"MIDROW ("+p([u,v])+")"),!0):!1}return!1},w.parsePAC=function(u,v){var a,_=this.cmdHistory,N=(u>=17&&u<=23||u>=25&&u<=31)&&v>=64&&v<=127,F=(u===16||u===24)&&v>=64&&v<=95;if(!(N||F))return!1;if(L(u,v,_))return C(null,null,_),!0;var S=u<=23?1:2;v>=64&&v<=95?a=S===1?n[u]:y[u]:a=S===1?D[u]:g[u];var U=this.channels[S];return U?(U.setPAC(this.interpretPAC(a,v)),C(u,v,_),this.currentChannel=S,!0):!1},w.interpretPAC=function(u,v){var a,_={color:null,italics:!1,indent:null,underline:!1,row:u};return v>95?a=v-96:a=v-64,_.underline=(a&1)===1,a<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(a/2)]:a<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((a-16)/2)*4,_},w.parseChars=function(u,v){var a,_=null,N=null;if(u>=25?(a=2,N=u-8):(a=1,N=u),N>=17&&N<=19){var F;N===17?F=v+80:N===18?F=v+112:F=v+144,this.logger.log(c.INFO,"Special char '"+B(F)+"' in channel "+a),_=[F]}else u>=32&&u<=127&&(_=v===0?[u]:[u,v]);if(_){var S=p(_);this.logger.log(c.DEBUG,"Char codes = "+S.join(",")),C(u,v,this.cmdHistory)}return _},w.parseBackgroundAttributes=function(u,v){var a=(u===16||u===24)&&v>=32&&v<=47,_=(u===23||u===31)&&v>=45&&v<=47;if(!(a||_))return!1;var N,F={};u===16||u===24?(N=Math.floor((v-32)/2),F.background=m[N],v%2===1&&(F.background=F.background+"_semi")):v===45?F.background="transparent":(F.foreground="black",v===47&&(F.underline=!0));var S=u<=23?1:2,U=this.channels[S];return U.setBkgData(F),C(u,v,this.cmdHistory),!0},w.reset=function(){for(var u=0;u<Object.keys(this.channels).length;u++){var v=this.channels[u];v&&v.reset()}this.cmdHistory=O()},w.cueSplitAtTime=function(u){for(var v=0;v<this.channels.length;v++){var a=this.channels[v];a&&a.cueSplitAtTime(u)}},A}();function C(A,w,b){b.a=A,b.b=w}function L(A,w,b){return b.a===A&&b.b===w}function O(){return{a:null,b:null}}J.default=x},"./src/utils/codecs.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"isCodecType",function(){return j}),k.d(J,"isCodecSupportedInMp4",function(){return B});var Y={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 j(z,G){var n=Y[G];return!!n&&n[z.slice(0,4)]===!0}function B(z,G){return MediaSource.isTypeSupported((G||"video")+'/mp4;codecs="'+z+'"')}},"./src/utils/cues.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/utils/vttparser.ts"),j=k("./src/utils/webvtt-parser.ts"),B=k("./src/utils/texttrack-utils.ts"),z=/\s/,G={newCue:function(D,y,g,m){for(var c=[],d,p,l,h,o,s=self.VTTCue||self.TextTrackCue,R=0;R<m.rows.length;R++)if(d=m.rows[R],l=!0,h=0,o="",!d.isEmpty()){for(var x=0;x<d.chars.length;x++)z.test(d.chars[x].uchar)&&l?h++:(o+=d.chars[x].uchar,l=!1);d.cueStartTime=y,y===g&&(g+=1e-4),h>=16?h--:h++;var C=Object(Y.fixLineBreaks)(o.trim()),L=Object(j.generateCueId)(y,g,C);(!D||!D.cues||!D.cues.getCueById(L))&&(p=new s(y,g,C),p.id=L,p.line=R+1,p.align="left",p.position=10+Math.min(80,Math.floor(h*8/32)*10),c.push(p))}return D&&c.length&&(c.sort(function(O,A){return O.line==="auto"||A.line==="auto"?0:O.line>8&&A.line>8?A.line-O.line:O.line-A.line}),c.forEach(function(O){return Object(B.addCueToTrack)(D,O)})),c}};J.default=G},"./src/utils/discontinuities.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"findFirstFragWithCC",function(){return z}),k.d(J,"shouldAlignOnDiscontinuities",function(){return G}),k.d(J,"findDiscontinuousReferenceFrag",function(){return n}),k.d(J,"adjustSlidingStart",function(){return y}),k.d(J,"alignStream",function(){return g}),k.d(J,"alignPDT",function(){return c}),k.d(J,"alignFragmentByPDTDelta",function(){return d}),k.d(J,"alignMediaPlaylistByPDT",function(){return p});var Y=k("./src/polyfills/number.ts"),j=k("./src/utils/logger.ts"),B=k("./src/controller/level-helper.ts");function z(l,h){for(var o=null,s=0,R=l.length;s<R;s++){var x=l[s];if(x&&x.cc===h){o=x;break}}return o}function G(l,h,o){return!!(h.details&&(o.endCC>o.startCC||l&&l.cc<o.startCC))}function n(l,h){var o=l.fragments,s=h.fragments;if(!s.length||!o.length){j.logger.log("No fragments to align");return}var R=z(o,s[0].cc);if(!R||R&&!R.startPTS){j.logger.log("No frag in previous level to align on");return}return R}function D(l,h){if(l){var o=l.start+h;l.start=l.startPTS=o,l.endPTS=o+l.duration}}function y(l,h){for(var o=h.fragments,s=0,R=o.length;s<R;s++)D(o[s],l);h.fragmentHint&&D(h.fragmentHint,l),h.alignedSliding=!0}function g(l,h,o){if(!h)return;m(l,o,h),!o.alignedSliding&&h.details&&c(o,h.details),!o.alignedSliding&&h.details&&!o.skippedSegments&&Object(B.adjustSliding)(h.details,o)}function m(l,h,o){if(G(l,o,h)){var s=n(o.details,h);s&&Object(Y.isFiniteNumber)(s.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+h.url),y(s.start,h))}}function c(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var o=h.fragments[0].programDateTime,s=l.fragments[0].programDateTime,R=(s-o)/1e3+h.fragments[0].start;R&&Object(Y.isFiniteNumber)(R)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(s-o)+"ms, sliding:"+R.toFixed(3)+" "+l.url+" "),y(R,l))}function d(l,h){var o=l.programDateTime;if(!o)return;var s=(o-h)/1e3;l.start=l.startPTS=s,l.endPTS=s+l.duration}function p(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var o=h.fragments[0].programDateTime,s=h.fragments[0].start,R=o-s*1e3;l.fragments.forEach(function(x){d(x,R)}),l.fragmentHint&&d(l.fragmentHint,R),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/utils/ewma.ts"),j=function(){function B(G,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 Y.default(G),this.fast_=new Y.default(n)}var z=B.prototype;return z.update=function(n,D){var y=this.slow_,g=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new Y.default(n,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new Y.default(D,g.getEstimate(),g.getTotalWeight()))},z.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)},z.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},z.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},z.destroy=function(){},B}();J.default=j},"./src/utils/ewma.ts":function(ie,J,k){"use strict";k.r(J);var Y=function(){function j(z,G,n){G===void 0&&(G=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=z,this.alpha_=z?Math.exp(Math.log(.5)/z):0,this.estimate_=G,this.totalWeight_=n}var B=j.prototype;return B.sample=function(G,n){var D=Math.pow(this.alpha_,G);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=G},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},j}();J.default=Y},"./src/utils/fetch-loader.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"fetchSupported",function(){return d});var Y=k("./src/polyfills/number.ts"),j=k("./src/loader/load-stats.ts"),B=k("./src/demux/chunk-cache.ts");function z(s,R){s.prototype=Object.create(R.prototype),s.prototype.constructor=s,g(s,R)}function G(s){var R=typeof Map=="function"?new Map:void 0;return G=function(C){if(C===null||!y(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(C))return R.get(C);R.set(C,L)}function L(){return n(C,arguments,m(this).constructor)}return L.prototype=Object.create(C.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),g(L,C)},G(s)}function n(s,R,x){return D()?n=Reflect.construct:n=function(L,O,A){var w=[null];w.push.apply(w,O);var b=Function.bind.apply(L,w),u=new b;return A&&g(u,A.prototype),u},n.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function y(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function g(s,R){return g=Object.setPrototypeOf||function(C,L){return C.__proto__=L,C},g(s,R)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},m(s)}function c(){return c=Object.assign||function(s){for(var R=1;R<arguments.length;R++){var x=arguments[R];for(var C in x)Object.prototype.hasOwnProperty.call(x,C)&&(s[C]=x[C])}return s},c.apply(this,arguments)}function d(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var p=function(){function s(x){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=x.fetchSetup||h,this.controller=new self.AbortController,this.stats=new j.LoadStats}var R=s.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var C=this.response;(!C||!C.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(C,L,O){var A=this,w=this.stats;if(w.loading.start)throw new Error("Loader can only be used once.");w.loading.start=self.performance.now();var b=l(C,this.controller.signal),u=O.onProgress,v=C.responseType==="arraybuffer",a=v?"byteLength":"length";this.context=C,this.config=L,this.callbacks=O,this.request=this.fetchSetup(C,b),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){A.abortInternal(),O.onTimeout(w,C,A.response)},L.timeout),self.fetch(this.request).then(function(_){if(A.response=A.loader=_,!_.ok){var N=_.status,F=_.statusText;throw new o(F||"fetch, bad network response",N,_)}return w.loading.first=Math.max(self.performance.now(),w.loading.start),w.total=parseInt(_.headers.get("Content-Length")||"0"),u&&Object(Y.isFiniteNumber)(L.highWaterMark)?A.loadProgressively(_,w,C,L.highWaterMark,u):v?_.arrayBuffer():_.text()}).then(function(_){var N=A.response;self.clearTimeout(A.requestTimeout),w.loading.end=Math.max(self.performance.now(),w.loading.first),w.loaded=w.total=_[a];var F={url:N.url,data:_};u&&!Object(Y.isFiniteNumber)(L.highWaterMark)&&u(w,C,_,N),O.onSuccess(F,w,C,N)}).catch(function(_){if(self.clearTimeout(A.requestTimeout),w.aborted)return;var N=_.code||0;O.onError({code:N,text:_.message},C,_.details)})},R.getCacheAge=function(){var C=null;if(this.response){var L=this.response.headers.get("age");C=L?parseFloat(L):null}return C},R.loadProgressively=function(C,L,O,A,w){A===void 0&&(A=0);var b=new B.default,u=C.body.getReader(),v=function a(){return u.read().then(function(_){if(_.done)return b.dataLength&&w(L,O,b.flush(),C),Promise.resolve(new ArrayBuffer(0));var N=_.value,F=N.length;return L.loaded+=F,F<A||b.dataLength?(b.push(N),b.dataLength>=A&&w(L,O,b.flush(),C)):w(L,O,N,C),a()}).catch(function(){return Promise.reject()})};return v()},s}();function l(s,R){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(c({},s.headers))};return s.rangeEnd&&x.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),x}function h(s,R){return new self.Request(s.url,R)}var o=function(s){z(R,s);function R(x,C,L){var O;return O=s.call(this,x)||this,O.code=void 0,O.details=void 0,O.code=C,O.details=L,O}return R}(G(Error));J.default=p},"./src/utils/imsc1-ttml-parser.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"IMSC1_CODEC",function(){return y}),k.d(J,"parseIMSC1",function(){return d});var Y=k("./src/utils/mp4-tools.ts"),j=k("./src/utils/vttparser.ts"),B=k("./src/utils/vttcue.ts"),z=k("./src/demux/id3.ts"),G=k("./src/utils/timescale-conversion.ts"),n=k("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var b=arguments[w];for(var u in b)Object.prototype.hasOwnProperty.call(b,u)&&(A[u]=b[u])}return A},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 d(A,w,b,u,v){var a=Object(Y.findBox)(new Uint8Array(A),["mdat"]);if(a.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var _=a[0],N=Object(z.utf8ArrayToStr)(new Uint8Array(A,_.start,_.end-_.start)),F=Object(G.toTimescaleFromScale)(w,1,b);try{u(p(N,F))}catch(S){v(S)}}function p(A,w){var b=new DOMParser,u=b.parseFromString(A,"text/xml"),v=u.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(a).reduce(function(M,E){return M[E]=v.getAttribute("ttp:"+E)||a[E],M},{}),N=v.getAttribute("xml:space")!=="preserve",F=h(l(v,"styling","style")),S=h(l(v,"layout","region")),U=l(v,"body","[begin]");return[].map.call(U,function(M){var E=o(M,N);if(!E||!M.hasAttribute("begin"))return null;var W=C(M.getAttribute("begin"),_),Z=C(M.getAttribute("dur"),_),ne=C(M.getAttribute("end"),_);if(W===null)throw x(M);if(ne===null){if(Z===null)throw x(M);ne=W+Z}var ae=new B.default(W-w,ne-w,E);ae.id=Object(n.generateCueId)(ae.startTime,ae.endTime,ae.text);var we=S[M.getAttribute("region")],fe=F[M.getAttribute("style")];ae.position=10,ae.size=80;var _e=s(we,fe),Se=_e.textAlign;if(Se){var ve=c[Se];ve&&(ae.lineAlign=ve),ae.align=Se}return D(ae,_e),ae}).filter(function(M){return M!==null})}function l(A,w,b){var u=A.getElementsByTagName(w)[0];return u?[].slice.call(u.querySelectorAll(b)):[]}function h(A){return A.reduce(function(w,b){var u=b.getAttribute("xml:id");return u&&(w[u]=b),w},{})}function o(A,w){return[].slice.call(A.childNodes).reduce(function(b,u,v){var a;return u.nodeName==="br"&&v?b+`
|
|
`:(a=u.childNodes)!==null&&a!==void 0&&a.length?o(u,w):w?b+u.textContent.trim().replace(/\s+/g," "):b+u.textContent},"")}function s(A,w){var b="http://www.w3.org/ns/ttml#styling",u=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return u.reduce(function(v,a){var _=R(w,b,a)||R(A,b,a);return _&&(v[a]=_),v},{})}function R(A,w,b){return A.hasAttributeNS(w,b)?A.getAttributeNS(w,b):null}function x(A){return new Error("Could not parse ttml timestamp "+A)}function C(A,w){if(!A)return null;var b=Object(j.parseTimeStamp)(A);return b===null&&(g.test(A)?b=L(A,w):m.test(A)&&(b=O(A,w))),b}function L(A,w){var b=g.exec(A),u=(b[4]|0)+(b[5]|0)/w.subFrameRate;return(b[1]|0)*3600+(b[2]|0)*60+(b[3]|0)+u/w.frameRate}function O(A,w){var b=m.exec(A),u=Number(b[1]),v=b[2];switch(v){case"h":return u*3600;case"m":return u*60;case"ms":return u*1e3;case"f":return u/w.frameRate;case"t":return u/w.tickRate}return u}},"./src/utils/logger.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"enableLogs",function(){return n}),k.d(J,"logger",function(){return D});var Y=function(){},j={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y},B=j;function z(y){var g=self.console[y];return g?g.bind(self.console,"["+y+"] >"):Y}function G(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(d){B[d]=y[d]?y[d].bind(y):z(d)})}function n(y){if(self.console&&y===!0||typeof y=="object"){G(y,"debug","log","info","warn","error");try{B.log()}catch(g){B=j}}else B=j}var D=B},"./src/utils/mediakeys-helper.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"KeySystems",function(){return Y}),k.d(J,"requestMediaKeySystemAccess",function(){return j});var Y;(function(B){B.WIDEVINE="com.widevine.alpha",B.PLAYREADY="com.microsoft.playready"})(Y||(Y={}));var j=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"getMediaSource",function(){return Y});function Y(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"bin2str",function(){return G}),k.d(J,"readUint16",function(){return n}),k.d(J,"readUint32",function(){return D}),k.d(J,"writeUint32",function(){return y}),k.d(J,"findBox",function(){return g}),k.d(J,"parseSegmentIndex",function(){return m}),k.d(J,"parseInitSegment",function(){return c}),k.d(J,"getStartDTS",function(){return d}),k.d(J,"getDuration",function(){return p}),k.d(J,"computeRawDurationFromSamples",function(){return l}),k.d(J,"offsetStartDTS",function(){return h}),k.d(J,"segmentValidRange",function(){return o}),k.d(J,"appendUint8Array",function(){return s});var Y=k("./src/utils/typed-array.ts"),j=k("./src/loader/fragment.ts"),B=Math.pow(2,32)-1,z=[].push;function G(R){return String.fromCharCode.apply(null,R)}function n(R,x){"data"in R&&(x+=R.start,R=R.data);var C=R[x]<<8|R[x+1];return C<0?65536+C:C}function D(R,x){"data"in R&&(x+=R.start,R=R.data);var C=R[x]<<24|R[x+1]<<16|R[x+2]<<8|R[x+3];return C<0?4294967296+C:C}function y(R,x,C){"data"in R&&(x+=R.start,R=R.data),R[x]=C>>24,R[x+1]=C>>16&255,R[x+2]=C>>8&255,R[x+3]=C&255}function g(R,x){var C=[];if(!x.length)return C;var L,O,A;"data"in R?(L=R.data,O=R.start,A=R.end):(L=R,O=0,A=L.byteLength);for(var w=O;w<A;){var b=D(L,w),u=G(L.subarray(w+4,w+8)),v=b>1?w+b:A;if(u===x[0])if(x.length===1)C.push({data:L,start:w+8,end:v});else{var a=g({data:L,start:w+8,end:v},x.slice(1));a.length&&z.apply(C,a)}w=v}return C}function m(R){var x=g(R,["moov"]),C=x[0],L=C?C.end:null,O=g(R,["sidx"]);if(!O||!O[0])return null;var A=[],w=O[0],b=w.data[0],u=b===0?8:16,v=D(w,u);u+=4;var a=0,_=0;b===0?u+=8:u+=16,u+=2;var N=w.end+_,F=n(w,u);u+=2;for(var S=0;S<F;S++){var U=u,M=D(w,U);U+=4;var E=M&2147483647,W=(M&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=D(w,U);U+=4,A.push({referenceSize:E,subsegmentDuration:Z,info:{duration:Z/v,start:N,end:N+E-1}}),N+=E,U+=4,u=U}return{earliestPresentationTime:a,timescale:v,version:b,referencesCount:F,references:A,moovEndOffset:L}}function c(R){for(var x=[],C=g(R,["moov","trak"]),L=0;L<C.length;L++){var O=C[L],A=g(O,["tkhd"])[0];if(A){var w=A.data[A.start],b=w===0?12:20,u=D(A,b),v=g(O,["mdia","mdhd"])[0];if(v){w=v.data[v.start],b=w===0?12:20;var a=D(v,b),_=g(O,["mdia","hdlr"])[0];if(_){var N=G(_.data.subarray(_.start+8,_.start+12)),F={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[N];if(F){var S=g(O,["mdia","minf","stbl","stsd"])[0],U=void 0;S&&(U=G(S.data.subarray(S.start+12,S.start+16))),x[u]={timescale:a,type:F},x[F]={timescale:a,id:u,codec:U}}}}}}var M=g(R,["moov","mvex","trex"]);return M.forEach(function(E){var W=D(E,4),Z=x[W];Z&&(Z.default={duration:D(E,12),flags:D(E,20)})}),x}function d(R,x){return g(x,["moof","traf"]).reduce(function(C,L){var O=g(L,["tfdt"])[0],A=O.data[O.start],w=g(L,["tfhd"]).reduce(function(b,u){var v=D(u,4),a=R[v];if(a){var _=D(O,4);A===1&&(_*=Math.pow(2,32),_+=D(O,8));var N=a.timescale||9e4,F=_/N;if(isFinite(F)&&(b===null||F<b))return F}return b},null);return w!==null&&isFinite(w)&&(C===null||w<C)?w:C},null)||0}function p(R,x){for(var C=0,L=0,O=0,A=g(R,["moof","traf"]),w=0;w<A.length;w++){var b=A[w],u=g(b,["tfhd"])[0],v=D(u,4),a=x[v];if(!a)continue;var _=a.default,N=D(u,0)|(_==null?void 0:_.flags),F=_==null?void 0:_.duration;N&8&&(N&2?F=D(u,12):F=D(u,8));for(var S=a.timescale||9e4,U=g(b,["trun"]),M=0;M<U.length;M++){if(F){var E=D(U[M],4);C=F*E}else C=l(U[M]);a.type===j.ElementaryStreamTypes.VIDEO?L+=C/S:a.type===j.ElementaryStreamTypes.AUDIO&&(O+=C/S)}}if(L===0&&O===0){var W=m(R);if(W!=null&&W.references)return W.references.reduce(function(Z,ne){return Z+ne.info.duration||0},0)}return L||O}function l(R){var x=D(R,0),C=8;x&1&&(C+=4),x&4&&(C+=4);for(var L=0,O=D(R,4),A=0;A<O;A++){if(x&256){var w=D(R,C);L+=w,C+=4}x&512&&(C+=4),x&1024&&(C+=4),x&2048&&(C+=4)}return L}function h(R,x,C){g(x,["moof","traf"]).forEach(function(L){g(L,["tfhd"]).forEach(function(O){var A=D(O,4),w=R[A];if(!w)return;var b=w.timescale||9e4;g(L,["tfdt"]).forEach(function(u){var v=u.data[u.start],a=D(u,4);if(v===0)y(u,4,a-C*b);else{a*=Math.pow(2,32),a+=D(u,8),a-=C*b,a=Math.max(a,0);var _=Math.floor(a/(B+1)),N=Math.floor(a%(B+1));y(u,4,_),y(u,8,N)}})})})}function o(R){var x={valid:null,remainder:null},C=g(R,["moof"]);if(C){if(C.length<2)return x.remainder=R,x}else return x;var L=C[C.length-1];return x.valid=Object(Y.sliceUint8)(R,0,L.start-8),x.remainder=Object(Y.sliceUint8)(R,L.start-8),x}function s(R,x){var C=new Uint8Array(R.length+x.length);return C.set(R),C.set(x,R.length),C}},"./src/utils/output-filter.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"default",function(){return Y});var Y=function(){function j(z,G){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=z,this.trackName=G}var B=j.prototype;return B.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},B.newCue=function(G,n,D){(this.startTime===null||this.startTime>G)&&(this.startTime=G),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"sendAddTrackEvent",function(){return j}),k.d(J,"addCueToTrack",function(){return B}),k.d(J,"clearCurrentCues",function(){return z}),k.d(J,"removeCuesInRange",function(){return G}),k.d(J,"getCuesInRange",function(){return D});var Y=k("./src/utils/logger.ts");function j(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 B(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(d){Y.logger.debug("[texttrack-utils]: "+d);var c=new self.TextTrackCue(g.startTime,g.endTime,g.text);c.id=g.id,y.addCue(c)}m==="disabled"&&(y.mode=m)}function z(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 G(y,g,m){var c=y.mode;if(c==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var d=D(y.cues,g,m),p=0;p<d.length;p++)y.removeCue(d[p]);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,d=m;c<=d;){var p=Math.floor((d+c)/2);if(g<y[p].startTime)d=p-1;else if(g>y[p].startTime&&c<m)c=p+1;else return p}return y[c].startTime-g<g-y[d].startTime?c:d}function D(y,g,m){var c=[],d=n(y,g);if(d>-1)for(var p=d,l=y.length;p<l;p++){var h=y[p];if(h.startTime>=g&&h.endTime<=m)c.push(h);else if(h.startTime>m)return c}return c}},"./src/utils/time-ranges.ts":function(ie,J,k){"use strict";k.r(J);var Y={toString:function(B){for(var z="",G=B.length,n=0;n<G;n++)z+="["+B.start(n).toFixed(3)+","+B.end(n).toFixed(3)+"]";return z}};J.default=Y},"./src/utils/timescale-conversion.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"toTimescaleFromBase",function(){return j}),k.d(J,"toTimescaleFromScale",function(){return B}),k.d(J,"toMsFromMpegTsClock",function(){return z}),k.d(J,"toMpegTsClockFromTimescale",function(){return G});var Y=9e4;function j(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 B(n,D,y,g){return y===void 0&&(y=1),g===void 0&&(g=!1),j(n,D,1/y,g)}function z(n,D){return D===void 0&&(D=!1),j(n,1e3,1/Y,D)}function G(n,D){return D===void 0&&(D=1),j(n,Y,1/D)}},"./src/utils/typed-array.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"sliceUint8",function(){return Y});function Y(j,B,z){return Uint8Array.prototype.slice?j.slice(B,z):new Uint8Array(Array.prototype.slice.call(j,B,z))}},"./src/utils/vttcue.ts":function(ie,J,k){"use strict";k.r(J),J.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Y=["","lr","rl"],j=["start","middle","end","left","right"];function B(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 z(y){return B(Y,y)}function G(y){return B(j,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 d=1;d<arguments.length;d++){var p=arguments[d];for(var l in p)y[l]=p[l]}return y}function D(y,g,m){var c=this,d={enumerable:!0};c.hasBeenReset=!1;var p="",l=!1,h=y,o=g,s=m,R=null,x="",C=!0,L="auto",O="start",A=50,w="middle",b=50,u="middle";Object.defineProperty(c,"id",n({},d,{get:function(){return p},set:function(a){p=""+a}})),Object.defineProperty(c,"pauseOnExit",n({},d,{get:function(){return l},set:function(a){l=!!a}})),Object.defineProperty(c,"startTime",n({},d,{get:function(){return h},set:function(a){if(typeof a!="number")throw new TypeError("Start time must be set to a number.");h=a,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},d,{get:function(){return o},set:function(a){if(typeof a!="number")throw new TypeError("End time must be set to a number.");o=a,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},d,{get:function(){return s},set:function(a){s=""+a,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},d,{get:function(){return R},set:function(a){R=a,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},d,{get:function(){return x},set:function(a){var _=z(a);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=_,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},d,{get:function(){return C},set:function(a){C=!!a,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},d,{get:function(){return L},set:function(a){if(typeof a!="number"&&a!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=a,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},d,{get:function(){return O},set:function(a){var _=G(a);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");O=_,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},d,{get:function(){return A},set:function(a){if(a<0||a>100)throw new Error("Position must be between 0 and 100.");A=a,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},d,{get:function(){return w},set:function(a){var _=G(a);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");w=_,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},d,{get:function(){return b},set:function(a){if(a<0||a>100)throw new Error("Size must be between 0 and 100.");b=a,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},d,{get:function(){return u},set:function(a){var _=G(a);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");u=_,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(ie,J,k){"use strict";k.r(J),k.d(J,"parseTimeStamp",function(){return B}),k.d(J,"fixLineBreaks",function(){return g}),k.d(J,"VTTParser",function(){return m});var Y=k("./src/utils/vttcue.ts"),j=function(){function c(){}var d=c.prototype;return d.decode=function(l,h){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},c}();function B(c){function d(l,h,o,s){return(l|0)*3600+(h|0)*60+(o|0)+parseFloat(s||0)}var p=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?d(p[2],p[3],0,p[4]):d(p[1],p[2],p[3],p[4]):null}var z=function(){function c(){this.values=Object.create(null)}var d=c.prototype;return d.set=function(l,h){!this.get(l)&&h!==""&&(this.values[l]=h)},d.get=function(l,h,o){return o?this.has(l)?this.values[l]:h[o]:this.has(l)?this.values[l]:h},d.has=function(l){return l in this.values},d.alt=function(l,h,o){for(var s=0;s<o.length;++s)if(h===o[s]){this.set(l,h);break}},d.integer=function(l,h){/^-?\d+$/.test(h)&&this.set(l,parseInt(h,10))},d.percent=function(l,h){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(h)){var o=parseFloat(h);if(o>=0&&o<=100)return this.set(l,o),!0}return!1},c}();function G(c,d,p,l){var h=l?c.split(l):[c];for(var o in h){if(typeof h[o]!="string")continue;var s=h[o].split(p);if(s.length!==2)continue;var R=s[0],x=s[1];d(R,x)}}var n=new Y.default(0,0,""),D=n.align==="middle"?"middle":"center";function y(c,d,p){var l=c;function h(){var R=B(c);if(R===null)throw new Error("Malformed timestamp: "+l);return c=c.replace(/^[^\sa-zA-Z-]+/,""),R}function o(R,x){var C=new z;G(R,function(A,w){var b;switch(A){case"region":for(var u=p.length-1;u>=0;u--)if(p[u].id===w){C.set(A,p[u].region);break}break;case"vertical":C.alt(A,w,["rl","lr"]);break;case"line":b=w.split(","),C.integer(A,b[0]),C.percent(A,b[0])&&C.set("snapToLines",!1),C.alt(A,b[0],["auto"]),b.length===2&&C.alt("lineAlign",b[1],["start",D,"end"]);break;case"position":b=w.split(","),C.percent(A,b[0]),b.length===2&&C.alt("positionAlign",b[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":C.percent(A,w);break;case"align":C.alt(A,w,["start",D,"end","left","right"]);break}},/:/,/\s/),x.region=C.get("region",null),x.vertical=C.get("vertical","");var L=C.get("line","auto");L==="auto"&&n.line===-1&&(L=-1),x.line=L,x.lineAlign=C.get("lineAlign","start"),x.snapToLines=C.get("snapToLines",!0),x.size=C.get("size",100),x.align=C.get("align",D);var O=C.get("position","auto");O==="auto"&&n.position===50&&(O=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=O}function s(){c=c.replace(/^\s+/,"")}if(s(),d.startTime=h(),s(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);c=c.substr(3),s(),d.endTime=h(),s(),o(c,d)}function g(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var d=c.prototype;return d.parse=function(l){var h=this;l&&(h.buffer+=h.decoder.decode(l,{stream:!0}));function o(){var O=h.buffer,A=0;for(O=g(O);A<O.length&&O[A]!=="\r"&&O[A]!==`
|
|
`;)++A;var w=O.substr(0,A);return O[A]==="\r"&&++A,O[A]===`
|
|
`&&++A,h.buffer=O.substr(A),w}function s(O){G(O,function(A,w){},/:/)}try{var R="";if(h.state==="INITIAL"){if(!/\r\n|\n/.test(h.buffer))return this;R=o();var x=R.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");h.state="HEADER"}for(var C=!1;h.buffer;){if(!/\r\n|\n/.test(h.buffer))return this;C?C=!1:R=o();switch(h.state){case"HEADER":/:/.test(R)?s(R):R||(h.state="ID");continue;case"NOTE":R||(h.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){h.state="NOTE";break}if(!R)continue;if(h.cue=new Y.default(0,0,""),h.state="CUE",R.indexOf("-->")===-1){h.cue.id=R;continue}case"CUE":if(!h.cue){h.state="BADCUE";continue}try{y(R,h.cue,h.regionList)}catch(O){h.cue=null,h.state="BADCUE";continue}h.state="CUETEXT";continue;case"CUETEXT":{var L=R.indexOf("-->")!==-1;if(!R||L&&(C=!0)){h.oncue&&h.cue&&h.oncue(h.cue),h.cue=null,h.state="ID";continue}if(h.cue===null)continue;h.cue.text&&(h.cue.text+=`
|
|
`),h.cue.text+=R}continue;case"BADCUE":R||(h.state="ID")}}}catch(O){h.state==="CUETEXT"&&h.cue&&h.oncue&&h.oncue(h.cue),h.cue=null,h.state=h.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},d.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
|
|
|
|
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(h){l.onparsingerror&&l.onparsingerror(h)}return l.onflush&&l.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(ie,J,k){"use strict";k.r(J),k.d(J,"generateCueId",function(){return m}),k.d(J,"parseWebVTT",function(){return d});var Y=k("./src/polyfills/number.ts"),j=k("./src/utils/vttparser.ts"),B=k("./src/demux/id3.ts"),z=k("./src/utils/timescale-conversion.ts"),G=k("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(l,h,o){return o===void 0&&(o=0),l.substr(o,h.length)===h},y=function(l){var h=parseInt(l.substr(-3)),o=parseInt(l.substr(-6,2)),s=parseInt(l.substr(-9,2)),R=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(h)||!Object(Y.isFiniteNumber)(o)||!Object(Y.isFiniteNumber)(s)||!Object(Y.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return h+=1e3*o,h+=60*1e3*s,h+=60*60*1e3*R,h},g=function(l){for(var h=5381,o=l.length;o;)h=h*33^l.charCodeAt(--o);return(h>>>0).toString()};function m(p,l,h){return g(p.toString())+g(l.toString())+g(h)}var c=function(l,h,o){var s=l[h],R=l[s.prevCC];if(!R||!R.new&&s.new){l.ccOffset=l.presentationOffset=s.start,s.new=!1;return}for(;(x=R)!==null&&x!==void 0&&x.new;){var x;l.ccOffset+=s.start-R.start,s.new=!1,s=R,R=l[s.prevCC]}l.presentationOffset=o};function d(p,l,h,o,s,R,x,C){var L=new j.VTTParser,O=Object(B.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(n,`
|
|
`).split(`
|
|
`),A=[],w=Object(z.toMpegTsClockFromTimescale)(l,h),b="00:00.000",u=0,v=0,a,_=!0,N=!1;L.oncue=function(F){var S=o[s],U=o.ccOffset,M=(u-w)/9e4;if(S!=null&&S.new&&(v!==void 0?U=o.ccOffset=S.start:c(o,s,M)),M&&(U=M-o.presentationOffset),N){var E=F.endTime-F.startTime,W=Object(G.normalizePts)((F.startTime+U-v)*9e4,R*9e4)/9e4;F.startTime=W,F.endTime=W+E}var Z=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Z)),F.id||(F.id=m(F.startTime,F.endTime,Z)),F.endTime>0&&A.push(F)},L.onparsingerror=function(F){a=F},L.onflush=function(){if(a){C(a);return}x(A)},O.forEach(function(F){if(_)if(D(F,"X-TIMESTAMP-MAP=")){_=!1,N=!0,F.substr(16).split(",").forEach(function(S){D(S,"LOCAL:")?b=S.substr(6):D(S,"MPEGTS:")&&(u=parseInt(S.substr(7)))});try{v=y(b)/1e3}catch(S){N=!1,a=S}return}else F===""&&(_=!1);L.parse(F+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ie,J,k){"use strict";k.r(J);var Y=k("./src/utils/logger.ts"),j=k("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,z=function(){function G(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 j.LoadStats,this.retryDelay=0}var n=G.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 d=this.xhrSetup;try{if(d)try{d(m,g.url)}catch(h){m.open("GET",g.url,!0),d(m,g.url)}m.readyState||m.open("GET",g.url,!0);var p=this.context.headers;if(p)for(var l in p)m.setRequestHeader(l,p[l])}catch(h){this.callbacks.onError({code:m.status,text:h.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,d=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 p=g.status;if(p>=200&&p<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var l,h;if(y.responseType==="arraybuffer"?(l=g.response,h=l.byteLength):(l=g.responseText,h=l.length),m.loaded=m.total=h,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(m,y,l,g),!this.callbacks)return;var s={url:g.responseURL,data:l};this.callbacks.onSuccess(s,m,y,g)}else m.retry>=d.maxRetry||p>=400&&p<499?(Y.logger.error(p+" while loading "+y.url),this.callbacks.onError({code:p,text:g.statusText},y,g)):(Y.logger.warn(p+" 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,d.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),d.timeout)},n.loadtimeout=function(){Y.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&&B.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");y=g?parseFloat(g):null}return y},G}();J.default=z}}).default})},vHTk:function(dt,be,$){dt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|