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

445 lines
1.2 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[48,5,6,7],{"+NIl":function(nt,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(J,P){"use strict";function Y(h,o){h.cmdState.push(o)}function j(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function U(h){var o=h.cmdState.pop();o&&o.closeBracket()}function z(h){for(var o=h.cmdState,f=o.length-1;f>=0;f--){var l=o[f];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(h,o,f){return function(){this.name=h,this.bracketNo=0,this.style=o,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=W("importmodule","tag",["string","builtin"]),r.documentclass=W("documentclass","tag",["","atom"]),r.usepackage=W("usepackage","tag",["atom"]),r.begin=W("begin","tag",["atom"]),r.end=W("end","tag",["atom"]),r.label=W("label","tag",["atom"]),r.ref=W("ref","tag",["atom"]),r.eqref=W("eqref","tag",["atom"]),r.cite=W("cite","tag",["atom"]),r.bibitem=W("bibitem","tag",["atom"]),r.Bibitem=W("Bibitem","tag",["atom"]),r.RBibitem=W("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(h,o){h.f=o}function v(h,o){var f;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return f=r.hasOwnProperty(l)?r[l]:r.DEFAULT,f=new f,Y(o,f),R(o,p),f.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return R(o,function(s,a){return m(s,a,"\\]")}),"keyword";if(h.match("\\("))return R(o,function(s,a){return m(s,a,"\\)")}),"keyword";if(h.match("$$"))return R(o,function(s,a){return m(s,a,"$$")}),"keyword";if(h.match("$"))return R(o,function(s,a){return m(s,a,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(f=j(o),f)f.closeBracket(u),R(o,p);else return"error";return"bracket"}else return u=="{"||u=="["?(f=r.DEFAULT,f=new f,Y(o,f),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),f=z(o),f.name=="begin"&&(f.argument=h.current()),f.styleIdentifier())}function m(h,o,f){if(h.eatSpace())return null;if(f&&h.match(f))return R(o,v),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=h.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(h.skipToEnd(),"comment"):"error"}function p(h,o){var f=h.peek(),l;return f=="{"||f=="["?(l=j(o),l.openBracket(f),h.eat(f),R(o,v),"bracket"):/[ \t\r]/.test(f)?(h.eat(f),null):(R(o,v),U(o),v(h,o))}return{startState:function(){var h=P.inMathMode?function(o,f){return m(o,f)}:v;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,o){return o.f(h,o)},blankLine:function(h){h.f=v,h.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(nt,be,Q){},"/cxE":function(nt,be,Q){"use strict";Q.d(be,"f",function(){return P}),Q.d(be,"g",function(){return Y}),Q.d(be,"h",function(){return j}),Q.d(be,"e",function(){return z}),Q.d(be,"b",function(){return W}),Q.d(be,"c",function(){return r}),Q.d(be,"d",function(){return R}),Q.d(be,"a",function(){return v});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
`+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const J=new ie;function P(m){z(m)||J.onUnexpectedError(m);return}function Y(m){z(m)||J.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:h}=m;const o=m.stacktrace||m.stack;return{$isError:!0,name:p,message:h,stack:o}}return m}const U="Canceled";function z(m){return m instanceof Error&&m.name===U&&m.message===U}function W(){const m=new Error(U);return m.name=m.message,m}function r(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function R(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(nt,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(W,r,R){var v=R&&R!=ie.Init;if(r&&!v)W.on("blur",j),W.on("change",U),W.on("swapDoc",U),ie.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){Y(W)}),U(W);else if(!r&&v){W.off("blur",j),W.off("change",U),W.off("swapDoc",U),ie.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),J(W);var m=W.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}r&&!W.hasFocus()&&j(W)});function J(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function P(W){J(W);var r=W.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=W.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var R=W.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),r.appendChild(R),W.display.lineSpace.insertBefore(r,W.display.lineSpace.firstChild)}function Y(W){setTimeout(function(){var r=!1,R=W.getInputField();R.nodeName=="TEXTAREA"?r=!R.value:W.lineCount()==1&&(r=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),r?P(W):J(W)},20)}function j(W){z(W)&&P(W)}function U(W){var r=W.getWrapperElement(),R=z(W);r.className=r.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?P(W):J(W)}function z(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(nt,be,Q){(function(ie){ie(Q("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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Y,j){var U=Y.indentUnit,z={},W=j.htmlMode?J:P;for(var r in W)z[r]=W[r];for(var r in j)z[r]=j[r];var R,v;function m(d,w){function y(F){return w.tokenize=F,F(d,w)}var b=d.next();if(b=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?y(o("atom","]]>")):null:d.match("--")?y(o("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),y(f(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),w.tokenize=o("meta","?>"),"meta"):(R=d.eat("/")?"closeTag":"openTag",w.tokenize=p,"tag bracket");if(b=="&"){var B;return d.eat("#")?d.eat("x")?B=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):B=d.eatWhile(/[\d]/)&&d.eat(";"):B=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),B?"atom":"error"}else return d.eatWhile(/[^&<]/),null}m.isInText=!0;function p(d,w){var y=d.next();if(y==">"||y=="/"&&d.eat(">"))return w.tokenize=m,R=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return R="equals",null;if(y=="<"){w.tokenize=m,w.state=a,w.tagName=w.tagStart=null;var b=w.tokenize(d,w);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(w.tokenize=h(y),w.stringStartCol=d.column(),w.tokenize(d,w)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(d){var w=function(y,b){for(;!y.eol();)if(y.next()==d){b.tokenize=p;break}return"string"};return w.isInAttribute=!0,w}function o(d,w){return function(y,b){for(;!y.eol();){if(y.match(w)){b.tokenize=m;break}y.next()}return d}}function f(d){return function(w,y){for(var b;(b=w.next())!=null;){if(b=="<")return y.tokenize=f(d+1),y.tokenize(w,y);if(b==">")if(d==1){y.tokenize=m;break}else return y.tokenize=f(d-1),y.tokenize(w,y)}return"meta"}}function l(d,w,y){this.prev=d.context,this.tagName=w,this.indent=d.indented,this.startOfLine=y,(z.doNotIndent.hasOwnProperty(w)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function u(d){d.context&&(d.context=d.context.prev)}function s(d,w){for(var y;;){if(!d.context)return;if(y=d.context.tagName,!z.contextGrabbers.hasOwnProperty(y)||!z.contextGrabbers[y].hasOwnProperty(w))return;u(d)}}function a(d,w,y){return d=="openTag"?(y.tagStart=w.column(),O):d=="closeTag"?x:a}function O(d,w,y){return d=="word"?(y.tagName=w.current(),v="tag",L):z.allowMissingTagName&&d=="endTag"?(v="tag bracket",L(d,w,y)):(v="error",O)}function x(d,w,y){if(d=="word"){var b=w.current();return y.context&&y.context.tagName!=b&&z.implicitlyClosed.hasOwnProperty(y.context.tagName)&&u(y),y.context&&y.context.tagName==b||z.matchClosing===!1?(v="tag",S):(v="tag error",D)}else return z.allowMissingTagName&&d=="endTag"?(v="tag bracket",S(d,w,y)):(v="error",D)}function S(d,w,y){return d!="endTag"?(v="error",S):(u(y),a)}function D(d,w,y){return v="error",S(d,w,y)}function L(d,w,y){if(d=="word")return v="attribute",A;if(d=="endTag"||d=="selfcloseTag"){var b=y.tagName,B=y.tagStart;return y.tagName=y.tagStart=null,d=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(b)?s(y,b):(s(y,b),y.context=new l(y,b,B==y.indented)),a}return v="error",L}function A(d,w,y){return d=="equals"?C:(z.allowMissing||(v="error"),L(d,w,y))}function C(d,w,y){return d=="string"?E:d=="word"&&z.allowUnquoted?(v="string",L):(v="error",L(d,w,y))}function E(d,w,y){return d=="string"?E:L(d,w,y)}return{startState:function(d){var w={tokenize:m,state:a,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(w.baseIndent=d),w},token:function(d,w){if(!w.tagName&&d.sol()&&(w.indented=d.indentation()),d.eatSpace())return null;R=null;var y=w.tokenize(d,w);return(y||R)&&y!="comment"&&(v=null,w.state=w.state(R||y,d,w),v&&(y=v=="error"?y+" error":v)),y},indent:function(d,w,y){var b=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+U;if(b&&b.noIndent)return ie.Pass;if(d.tokenize!=p&&d.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(d.tagName)return z.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+U*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/<!\[CDATA\[/.test(w))return 0;var B=w&&/^<(\/)?([\w_:\.-]*)/.exec(w);if(B&&B[1])for(;b;)if(b.tagName==B[2]){b=b.prev;break}else if(z.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(B)for(;b;){var F=z.contextGrabbers[b.tagName];if(F&&F.hasOwnProperty(B[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+U:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(d){d.state==C&&(d.state=L)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var w=[],y=d.context;y;y=y.prev)y.tagName&&w.push(y.tagName);return w.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(nt,be,Q){"use strict";Q.d(be,"a",function(){return J});class ie{constructor(P){this.element=P,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 P=this._first;for(;P!==ie.Undefined;){const Y=P.next;P.prev=ie.Undefined,P.next=ie.Undefined,P=Y}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,Y){const j=new ie(P);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 U=!1;return()=>{U||(U=!0,this._remove(j))}}shift(){if(this._first===ie.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===ie.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==ie.Undefined&&P.next!==ie.Undefined){const Y=P.prev;Y.next=P.next,P.next.prev=Y}else P.prev===ie.Undefined&&P.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):P.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):P.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==ie.Undefined;)yield P.element,P=P.next}}},"3/fG":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return J});function ie(P,Y){let j;return Y.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(U,z){const W=z[0];return typeof Y[W]!="undefined"?Y[W]:U}),j}function J(P,Y,...j){return ie(Y,j)}},"500L":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return x});var ie=Q("+L6B"),J=Q("2/Rp"),P=Q("2qtc"),Y=Q("kLXV"),j=Q("9og8"),U=Q("k1fw"),z=Q("miYZ"),W=Q("tsqr"),r=Q("oBTY"),R=Q("tJVT"),v=Q("DZo9"),m=Q("8z0m"),p=Q("WmNS"),h=Q.n(p),o=Q("q1tI"),f=Q.n(o),l=Q("m3rI"),u=Q("wzkS"),s=Q("y5JW"),a=Q("LtfV"),O=m.a.Dragger;function x(S){var D=[];return S&&S.length>0&&(D=S.map(function(L){return{uid:L.id,id:L.id,name:L.title+s.c+L.filesize,url:L.url,filesize:L.filesize,status:"done",response:{id:L.id}}})),D}be.b=function(S){var D=S.value,L=S.onChange,A=S.action,C=S.className,E=S.maxSize,d=E===void 0?150:E,w=S.title,y=w===void 0?"\u4E0A\u4F20\u9644\u4EF6":w,b=S.showRemoveModal,B=b===void 0?!1:b,F=S.accept,_=F===void 0?"":F,M=S.additionalText,I=S.isDragger,g=S.number,H=g===void 0?1e3:g,$=S.aloneClear,ae=$===void 0?!1:$,ue=Object(o.useState)(!1),Le=Object(R.a)(ue,2),ve=Le[0],Te=Le[1],_e=Object(o.useState)(D||[]),De=Object(R.a)(_e,2),he=De[0],ce=De[1];Object(o.useEffect)(function(){D&&(ce(Object(r.a)(D)),H===(D==null?void 0:D.length)&&Te(!0))},[D]);var ne=function(){setTimeout(function(){he.pop(),ce(Object(r.a)(he))},500)},fe={multiple:!0,disabled:ve,accept:_,withCredentials:!0,fileList:he,beforeUpload:function(Fe,Ae){var Re=Fe.size/1024/1024;return he.concat(Ae).length>H?(he.pop(),ce(Object(r.a)(he)),W.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(H,"\u4E2A\u6587\u4EF6")),ae?Promise.reject():(ne(),!1)):!0},action:A||"".concat(l.a.API_SERVER,"/api/attachments.json"),onChange:function(Fe){var Ae,Re,Pe=Object(r.a)(Fe.fileList);if(Fe.file.status==="done"&&((Ae=Fe.file)===null||Ae===void 0||((Re=Ae.response)===null||Re===void 0)?void 0:Re.status)===-1){var se,pe;W.b.error((se=Fe.file)===null||se===void 0||((pe=se.response)===null||pe===void 0)?void 0:pe.message);return}Pe.length>=H?Te(!0):Te(!1),ce(Object(r.a)(Pe)),Pe=Pe.map(function(ye){var Oe;if(ye!=null&&(Oe=ye.response)!==null&&Oe!==void 0&&Oe.id){var je;ye.url="/api/attachments/".concat(ye==null||((je=ye.response)===null||je===void 0)?void 0:je.id)}return ye.name.indexOf(s.c)===-1&&(ye.name="".concat(ye.name).concat(s.c).concat(Object(s.a)(ye.size))),Object(U.a)({},ye)}),console.log("info:",Fe),L(Pe)},onRemove:function(){var ke=Object(j.a)(h.a.mark(function Ae(Re){var Pe;return h.a.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:if(Pe=function(){var ye=Object(j.a)(h.a.mark(function Oe(){var je,ze;return h.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:if(je=Re.response?Re.response.id:Re.id,!je){Ye.next=8;break}return Ye.next=4,Object(u.d)(Re.response?Re.response.id:Re.uid);case 4:return ze=Ye.sent,Ye.abrupt("return",ze);case 8:return Ye.abrupt("return",!0);case 9:case"end":return Ye.stop()}},Oe)}));return function(){return ye.apply(this,arguments)}}(),!B){pe.next=5;break}return pe.abrupt("return",new Promise(function(ye,Oe){Y.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:f.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var je=Object(j.a)(h.a.mark(function Je(){var Ye;return h.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return Ze.next=2,Pe();case 2:Ye=Ze.sent,W.b.success("\u5220\u9664\u6210\u529F"),ye(!0);case 5:case"end":return Ze.stop()}},Je)}));function ze(){return je.apply(this,arguments)}return ze}(),onCancel:function(){return ye(!1)}})}));case 5:return pe.next=7,Pe();case 7:return pe.abrupt("return",pe.sent);case 8:case"end":return pe.stop()}},Ae)}));function Fe(Ae){return ke.apply(this,arguments)}return Fe}()};function le(ke){ke.preventDefault(),ke.stopPropagation()}return f.a.createElement("div",{className:"multi-upload ".concat(C||"")},I&&f.a.createElement(O,fe,f.a.createElement("p",{className:"ant-upload-drag-icon"},f.a.createElement(a.a,null)),f.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",f.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",d,"MB)"," "),M),!I&&f.a.createElement(m.a,fe,f.a.createElement(J.a,{style:{width:"108px",height:"32px",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)",borderRadius:"2px",border:"1px solid #BACFFE",color:"#3061D0"},icon:f.a.createElement("i",{className:"iconfont icon-shangchuan3",style:{marginRight:"6px"}}),disabled:ve},y),f.a.createElement("span",{onClick:le,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",d,"MB)"," ")))}},"55Ip":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return s});var ie=Q("Ty5D"),J=Q("dI71"),P=Q("q1tI"),Y=Q.n(P),j=Q("YS25"),U=Q("17x9"),z=Q.n(U),W=Q("wx14"),r=Q("zLVn"),R=Q("9R94"),v=function(C){Object(J.a)(E,C);function E(){for(var w,y=arguments.length,b=new Array(y),B=0;B<y;B++)b[B]=arguments[B];return w=C.call.apply(C,[this].concat(b))||this,w.history=Object(j.a)(w.props),w}var d=E.prototype;return d.render=function(){return Y.a.createElement(ie.c,{history:this.history,children:this.props.children})},E}(Y.a.Component),m=function(C){Object(J.a)(E,C);function E(){for(var w,y=arguments.length,b=new Array(y),B=0;B<y;B++)b[B]=arguments[B];return w=C.call.apply(C,[this].concat(b))||this,w.history=Object(j.b)(w.props),w}var d=E.prototype;return d.render=function(){return Y.a.createElement(ie.c,{history:this.history,children:this.props.children})},E}(Y.a.Component),p=function(E,d){return typeof E=="function"?E(d):E},h=function(E,d){return typeof E=="string"?Object(j.c)(E,null,null,d):E},o=function(E){return E},f=Y.a.forwardRef;typeof f=="undefined"&&(f=o);function l(C){return!!(C.metaKey||C.altKey||C.ctrlKey||C.shiftKey)}var u=f(function(C,E){var d=C.innerRef,w=C.navigate,y=C.onClick,b=Object(r.a)(C,["innerRef","navigate","onClick"]),B=b.target,F=Object(W.a)({},b,{onClick:function(M){try{y&&y(M)}catch(I){throw M.preventDefault(),I}!M.defaultPrevented&&M.button===0&&(!B||B==="_self")&&!l(M)&&(M.preventDefault(),w())}});return o!==f?F.ref=E||d:F.ref=d,Y.a.createElement("a",F)}),s=f(function(C,E){var d=C.component,w=d===void 0?u:d,y=C.replace,b=C.to,B=C.innerRef,F=Object(r.a)(C,["component","replace","to","innerRef"]);return Y.a.createElement(ie.e.Consumer,null,function(_){_||Object(R.a)(!1);var M=_.history,I=h(p(b,_.location),_.location),g=I?M.createHref(I):"",H=Object(W.a)({},F,{href:g,navigate:function(){var ae=p(b,_.location),ue=y?M.replace:M.push;ue(ae)}});return o!==f?H.ref=E||B:H.innerRef=B,Y.a.createElement(w,H)})});if(!1)var a,O;var x=function(E){return E},S=Y.a.forwardRef;typeof S=="undefined"&&(S=x);function D(){for(var C=arguments.length,E=new Array(C),d=0;d<C;d++)E[d]=arguments[d];return E.filter(function(w){return w}).join(" ")}var L=S(function(C,E){var d=C["aria-current"],w=d===void 0?"page":d,y=C.activeClassName,b=y===void 0?"active":y,B=C.activeStyle,F=C.className,_=C.exact,M=C.isActive,I=C.location,g=C.sensitive,H=C.strict,$=C.style,ae=C.to,ue=C.innerRef,Le=Object(r.a)(C,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Y.a.createElement(ie.e.Consumer,null,function(ve){ve||Object(R.a)(!1);var Te=I||ve.location,_e=h(p(ae,Te),Te),De=_e.pathname,he=De&&De.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ce=he?Object(ie.f)(Te.pathname,{path:he,exact:_,sensitive:g,strict:H}):null,ne=!!(M?M(ce,Te):ce),fe=ne?D(F,b):F,le=ne?Object(W.a)({},$,{},B):$,ke=Object(W.a)({"aria-current":ne&&w||null,className:fe,style:le,to:_e},Le);return x!==S?ke.ref=E||ue:ke.innerRef=ue,Y.a.createElement(s,ke)})});if(!1)var A},"5VLF":function(nt,be,Q){"use strict";var ie,J;function P(Y,j,U){var z=function(W,r){return Y.js_beautify(W,r)};return z.js=Y.js_beautify,z.css=j.css_beautify,z.html=U.html_beautify,z.js_beautify=Y.js_beautify,z.css_beautify=j.css_beautify,z.html_beautify=U.html_beautify,z}!(ie=[Q("6UM0"),Q("TXwP"),Q("psGv")],J=function(Y,j,U){return P(Y,j,U)}.apply(be,ie),J!==void 0&&(nt.exports=J))},"5Y4S":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return P});var ie=Q("MNsG");const J=ie.b.performance&&typeof ie.b.performance.now=="function";class P{constructor(Y){this._highResolution=J&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new P(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()}}},"6UM0":function(nt,be,Q){var ie,J;(function(){var P;(function(){"use strict";var j=[function(r,R,v){var m=v(1).Beautifier,p=v(5).Options;function h(o,f){var l=new m(o,f);return l.beautify()}r.exports=h,r.exports.defaultOptions=function(){return new p}},function(r,R,v){var m=v(2).Output,p=v(3).Token,h=v(4),o=v(5).Options,f=v(7).Tokenizer,l=v(7).line_starters,u=v(7).positionable_operators,s=v(7).TOKEN;function a(g,H){return H.indexOf(g)!==-1}function O(g){return g.replace(/^\s+/g,"")}function x(g){for(var H={},$=0;$<g.length;$++)H[g[$].replace(/-/g,"_")]=g[$];return H}function S(g,H){return g&&g.type===s.RESERVED&&g.text===H}function D(g,H){return g&&g.type===s.RESERVED&&a(g.text,H)}var L=["case","return","do","if","throw","else","await","break","continue","async"],A=["before-newline","after-newline","preserve-newline"],C=x(A),E=[C.before_newline,C.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(g,H){if(H.multiline_frame||H.mode===d.ForInitializer||H.mode===d.Conditional)return;g.remove_indent(H.start_line_index)}function y(g){g=g.replace(h.allLineBreaks,`
`);for(var H=[],$=g.indexOf(`
`);$!==-1;)H.push(g.substring(0,$)),g=g.substring($+1),$=g.indexOf(`
`);return g.length&&H.push(g),H}function b(g){return g===d.ArrayLiteral}function B(g){return a(g,[d.Expression,d.ForInitializer,d.Conditional])}function F(g,H){for(var $=0;$<g.length;$++){var ae=g[$].trim();if(ae.charAt(0)!==H)return!1}return!0}function _(g,H){for(var $=0,ae=g.length,ue;$<ae;$++)if(ue=g[$],ue&&ue.indexOf(H)!==0)return!1;return!0}function M(g,H){H=H||{},this._source_text=g||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(H)}M.prototype.create_flags=function(g,H){var $=0;g&&($=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>$&&($=g.line_indent_level));var ae={mode:H,parent:g,last_token:g?g.last_token:new p(s.START_BLOCK,""),last_word:g?g.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:g?g.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},M.prototype._reset=function(g){var H=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var $=new f(g,this._options);return this._tokens=$.tokenize(),g},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,H&&h.lineBreak.test(H||"")&&($=H.match(h.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return g=this._output.get_code($),g},M.prototype.handle_token=function(g,H){g.type===s.START_EXPR?this.handle_start_expr(g):g.type===s.END_EXPR?this.handle_end_expr(g):g.type===s.START_BLOCK?this.handle_start_block(g):g.type===s.END_BLOCK?this.handle_end_block(g):g.type===s.WORD?this.handle_word(g):g.type===s.RESERVED?this.handle_word(g):g.type===s.SEMICOLON?this.handle_semicolon(g):g.type===s.STRING?this.handle_string(g):g.type===s.EQUALS?this.handle_equals(g):g.type===s.OPERATOR?this.handle_operator(g):g.type===s.COMMA?this.handle_comma(g):g.type===s.BLOCK_COMMENT?this.handle_block_comment(g,H):g.type===s.COMMENT?this.handle_comment(g,H):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,H):this.handle_unknown(g,H)},M.prototype.handle_whitespace_and_comments=function(g,H){var $=g.newlines,ae=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var ue=g.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,H),this.handle_token(ue,H),ue=g.comments_before.next();if(ae)for(var Le=0;Le<$;Le+=1)this.print_newline(Le>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var ve=1;ve<$;ve+=1)this.print_newline(!0,H)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(g,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&g.newlines||H,ae=a(this._flags.last_token.text,u)||a(g.text,u);if(ae){var ue=a(this._flags.last_token.text,u)&&a(this._options.operator_position,E)||a(g.text,u);$=$&&ue}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(g,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.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))},M.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.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))},M.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(g){var H=!1;return H=H||D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&D(this._flags.last_token,I)&&!g.newlines,H=H||S(this._flags.last_token,"else")&&!(S(g,"if")&&!g.comments_before),H=H||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),H=H||this._flags.last_token.type===s.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==s.WORD&&g.type!==s.RESERVED,H=H||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),H?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var H=d.Expression;if(g.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=d.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=d.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=d.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(a(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===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ae=this._tokens.peek(-4);D($,["async","function"])||$.text==="*"&&D(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ae.text==="{"||ae.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(g);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&a(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(g){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.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(g),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var H=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):$&&(a($.text,[":",","])&&a(H.type,[s.STRING,s.WORD,s.RESERVED])||a(H.text,["get","set","..."])&&a($.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a($.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!H.comments_before&&H.text==="}",ue=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Le=0,ve=null;this._flags.inline_frame=!0;do if(Le+=1,ve=this._tokens.peek(Le-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==s.EOF&&!(ve.type===s.END_BLOCK&&ve.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ue||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,L)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===d.Statement;)this.restore_mode();var H=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(b(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(g)},M.prototype.handle_word=function(g){if(g.type===s.RESERVED){if(a(g.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)g.type=s.WORD;else if(g.text==="import"&&a(this._tokens.peek().text,["(","."]))g.type=s.WORD;else if(a(g.text,["as","from"])&&!this._flags.import_block)g.type=s.WORD;else if(this._flags.mode===d.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(g.type=s.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!B(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(S(g,"while")){this._output.space_before_token=!0,this.print_token(g),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&&S(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(g,["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(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g)),S(g,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:S(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===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var $="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===d.BlockStatement?$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?$="SPACE":this._flags.last_token.type===s.STRING?$="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&a(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),D(g,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),D(g,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?D(this._flags.last_token,L)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(g,"if")&&S(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===s.WORD||g.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===s.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(g,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var H=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},M.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},M.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},M.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(B(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(g)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},M.prototype.handle_operator=function(g){var H=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),$=a(g.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var ae=!H;this.handle_whitespace_and_comments(g,ae)}if(g.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,E)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.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 ue=!0,Le=!0,ve=!1;if(g.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,ve=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&a(g.text,u)){var Te=g.text===":",_e=Te&&ve,De=Te&&!ve;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!De,this.print_token(g),(!Te||_e)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!Te||_e?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case C.preserve_newline:De||this.allow_wrap_or_preserved_newline(g),ue=!(this._output.just_added_newline()||De),this._output.space_before_token=ue,this.print_token(g),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(g),ue=!1;var he=this._tokens.peek();Le=he&&a(he.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),ue=this._flags.last_token.type===s.START_BLOCK,Le=!1;else if(a(g.text,["--","++","!","~"])||$){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),ue=!1,Le=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var ce=D(this._flags.last_token,L)&&g.newlines;ce&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ce,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(ue=!0),this._flags.last_token.type===s.RESERVED?ue=!0:this._flags.last_token.type===s.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ue=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Le=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(g),this._output.space_before_token=Le},M.prototype.handle_block_comment=function(g,H){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,H),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,H)},M.prototype.print_block_commment=function(g,H){var $=y(g.text),ae,ue=!1,Le=!1,ve=g.whitespace_before,Te=ve.length;if(this.print_newline(!1,H),this.print_token_line_indentation(g),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),ue=F($,"*"),Le=_($,ve),ue&&(this._flags.alignment=1),ae=0;ae<$.length;ae++)ue?(this.print_token_line_indentation(g),this._output.add_token(O($[ae]))):Le&&$[ae]?(this.print_token_line_indentation(g),this._output.add_token($[ae].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token($[ae])),this.print_newline(!1,H);this._flags.alignment=0}},M.prototype.handle_comment=function(g,H){g.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,H)},M.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,L)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,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(g)},M.prototype.handle_unknown=function(g,H){this.print_token(g),g.text[g.text.length-1]===`
`&&this.print_newline(!1,H)},M.prototype.handle_eof=function(g){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},r.exports.Beautifier=M},function(r){function R(p){this.__parent=p,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=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(p))return!0;return!1},R.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.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)},R.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},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(`
`);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var o=this.__base_string_length;return h=h||0,p<0&&(o=0),o+=p*this.__indent_size,o+=h,o},v.prototype.get_indent_string=function(p,h){var o=this.__base_string;return h=h||0,p<0&&(p=0,o=""),h+=p*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,o="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),p&&(o+=new Array(p+1).join(" ")),this.__cache.push(o)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return p!==`
`&&(o=o.replace(/[\n]/g,p)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h<p.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var h=this.__lines.length;p<h;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var o=this.__lines.length-2;o>=0;){var f=this.__lines[o];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(o+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},r.exports.Output=m},function(r){function R(v,m,p,h){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=R},function(r,R){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])*";R.identifier=new RegExp(o+f,"g"),R.identifierStart=new RegExp(o),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r
|`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(r,R,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function h(o){m.call(this,o,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="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 u=0;u<l.length;u++)l[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[u];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}h.prototype=new m,r.exports.Options=h},function(r){function R(p,h){this.raw_options=v(p,h),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"])}R.prototype._get_array=function(p,h){var o=this.raw_options[p],f=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(f=o.concat()):typeof o=="string"&&(f=o.split(/[^a-zA-Z0-9_\/\-]+/)),f},R.prototype._get_boolean=function(p,h){var o=this.raw_options[p],f=o===void 0?!!h:!!o;return f},R.prototype._get_characters=function(p,h){var o=this.raw_options[p],f=h||"";return typeof o=="string"&&(f=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),f},R.prototype._get_number=function(p,h){var o=this.raw_options[p];h=parseInt(h,10),isNaN(h)&&(h=0);var f=parseInt(o,10);return isNaN(f)&&(f=h),f},R.prototype._get_selection=function(p,h,o){var f=this._get_selection_list(p,h,o);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f[0]},R.prototype._get_selection_list=function(p,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var f=this._get_array(p,o);if(!this._is_valid_selection(f,h))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f},R.prototype._is_valid_selection=function(p,h){return p.length&&h.length&&!p.some(function(o){return h.indexOf(o)===-1})};function v(p,h){var o={};p=m(p);var f;for(f in p)f!==h&&(o[f]=p[f]);if(h&&p[h])for(f in p[h])o[f]=p[h][f];return o}function m(p){var h={},o;for(o in p){var f=o.replace(/-/g,"_");h[f]=p[o]}return h}r.exports.Options=R,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},function(r,R,v){var m=v(8).InputScanner,p=v(9).Tokenizer,h=v(9).TOKEN,o=v(13).Directives,f=v(4),l=v(12).Pattern,u=v(14).TemplatablePattern;function s(F,_){return _.indexOf(F)!==-1}var a={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:h.START,RAW:h.RAW,EOF:h.EOF},O=new o(/\/\*/,/\*\//),x=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,D=/[^\d\.]/,L=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var C=new RegExp(A),E="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=E.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+d.join("|")+")$"),y,b=function(F,_){p.call(this,F,_),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new l(this._input),I=new u(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(f.identifier).matching(f.identifierMatch),number:M.matching(x),punct:M.matching(C),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(/<!--/),html_comment_end:M.matching(/-->/),include:M.starting_with(/#include/).until_after(f.lineBreak),shebang:M.starting_with(/#!/).until_after(f.lineBreak),xml:M.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:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===a.COMMENT||F.type===a.BLOCK_COMMENT||F.type===a.UNKNOWN},b.prototype._is_opening=function(F){return F.type===a.START_BLOCK||F.type===a.START_EXPR},b.prototype._is_closing=function(F,_){return(F.type===a.END_BLOCK||F.type===a.END_EXPR)&&_&&(F.text==="]"&&_.text==="["||F.text===")"&&_.text==="("||F.text==="}"&&_.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,_){var M=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(a.EOF,""):(M=M||this._read_non_javascript(I),M=M||this._read_string(I),M=M||this._read_word(F),M=M||this._read_singles(I),M=M||this._read_comment(I),M=M||this._read_regexp(I,F),M=M||this._read_xml(I,F),M=M||this._read_punctuation(),M=M||this._create_token(a.UNKNOWN,this._input.next()),M)},b.prototype._read_word=function(F){var _;if(_=this.__patterns.identifier.read(),_!=="")return _=_.replace(f.allLineBreaks,`
`),!(F.type===a.DOT||F.type===a.RESERVED&&(F.text==="set"||F.text==="get"))&&w.test(_)?(_==="in"||_==="of")&&(F.type===a.WORD||F.type===a.STRING)?this._create_token(a.OPERATOR,_):this._create_token(a.RESERVED,_):this._create_token(a.WORD,_);if(_=this.__patterns.number.read(),_!=="")return this._create_token(a.WORD,_)},b.prototype._read_singles=function(F){var _=null;return F==="("||F==="["?_=this._create_token(a.START_EXPR,F):F===")"||F==="]"?_=this._create_token(a.END_EXPR,F):F==="{"?_=this._create_token(a.START_BLOCK,F):F==="}"?_=this._create_token(a.END_BLOCK,F):F===";"?_=this._create_token(a.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?_=this._create_token(a.DOT,F):F===","&&(_=this._create_token(a.COMMA,F)),_&&this._input.next(),_},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(a.EQUALS,F):F==="?."?this._create_token(a.DOT,F):this._create_token(a.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var _="";if(F==="#"){if(this._is_first_token()&&(_=this.__patterns.shebang.read(),_))return this._create_token(a.UNKNOWN,_.trim()+`
`);if(_=this.__patterns.include.read(),_)return this._create_token(a.UNKNOWN,_.trim()+`
`);F=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(S)){do F=this._input.next(),M+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,M)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(_=this.__patterns.html_comment_start.read(),_){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)_+=this._input.next();return y=!0,this._create_token(a.COMMENT,_)}}else if(y&&F==="-"&&(_=this.__patterns.html_comment_end.read(),_))return y=!1,this._create_token(a.COMMENT,_);return null},b.prototype._read_comment=function(F){var _=null;if(F==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var I=O.get_directives(M);I&&I.ignore==="start"&&(M+=O.readIgnored(this._input)),M=M.replace(f.allLineBreaks,`
`),_=this._create_token(a.BLOCK_COMMENT,M),_.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),_=this._create_token(a.COMMENT,M))}return _},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var _=this._input.next();return this.has_char_escapes=!1,F==="`"?_+=this._read_string_recursive("`",!0,"${"):_+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(_=B(_)),this._input.peek()===F&&(_+=this._input.next()),_=_.replace(f.allLineBreaks,`
`),this._create_token(a.STRING,_)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===a.RESERVED&&s(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===a.END_EXPR&&F.text===")"&&F.opened.previous.type===a.RESERVED&&s(F.opened.previous.text,["if","while","for"])||s(F.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},b.prototype._read_regexp=function(F,_){if(F==="/"&&this._allow_regexp_or_xml(_)){for(var M=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(f.newline);)M+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(M+=this._input.next(),M+=this._input.read(f.identifier)),this._create_token(a.STRING,M)}return null},b.prototype._read_xml=function(F,_){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(_)){var M="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=g.indexOf("{")===0,$=0;I;){var ae=!!I[1],ue=I[2],Le=!!I[I.length-1]||ue.slice(0,8)==="![CDATA[";if(!Le&&(ue===g||H&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--$:++$),M+=I[0],$<=0)break;I=this.__patterns.xml.read_match()}return I||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(f.allLineBreaks,`
`),this._create_token(a.STRING,M)}}return null};function B(F){for(var _="",M=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(_+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{_+="\\",I.hasNext()&&(_+=I.next());continue}if(!g)return F;if(M=parseInt(g[1],16),M>126&&M<=255&&g[0].indexOf("x")===0)return F;if(M>=0&&M<32){_+="\\"+g[0];continue}else M===34||M===39||M===92?_+="\\"+String.fromCharCode(M):_+=String.fromCharCode(M)}return _}b.prototype._read_string_recursive=function(F,_,M){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var H=g.read(),$="";this._input.hasNext();){if($=this._input.next(),$===F||!_&&f.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),$+=this._input.next()):M&&(M==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),M===$&&(F==="`"?$+=this._read_string_recursive("}",_,"`"):$+=this._read_string_recursive("`",_,"${"),this._input.hasNext()&&($+=this._input.next())));$+=g.read(),H+=$}return H},r.exports.Tokenizer=b,r.exports.TOKEN=a,r.exports.positionable_operators=L.slice(),r.exports.line_starters=E.slice()},function(r){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var h=m.exec(this.__input);return h&&!(R&&m.sticky)&&(h.index!==p&&(h=null)),h},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var h=this.peek(p);return m.lastIndex=0,h!==null&&m.test(h)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,h){var o="",f;return m&&(f=this.match(m),f&&(o+=f[0])),p&&(f||!m)&&(o+=this.readUntil(p,h)),o},v.prototype.readUntil=function(m,p){var h="",o=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(o=f.index,p&&(o+=f[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var h=null,o="g";return p&&R&&(o="y"),typeof m=="string"&&m!==""?h=new RegExp(m,o):m&&(h=new RegExp(m.source,o)),h},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,h=this.readUntilAfter(m);return this.__position=p,h},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},function(r,R,v){var m=v(8).InputScanner,p=v(3).Token,h=v(10).TokenStream,o=v(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(u,s){this._input=new m(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,s=new p(f.START,""),a=null,O=[],x=new h;s.type!==f.EOF;){for(u=this._get_next_token(s,a);this._is_comment(u);)x.add(u),u=this._get_next_token(s,a);x.isEmpty()||(u.comments_before=x,x=new h),u.parent=a,this._is_opening(u)?(O.push(a),a=u):a&&this._is_closing(u,a)&&(u.opened=a,a.closed=u,a=O.pop(),u.parent=a),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(u,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(f.RAW,a):this._create_token(f.EOF,"")},l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return!1},l.prototype._is_closing=function(u,s){return!1},l.prototype._create_token=function(u,s){var a=new p(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=l,r.exports.TOKEN=f},function(r){function R(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position<this.__tokens_length},R.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},R.prototype.peek=function(v){var m=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(m=this.__tokens[v]),m},R.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},r.exports.TokenStream=R},function(r,R,v){var m=v(12).Pattern;function p(h,o){m.call(this,h,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(h,o){h+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var o=this.__split(this._newline_regexp,h);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return h},p.prototype.matching=function(h,o){var f=this._create();return f.__set_whitespace_patterns(h,o),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(h,o){h.lastIndex=0;for(var f=0,l=[],u=h.exec(o);u;)l.push(o.substring(f,u.index)),f=u.index+u[0].length,u=h.exec(o);return f<o.length?l.push(o.substring(f,o.length)):l.push(""),l},r.exports.WhitespacePattern=p},function(r){function R(v,m){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}R.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},R.prototype.read_match=function(){return this._input.match(this._match_pattern)},R.prototype.until_after=function(v){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(v),m._update(),m},R.prototype.until=function(v){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(v),m._update(),m},R.prototype.starting_with=function(v){var m=this._create();return m._starting_pattern=this._input.get_regexp(v,!0),m._update(),m},R.prototype.matching=function(v){var m=this._create();return m._match_pattern=this._input.get_regexp(v,!0),m._update(),m},R.prototype._create=function(){return new R(this._input,this)},R.prototype._update=function(){},r.exports.Pattern=R},function(r){function R(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}R.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},R.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=R},function(r,R,v){var m=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(o,f){m.call(this,o,f),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._disabled));var l=new m(o);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}/)}}h.prototype=new m,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(o){var f=this._create();return f._disabled[o]=!0,f._update(),f},h.prototype.read_options=function(o){var f=this._create();for(var l in p)f._disabled[l]=o.templating.indexOf(l)===-1;return f._update(),f},h.prototype.exclude=function(o){var f=this._create();return f._excluded[o]=!0,f._update(),f},h.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),o+=f,f=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},h.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},h.prototype._read_template=function(){var o="",f=this._input.peek();if(f==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(o=o||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},r.exports.TemplatablePattern=h}],U={};function z(r){var R=U[r];if(R!==void 0)return R.exports;var v=U[r]={exports:{}};return j[r](v,v.exports,z),v.exports}var W=z(0);P=W})();var Y=P;!(ie=[],J=function(){return{js_beautify:Y}}.apply(be,ie),J!==void 0&&(nt.exports=J))})()},"746U":function(nt,be,Q){"use strict";Q.d(be,"f",function(){return ie}),Q.d(be,"l",function(){return J}),Q.d(be,"k",function(){return P}),Q.d(be,"j",function(){return Y}),Q.d(be,"g",function(){return j}),Q.d(be,"m",function(){return U}),Q.d(be,"h",function(){return z}),Q.d(be,"n",function(){return W}),Q.d(be,"c",function(){return r}),Q.d(be,"a",function(){return R}),Q.d(be,"i",function(){return v}),Q.d(be,"o",function(){return m}),Q.d(be,"e",function(){return o}),Q.d(be,"d",function(){return f}),Q.d(be,"p",function(){return l}),Q.d(be,"b",function(){return u});function ie(s){return Array.isArray(s)}function J(s){return typeof s=="string"}function P(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function Y(s){return typeof s=="number"&&!isNaN(s)}function j(s){return s===!0||s===!1}function U(s){return typeof s=="undefined"}function z(s){return!W(s)}function W(s){return U(s)||s===null}function r(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function R(s){if(W(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function m(s,a){const O=Math.min(s.length,a.length);for(let x=0;x<O;x++)p(s[x],a[x])}function p(s,a){if(J(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(v(a)){try{if(s instanceof a)return}catch(O){}if(!W(s)&&s.constructor===a)return;if(a.length===1&&a.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function h(s){let a=[],O=Object.getPrototypeOf(s);for(;Object.prototype!==O;)a=a.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return a}function o(s){const a=[];for(const O of h(s))typeof s[O]=="function"&&a.push(O);return a}function f(s,a){const O=S=>function(){const D=Array.prototype.slice.call(arguments,0);return a(S,D)};let x={};for(const S of s)x[S]=O(S);return x}function l(s){return s===null?void 0:s}function u(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(nt,be,Q){"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 P(){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(p){return typeof p=="string"&&Y.test(p)}for(var U=j,z=[],W=0;W<256;++W)z.push((W+256).toString(16).substr(1));function r(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(z[p[h+0]]+z[p[h+1]]+z[p[h+2]]+z[p[h+3]]+"-"+z[p[h+4]]+z[p[h+5]]+"-"+z[p[h+6]]+z[p[h+7]]+"-"+z[p[h+8]]+z[p[h+9]]+"-"+z[p[h+10]]+z[p[h+11]]+z[p[h+12]]+z[p[h+13]]+z[p[h+14]]+z[p[h+15]]).toLowerCase();if(!U(o))throw TypeError("Stringified UUID is invalid");return o}var R=r;function v(p,h,o){p=p||{};var f=p.random||(p.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,h){o=o||0;for(var l=0;l<16;++l)h[o+l]=f[l];return h}return R(f)}var m=be.a=v},"7ahc":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return O});var ie=Q("k1fw"),J=Q("0Owb"),P=Q("+L6B"),Y=Q("2/Rp"),j=Q("y8nQ"),U=Q("Vl3Y"),z=Q("tJVT"),W=Q("OaEy"),r=Q("2fM7"),R=Q("q1tI"),v=Q.n(R),m=Q("VrN/"),p=Q.n(m),h=Q("p77/"),o=Q.n(h),f=Q("c5Ni"),l=Q.n(f),u=r.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};be.b=function(x){var S=x.callback,D=x.onCancel,L=Object(R.useState)("python"),A=Object(z.a)(L,2),C=A[0],E=A[1];function d(y){E(a[y][1])}function w(y){S(y)}return v.a.createElement(U.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:d},Object.keys(a).map(function(y){return v.a.createElement(u,{key:y,value:y},a[y][0])}))),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(O,{mode:C})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(Y.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function O(x){var S=x.value,D=x.onChange,L=x.mode,A=x.options,C=A===void 0?{}:A,E=Object(R.useRef)(),d=Object(R.useState)(),w=Object(z.a)(d,2),y=w[0],b=w[1];return Object(R.useEffect)(function(){if(y){function B(F){var _=F.getValue();D&&D(_)}return y.on("change",B),function(){y.off("change",B)}}},[y,D]),Object(R.useEffect)(function(){y&&y.setOption("mode",L)},[y,L]),Object(R.useEffect)(function(){y&&((S!==y.getValue()||S==="")&&setTimeout(function(){y.setValue(S||" ")},300))},[y,S]),Object(R.useEffect)(function(){if(E.current&&!y){var B=p.a.fromTextArea(E.current,Object(ie.a)({mode:L,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));b(B)}},[E.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:E}))}},"8EBN":function(nt,be,Q){(function(ie){ie(Q("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 P=ie.modeInfo[J];P.mimes&&(P.mime=P.mimes[0])}ie.findModeByMIME=function(Y){Y=Y.toLowerCase();for(var j=0;j<ie.modeInfo.length;j++){var U=ie.modeInfo[j];if(U.mime==Y)return U;if(U.mimes){for(var z=0;z<U.mimes.length;z++)if(U.mimes[z]==Y)return U}}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 U=ie.modeInfo[j];if(U.ext){for(var z=0;z<U.ext.length;z++)if(U.ext[z]==Y)return U}}},ie.findModeByFileName=function(Y){for(var j=0;j<ie.modeInfo.length;j++){var U=ie.modeInfo[j];if(U.file&&U.file.test(Y))return U}var z=Y.lastIndexOf("."),W=z>-1&&Y.substring(z+1,Y.length);if(W)return ie.findModeByExtension(W)},ie.findModeByName=function(Y){Y=Y.toLowerCase();for(var j=0;j<ie.modeInfo.length;j++){var U=ie.modeInfo[j];if(U.name.toLowerCase()==Y)return U;if(U.alias){for(var z=0;z<U.alias.length;z++)if(U.alias[z].toLowerCase()==Y)return U}}}})},"8HAY":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return j}),Q.d(be,"b",function(){return U}),Q.d(be,"d",function(){return z}),Q.d(be,"e",function(){return W}),Q.d(be,"c",function(){return r});var ie=Q("MI8n"),J=Q("pmY6"),P=Q("3/fG"),Y=function(R,v,m,p){function h(o){return o instanceof m?o:new m(function(f){f(o)})}return new(m||(m=Promise))(function(o,f){function l(a){try{s(p.next(a))}catch(O){f(O)}}function u(a){try{s(p.throw(a))}catch(O){f(O)}}function s(a){a.done?o(a.value):h(a.value).then(l,u)}s((p=p.apply(R,v||[])).next())})};class j extends J.a{constructor(R,v="",m="",p=!0,h){super();this._onDidChange=this._register(new ie.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=R,this._label=v,this._cssClass=m,this._enabled=p,this._actionCallback=h}get id(){return this._id}get label(){return this._label}set label(R){this._setLabel(R)}_setLabel(R){this._label!==R&&(this._label=R,this._onDidChange.fire({label:R}))}get tooltip(){return this._tooltip||""}set tooltip(R){this._setTooltip(R)}_setTooltip(R){this._tooltip!==R&&(this._tooltip=R,this._onDidChange.fire({tooltip:R}))}get class(){return this._cssClass}set class(R){this._setClass(R)}_setClass(R){this._cssClass!==R&&(this._cssClass=R,this._onDidChange.fire({class:R}))}get enabled(){return this._enabled}set enabled(R){this._setEnabled(R)}_setEnabled(R){this._enabled!==R&&(this._enabled=R,this._onDidChange.fire({enabled:R}))}get checked(){return this._checked}set checked(R){this._setChecked(R)}_setChecked(R){this._checked!==R&&(this._checked=R,this._onDidChange.fire({checked:R}))}run(R,v){return Y(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(R))})}}class U 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(R,v){return Y(this,void 0,void 0,function*(){if(!R.enabled)return;this._onBeforeRun.fire({action:R});let m;try{yield this.runAction(R,v)}catch(p){m=p}this._onDidRun.fire({action:R,error:m})})}runAction(R,v){return Y(this,void 0,void 0,function*(){yield R.run(v)})}}class z extends j{constructor(R){super(z.ID,R,R?"separator text":"separator");this.checked=!1,this.enabled=!1}}z.ID="vs.actions.separator";class W{constructor(R,v,m,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=R,this.label=v,this.class=p,this._actions=m}get actions(){return this._actions}dispose(){}run(){return Y(this,void 0,void 0,function*(){})}}class r extends j{constructor(){super(r.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(nt,be,Q){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,be,Q){"use strict";var ie=Q("DYRE"),J=Q("zeV3"),P=Q("+L6B"),Y=Q("2/Rp"),j=Q("k1fw"),U=Q("9og8"),z=Q("tJVT"),W=Q("WmNS"),r=Q.n(W),R=Q("q1tI"),v=Q.n(R),m=Q("vg9a"),p=Q("DlQD"),h=Q.n(p),o=Q("rUJ1");function f(X,T){var k=X.match(/^(\s+)(?:```)/);if(k===null)return T;var G=k[1];return T.split(`
`).map(function(ee){var V=ee.match(/^\s+/);if(V===null)return ee;var we=Object(z.a)(V,1),Ke=we[0];return Ke.length>=G.length?ee.slice(G.length):ee}).join(`
`)}var l=[],u=["<ul>"],s=new h.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){l.length=0,u=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(X,T,k,G){if(T>=X.length||X[T].level<=k)return T;var ee=X[T];G.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),T++;var V=[];return T=S(X,T,ee.level,V),V.length>0&&(G.push("<ul>"),V.forEach(function(we){G.push(we)}),G.push("</ul>")),G.push("</li>"),T=S(X,T,k,G),T}function D(){return S(l,0,0,u),u.push("</ul>"),u.join("")}var L={heading:function(T){var k=a.exec(T);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(T){var k=this.rules.block.fences.exec(T);if(k){var G=k[0],ee=f(G,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var we=E(),Ke=ee;ee=we,d[we]={type:"block",expression:Ke}}return{type:"code",raw:G,lang:V,text:ee}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,E=function(){return"__special_katext_id_".concat(C++,"__")},d={};function w(){return d}function y(){C=0,d={}}function b(X){return X=X.replace(A,function(T,k){var G=E();return d[G]={type:"inline",expression:k},G}),X}var B=s.listitem;s.listitem=function(X){return B(b(X))};var F=s.paragraph;s.paragraph=function(X){return F(b(X))};var _=s.tablecell;s.tablecell=function(X,T){return _(b(X),T)},s.code=function(X,T,k){var G=(T||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(T,'">').concat(k?X:Object(o.escape)(X,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(k?X:Object(o.escape)(X,!0))+"</code></pre>"},s.heading=function(X,T,k){var G=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:G,level:T,text:X}),"<h"+T+' id="'+G+'">'+X+"</h"+T+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:L,renderer:s});var M=h.a,I=Q("SJMd"),g=Q("ulZh"),H=Q.n(g),$=Q("m3rI"),ae=Q("Oy/b"),ue=Q("p5ED"),Le=Q("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 ve=function(X,T){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var ee in G)Object.prototype.hasOwnProperty.call(G,ee)&&(k[ee]=G[ee])})(X,T)};function Te(X,T){function k(){this.constructor=X}ve(X,T),X.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function _e(X,T,k,G){return new(k||(k=Promise))(function(ee,V){function we(pt){try{tt(G.next(pt))}catch(Xe){V(Xe)}}function Ke(pt){try{tt(G.throw(pt))}catch(Xe){V(Xe)}}function tt(pt){var Xe;pt.done?ee(pt.value):(Xe=pt.value,Xe instanceof k?Xe:new k(function(_t){_t(Xe)})).then(we,Ke)}tt((G=G.apply(X,T||[])).next())})}function De(X,T){var k,G,ee,V,we={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(tt){return function(pt){return function(Xe){if(k)throw new TypeError("Generator is already executing.");for(;we;)try{if(k=1,G&&(ee=2&Xe[0]?G.return:Xe[0]?G.throw||((ee=G.return)&&ee.call(G),0):G.next)&&!(ee=ee.call(G,Xe[1])).done)return ee;switch(G=0,ee&&(Xe=[2&Xe[0],ee.value]),Xe[0]){case 0:case 1:ee=Xe;break;case 4:return we.label++,{value:Xe[1],done:!1};case 5:we.label++,G=Xe[1],Xe=[0];continue;case 7:Xe=we.ops.pop(),we.trys.pop();continue;default:if(!(ee=we.trys,(ee=ee.length>0&&ee[ee.length-1])||Xe[0]!==6&&Xe[0]!==2)){we=0;continue}if(Xe[0]===3&&(!ee||Xe[1]>ee[0]&&Xe[1]<ee[3])){we.label=Xe[1];break}if(Xe[0]===6&&we.label<ee[1]){we.label=ee[1],ee=Xe;break}if(ee&&we.label<ee[2]){we.label=ee[2],we.ops.push(Xe);break}ee[2]&&we.ops.pop(),we.trys.pop();continue}Xe=T.call(X,we)}catch(_t){Xe=[6,_t],G=0}finally{k=ee=0}if(5&Xe[0])throw Xe[1];return{value:Xe[0]?Xe[1]:void 0,done:!0}}([tt,pt])}}}function he(){for(var X=0,T=0,k=arguments.length;T<k;T++)X+=arguments[T].length;var G=Array(X),ee=0;for(T=0;T<k;T++)for(var V=arguments[T],we=0,Ke=V.length;we<Ke;we++,ee++)G[ee]=V[we];return G}var ce=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(T,k){for(var G=0,ee=k;G<ee.length;G++){var V=ee[G],we=V[0],Ke=V[1];T.setAttribute(we,Ke)}},X.createRect=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",T.toString()),ee.setAttribute("height",k.toString()),G&&X.setAttributes(ee,G),ee},X.createLine=function(T,k,G,ee,V){var we=document.createElementNS("http://www.w3.org/2000/svg","line");return we.setAttribute("x1",T.toString()),we.setAttribute("y1",k.toString()),we.setAttribute("x2",G.toString()),we.setAttribute("y2",ee.toString()),V&&X.setAttributes(we,V),we},X.createPolygon=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",T),k&&X.setAttributes(G,k),G},X.createCircle=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("r",T.toString()),k&&X.setAttributes(G,k),G},X.createEllipse=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(T/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(T/2).toString()),ee.setAttribute("ry",(k/2).toString()),G&&X.setAttributes(ee,G),ee},X.createGroup=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&X.setAttributes(k,T),k},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(T,k,G,ee,V,we,Ke){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(tt,[["id",T],["orient",k],["markerWidth",G.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",we.toString()]]),tt.appendChild(Ke),tt},X.createText=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),T&&X.setAttributes(k,T),k},X.createTSpan=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=T,k&&X.setAttributes(G,k),G},X.createImage=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&X.setAttributes(k,T),k},X.createPoint=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=T,G.y=k,G},X.createPath=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",T),k&&X.setAttributes(G,k),G},X}(),ne=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}(),fe=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(T,k,G){var ee=this;return new Promise(function(V){var we=G!==void 0?G:document.createElement("canvas");T===null&&(ee.markersOnly=!0,ee.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",k.width.baseVal.valueAsString),Ke.setAttribute("height",k.height.baseVal.valueAsString),Ke.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),Ke.innerHTML=k.innerHTML,ee.naturalSize===!0?(Ke.width.baseVal.value=T.naturalWidth,Ke.height.baseVal.value=T.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Ke.width.baseVal.value=ee.width,Ke.height.baseVal.value=ee.height),we.width=Ke.width.baseVal.value,we.height=Ke.height.baseVal.value;var tt=Ke.outerHTML,pt=we.getContext("2d");ee.markersOnly!==!0&&pt.drawImage(T,0,0,we.width,we.height);var Xe=window.URL,_t=new Image(we.width,we.height);_t.setAttribute("crossOrigin","anonymous");var jt=new Blob([tt],{type:"image/svg+xml"}),$t=Xe.createObjectURL(jt);_t.onload=function(){pt.drawImage(_t,0,0),Xe.revokeObjectURL($t);var jr=we.toDataURL(ee.imageType,ee.imageQuality);V(jr)},_t.src=$t})},X}(),le=function(){},ke=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 Fe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ae("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ae("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}(),Fe=function(X,T){this.selector=X,this.style=T},Ae=function(X,T){this.localName=X,this.style=T},Re=function(){function X(T,k,G,ee,V){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=k,this.markerItems=G,this.uiStyleSettings=ee,this.styles=V,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 k=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 G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",this.uiContainer.appendChild(G),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var we=document.createElement("div");we.className=""+k.toolbarButtonStyleClass.name,we.setAttribute("data-type-name",V.typeName),we.innerHTML=V.icon,we.addEventListener("click",function(){k.markerToolbarButtonClicked(we,V)}),k.buttons.push(we),k.markerButtons.push(we)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},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 k=0;k<this.markerButtons.length;k++)k<T||k===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},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(k){k.className=k.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(T,k,G){var ee=this,V=document.createElement("div");switch(V.className=""+this.toolbarButtonStyleClass.name,V.innerHTML=k,V.setAttribute("data-action",G),V.addEventListener("click",function(){ee.actionToolbarButtonClicked(V,G)}),G){case"select":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":V.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":V.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":V.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(V),this.buttons.push(V)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ae("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Fe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},X.prototype.markerToolbarButtonClicked=function(T,k){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(T,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},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 k=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===T});k&&this.setActiveButton(k)},X.prototype.setCurrentMarker=function(T){var k=this;this.currentMarker=T,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){k.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},X}(),Pe=function(){function X(T,k,G,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=k,this.uiStyleSettings=G,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-panel-row_colors",`
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Fe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},X.prototype.show=function(T){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(T){var k,G,ee=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var we;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((we=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&we!==void 0?we:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(T){var k=this,G=-1;if(T!==this.activePanel){G=this.panels.indexOf(T),this.panelRow.innerHTML="";var ee=T.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,we){var Ke,tt;V.className=k.toolboxButtonStyleClass.name+" "+(we===G?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((tt=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:k.toolboxButtonStyleColorsClass.name))})},X}(),se=function(X,T){this.title=X,this.icon=T},pe=function(X){function T(k,G,ee,V){var we=X.call(this,k,V||'<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 we.colors=[],we.addTransparent=!1,we.colorBoxes=[],we.colors=G,we.currentColor=ee,we.setCurrentColor=we.setCurrentColor.bind(we),we.getColorBox=we.getColorBox.bind(we),we}return Te(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);G.appendChild(V),k.colorBoxes.push(V)}),G},T.prototype.getColorBox=function(k){var G=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,we=document.createElement("div");we.style.display="inline-block",we.style.boxSizing="content-box",we.style.width=V-2+"px",we.style.height=V-2+"px",we.style.padding="1px",we.style.marginRight="2px",we.style.marginBottom="2px",we.style.borderWidth="2px",we.style.borderStyle="solid",we.style.borderRadius=(V+2)/2+"px",we.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",we.addEventListener("click",function(){G.setCurrentColor(k,we)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="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>`),we.appendChild(Ke),we},T.prototype.setCurrentColor=function(k,G){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},T}(se),ye=function(){function X(T,k,G){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=k,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(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,k){},X.prototype.dblClick=function(T,k){},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,k){},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}(),Oe=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}(),je=function(){function X(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.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}(),ze=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,k){return T.a=k.a,T.b=k.b,T.c=k.c,T.d=k.d,T.e=k.e,T.f=k.f,T},X}(),Je=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(ce.createTransform()),V.setupControlBox(),V}return Te(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(k){this._visual=k;var G=ce.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var we=this.container.transform.baseVal.getItem(0);we.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(we,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(k){var G=this.state;X.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},T.prototype.manipulate=function(k){var G=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(k)},T.prototype.resize=function(k){var G=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,we=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,we=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:we=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=G,this.width=ee):(this.left=G+ee,this.width=-ee),we>=0?(this.top=V,this.height=we):(this.top=V+we,this.height=-we),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var G=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},T.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},T.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM(),ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(G)).x,y:ee.y}},T.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var G=this.container.getCTM();G=G.inverse();var ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(G)).x,y:ee.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=ce.createGroup();var k=ce.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.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 Oe,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},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 k=new je;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,G=-k/2,ee=G,V=(this.width+this.CB_DISTANCE)/2-k/2,we=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,tt=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,G,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,tt,ee),this.positionGrip(this.controlGrips.centerLeft.visual,G,we),this.positionGrip(this.controlGrips.centerRight.visual,tt,we),this.positionGrip(this.controlGrips.bottomLeft.visual,G,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(k,G,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(G,ee),k.transform.baseVal.replaceItem(V,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:ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ze.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ze.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*G});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*G,this.adjustControlBox()},T}(ye),Ye=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Te(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=ce.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(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){X.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){X.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ce.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(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.setSize()},T.title="Rectangle marker",T}(Je),rt=function(X){function T(k,G,ee,V){var we=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return we.widths=[],we.widthBoxes=[],we.widths=G,we.currentWidth=ee,we.setCurrentWidth=we.setCurrentWidth.bind(we),we}return Te(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),G.appendChild(V);var we=document.createElement("div");we.innerText=ee.toString(),we.style.marginRight="5px",V.appendChild(we);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ke.appendChild(tt),V.appendChild(Ke),k.widthBoxes.push(V)}),G},T.prototype.setCurrentWidth=function(k,G){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(se),Ze=function(X){function T(k,G,ee,V){var we=X.call(this,k,V||'<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 we.styles=[],we.styleBoxes=[],we.styles=G,we.currentStyle=ee,we.setCurrentStyle=we.setCurrentStyle.bind(we),we}return Te(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),G.appendChild(V);var we=document.createElement("div");we.style.minHeight="20px",we.style.flexGrow="2",we.style.overflow="hidden";var Ke=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
</svg>`;we.innerHTML=Ke,V.appendChild(we),k.styleBoxes.push(V)}),G},T.prototype.setCurrentStyle=function(k,G){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(se),et=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new pe("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new rt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(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 k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="FrameMarker",T.title="Frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',T}(Ye),Be=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},ut=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Te(T,X),T.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(k){var G=this.state;X.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},T.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},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=ce.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 k=new je;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},T.prototype.positionGrip=function(k,G,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(G,ee),k.transform.baseVal.replaceItem(V,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(k){X.prototype.restoreState.call(this,k);var G=k;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.x1=this.x1*k,this.y1=this.y1*G,this.x2=this.x2*k,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},T}(ye),st=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new pe("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new rt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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(k,G){X.prototype.pointerDown.call(this,k,G),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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,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 k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.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}(ut),He=function(X){function T(k,G,ee,V){var we=X.call(this,k,V||'<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 we.fonts=[],we.fontBoxes=[],we.fonts=G,we.currentFont=ee,we.setCurrentFont=we.setCurrentFont.bind(we),we}return Te(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),G.appendChild(V);var we=document.createElement("div");we.style.display="flex",we.style.minHeight="20px",we.style.flexGrow="2",we.style.fontFamily=ee,we.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",we.appendChild(Ke),V.appendChild(we),k.fontBoxes.push(V)}),G},T.prototype.setCurrentFont=function(k,G){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(se),We=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new pe("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new He("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Te(T,X),T.prototype.ownsTarget=function(k){if(X.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(G=!0)}),G},T.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(G){k.textElement.appendChild(ce.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var k=this.textElement.getBBox(),G=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;G=Math.min(ee,V)}return G},T.prototype.getTextPosition=function(k){var G=this.textElement.getBBox(),ee=0,V=0;return G.width>0&&G.height>0&&(ee=(this.width-G.width*k)/2,V=this.height/2-G.height*k/2),{x:ee,y:V}},T.prototype.sizeText=function(){var k=this.textElement.getBBox(),G=this.getTextScale(),ee=this.getTextPosition(G);ee.y-=k.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},T.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(k){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,k),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&G>.9;)G-=.1,k.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var ee=G.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};G.x-=V.x/2,G.y-=V.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},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(k,G){X.prototype.dblClick.call(this,k,G),this.showTextEditor()},T.prototype.setColor=function(k){this.textElement&&ce.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},T.prototype.setFont=function(k){this.textElement&&ce.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,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 k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),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}(Je),Ie=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new pe("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new rt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Te(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var k=ce.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):X.prototype.pointerDown.call(this,k,G)},T.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,k)},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 k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=G[0],V=G[1],we=G[2],Ke=G[3],tt=!1,pt=0;pt<this.canvasElement.height;pt++)for(var Xe=0;Xe<this.canvasElement.width;Xe++)k.data[pt*this.canvasElement.width*4+4*Xe+3]>0&&(tt=!0,pt<V&&(V=pt),Xe<ee&&(ee=Xe),pt>Ke&&(Ke=pt),Xe>we&&(we=Xe));if(tt){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(we-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=we-ee,_t.height=Ke-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,we-ee,Ke-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},T.prototype.setLineWidth=function(k){this.lineWidth=k},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 k=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){this.createVisual(),X.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),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}(Je),Ee=function(X){function T(k,G,ee){var V=X.call(this,k,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return V.typeBoxes=[],V.currentType=G,V.setCurrentType=V.setCurrentType.bind(V),V}return Te(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var ee=function(Ke){var tt="both";switch(Ke){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=tt===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){k.setCurrentType(tt,pt)}),G.appendChild(pt),tt==="both"||tt==="start"){var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.alignItems="center",Xe.style.minHeight="20px",Xe.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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Xe.style.marginLeft="5px",pt.appendChild(Xe)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),tt==="both"||tt==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,$t.style.marginRight="5px",pt.appendChild($t)}V.typeBoxes.push(pt)},V=this,we=0;we<4;we++)ee(we);return G},T.prototype.setCurrentType=function(k,G){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(se),Ce=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new Ee("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Te(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},T.prototype.getArrowPoints=function(k,G){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(G+V/2)+" "+k+","+(G-V/2)+" "+(k+ee/2)+","+(G+V/2)},T.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),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",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},T.prototype.setArrowType=function(k){this.arrowType=k,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 k=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.arrowType=G.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}(st),re=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new pe("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Te(T,X),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(Ye),oe=function(X){function T(k,G,ee,V){var we=X.call(this,k,V||'<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 we.opacities=[],we.opacityBoxes=[],we.opacities=G,we.currentOpacity=ee,we.setCurrentOpacity=we.setCurrentOpacity.bind(we),we}return Te(T,X),T.prototype.getUi=function(){var k=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),G.appendChild(V);var we=document.createElement("div");we.innerText=100*ee+"%",V.appendChild(we),k.opacityBoxes.push(V)}),G},T.prototype.setCurrentOpacity=function(k,G){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===G?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(se),de=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new pe("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new oe("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Te(T,X),T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ce.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 k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},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),ge='<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>',Se=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new pe("Text color",ee.defaultColorSet,V.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>'),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new pe("Fill color",ee.defaultColorSet,V.bgColor,ge),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new He("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new je,V.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Te(T,X),T.prototype.ownsTarget=function(k){return X.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},T.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(k,G){this.state==="new"&&X.prototype.pointerDown.call(this,k,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,k,G)},T.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,k);else{var G=this.state==="creating";X.prototype.pointerUp.call(this,k),this.setTipPoints(G),this.positionTip()}},T.prototype.manipulate=function(k){if(this.tipMoving){var G=this.unrotatePoint(k);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,k)},T.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",k]]),ce.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},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(k){k===void 0&&(k=!1);var G=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:G+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:0},this.tipBase2Position={x:G+ee,y:0}):(this.tipBase1Position={x:0,y:G},this.tipBase2Position={x:0,y:G+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-ee,y:0},this.tipBase2Position={x:this.width-G,y:0}):(this.tipBase1Position={x:this.width,y:G},this.tipBase2Position={x:this.width,y:G+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?V<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-ee,y:this.height},this.tipBase2Position={x:this.width-G,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-G-ee},this.tipBase2Position={x:this.width,y:this.height-G}):V<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:this.height},this.tipBase2Position={x:G+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-G},this.tipBase2Position={x:0,y:this.height-G-ee})},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.positionTip()},T.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(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 k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.bgColor=G.bgColor,this.tipPosition=G.tipPosition,X.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*G},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}(We),Ue=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.fillColor=ee.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new pe("Line color",he(ee.defaultColorSet,["transparent"]),ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new pe("Fill color",he(ee.defaultColorSet,["transparent"]),V.fillColor,ge),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new rt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new oe("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Te(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=ce.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(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){X.prototype.setSize.call(this),ce.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(k){X.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ce.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 k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var G=k;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,G){X.prototype.scale.call(this,k,G),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}(Je),Ve=function(X){function T(k,G,ee){return X.call(this,k,G,ee)||this}return Te(T,X),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},T.prototype.createTips=function(){this.tip1=ce.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(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.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(ce.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(k,G){X.prototype.pointerDown.call(this,k,G),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.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()]]),ce.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k),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}(st),ot=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Te(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 k=X.prototype.getState.call(this);return k.typeName=T.typeName,k},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}(Ue),mt=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}(),ft=function(X){function T(k,G,ee){var V=X.call(this,k,G,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new pe("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new rt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ze("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,X),T.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},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=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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(k,G){X.prototype.pointerDown.call(this,k,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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 k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},T.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),X.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),X.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},T.prototype.scale=function(k,G){this.curveX=this.curveX*k,this.curveY=this.curveY*G,X.prototype.scale.call(this,k,G)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var G=k;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},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}(ut),wt=function(){function X(T,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=k}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),St=function(X){function T(k,G,ee){var V=X.call(this,k,!1)||this;return V.dataUrl=G,V.state=ee,V}return Te(T,X),T}(wt),dt=function(X){function T(k,G,ee){ee===void 0&&(ee=!1);var V=X.call(this,k,ee)||this;return V.marker=G,V}return Te(T,X),T}(wt),Bt=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,k){this[T].push(k)},X.prototype.removeEventListener=function(T,k){var G=this[T].indexOf(k);G>-1&&this[T].splice(G,1)},X}(),Lt=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 Be,this._isOpen=!1,this.undoRedoManager=new mt,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 Bt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new ke(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[et,Ie,Ce,We,ot,Ue,de,Se,Ve,re,st,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,Ie,Ce,We,Ue,de,Se]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,Ie,Ce,We,de]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var k=this;this._availableMarkerTypes.splice(0),T.forEach(function(G){if(typeof G=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===G});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(G)})},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(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&le.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=le.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new wt(T))})},X.prototype.render=function(){return _e(this,void 0,void 0,function(){var T;return De(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(T=new fe).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 k.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},X.prototype.close=function(T){var k=this;if(T===void 0&&(T=!1),this.isOpen){var G=!1;T||this.eventListeners.beforeclose.forEach(function(ee){var V=new wt(k,!0);ee(V),V.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new wt(k))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var T,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];(T=this._availableMarkerTypes).push.apply(T,k)},X.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(k){T(k.dataUrl,k.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,k=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,G=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(k,G)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(T,k){this._isResizing=!0;var G=T/this.imageWidth,ee=k/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(G,ee),this._isResizing=!1},X.prototype.scaleMarkers=function(T,k){var G,ee=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(T,k):(G=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(V){V!==ee._currentMarker&&V.scale(T,k)}),G!==void 0&&this.setCurrentMarker(G)},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(),k=this.editorCanvas.getBoundingClientRect();this.left=T.left-k.left,this.top=T.top-k.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,k=[],G=0;G<arguments.length;G++)k[G]=arguments[G];this.defs=ce.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,k)},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 Re(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 Pe(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,k){if(T==="marker"&&k!==void 0)this.createNewMarker(k);else if(T==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new dt(T,T._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var G=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new dt(T,G))})}}},X.prototype.clear=function(){var T=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(we){var Ke=new dt(T,void 0,!0);we(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var G=function(we){var Ke=ee.markers[we];ee.setCurrentMarker(ee.markers[we]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(tt){return tt(new dt(T,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)G(V);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 k=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===k.width&&G.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(V){return V(new wt(T))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(V){return V(new wt(T))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var T=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new wt(T))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var T=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new wt(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 _e(this,void 0,void 0,function(){var T,k,G=this;return De(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return T=ee.sent(),k=this.getState(),this.eventListeners.render.forEach(function(V){return V(new St(G,T,k))}),this.close(!0),[2]}})})},X.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(G){return k.markers.push(G.getState())}),k},X.prototype.restoreState=function(T){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(G){var ee=k._availableMarkerTypes.find(function(we){return we.typeName===G.typeName});if(ee!==void 0){var V=k.addNewMarker(ee);V.restoreState(G),k.markers.push(V)}}),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(G){return G(new wt(k))})},X.prototype.addNewMarker=function(T){var k=ce.createGroup();return this.markerImage.appendChild(k),new T(k,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(T){var k,G=this;(k=typeof T=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new dt(G,G._currentMarker))}))},X.prototype.markerCreated=function(T){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof Ie&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ie):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(G){return G(new dt(k,k._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 k=this;this.eventListeners.markerchange.forEach(function(G){return G(new dt(k,T))})},X.prototype.setCurrentMarker=function(T){var k=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(G){return G(new dt(k,k._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(G){return G(new dt(k,k._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 k=this.markers.find(function(G){return G.ownsTarget(T.target)});k!==void 0?(this.setCurrentMarker(k),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 k=this.markers.find(function(G){return G.ownsTarget(T.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),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,k){var G=this.markerImage.getBoundingClientRect();return{x:(T-G.left)/this.zoomLevel,y:(k-G.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){ne.addKey(T)},X.prototype.addEventListener=function(T,k){this.eventListeners.addEventListener(T,k)},X.prototype.removeEventListener=function(T,k){this.eventListeners.removeEventListener(T,k)},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(k){return k(new wt(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(k){return k(new wt(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 qt=function(X,T){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,G){k.__proto__=G}||function(k,G){for(var ee in G)Object.prototype.hasOwnProperty.call(G,ee)&&(k[ee]=G[ee])})(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 k(){this.constructor=X}qt(X,T),X.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function It(X,T,k,G){return new(k||(k=Promise))(function(ee,V){function we(pt){try{tt(G.next(pt))}catch(Xe){V(Xe)}}function Ke(pt){try{tt(G.throw(pt))}catch(Xe){V(Xe)}}function tt(pt){var Xe;pt.done?ee(pt.value):(Xe=pt.value,Xe instanceof k?Xe:new k(function(_t){_t(Xe)})).then(we,Ke)}tt((G=G.apply(X,T||[])).next())})}function Cr(X,T){var k,G,ee,V,we={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(tt){return function(pt){return function(Xe){if(k)throw new TypeError("Generator is already executing.");for(;we;)try{if(k=1,G&&(ee=2&Xe[0]?G.return:Xe[0]?G.throw||((ee=G.return)&&ee.call(G),0):G.next)&&!(ee=ee.call(G,Xe[1])).done)return ee;switch(G=0,ee&&(Xe=[2&Xe[0],ee.value]),Xe[0]){case 0:case 1:ee=Xe;break;case 4:return we.label++,{value:Xe[1],done:!1};case 5:we.label++,G=Xe[1],Xe=[0];continue;case 7:Xe=we.ops.pop(),we.trys.pop();continue;default:if(!(ee=we.trys,(ee=ee.length>0&&ee[ee.length-1])||Xe[0]!==6&&Xe[0]!==2)){we=0;continue}if(Xe[0]===3&&(!ee||Xe[1]>ee[0]&&Xe[1]<ee[3])){we.label=Xe[1];break}if(Xe[0]===6&&we.label<ee[1]){we.label=ee[1],ee=Xe;break}if(ee&&we.label<ee[2]){we.label=ee[2],we.ops.push(Xe);break}ee[2]&&we.ops.pop(),we.trys.pop();continue}Xe=T.call(X,we)}catch(_t){Xe=[6,_t],G=0}finally{k=ee=0}if(5&Xe[0])throw Xe[1];return{value:Xe[0]?Xe[1]:void 0,done:!0}}([tt,pt])}}}var zr=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}(),yt=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(T,k){for(var G=0,ee=k;G<ee.length;G++){var V=ee[G],we=V[0],Ke=V[1];T.setAttribute(we,Ke)}},X.createRect=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",T.toString()),ee.setAttribute("height",k.toString()),G&&X.setAttributes(ee,G),ee},X.createLine=function(T,k,G,ee,V){var we=document.createElementNS("http://www.w3.org/2000/svg","line");return we.setAttribute("x1",T.toString()),we.setAttribute("y1",k.toString()),we.setAttribute("x2",G.toString()),we.setAttribute("y2",ee.toString()),V&&X.setAttributes(we,V),we},X.createPolygon=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",T),k&&X.setAttributes(G,k),G},X.createCircle=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("r",T.toString()),k&&X.setAttributes(G,k),G},X.createEllipse=function(T,k,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(T/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(T/2).toString()),ee.setAttribute("ry",(k/2).toString()),G&&X.setAttributes(ee,G),ee},X.createGroup=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&X.setAttributes(k,T),k},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(T,k,G,ee,V,we,Ke){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(tt,[["id",T],["orient",k],["markerWidth",G.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",we.toString()]]),tt.appendChild(Ke),tt},X.createText=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),T&&X.setAttributes(k,T),k},X.createTSpan=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=T,k&&X.setAttributes(G,k),G},X.createImage=function(T){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&X.setAttributes(k,T),k},X.createPoint=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=T,G.y=k,G},X.createPath=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",T),k&&X.setAttributes(G,k),G},X.createElement=function(T,k){var G=document.createElementNS("http://www.w3.org/2000/svg",T);return k&&X.setAttributes(G,k),G},X.getHollowRectanglePath=function(T,k,G,ee,V,we,Ke,tt){return"M"+T+","+k+"V"+(k+ee)+"H"+(T+G)+"V"+k+"H"+V+"V"+we+"H"+(V+Ke)+"V"+(we+tt)+"H"+V+"V"+k+"Z"},X}(),Lr=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 bt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new bt("@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}(),bt=function(X,T){this.selector=X,this.style=T},xt=function(X,T){this.localName=X,this.style=T},Ft=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(k){return T.appendChild(k.getUI())}),T},X}(),tr=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}(),dr=function(X){function T(){var k=X!==null&&X.apply(this,arguments)||this;return k.buttons=[],k}return Qt(T,X),T.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},T.prototype.getUI=function(){var k=X.prototype.getUI.call(this);return this.buttons.forEach(function(G){return k.appendChild(G.getUI())}),k},T}(tr),Pt=function(){function X(T,k){this._isActive=!1,this._isHidden=!1,this._icon=T,this.title=k,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}(),ct=function(X){function T(){var k=X!==null&&X.apply(this,arguments)||this;return k.elements=[],k}return Qt(T,X),T.prototype.addElement=function(k){this.elements.push(k)},T.prototype.getUI=function(){var k=X.prototype.getUI.call(this);return this.elements.forEach(function(G){return k.appendChild(G)}),k},T}(tr),Br=function(){function X(T,k){this.horizontal=T,this.vertical=k}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}(),Vt=function(){function X(){}return X.getIcon=function(T,k){if(T>0&&k>0){var G=new Br(T,k),ee=G.ratio>=1?20:G.getHorizontalLength(20),V=G.ratio<1?20:G.getVerticalLength(20),we=document.createElementNS("http://www.w3.org/2000/svg","svg");we.setAttribute("xmlns","http://www.w3.org/2000/svg"),we.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(we);var Ke=yt.createDefs();we.appendChild(Ke);var tt=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(tt);var pt=yt.createPath(yt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));we.appendChild(pt);var Xe=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Xe.appendChild(yt.createTSpan(T+":"+k)),we.appendChild(Xe);var _t=Xe.getBBox();yt.setAttributes(Xe,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return tt.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(we),we.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}(),Jt=function(X){function T(k,G,ee){var V=X.call(this,k,G)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Qt(T,X),T.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(G){G.className=k.className,G.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(G.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},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}(Pt),Ot=function(){function X(T,k){this.GRIP_SIZE=10,this.color=T,this.fillColor=k,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.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,k){this.visual.childNodes.forEach(function(G){return yt.setAttributes(G,[["cx",T.toString()],["cy",k.toString()]])})},X}(),lr=function(){function X(T,k,G,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=T,this.canvasHeight=k,this.margin=G,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(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&&yt.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=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(G){return T.gridContainer.appendChild(G)}),this.verticalGridLines.forEach(function(G){return T.gridContainer.appendChild(G)}),this.cropRectElement=yt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(T){this.cropRect=T;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),yt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var G=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,we){var Ke=k.y+G*(we+1);yt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,we){var Ke=k.x+ee*(we+1);yt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},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,k){var G=this.container.getBoundingClientRect();return{x:T-G.left+this.margin,y:k-G.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 k=this.clientToLocalCoordinates(T.clientX,T.clientY);this.resize(k)}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 k=T.x-this.previousPoint.x,G=T.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,G=-G/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+G),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=T},X.prototype.resize=function(T){var k=Object.assign({},this.cropRect),G=T.x-this.previousPoint.x,ee=T.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+G<this.margin&&(G=this.margin-k.x),k.x+=G,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+G>this.canvasWidth*this.zoomFactor&&(G=this.canvasWidth*this.zoomFactor-k.width),k.width+=G}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(G),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=T,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},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,k=this.cropRect.y+this.cropRect.height/2,G=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);G/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=G:this.cropRect.height=ee,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=T-this.cropRect.width/2,this.cropRect.y=k-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},X.prototype.getRescaledRect=function(T,k,G,ee,V,we){var Ke=G/T,tt=ee/k;return{x:(V.x-we)*Ke+we,y:(V.y-we)*tt+we,width:V.width*Ke,height:V.height*tt}},X.prototype.scaleCanvas=function(T,k){var G=this.getRescaledRect(this.canvasWidth,this.canvasHeight,T,k,this.cropRect,this.margin);this.canvasWidth=T,this.canvasHeight=k,this.onCropChange&&this.onCropChange(G),this.setCropRectangle(G)},X}(),Ir=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();yt.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 k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,G=1;G<=this.width/5+10;G++){var ee=G%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=yt.createPath(k);var V=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),T.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var we=yt.createTSpan("");return we.innerHTML="&deg;",this.angleLabelElement.appendChild(we),T.appendChild(this.angleLabelElement),document.body.removeChild(T),T},X}(),Yr=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(T,k,G,ee,V,we,Ke){var tt=this;return new Promise(function(pt){var Xe=document.createElement("canvas");Xe.width=T.width.baseVal.value-2*ee,Xe.height=T.height.baseVal.value-2*ee;var _t=1,jt=1;tt.naturalSize===!0?(_t=k.naturalWidth/(T.width.baseVal.value-2*ee)/we,jt=k.naturalHeight/(T.height.baseVal.value-2*ee)/Ke,Xe.width=k.naturalWidth/we,Xe.height=k.naturalHeight/Ke):tt.width!==void 0&&tt.height!==void 0&&(_t=tt.width/G.width,jt=tt.height/G.height,Xe.width*=_t,Xe.height*=jt);var $t=Xe.getContext("2d");$t.translate(Xe.width/2,Xe.height/2),$t.rotate(V*Math.PI/180),$t.scale(we,Ke),$t.translate(-Xe.width/2,-Xe.height/2),$t.drawImage(k,0,0,Xe.width,Xe.height);var jr=document.createElement("canvas");jr.width=G.width*_t,jr.height=G.height*jt,jr.getContext("2d").putImageData($t.getImageData((G.x-ee)*_t,(G.y-ee)*jt,G.width*_t,G.height*jt),0,0),pt(jr.toDataURL(tt.imageType,tt.imageQuality))})},X}(),Qe=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 Lr(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(k){return k()}),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,k=this.contentDiv.clientWidth/T>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*T:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,G=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/T;this.resize(k,G)}},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",yt.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,k){this.imageWidth=Math.round(T),this.imageHeight=Math.round(k),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},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 k=T.toDataURL();yt.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var T=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=T.left-k.left-this.CANVAS_MARGIN,this.top=T.top-k.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=yt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=yt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=yt.createGroup(),this.editingTargetRotationScaleContainer=yt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var T=yt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(T);var k=yt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=yt.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=yt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new lr(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,k=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=T+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-T+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+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,k=this.target.offsetTop>T+this.CANVAS_MARGIN?this.target.offsetTop-(T+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var T=this;this.topToolbar=new Ft,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new dr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var G=[];this.aspectRatios.forEach(function(jt){var $t=new Pt(Vt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return T.ratioButtonClicked(jt)},G.push($t)}),this.aspectRatioButton=new Jt(Vt.getIcon(0,0),"Aspect ratio",G),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Pt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){T.isGridVisible=!T.isGridVisible,ee.isActive=T.isGridVisible},k.addButton(ee);var V=new Pt('<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(V.isActive=this.zoomToCropEnabled,V.onClick=function(){T.zoomToCropEnabled=!T.zoomToCropEnabled,V.isActive=T.zoomToCropEnabled},k.addButton(V),!zr.isLicensed){var we=new ct;this.topToolbar.addElementBlock(we);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.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(tt),we.addElement(Ke)}var pt=new dr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Xe=new Pt('<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");Xe.onClick=this.startRenderAndClose,pt.addButton(Xe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Xe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Pt('<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");_t.onClick=this.close,pt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var T=this;this.bottomToolbar=new Ft,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new dr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var G=new Pt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");G.onClick=this.rotateLeftButtonClicked,k.addButton(G);var ee=new Pt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new ct;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Ir("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(pt){T.rotateBy(pt),T.straightener.angle=T.rotationAngle},V.addElement(this.straightener.getUI());var we=new dr;we.minWidth=2*this.toolbarHeight+"px",we.contentAlign="end",this.bottomToolbar.addButtonBlock(we);var Ke=new Pt('<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,we.addButton(Ke);var tt=new Pt('<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");tt.onClick=this.flipVerticallyButtonClicked,we.addButton(tt)},X.prototype.ratioButtonClicked=function(T){this.aspectRatio=T,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.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 Br(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 k=this.cropLayer.getRescaledRect(T.width,T.height,this.imageWidth,this.imageHeight,T.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=T.flippedHorizontally,this.flippedVertically=T.flippedVertically,this.applyFlip(),this.rotationAngle=T.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(T,k){var G=this.cropImage.getBoundingClientRect();return{x:T-G.left,y:k-G.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 k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var G=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/G.width,this.imageHeight/G.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=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 It(this,void 0,void 0,function(){var T,k;return Cr(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return T=G.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(T,k)}),this.close(!0),[2]}})})},X.prototype.render=function(){return It(this,void 0,void 0,function(){var T;return Cr(this,function(k){switch(k.label){case 0:return(T=new Yr).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.width=this.renderWidth,T.height=this.renderHeight,this.unzoomFromCrop(),yt.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 k.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,k.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 bt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new bt("."+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}(),Ct=Q("8hTe"),mn=Q.n(Ct),gn=/<pre[^>]*>/g;function vn(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,k=T===void 0?"":T,G=X.edit,ee=G===void 0?!1:G,V=X.className,we=X.showTextOnly,Ke=X.showLines,tt=X.replaces,pt=X.zoomImg,Xe=X.hasMask,_t=X.style,jt=_t===void 0?{}:_t,$t=X.stylesPrev,jr=$t===void 0?{}:$t,Er=String(k),xr=Object(R.useRef)(),Qr=Object(R.useRef)(),Dn=Object(R.useState)(""),cr=Object(z.a)(Dn,2),Kr=cr[0],un=cr[1],hn=Object(R.useState)("office"),Hr=Object(z.a)(hn,2),kn=Hr[0],bn=Hr[1],Kn=function(){var Ht=new Qe(Qr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var zt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return xr.current.style.display="none",fr.next=3,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar}});case 3:zt=fr.sent,zt!=null&&zt.id&&tt(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 5:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show()},Vn=function(){var Ht=new Lt(Qr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var zt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(xr.current.style.display="none",!Qr.current){fr.next=6;break}return fr.next=4,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar.dataUrl}});case 4:zt=fr.sent,zt!=null&&zt.id&&tt(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 6:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Zr=Object(R.useMemo)(function(){xr.current&&(xr.current.style.zIndex=-1);try{var nr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Er=Er.replace(nr,"("+$.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+$.a.API_SERVER+"/api/attachments/").replace(yr,'"'+$.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(nn){}var kt=M(Er),ar=w();if(Er.match(/\[TOC\]/)&&(kt=kt.replace("<p>[TOC]</p>",D()),O()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(nn,fr){var Ar=ar[fr],Xn=Ar.type,xn=Ar.expression;return Object(ae.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),y(),we){var zt=document.createElement("div");return zt.innerHTML=kt,zt.innerText}return setTimeout(function(){return di()},500),kt},[Er]),$r=Object(R.useRef)();x.WebkitLineClamp=Ke,Ke&&(jt=Object(j.a)(Object(j.a)({},jt),x));function _n(nr){var Ht=nr.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yr=Ht.getAttribute("src");un(yr),bn("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)nr.preventDefault(),un(kt),bn("office");else if(kt.indexOf("application/pdf")>-1)nr.preventDefault(),un(kt),bn("pdf");else if(kt.indexOf("text/html")>-1)nr.preventDefault(),un(kt),bn("html");else if(kt.startsWith("#")){nr.preventDefault();var ar=document.getElementById(kt.replace("#",""));ar&&ar.scrollIntoView(!0)}}}var di=function(){var Ht,yr=(Ht=$r.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yr==null||yr.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var ar=new H.a;ar.loadSource(kt.src),ar.attachMedia(kt)}}})};Object(R.useEffect)(function(){if($r.current&&Zr&&(Zr.match(gn)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",_n),function(){$r.current.removeEventListener("click",_n),y(),O()}},[Zr,$r.current,_n]);var En=function(Ht){if(!ee)return;Ht.target.nodeName==="IMG"?(xr.current.style.zIndex=1,xr.current.style.display="flex",xr.current.style.width=Ht.target.clientWidth+"px",xr.current.style.height=Ht.target.clientHeight+"px",xr.current.style.top=Ht.target.offsetTop+"px",xr.current.style.left=Ht.target.offsetLeft+"px",Qr.current.src=Ht.target.getAttribute("src")):xr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$r,style:Object(j.a)({},jt),className:"".concat(V||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Zr}}),v.a.createElement("div",{ref:xr,className:mn.a.button},v.a.createElement(J.a,null,v.a.createElement(Y.a,{onClick:function(){return Kn()}},"\u88C1\u526A"),v.a.createElement(Y.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ue.a,{close:!0,data:Kr,type:Kr!=null&&Kr.length?kn:"",style:Object(j.a)({},jr),onClose:function(){return un("")}}))}},"9VGf":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return P});var ie=Q("q1tI"),J=Q.n(ie);function P(Y,j){var U=Object(ie.useRef)();Object(ie.useEffect)(function(){U.current=Y}),Object(ie.useEffect)(function(){function z(){U.current()}if(j!==null){var W=setInterval(z,j);return function(){return clearInterval(W)}}},[j])}},BU3w:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return U});var ie=Q("MNnm"),J="rc-util-key";function P(z){if(z.attachTo)return z.attachTo;var W=document.querySelector("head");return W||document.body}function Y(z){var W,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var R=document.createElement("style");if((W=r.csp)===null||W===void 0?void 0:W.nonce){var v;R.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=z;var m=P(r),p=m.firstChild;return r.prepend&&m.prepend?m.prepend(R):r.prepend&&p?m.insertBefore(R,p):m.appendChild(R),R}var j=new Map;function U(z,W){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=P(r);if(!j.has(R)){var v=Y("",r),m=v.parentNode;j.set(R,m),m.removeChild(v)}var p=Array.from(j.get(R).children).find(function(u){return u.tagName==="STYLE"&&u[J]===W});if(p){var h,o;if(((h=r.csp)===null||h===void 0?void 0:h.nonce)&&p.nonce!==((o=r.csp)===null||o===void 0?void 0:o.nonce)){var f;p.nonce=(f=r.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==z&&(p.innerHTML=z),p}var l=Y(z,r);return l[J]=W,l}},Bd2K:function(nt,be,Q){(function(ie){ie(Q("VrN/"),Q("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(r,R,v){if(v!=ie.Init&&v&&r.removeKeyMap("autoCloseTags"),!R)return;var m={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(m["'/'"]=function(p){return U(p)}),(typeof R!="object"||R.whenOpening!==!1)&&(m["'>'"]=function(p){return Y(p)}),r.addKeyMap(m)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Y(r){if(r.getOption("disableInput"))return ie.Pass;for(var R=r.listSelections(),v=[],m=r.getOption("autoCloseTags"),p=0;p<R.length;p++){if(!R[p].empty())return ie.Pass;var h=R[p].head,o=r.getTokenAt(h),f=ie.innerMode(r.getMode(),o.state),l=f.state,u=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(l),s=u&&u.name;if(!s)return ie.Pass;var a=f.mode.configuration=="html",O=typeof m=="object"&&m.dontCloseTags||a&&J,x=typeof m=="object"&&m.indentTags||a&&P;o.end>h.ch&&(s=s.slice(0,s.length-o.end+h.ch));var S=s.toLowerCase();if(!s||o.type=="string"&&(o.end!=h.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&u.close||o.string.indexOf("/")==h.ch-o.start-1||O&&z(O,S)>-1||W(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(l)||[],s,h,!0))return ie.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&z(D,s)>-1){v[p]={text:"/>",newPos:ie.Pos(h.line,h.ch+2)};continue}var L=x&&z(x,S)>-1;v[p]={indent:L,text:">"+(L?`
`:"")+"</"+s+">",newPos:L?ie.Pos(h.line+1,0):ie.Pos(h.line,h.ch+1)}}for(var A=typeof m=="object"&&m.dontIndentOnAutoClose,p=R.length-1;p>=0;p--){var C=v[p];r.replaceRange(C.text,R[p].head,R[p].anchor,"+insert");var E=r.listSelections().slice(0);E[p]={head:C.newPos,anchor:C.newPos},r.setSelections(E),!A&&C.indent&&(r.indentLine(C.newPos.line,null,!0),r.indentLine(C.newPos.line+1,null,!0))}}function j(r,R){for(var v=r.listSelections(),m=[],p=R?"/":"</",h=r.getOption("autoCloseTags"),o=typeof h=="object"&&h.dontIndentOnSlash,f=0;f<v.length;f++){if(!v[f].empty())return ie.Pass;var l=v[f].head,u=r.getTokenAt(l),s=ie.innerMode(r.getMode(),u.state),a=s.state;if(R&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=l.ch-1))return ie.Pass;var O,x=s.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(x&&s.mode.name=="javascript")O=p+"script";else if(x&&s.mode.name=="css")O=p+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!S||S.length&&W(r,S,S[S.length-1],l))return ie.Pass;O=p+S[S.length-1]}r.getLine(l.line).charAt(u.end)!=">"&&(O+=">"),m[f]=O}if(r.replaceSelections(m),v=r.listSelections(),!o)for(var f=0;f<v.length;f++)(f==v.length-1||v[f].head.line<v[f+1].head.line)&&r.indentLine(v[f].head.line)}function U(r){return r.getOption("disableInput")?ie.Pass:j(r,!0)}ie.commands.closeTag=function(r){return j(r)};function z(r,R){if(r.indexOf)return r.indexOf(R);for(var v=0,m=r.length;v<m;++v)if(r[v]==R)return v;return-1}function W(r,R,v,m,p){if(!ie.scanForClosingTag)return!1;var h=Math.min(r.lastLine()+1,m.line+500),o=ie.scanForClosingTag(r,m,null,h);if(!o||o.tag!=v)return!1;for(var f=p?1:0,l=R.length-1;l>=0&&R[l]==v;l--)++f;m=o.to;for(var l=1;l<f;l++){var u=ie.scanForClosingTag(r,m,null,h);if(!u||u.tag!=v)return!1;m=u.to}return!0}})},BjJ7:function(nt,be,Q){"use strict";Q.d(be,"d",function(){return J}),Q.d(be,"c",function(){return P}),Q.d(be,"e",function(){return Y}),Q.d(be,"b",function(){return j}),Q.d(be,"a",function(){return z});var ie=Q("m3rI");function J(W){var r=!0;if(W.length>0){for(var R=0;R<W.length;R++)if(W[R].compile_success==0||!W[R].compile_success){r=!1;break}}else r=!1;return r}function P(W){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;v<W.length;v++){var m=W[v],p=r?"".concat(r,"/").concat(m.name):"".concat(m.name);R.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return R}function Y(W,r,R){for(var v=0;v<W.length;v++){var m=W[v];if(m.key===r){m.children=R;break}m.children&&Y(m.children,r,R)}return W}function j(W,r,R){var v;return function(){var m=this,p=arguments,h=function(){v=null,R||W.apply(m,p)},o=R&&!v;clearTimeout(v),v=setTimeout(h,r),o&&W.apply(m,p)}}var U=!0,z=ie.a.API_SERVER},"C+DQ":function(nt,be,Q){},"C/vA":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return ie});function ie(J){const P=this;let Y=!1,j;return function(){return Y||(Y=!0,j=J.apply(P,arguments)),j}}},"Cg/j":function(nt,be,Q){"use strict";Q.d(be,"b",function(){return ie}),Q.d(be,"a",function(){return J}),Q.d(be,"c",function(){return Y}),Q.d(be,"d",function(){return j});var ie;(function(U){U.serviceIds=new Map,U.DI_TARGET="$di$target",U.DI_DEPENDENCIES="$di$dependencies";function z(W){return W[U.DI_DEPENDENCIES]||[]}U.getServiceDependencies=z})(ie||(ie={}));const J=Y("instantiationService");function P(U,z,W,r){z[ie.DI_TARGET]===z?z[ie.DI_DEPENDENCIES].push({id:U,index:W,optional:r}):(z[ie.DI_DEPENDENCIES]=[{id:U,index:W,optional:r}],z[ie.DI_TARGET]=z)}function Y(U){if(ie.serviceIds.has(U))return ie.serviceIds.get(U);const z=function(W,r,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(z,W,R,!1)};return z.toString=()=>U,ie.serviceIds.set(U,z),z}function j(U){return function(z,W,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(U,z,r,!0)}}},DlQD:function(nt,be,Q){(function(ie,J){nt.exports=J()})(this,function(){"use strict";function ie(Ie,Ee){for(var Ce=0;Ce<Ee.length;Ce++){var re=Ee[Ce];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Ie,re.key,re)}}function J(Ie,Ee,Ce){return Ee&&ie(Ie.prototype,Ee),Ce&&ie(Ie,Ce),Ie}function P(Ie,Ee){if(!Ie)return;if(typeof Ie=="string")return Y(Ie,Ee);var Ce=Object.prototype.toString.call(Ie).slice(8,-1);if(Ce==="Object"&&Ie.constructor&&(Ce=Ie.constructor.name),Ce==="Map"||Ce==="Set")return Array.from(Ie);if(Ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce))return Y(Ie,Ee)}function Y(Ie,Ee){(Ee==null||Ee>Ie.length)&&(Ee=Ie.length);for(var Ce=0,re=new Array(Ee);Ce<Ee;Ce++)re[Ce]=Ie[Ce];return re}function j(Ie,Ee){var Ce;if(typeof Symbol=="undefined"||Ie[Symbol.iterator]==null){if(Array.isArray(Ie)||(Ce=P(Ie))||Ee&&Ie&&typeof Ie.length=="number"){Ce&&(Ie=Ce);var re=0;return function(){return re>=Ie.length?{done:!0}:{done:!1,value:Ie[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 Ce=Ie[Symbol.iterator](),Ce.next.bind(Ce)}function U(Ie,Ee){return Ee={exports:{}},Ie(Ee,Ee.exports),Ee.exports}var z=U(function(Ie){function Ee(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ce(re){Ie.exports.defaults=re}Ie.exports={defaults:Ee(),getDefaults:Ee,changeDefaults:Ce}}),W=z.defaults,r=z.getDefaults,R=z.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},f=function(Ee){return o[Ee]};function l(Ie,Ee){if(Ee){if(v.test(Ie))return Ie.replace(m,f)}else if(p.test(Ie))return Ie.replace(h,f);return Ie}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ie){return Ie.replace(u,function(Ee,Ce){return Ce=Ce.toLowerCase(),Ce==="colon"?":":Ce.charAt(0)==="#"?Ce.charAt(1)==="x"?String.fromCharCode(parseInt(Ce.substring(2),16)):String.fromCharCode(+Ce.substring(1)):""})}var a=/(^|[^\[])\^/g;function O(Ie,Ee){Ie=Ie.source||Ie,Ee=Ee||"";var Ce={replace:function(oe,de){return de=de.source||de,de=de.replace(a,"$1"),Ie=Ie.replace(oe,de),Ce},getRegex:function(){return new RegExp(Ie,Ee)}};return Ce}var x=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ie,Ee,Ce){if(Ie){var re;try{re=decodeURIComponent(s(Ce)).replace(x,"").toLowerCase()}catch(oe){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}Ee&&!S.test(Ce)&&(Ce=d(Ee,Ce));try{Ce=encodeURI(Ce).replace(/%25/g,"%")}catch(oe){return null}return Ce}var L={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(Ie,Ee){L[" "+Ie]||(A.test(Ie)?L[" "+Ie]=Ie+"/":L[" "+Ie]=B(Ie,"/",!0)),Ie=L[" "+Ie];var Ce=Ie.indexOf(":")===-1;return Ee.substring(0,2)==="//"?Ce?Ee:Ie.replace(C,"$1")+Ee:Ee.charAt(0)==="/"?Ce?Ee:Ie.replace(E,"$1")+Ee:Ie+Ee}var w={exec:function(){}};function y(Ie){for(var Ee=1,Ce,re;Ee<arguments.length;Ee++){Ce=arguments[Ee];for(re in Ce)Object.prototype.hasOwnProperty.call(Ce,re)&&(Ie[re]=Ce[re])}return Ie}function b(Ie,Ee){var Ce=Ie.replace(/\|/g,function(de,ge,Se){for(var Ue=!1,Ve=ge;--Ve>=0&&Se[Ve]==="\\";)Ue=!Ue;return Ue?"|":" |"}),re=Ce.split(/ \|/),oe=0;if(re.length>Ee)re.splice(Ee);else for(;re.length<Ee;)re.push("");for(;oe<re.length;oe++)re[oe]=re[oe].trim().replace(/\\\|/g,"|");return re}function B(Ie,Ee,Ce){var re=Ie.length;if(re===0)return"";for(var oe=0;oe<re;){var de=Ie.charAt(re-oe-1);if(de===Ee&&!Ce)oe++;else if(de!==Ee&&Ce)oe++;else break}return Ie.substr(0,re-oe)}function F(Ie,Ee){if(Ie.indexOf(Ee[1])===-1)return-1;for(var Ce=Ie.length,re=0,oe=0;oe<Ce;oe++)if(Ie[oe]==="\\")oe++;else if(Ie[oe]===Ee[0])re++;else if(Ie[oe]===Ee[1]&&(re--,re<0))return oe;return-1}function _(Ie){Ie&&Ie.sanitize&&!Ie.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 M={escape:l,unescape:s,edit:O,cleanUrl:D,resolveUrl:d,noopTest:w,merge:y,splitCells:b,rtrim:B,findClosingBracket:F,checkSanitizeDeprecation:_},I=z.defaults,g=M.rtrim,H=M.splitCells,$=M.escape,ae=M.findClosingBracket;function ue(Ie,Ee,Ce){var re=Ee.href,oe=Ee.title?$(Ee.title):null,de=Ie[1].replace(/\\([\[\]])/g,"$1");return Ie[0].charAt(0)!=="!"?{type:"link",raw:Ce,href:re,title:oe,text:de}:{type:"image",raw:Ce,href:re,title:oe,text:$(de)}}function Le(Ie,Ee){var Ce=Ie.match(/^(\s+)(?:```)/);if(Ce===null)return Ee;var re=Ce[1];return Ee.split(`
`).map(function(oe){var de=oe.match(/^\s+/);if(de===null)return oe;var ge=de[0];return ge.length>=re.length?oe.slice(re.length):oe}).join(`
`)}var ve=function(){function Ie(Ce){this.options=Ce||I}var Ee=Ie.prototype;return Ee.space=function(re){var oe=this.rules.block.newline.exec(re);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},Ee.code=function(re,oe){var de=this.rules.block.code.exec(re);if(de){var ge=oe[oe.length-1];if(ge&&ge.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var Se=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?Se:g(Se,`
`)}}},Ee.fences=function(re){var oe=this.rules.block.fences.exec(re);if(oe){var de=oe[0],ge=Le(de,oe[3]||"");return{type:"code",raw:de,lang:oe[2]?oe[2].trim():oe[2],text:ge}}},Ee.heading=function(re){var oe=this.rules.block.heading.exec(re);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},Ee.nptable=function(re){var oe=this.rules.block.nptable.exec(re);if(oe){var de={type:"table",header:H(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(de.header.length===de.align.length){var ge=de.align.length,Se;for(Se=0;Se<ge;Se++)/^ *-+: *$/.test(de.align[Se])?de.align[Se]="right":/^ *:-+: *$/.test(de.align[Se])?de.align[Se]="center":/^ *:-+ *$/.test(de.align[Se])?de.align[Se]="left":de.align[Se]=null;for(ge=de.cells.length,Se=0;Se<ge;Se++)de.cells[Se]=H(de.cells[Se],de.header.length);return de}}},Ee.hr=function(re){var oe=this.rules.block.hr.exec(re);if(oe)return{type:"hr",raw:oe[0]}},Ee.blockquote=function(re){var oe=this.rules.block.blockquote.exec(re);if(oe){var de=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:de}}},Ee.list=function(re){var oe=this.rules.block.list.exec(re);if(oe){for(var de=oe[0],ge=oe[2],Se=ge.length>1,Ue=ge[ge.length-1]===")",Ve={type:"list",raw:de,ordered:Se,start:Se?+ge.slice(0,-1):"",loose:!1,items:[]},ot=oe[0].match(this.rules.block.item),mt=!1,ft,wt,St,dt,Bt,Lt,qt,Qt=ot.length,It=0;It<Qt;It++)ft=ot[It],de=ft,wt=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
`)&&(wt-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+wt+"}","gm"),"")),It!==Qt-1&&(St=this.rules.block.bullet.exec(ot[It+1])[0],(Se?St.length===1||!Ue&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==ge)&&(dt=ot.slice(It+1).join(`
`),Ve.raw=Ve.raw.substring(0,Ve.raw.length-dt.length),It=Qt-1)),Bt=mt||/\n\n(?!\s*$)/.test(ft),It!==Qt-1&&(mt=ft.charAt(ft.length-1)===`
`,Bt||(Bt=mt)),Bt&&(Ve.loose=!0),Lt=/^\[[ xX]\] /.test(ft),qt=void 0,Lt&&(qt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ve.items.push({type:"list_item",raw:de,task:Lt,checked:qt,loose:Bt,text:ft});return Ve}},Ee.html=function(re){var oe=this.rules.block.html.exec(re);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):$(oe[0]):oe[0]}},Ee.def=function(re){var oe=this.rules.block.def.exec(re);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var de=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:oe[0],href:oe[2],title:oe[3]}}},Ee.table=function(re){var oe=this.rules.block.table.exec(re);if(oe){var de={type:"table",header:H(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=oe[0];var ge=de.align.length,Se;for(Se=0;Se<ge;Se++)/^ *-+: *$/.test(de.align[Se])?de.align[Se]="right":/^ *:-+: *$/.test(de.align[Se])?de.align[Se]="center":/^ *:-+ *$/.test(de.align[Se])?de.align[Se]="left":de.align[Se]=null;for(ge=de.cells.length,Se=0;Se<ge;Se++)de.cells[Se]=H(de.cells[Se].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},Ee.lheading=function(re){var oe=this.rules.block.lheading.exec(re);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},Ee.paragraph=function(re){var oe=this.rules.block.paragraph.exec(re);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
`?oe[1].slice(0,-1):oe[1]}},Ee.text=function(re,oe){var de=this.rules.block.text.exec(re);if(de){var ge=oe[oe.length-1];return ge&&ge.type==="text"?{raw:de[0],text:de[0]}:{type:"text",raw:de[0],text:de[0]}}},Ee.escape=function(re){var oe=this.rules.inline.escape.exec(re);if(oe)return{type:"escape",raw:oe[0],text:$(oe[1])}},Ee.tag=function(re,oe,de){var ge=this.rules.inline.tag.exec(re);if(ge)return!oe&&/^<a /i.test(ge[0])?oe=!0:oe&&/^<\/a>/i.test(ge[0])&&(oe=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:oe,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]}},Ee.link=function(re){var oe=this.rules.inline.link.exec(re);if(oe){var de=ae(oe[2],"()");if(de>-1){var ge=oe[0].indexOf("!")===0?5:4,Se=ge+oe[1].length+de;oe[2]=oe[2].substring(0,de),oe[0]=oe[0].substring(0,Se).trim(),oe[3]=""}var Ue=oe[2],Ve="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);ot?(Ue=ot[1],Ve=ot[3]):Ve=""}else Ve=oe[3]?oe[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ue(oe,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:Ve&&Ve.replace(this.rules.inline._escapes,"$1")},oe[0]);return mt}},Ee.reflink=function(re,oe){var de;if((de=this.rules.inline.reflink.exec(re))||(de=this.rules.inline.nolink.exec(re))){var ge=(de[2]||de[1]).replace(/\s+/g," ");if(ge=oe[ge.toLowerCase()],!ge||!ge.href){var Se=de[0].charAt(0);return{type:"text",raw:Se,text:Se}}var Ue=ue(de,ge,de[0]);return Ue}},Ee.strong=function(re,oe,de){de===void 0&&(de="");var ge=this.rules.inline.strong.start.exec(re);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){oe=oe.slice(-1*re.length);var Se=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Se.lastIndex=0;for(var Ue;(ge=Se.exec(oe))!=null;)if(Ue=this.rules.inline.strong.middle.exec(oe.slice(0,ge.index+3)),Ue)return{type:"strong",raw:re.slice(0,Ue[0].length),text:re.slice(2,Ue[0].length-2)}}},Ee.em=function(re,oe,de){de===void 0&&(de="");var ge=this.rules.inline.em.start.exec(re);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){oe=oe.slice(-1*re.length);var Se=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Se.lastIndex=0;for(var Ue;(ge=Se.exec(oe))!=null;)if(Ue=this.rules.inline.em.middle.exec(oe.slice(0,ge.index+2)),Ue)return{type:"em",raw:re.slice(0,Ue[0].length),text:re.slice(1,Ue[0].length-1)}}},Ee.codespan=function(re){var oe=this.rules.inline.code.exec(re);if(oe){var de=oe[2].replace(/\n/g," "),ge=/[^ ]/.test(de),Se=de.startsWith(" ")&&de.endsWith(" ");return ge&&Se&&(de=de.substring(1,de.length-1)),de=$(de,!0),{type:"codespan",raw:oe[0],text:de}}},Ee.br=function(re){var oe=this.rules.inline.br.exec(re);if(oe)return{type:"br",raw:oe[0]}},Ee.del=function(re){var oe=this.rules.inline.del.exec(re);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},Ee.autolink=function(re,oe){var de=this.rules.inline.autolink.exec(re);if(de){var ge,Se;return de[2]==="@"?(ge=$(this.options.mangle?oe(de[1]):de[1]),Se="mailto:"+ge):(ge=$(de[1]),Se=ge),{type:"link",raw:de[0],text:ge,href:Se,tokens:[{type:"text",raw:ge,text:ge}]}}},Ee.url=function(re,oe){var de;if(de=this.rules.inline.url.exec(re)){var ge,Se;if(de[2]==="@")ge=$(this.options.mangle?oe(de[0]):de[0]),Se="mailto:"+ge;else{var Ue;do Ue=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Ue!==de[0]);ge=$(de[0]),de[1]==="www."?Se="http://"+ge:Se=ge}return{type:"link",raw:de[0],text:ge,href:Se,tokens:[{type:"text",raw:ge,text:ge}]}}},Ee.inlineText=function(re,oe,de){var ge=this.rules.inline.text.exec(re);if(ge){var Se;return oe?Se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]:Se=$(this.options.smartypants?de(ge[0]):ge[0]),{type:"text",raw:ge[0],text:Se}}},Ie}(),Te=M.noopTest,_e=M.edit,De=M.merge,he={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=_e(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=_e(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=_e(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",he._comment=/<!--(?!-?>)[\s\S]*?-->/,he.html=_e(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=_e(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.blockquote=_e(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=De({},he),he.gfm=De({},he.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),he.gfm.nptable=_e(he.gfm.nptable).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.gfm.table=_e(he.gfm.table).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.pedantic=De({},he.normal,{html:_e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Te,paragraph:_e(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=_e(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=_e(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=_e(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=_e(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=_e(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=_e(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=_e(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=_e(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=_e(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=_e(ce._blockSkip,"g").getRegex(),ce.overlapSkip=_e(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=_e(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=_e(ce.tag).replace("comment",he._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=_e(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=_e(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=_e(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=De({},ce),ce.pedantic=De({},ce.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:_e(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:_e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=De({},ce.normal,{escape:_e(ce.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=_e(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=De({},ce.gfm,{br:_e(ce.br).replace("{2,}","*").getRegex(),text:_e(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:he,inline:ce},fe=z.defaults,le=ne.block,ke=ne.inline;function Fe(Ie){return Ie.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 Ae(Ie){var Ee="",Ce,re,oe=Ie.length;for(Ce=0;Ce<oe;Ce++)re=Ie.charCodeAt(Ce),Math.random()>.5&&(re="x"+re.toString(16)),Ee+="&#"+re+";";return Ee}var Re=function(){function Ie(Ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ce||fe,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:le.normal,inline:ke.normal};this.options.pedantic?(re.block=le.pedantic,re.inline=ke.pedantic):this.options.gfm&&(re.block=le.gfm,this.options.breaks?re.inline=ke.breaks:re.inline=ke.gfm),this.tokenizer.rules=re}Ie.lex=function(re,oe){var de=new Ie(oe);return de.lex(re)};var Ee=Ie.prototype;return Ee.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},Ee.blockTokens=function(re,oe,de){oe===void 0&&(oe=[]),de===void 0&&(de=!0),re=re.replace(/^ +$/gm,"");for(var ge,Se,Ue,Ve;re;){if(ge=this.tokenizer.space(re)){re=re.substring(ge.raw.length),ge.type&&oe.push(ge);continue}if(ge=this.tokenizer.code(re,oe)){re=re.substring(ge.raw.length),ge.type?oe.push(ge):(Ve=oe[oe.length-1],Ve.raw+=`
`+ge.raw,Ve.text+=`
`+ge.text);continue}if(ge=this.tokenizer.fences(re)){re=re.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.heading(re)){re=re.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.nptable(re)){re=re.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.hr(re)){re=re.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.blockquote(re)){re=re.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],de),oe.push(ge);continue}if(ge=this.tokenizer.list(re)){for(re=re.substring(ge.raw.length),Ue=ge.items.length,Se=0;Se<Ue;Se++)ge.items[Se].tokens=this.blockTokens(ge.items[Se].text,[],!1);oe.push(ge);continue}if(ge=this.tokenizer.html(re)){re=re.substring(ge.raw.length),oe.push(ge);continue}if(de&&(ge=this.tokenizer.def(re))){re=re.substring(ge.raw.length),this.tokens.links[ge.tag]||(this.tokens.links[ge.tag]={href:ge.href,title:ge.title});continue}if(ge=this.tokenizer.table(re)){re=re.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.lheading(re)){re=re.substring(ge.raw.length),oe.push(ge);continue}if(de&&(ge=this.tokenizer.paragraph(re))){re=re.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.text(re,oe)){re=re.substring(ge.raw.length),ge.type?oe.push(ge):(Ve=oe[oe.length-1],Ve.raw+=`
`+ge.raw,Ve.text+=`
`+ge.text);continue}if(re){var ot="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return oe},Ee.inline=function(re){var oe,de,ge,Se,Ue,Ve,ot=re.length;for(oe=0;oe<ot;oe++){Ve=re[oe];switch(Ve.type){case"paragraph":case"text":case"heading":{Ve.tokens=[],this.inlineTokens(Ve.text,Ve.tokens);break}case"table":{for(Ve.tokens={header:[],cells:[]},Se=Ve.header.length,de=0;de<Se;de++)Ve.tokens.header[de]=[],this.inlineTokens(Ve.header[de],Ve.tokens.header[de]);for(Se=Ve.cells.length,de=0;de<Se;de++)for(Ue=Ve.cells[de],Ve.tokens.cells[de]=[],ge=0;ge<Ue.length;ge++)Ve.tokens.cells[de][ge]=[],this.inlineTokens(Ue[ge],Ve.tokens.cells[de][ge]);break}case"blockquote":{this.inline(Ve.tokens);break}case"list":{for(Se=Ve.items.length,de=0;de<Se;de++)this.inline(Ve.items[de].tokens);break}}}return re},Ee.inlineTokens=function(re,oe,de,ge,Se){oe===void 0&&(oe=[]),de===void 0&&(de=!1),ge===void 0&&(ge=!1),Se===void 0&&(Se="");var Ue,Ve=re,ot;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(Ve))!=null;)mt.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(Ve=Ve.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(Ve))!=null;)Ve=Ve.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Ue=this.tokenizer.escape(re)){re=re.substring(Ue.raw.length),oe.push(Ue);continue}if(Ue=this.tokenizer.tag(re,de,ge)){re=re.substring(Ue.raw.length),de=Ue.inLink,ge=Ue.inRawBlock,oe.push(Ue);continue}if(Ue=this.tokenizer.link(re)){re=re.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,ge)),oe.push(Ue);continue}if(Ue=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,ge)),oe.push(Ue);continue}if(Ue=this.tokenizer.strong(re,Ve,Se)){re=re.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],de,ge),oe.push(Ue);continue}if(Ue=this.tokenizer.em(re,Ve,Se)){re=re.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],de,ge),oe.push(Ue);continue}if(Ue=this.tokenizer.codespan(re)){re=re.substring(Ue.raw.length),oe.push(Ue);continue}if(Ue=this.tokenizer.br(re)){re=re.substring(Ue.raw.length),oe.push(Ue);continue}if(Ue=this.tokenizer.del(re)){re=re.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],de,ge),oe.push(Ue);continue}if(Ue=this.tokenizer.autolink(re,Ae)){re=re.substring(Ue.raw.length),oe.push(Ue);continue}if(!de&&(Ue=this.tokenizer.url(re,Ae))){re=re.substring(Ue.raw.length),oe.push(Ue);continue}if(Ue=this.tokenizer.inlineText(re,ge,Fe)){re=re.substring(Ue.raw.length),Se=Ue.raw.slice(-1),oe.push(Ue);continue}if(re){var ft="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return oe},J(Ie,null,[{key:"rules",get:function(){return{block:le,inline:ke}}}]),Ie}(),Pe=z.defaults,se=M.cleanUrl,pe=M.escape,ye=function(){function Ie(Ce){this.options=Ce||Pe}var Ee=Ie.prototype;return Ee.code=function(re,oe,de){var ge=(oe||"").match(/\S*/)[0];if(this.options.highlight){var Se=this.options.highlight(re,ge);Se!=null&&Se!==re&&(de=!0,re=Se)}return ge?'<pre><code class="'+this.options.langPrefix+pe(ge,!0)+'">'+(de?re:pe(re,!0))+`</code></pre>
`:"<pre><code>"+(de?re:pe(re,!0))+`</code></pre>
`},Ee.blockquote=function(re){return`<blockquote>
`+re+`</blockquote>
`},Ee.html=function(re){return re},Ee.heading=function(re,oe,de,ge){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+ge.slug(de)+'">'+re+"</h"+oe+`>
`:"<h"+oe+">"+re+"</h"+oe+`>
`},Ee.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Ee.list=function(re,oe,de){var ge=oe?"ol":"ul",Se=oe&&de!==1?' start="'+de+'"':"";return"<"+ge+Se+`>
`+re+"</"+ge+`>
`},Ee.listitem=function(re){return"<li>"+re+`</li>
`},Ee.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ee.paragraph=function(re){return"<p>"+re+`</p>
`},Ee.table=function(re,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
<thead>
`+re+`</thead>
`+oe+`</table>
`},Ee.tablerow=function(re){return`<tr>
`+re+`</tr>
`},Ee.tablecell=function(re,oe){var de=oe.header?"th":"td",ge=oe.align?"<"+de+' align="'+oe.align+'">':"<"+de+">";return ge+re+"</"+de+`>
`},Ee.strong=function(re){return"<strong>"+re+"</strong>"},Ee.em=function(re){return"<em>"+re+"</em>"},Ee.codespan=function(re){return"<code>"+re+"</code>"},Ee.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ee.del=function(re){return"<del>"+re+"</del>"},Ee.link=function(re,oe,de){if(re=se(this.options.sanitize,this.options.baseUrl,re),re===null)return de;var ge='<a href="'+pe(re)+'"';return oe&&(ge+=' title="'+oe+'"'),ge+=">"+de+"</a>",ge},Ee.image=function(re,oe,de){if(re=se(this.options.sanitize,this.options.baseUrl,re),re===null)return de;var ge='<img src="'+re+'" alt="'+de+'"';return oe&&(ge+=' title="'+oe+'"'),ge+=this.options.xhtml?"/>":">",ge},Ee.text=function(re){return re},Ie}(),Oe=function(){function Ie(){}var Ee=Ie.prototype;return Ee.strong=function(re){return re},Ee.em=function(re){return re},Ee.codespan=function(re){return re},Ee.del=function(re){return re},Ee.html=function(re){return re},Ee.text=function(re){return re},Ee.link=function(re,oe,de){return""+de},Ee.image=function(re,oe,de){return""+de},Ee.br=function(){return""},Ie}(),je=function(){function Ie(){this.seen={}}var Ee=Ie.prototype;return Ee.slug=function(re){var oe=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var de=oe;do this.seen[de]++,oe=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Ie}(),ze=z.defaults,Je=M.unescape,Ye=function(){function Ie(Ce){this.options=Ce||ze,this.options.renderer=this.options.renderer||new ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Oe,this.slugger=new je}Ie.parse=function(re,oe){var de=new Ie(oe);return de.parse(re)};var Ee=Ie.prototype;return Ee.parse=function(re,oe){oe===void 0&&(oe=!0);var de="",ge,Se,Ue,Ve,ot,mt,ft,wt,St,dt,Bt,Lt,qt,Qt,It,Cr,zr,yt,Lr=re.length;for(ge=0;ge<Lr;ge++){dt=re[ge];switch(dt.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,Je(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(wt="",ft="",Ve=dt.header.length,Se=0;Se<Ve;Se++)ft+=this.renderer.tablecell(this.parseInline(dt.tokens.header[Se]),{header:!0,align:dt.align[Se]});for(wt+=this.renderer.tablerow(ft),St="",Ve=dt.cells.length,Se=0;Se<Ve;Se++){for(mt=dt.tokens.cells[Se],ft="",ot=mt.length,Ue=0;Ue<ot;Ue++)ft+=this.renderer.tablecell(this.parseInline(mt[Ue]),{header:!1,align:dt.align[Ue]});St+=this.renderer.tablerow(ft)}de+=this.renderer.table(wt,St);continue}case"blockquote":{St=this.parse(dt.tokens),de+=this.renderer.blockquote(St);continue}case"list":{for(Bt=dt.ordered,Lt=dt.start,qt=dt.loose,Ve=dt.items.length,St="",Se=0;Se<Ve;Se++)It=dt.items[Se],Cr=It.checked,zr=It.task,Qt="",It.task&&(yt=this.renderer.checkbox(Cr),qt?It.tokens.length>0&&It.tokens[0].type==="text"?(It.tokens[0].text=yt+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=yt+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:yt}):Qt+=yt),Qt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Qt,zr,Cr);de+=this.renderer.list(St,Bt,Lt);continue}case"html":{de+=this.renderer.html(dt.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(St=dt.tokens?this.parseInline(dt.tokens):dt.text;ge+1<Lr&&re[ge+1].type==="text";)dt=re[++ge],St+=`
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);de+=oe?this.renderer.paragraph(St):St;continue}default:{var bt='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return de},Ee.parseInline=function(re,oe){oe=oe||this.renderer;var de="",ge,Se,Ue=re.length;for(ge=0;ge<Ue;ge++){Se=re[ge];switch(Se.type){case"escape":{de+=oe.text(Se.text);break}case"html":{de+=oe.html(Se.text);break}case"link":{de+=oe.link(Se.href,Se.title,this.parseInline(Se.tokens,oe));break}case"image":{de+=oe.image(Se.href,Se.title,Se.text);break}case"strong":{de+=oe.strong(this.parseInline(Se.tokens,oe));break}case"em":{de+=oe.em(this.parseInline(Se.tokens,oe));break}case"codespan":{de+=oe.codespan(Se.text);break}case"br":{de+=oe.br();break}case"del":{de+=oe.del(this.parseInline(Se.tokens,oe));break}case"text":{de+=oe.text(Se.text);break}default:{var Ve='Token with "'+Se.type+'" type was not found.';if(this.options.silent){console.error(Ve);return}else throw new Error(Ve)}}}return de},Ie}(),rt=M.merge,Ze=M.checkSanitizeDeprecation,et=M.escape,Be=z.getDefaults,ut=z.changeDefaults,st=z.defaults;function He(Ie,Ee,Ce){if(typeof Ie=="undefined"||Ie===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ie!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ie)+", string expected");if(typeof Ee=="function"&&(Ce=Ee,Ee=null),Ee=rt({},He.defaults,Ee||{}),Ze(Ee),Ce){var re=Ee.highlight,oe;try{oe=Re.lex(Ie,Ee)}catch(Ue){return Ce(Ue)}var de=function(Ve){var ot;if(!Ve)try{ot=Ye.parse(oe,Ee)}catch(mt){Ve=mt}return Ee.highlight=re,Ve?Ce(Ve):Ce(null,ot)};if(!re||re.length<3)return de();if(delete Ee.highlight,!oe.length)return de();var ge=0;He.walkTokens(oe,function(Ue){Ue.type==="code"&&(ge++,setTimeout(function(){re(Ue.text,Ue.lang,function(Ve,ot){if(Ve)return de(Ve);ot!=null&&ot!==Ue.text&&(Ue.text=ot,Ue.escaped=!0),ge--,ge===0&&de()})},0))}),ge===0&&de();return}try{var Se=Re.lex(Ie,Ee);return Ee.walkTokens&&He.walkTokens(Se,Ee.walkTokens),Ye.parse(Se,Ee)}catch(Ue){if(Ue.message+=`
Please report this to https://github.com/markedjs/marked.`,Ee.silent)return"<p>An error occurred:</p><pre>"+et(Ue.message+"",!0)+"</pre>";throw Ue}}He.options=He.setOptions=function(Ie){return rt(He.defaults,Ie),ut(He.defaults),He},He.getDefaults=Be,He.defaults=st,He.use=function(Ie){var Ee=rt({},Ie);if(Ie.renderer&&function(){var re=He.defaults.renderer||new ye,oe=function(Se){var Ue=re[Se];re[Se]=function(){for(var Ve=arguments.length,ot=new Array(Ve),mt=0;mt<Ve;mt++)ot[mt]=arguments[mt];var ft=Ie.renderer[Se].apply(re,ot);return ft===!1&&(ft=Ue.apply(re,ot)),ft}};for(var de in Ie.renderer)oe(de);Ee.renderer=re}(),Ie.tokenizer&&function(){var re=He.defaults.tokenizer||new ve,oe=function(Se){var Ue=re[Se];re[Se]=function(){for(var Ve=arguments.length,ot=new Array(Ve),mt=0;mt<Ve;mt++)ot[mt]=arguments[mt];var ft=Ie.tokenizer[Se].apply(re,ot);return ft===!1&&(ft=Ue.apply(re,ot)),ft}};for(var de in Ie.tokenizer)oe(de);Ee.tokenizer=re}(),Ie.walkTokens){var Ce=He.defaults.walkTokens;Ee.walkTokens=function(re){Ie.walkTokens(re),Ce&&Ce(re)}}He.setOptions(Ee)},He.walkTokens=function(Ie,Ee){for(var Ce=j(Ie),re;!(re=Ce()).done;){var oe=re.value;Ee(oe);switch(oe.type){case"table":{for(var de=j(oe.tokens.header),ge;!(ge=de()).done;){var Se=ge.value;He.walkTokens(Se,Ee)}for(var Ue=j(oe.tokens.cells),Ve;!(Ve=Ue()).done;)for(var ot=Ve.value,mt=j(ot),ft;!(ft=mt()).done;){var wt=ft.value;He.walkTokens(wt,Ee)}break}case"list":{He.walkTokens(oe.items,Ee);break}default:oe.tokens&&He.walkTokens(oe.tokens,Ee)}}},He.Parser=Ye,He.parser=Ye.parse,He.Renderer=ye,He.TextRenderer=Oe,He.Lexer=Re,He.lexer=Re.lex,He.Tokenizer=ve,He.Slugger=je,He.parse=He;var We=He;return We})},ELLl:function(nt,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){var J={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(o,f,l){l&&l!=ie.Init&&(o.removeKeyMap(j),o.state.closeBrackets=null),f&&(U(Y(f,"pairs")),o.state.closeBrackets=f,o.addKeyMap(j))});function Y(o,f){return f=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[f]!=null?o[f]:J[f]}var j={Backspace:r,Enter:R};function U(o){for(var f=0;f<o.length;f++){var l=o.charAt(f),u="'"+l+"'";j[u]||(j[u]=z(l))}}U(J.pairs+"`");function z(o){return function(f){return m(f,o)}}function W(o){var f=o.state.closeBrackets;if(!f||f.override)return f;var l=o.getModeAt(o.getCursor());return l.closeBrackets||f}function r(o){var f=W(o);if(!f||o.getOption("disableInput"))return ie.Pass;for(var l=Y(f,"pairs"),u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return ie.Pass;var a=p(o,u[s].head);if(!a||l.indexOf(a)%2!=0)return ie.Pass}for(var s=u.length-1;s>=0;s--){var O=u[s].head;o.replaceRange("",P(O.line,O.ch-1),P(O.line,O.ch+1),"+delete")}}function R(o){var f=W(o),l=f&&Y(f,"explode");if(!l||o.getOption("disableInput"))return ie.Pass;for(var u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return ie.Pass;var a=p(o,u[s].head);if(!a||l.indexOf(a)%2!=0)return ie.Pass}o.operation(function(){var O=o.lineSeparator()||`
`;o.replaceSelection(O+O,null),o.execCommand("goCharLeft"),u=o.listSelections();for(var x=0;x<u.length;x++){var S=u[x].head.line;o.indentLine(S,null,!0),o.indentLine(S+1,null,!0)}})}function v(o){var f=ie.cmpPos(o.anchor,o.head)>0;return{anchor:new P(o.anchor.line,o.anchor.ch+(f?-1:1)),head:new P(o.head.line,o.head.ch+(f?1:-1))}}function m(o,f){var l=W(o);if(!l||o.getOption("disableInput"))return ie.Pass;var u=Y(l,"pairs"),s=u.indexOf(f);if(s==-1)return ie.Pass;for(var a=Y(l,"closeBefore"),O=Y(l,"triples"),x=u.charAt(s+1)==f,S=o.listSelections(),D=s%2==0,L,A=0;A<S.length;A++){var C=S[A],E=C.head,d,w=o.getRange(E,P(E.line,E.ch+1));if(D&&!C.empty())d="surround";else if((x||!D)&&w==f)x&&h(o,E)?d="both":O.indexOf(f)>=0&&o.getRange(E,P(E.line,E.ch+3))==f+f+f?d="skipThree":d="skip";else if(x&&E.ch>1&&O.indexOf(f)>=0&&o.getRange(P(E.line,E.ch-2),E)==f+f){if(E.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(E.line,E.ch-2))))return ie.Pass;d="addFour"}else if(x){var y=E.ch==0?" ":o.getRange(P(E.line,E.ch-1),E);if(!ie.isWordChar(w)&&y!=f&&!ie.isWordChar(y))d="both";else return ie.Pass}else if(D&&(w.length===0||/\s/.test(w)||a.indexOf(w)>-1))d="both";else return ie.Pass;if(!L)L=d;else if(L!=d)return ie.Pass}var b=s%2?u.charAt(s-1):f,B=s%2?f:u.charAt(s+1);o.operation(function(){if(L=="skip")o.execCommand("goCharRight");else if(L=="skipThree")for(var F=0;F<3;F++)o.execCommand("goCharRight");else if(L=="surround"){for(var _=o.getSelections(),F=0;F<_.length;F++)_[F]=b+_[F]+B;o.replaceSelections(_,"around"),_=o.listSelections().slice();for(var F=0;F<_.length;F++)_[F]=v(_[F]);o.setSelections(_)}else L=="both"?(o.replaceSelection(b+B,null),o.triggerElectric(b+B),o.execCommand("goCharLeft")):L=="addFour"&&(o.replaceSelection(b+b+b+b,"before"),o.execCommand("goCharRight"))})}function p(o,f){var l=o.getRange(P(f.line,f.ch-1),P(f.line,f.ch+1));return l.length==2?l:null}function h(o,f){var l=o.getTokenAt(P(f.line,f.ch+1));return/\bstring/.test(l.type)&&l.start==f.ch&&(f.ch==0||!/\bstring/.test(o.getTokenTypeAt(f)))}})},FWmy:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return ie});function ie(J,P){if(!J)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GfqC:function(nt,be,Q){"use strict";var ie=Q("q1tI"),J=Q.n(ie),P=Q("TSYQ"),Y=Q.n(P);function j(M,I){var g="cannot "+M.method+" "+M.action+" "+I.status+"'",H=new Error(g);return H.status=I.status,H.method=M.method,H.url=M.action,H}function U(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(g){return I}}function z(M){var I=new XMLHttpRequest;M.onProgress&&I.upload&&(I.upload.onprogress=function(ae){ae.total>0&&(ae.percent=ae.loaded/ae.total*100),M.onProgress(ae)});var g=new FormData;M.data&&Object.keys(M.data).forEach(function($){var ae=M.data[$];if(Array.isArray(ae)){ae.forEach(function(ue){g.append($+"[]",ue)});return}g.append($,M.data[$])}),M.file instanceof Blob?g.append(M.filename,M.file,M.file.name):g.append(M.filename,M.file),I.onerror=function(ae){M.onError(ae)},I.onload=function(){return I.status<200||I.status>=300?M.onError(j(M,I),U(I)):M.onSuccess(U(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var H=M.headers||{};return H["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function($){H[$]!==null&&I.setRequestHeader($,H[$])}),I.send(g),{abort:function(){I.abort()}}}var W=+new Date,r=0;function R(){return"rc-upload-"+W+"-"+ ++r}function v(M,I){return M.indexOf(I,M.length-I.length)!==-1}var m=function(M,I){if(M&&I){var g=Array.isArray(I)?I:I.split(","),H=M.name||"",$=M.type||"",ae=$.replace(/\/.*$/,"");return g.some(function(ue){var Le=ue.trim();return Le.charAt(0)==="."?v(H.toLowerCase(),Le.toLowerCase()):/\/\*$/.test(Le)?ae===Le.replace(/\/.*$/,""):$===Le})}return!0};function p(M,I){var g=M.createReader(),H=[];function $(){g.readEntries(function(ae){var ue=Array.prototype.slice.apply(ae);H=H.concat(ue);var Le=!ue.length;Le?I(H):$()})}$()}var h=function(I,g,H){var $=function ae(ue,Le){Le=Le||"",ue.isFile?ue.file(function(ve){H(ve)&&(ue.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=ue.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),g([ve]))}):ue.isDirectory&&p(ue,function(ve){ve.forEach(function(Te){ae(Te,""+Le+ue.name+"/")})})};I.forEach(function(ae){$(ae.webkitGetAsEntry())})},o=h,f=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var H in g)Object.prototype.hasOwnProperty.call(g,H)&&(M[H]=g[H])}return M},l=function(){function M(I,g){var H=[],$=!0,ae=!1,ue=void 0;try{for(var Le=I[Symbol.iterator](),ve;!($=(ve=Le.next()).done)&&!(H.push(ve.value),g&&H.length===g);$=!0);}catch(Te){ae=!0,ue=Te}finally{try{!$&&Le.return&&Le.return()}finally{if(ae)throw ue}}return H}return function(I,g){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return M(I,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function M(I,g){for(var H=0;H<g.length;H++){var $=g[H];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,g,H){return g&&M(I.prototype,g),H&&M(I,H),I}}();function s(M,I,g){return I in M?Object.defineProperty(M,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):M[I]=g,M}function a(M,I){var g={};for(var H in M){if(I.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(M,H))continue;g[H]=M[H]}return g}function O(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function x(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function S(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(g[H]=I[H]),g},{})},L=function(M){S(I,M);function I(){var g,H,$,ae;O(this,I);for(var ue=arguments.length,Le=Array(ue),ve=0;ve<ue;ve++)Le[ve]=arguments[ve];return ae=(H=($=x(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Le))),$),$.state={uid:R()},$.reqs={},$.onChange=function(Te){var _e=Te.target.files;$.uploadFiles(_e),$.reset()},$.onClick=function(Te){var _e=$.fileInput;if(!_e)return;var De=$.props,he=De.children,ce=De.onClick;he&&he.type==="button"&&(_e.parentNode.focus(),_e.parentNode.querySelector("button").blur()),_e.click(),ce&&ce(Te)},$.onKeyDown=function(Te){Te.key==="Enter"&&$.onClick()},$.onFileDrop=function(Te){var _e=$.props.multiple;if(Te.preventDefault(),Te.type==="dragover")return;if($.props.directory)o(Array.prototype.slice.call(Te.dataTransfer.items),$.uploadFiles,function(he){return m(he,$.props.accept)});else{var De=Array.prototype.slice.call(Te.dataTransfer.files).filter(function(he){return m(he,$.props.accept)});_e===!1&&(De=De.slice(0,1)),$.uploadFiles(De)}},$.uploadFiles=function(Te){var _e=Array.prototype.slice.call(Te);_e.map(function(De){return De.uid=R(),De}).forEach(function(De){$.upload(De,_e)})},$.saveFileInput=function(Te){$.fileInput=Te},H),x($,ae)}return u(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,$){var ae=this,ue=this.props;if(!ue.beforeUpload)return setTimeout(function(){return ae.post(H)},0);var Le=ue.beforeUpload(H,$);Le&&Le.then?Le.then(function(ve){var Te=Object.prototype.toString.call(ve);return Te==="[object File]"||Te==="[object Blob]"?ae.post(ve):ae.post(H)}).catch(function(ve){console.log(ve)}):Le!==!1&&setTimeout(function(){return ae.post(H)},0);return}},{key:"post",value:function(H){var $=this;if(!this._isMounted)return;var ae=this.props,ue=ae.onStart,Le=ae.onProgress,ve=ae.transformFile,Te=ve===void 0?function(_e){return _e}:ve;new Promise(function(_e){var De=ae.action;return typeof De=="function"&&(De=De(H)),_e(De)}).then(function(_e){var De=H.uid,he=ae.customRequest||z,ce=Promise.resolve(Te(H)).then(function(ne){var fe=ae.data;return typeof fe=="function"&&(fe=fe(ne)),Promise.all([ne,fe])}).catch(function(ne){console.error(ne)});ce.then(function(ne){var fe=l(ne,2),le=fe[0],ke=fe[1],Fe={action:_e,filename:ae.name,data:ke,file:le,headers:ae.headers,withCredentials:ae.withCredentials,method:ae.method||"post",onProgress:Le?function(Ae){Le(Ae,H)}:null,onSuccess:function(Re,Pe){delete $.reqs[De],ae.onSuccess(Re,H,Pe)},onError:function(Re,Pe){delete $.reqs[De],ae.onError(Re,Pe,H)}};ue(H),$.reqs[De]=he(Fe)})})}},{key:"reset",value:function(){this.setState({uid:R()})}},{key:"abort",value:function(H){var $=this.reqs;if(H){var ae=H;H&&H.uid&&(ae=H.uid),$[ae]&&$[ae].abort&&$[ae].abort(),delete $[ae]}else Object.keys($).forEach(function(ue){$[ue]&&$[ue].abort&&$[ue].abort(),delete $[ue]})}},{key:"render",value:function(){var H,$=this.props,ae=$.component,ue=$.prefixCls,Le=$.className,ve=$.disabled,Te=$.id,_e=$.style,De=$.multiple,he=$.accept,ce=$.children,ne=$.directory,fe=$.openFileDialogOnClick,le=$.onMouseEnter,ke=$.onMouseLeave,Fe=a($,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Ae=Y()((H={},s(H,ue,!0),s(H,ue+"-disabled",ve),s(H,Le,Le),H)),Re=ve?{}:{onClick:fe?this.onClick:function(){},onKeyDown:fe?this.onKeyDown:function(){},onMouseEnter:le,onMouseLeave:ke,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return J.a.createElement(ae,f({},Re,{className:Ae,role:"button",style:_e}),J.a.createElement("input",f({},D(Fe),{id:Te,type:"file",ref:this.saveFileInput,onClick:function(se){return se.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:he,directory:ne?"directory":null,webkitdirectory:ne?"webkitdirectory":null,multiple:De,onChange:this.onChange})),ce)}}]),I}(ie.Component),A=L,C=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var H in g)Object.prototype.hasOwnProperty.call(g,H)&&(M[H]=g[H])}return M},E=function(){function M(I,g){for(var H=0;H<g.length;H++){var $=g[H];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(I,$.key,$)}}return function(I,g,H){return g&&M(I.prototype,g),H&&M(I,H),I}}();function d(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function w(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function y(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}function b(){}var B=function(M){y(I,M);function I(){var g,H,$,ae;d(this,I);for(var ue=arguments.length,Le=Array(ue),ve=0;ve<ue;ve++)Le[ve]=arguments[ve];return ae=(H=($=w(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Le))),$),$.saveUploader=function(Te){$.uploader=Te},H),w($,ae)}return E(I,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return J.a.createElement(A,C({},this.props,{ref:this.saveUploader}))}}]),I}(ie.Component);B.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:b,onError:b,onSuccess:b,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=B,_=be.a=F},HmJG:function(nt,be,Q){},JYp7:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return ie});var ie;(function(J){function P(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}J.is=P;const Y=Object.freeze([]);function j(){return Y}J.empty=j;function*U(a){yield a}J.single=U;function z(a){return a||Y}J.from=z;function W(a){return!a||a[Symbol.iterator]().next().done===!0}J.isEmpty=W;function r(a){return a[Symbol.iterator]().next().value}J.first=r;function R(a,O){for(const x of a)if(O(x))return!0;return!1}J.some=R;function v(a,O){for(const x of a)if(O(x))return x;return}J.find=v;function*m(a,O){for(const x of a)O(x)&&(yield x)}J.filter=m;function*p(a,O){let x=0;for(const S of a)yield O(S,x++)}J.map=p;function*h(...a){for(const O of a)for(const x of O)yield x}J.concat=h;function*o(a){for(const O of a)for(const x of O)yield x}J.concatNested=o;function f(a,O,x){let S=x;for(const D of a)S=O(S,D);return S}J.reduce=f;function*l(a,O,x=a.length){for(O<0&&(O+=a.length),x<0?x+=a.length:x>a.length&&(x=a.length);O<x;O++)yield a[O]}J.slice=l;function u(a,O=Number.POSITIVE_INFINITY){const x=[];if(O===0)return[x,a];const S=a[Symbol.iterator]();for(let D=0;D<O;D++){const L=S.next();if(L.done)return[x,J.empty()];x.push(L.value)}return[x,{[Symbol.iterator](){return S}}]}J.consume=u;function s(a,O,x=(S,D)=>S===D){const S=a[Symbol.iterator](),D=O[Symbol.iterator]();for(;;){const L=S.next(),A=D.next();if(L.done!==A.done)return!1;if(L.done)return!0;if(!x(L.value,A.value))return!1}}J.equals=s})(ie||(ie={}))},LdHM:function(nt,be,Q){"use strict";Q.d(be,"b",function(){return a}),Q.d(be,"a",function(){return x});var ie=Q("1OyB"),J=Q("vuIU"),P=Q("Ji7U"),Y=Q("LK+K"),j=Q("q1tI"),U=Q("rePB"),z=Q("Ff2n"),W=Q("ODXe"),r=Q("4IlW"),R=Q("bX4T"),v=Q("YrtM"),m=Q("TSYQ"),p=Q.n(m),h=Q("+nKL"),o=Q("8OUc"),f=function(H,$){var ae=H.prefixCls,ue=H.id,Le=H.flattenOptions,ve=H.childrenAsData,Te=H.values,_e=H.searchValue,De=H.multiple,he=H.defaultActiveFirstOption,ce=H.height,ne=H.itemHeight,fe=H.notFoundContent,le=H.open,ke=H.menuItemSelectedIcon,Fe=H.virtual,Ae=H.onSelect,Re=H.onToggleOpen,Pe=H.onActiveValue,se=H.onScroll,pe=H.onMouseEnter,ye="".concat(ae,"-item"),Oe=Object(v.a)(function(){return Le},[le,Le],function(We,Ie){return Ie[0]&&We[1]!==Ie[1]}),je=j.useRef(null),ze=function(Ie){Ie.preventDefault()},Je=function(Ie){je.current&&je.current.scrollTo({index:Ie})},Ye=function(Ie){for(var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ce=Oe.length,re=0;re<Ce;re+=1){var oe=(Ie+re*Ee+Ce)%Ce,de=Oe[oe],ge=de.group,Se=de.data;if(!ge&&!Se.disabled)return oe}return-1},rt=j.useState(function(){return Ye(0)}),Ze=Object(W.a)(rt,2),et=Ze[0],Be=Ze[1],ut=function(Ie){Be(Ie);var Ee=Oe[Ie];if(!Ee){Pe(null,-1);return}Pe(Ee.data.value,Ie)};j.useEffect(function(){ut(he!==!1?Ye(0):-1)},[Oe.length,_e]),j.useEffect(function(){var We=setTimeout(function(){if(!De&&le&&Te.size===1){var Ie=Array.from(Te)[0],Ee=Oe.findIndex(function(Ce){var re=Ce.data;return re.value===Ie});ut(Ee),Je(Ee)}});return function(){return clearTimeout(We)}},[le]);var st=function(Ie){Ie!==void 0&&Ae(Ie,{selected:!Te.has(Ie)}),De||Re(!1)};if(j.useImperativeHandle($,function(){return{onKeyDown:function(Ie){var Ee=Ie.which;switch(Ee){case r.a.UP:case r.a.DOWN:{var Ce=0;if(Ee===r.a.UP?Ce=-1:Ee===r.a.DOWN&&(Ce=1),Ce!==0){var re=Ye(et+Ce,Ce);Je(re),ut(re)}break}case r.a.ENTER:{var oe=Oe[et];oe&&!oe.data.disabled?st(oe.data.value):st(void 0),le&&Ie.preventDefault();break}case r.a.ESC:Re(!1)}},onKeyUp:function(){},scrollTo:function(Ie){Je(Ie)}}}),Oe.length===0)return j.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(ye,"-empty"),onMouseDown:ze},fe);function He(We){var Ie=Oe[We];if(!Ie)return null;var Ee=Ie.data||{},Ce=Ee.value,re=Ee.label,oe=Ee.children,de=Object(R.a)(Ee,!0),ge=ve?oe:re;return Ie?j.createElement("div",Object.assign({"aria-label":typeof ge=="string"?ge:null},de,{key:We,role:"option",id:"".concat(ue,"_list_").concat(We),"aria-selected":Te.has(Ce)}),Ce):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},He(et-1),He(et),He(et+1)),j.createElement(h.a,{itemKey:"key",ref:je,data:Oe,height:ce,itemHeight:ne,fullHeight:!1,onMouseDown:ze,onScroll:se,virtual:Fe,onMouseEnter:pe},function(We,Ie){var Ee,Ce=We.group,re=We.groupOption,oe=We.data,de=oe.label,ge=oe.key;if(Ce)return j.createElement("div",{className:p()(ye,"".concat(ye,"-group"))},de!==void 0?de:ge);var Se=oe.disabled,Ue=oe.value,Ve=oe.title,ot=oe.children,mt=oe.style,ft=oe.className,wt=Object(z.a)(oe,["disabled","value","title","children","style","className"]),St=Te.has(Ue),dt="".concat(ye,"-option"),Bt=p()(ye,dt,ft,(Ee={},Object(U.a)(Ee,"".concat(dt,"-grouped"),re),Object(U.a)(Ee,"".concat(dt,"-active"),et===Ie&&!Se),Object(U.a)(Ee,"".concat(dt,"-disabled"),Se),Object(U.a)(Ee,"".concat(dt,"-selected"),St),Ee)),Lt=ve?ot:de,qt=!ke||typeof ke=="function"||St;return j.createElement("div",Object.assign({},wt,{"aria-selected":St,className:Bt,title:Ve,onMouseMove:function(){if(et===Ie||Se)return;ut(Ie)},onClick:function(){Se||st(Ue)},style:mt}),j.createElement("div",{className:"".concat(dt,"-content")},Lt||Ue),j.isValidElement(ke)||St,qt&&j.createElement(o.a,{className:"".concat(ye,"-option-state"),customizeIcon:ke,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},l=j.forwardRef(f);l.displayName="OptionList";var u=l,s=function(){return null};s.isSelectOption=!0;var a=s,O=function(){return null};O.isSelectOptGroup=!0;var x=O,S=Q("VTBJ"),D=Q("Zm9Q");function L(g){var H=g.key,$=g.props,ae=$.children,ue=$.value,Le=Object(z.a)($,["children","value"]);return Object(S.a)({key:H,value:ue!==void 0?ue:H,children:ae},Le)}function A(g){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function($,ae){if(!j.isValidElement($)||!$.type)return null;var ue=$.type.isSelectOptGroup,Le=$.key,ve=$.props,Te=ve.children,_e=Object(z.a)(ve,["children"]);return H||!ue?L($):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Le===null?ae:Le,"__"),label:Le},_e),{},{options:A(Te)})}).filter(function($){return $})}var C=Q("2Qr1"),E=Q("qNPg"),d=Q("U8pU"),w=Q("Kwbf"),y=Q("WKfj");function b(g){var H=g.mode,$=g.options,ae=g.children,ue=g.backfill,Le=g.allowClear,ve=g.placeholder,Te=g.getInputElement,_e=g.showSearch,De=g.onSearch,he=g.defaultOpen,ce=g.autoFocus,ne=g.labelInValue,fe=g.value,le=g.inputValue,ke=g.optionLabelProp,Fe=H==="multiple"||H==="tags",Ae=_e!==void 0?_e:Fe||H==="combobox",Re=$||A(ae);if(Object(w.a)(H!=="tags"||Re.every(function(ye){return!ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Pe=Re.some(function(ye){return ye.options?ye.options.some(function(Oe){return typeof("value"in Oe?Oe.value:Oe.key)=="number"}):typeof("value"in ye?ye.value:ye.key)=="number"});Object(w.a)(!Pe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(H!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(H==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(w.a)(H==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(w.b)(H!=="combobox"||!Te||!Le||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!Ae&&H!=="combobox"&&H!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!he||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var se=Object(y.d)(fe);Object(w.a)(!ne||se.every(function(ye){return Object(d.a)(ye)==="object"&&("key"in ye||"value"in ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!Fe||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var pe=null;Object(D.a)(ae).some(function(ye){if(!j.isValidElement(ye)||!ye.type)return!1;var Oe=ye.type;if(Oe.isSelectOption)return!1;if(Oe.isSelectOptGroup){var je=Object(D.a)(ye.props.children).every(function(ze){return!j.isValidElement(ze)||!ye.type||ze.type.isSelectOption?!0:(pe=ze.type,!1)});return!je}return pe=Oe,!0}),pe&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(pe.displayName||pe.name||pe,"`.")),Object(w.a)(le===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=b,F=Object(E.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:A,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:B,fillOptionsWithMissingValue:C.a}),_=function(g){Object(P.a)($,g);var H=Object(Y.a)($);function $(){var ae;return Object(ie.a)(this,$),ae=H.apply(this,arguments),ae.selectRef=j.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(J.a)($,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),$}(j.Component);_.Option=a,_.OptGroup=x;var M=_,I=be.c=M},M8RZ:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return r});var ie=Q("fWQN"),J=Q("mtLc"),P=Q("yKVA"),Y=Q("879j"),j=Q("q1tI"),U=Q.n(j),z=Q("i8i4"),W=Q.n(z),r=function(R){Object(P.a)(m,R);var v=Object(Y.a)(m);function m(p){var h;Object(ie.a)(this,m),h=v.call(this,p);var o=window.document;return h.node=o.createElement("div"),o.body.appendChild(h.node),h}return Object(J.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(z.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(U.a.Component)},MI8n:function(nt,be,Q){"use strict";Q.d(be,"c",function(){return j}),Q.d(be,"b",function(){return r}),Q.d(be,"e",function(){return R}),Q.d(be,"a",function(){return v}),Q.d(be,"d",function(){return m}),Q.d(be,"f",function(){return p});var ie=Q("/cxE"),J=Q("pmY6"),P=Q("24hK"),Y=Q("5Y4S"),j;(function(h){h.None=()=>J.a.None;function o(b){return(B,F=null,_)=>{let M=!1,I;return I=b(g=>M?void 0:(I?I.dispose():M=!0,B.call(F,g)),null,_),M&&I.dispose(),I}}h.once=o;function f(b,B){return x((F,_=null,M)=>b(I=>F.call(_,B(I)),null,M))}h.map=f;function l(b,B){return x((F,_=null,M)=>b(I=>{B(I),F.call(_,I)},null,M))}h.forEach=l;function u(b,B){return x((F,_=null,M)=>b(I=>B(I)&&F.call(_,I),null,M))}h.filter=u;function s(b){return b}h.signal=s;function a(...b){return(B,F=null,_)=>Object(J.e)(...b.map(M=>M(I=>B.call(F,I),null,_)))}h.any=a;function O(b,B,F){let _=F;return f(b,M=>(_=B(_,M),_))}h.reduce=O;function x(b){let B;const F=new r({onFirstListenerAdd(){B=b(F.fire,F)},onLastListenerRemove(){B.dispose()}});return F.event}function S(b,B,F=100,_=!1,M){let I,g,H,$=0;const ae=new r({leakWarningThreshold:M,onFirstListenerAdd(){I=b(ue=>{$++,g=B(g,ue),_&&!H&&(ae.fire(g),g=void 0),clearTimeout(H),H=setTimeout(()=>{const Le=g;g=void 0,H=void 0,(!_||$>1)&&ae.fire(Le),$=0},F)})},onLastListenerRemove(){I.dispose()}});return ae.event}h.debounce=S;function D(b,B=(F,_)=>F===_){let F=!0,_;return u(b,M=>{const I=F||!B(M,_);return F=!1,_=M,I})}h.latch=D;function L(b,B){return[h.filter(b,B),h.filter(b,F=>!B(F))]}h.split=L;function A(b,B=!1,F=[]){let _=F.slice(),M=b(H=>{_?_.push(H):g.fire(H)});const I=()=>{_&&_.forEach(H=>g.fire(H)),_=null},g=new r({onFirstListenerAdd(){M||(M=b(H=>g.fire(H)))},onFirstListenerDidAdd(){_&&(B?setTimeout(I):I())},onLastListenerRemove(){M&&M.dispose(),M=null}});return g.event}h.buffer=A;class C{constructor(b){this.event=b}map(b){return new C(f(this.event,b))}forEach(b){return new C(l(this.event,b))}filter(b){return new C(u(this.event,b))}reduce(b,B){return new C(O(this.event,b,B))}latch(){return new C(D(this.event))}debounce(b,B=100,F=!1,_){return new C(S(this.event,b,B,F,_))}on(b,B,F){return this.event(b,B,F)}once(b,B,F){return o(this.event)(b,B,F)}}function E(b){return new C(b)}h.chain=E;function d(b,B,F=_=>_){const _=(...H)=>g.fire(F(...H)),M=()=>b.on(B,_),I=()=>b.removeListener(B,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromNodeEventEmitter=d;function w(b,B,F=_=>_){const _=(...H)=>g.fire(F(...H)),M=()=>b.addEventListener(B,_),I=()=>b.removeEventListener(B,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromDOMEventEmitter=w;function y(b){return new Promise(B=>o(b)(B))}h.toPromise=y})(j||(j={}));class U{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${U._idPool++}`}start(h){this._stopWatch=new Y.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let z=-1;class W{constructor(h,o=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let o=z;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||h<o)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
`).slice(3).join(`
`),l=this._stacks.get(f)||0;if(this._stacks.set(f,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let u,s=0;for(const[a,O]of this._stacks)(!u||s<O)&&(u=a,s=O);console.warn(`[${this.name}] potential listener LEAK detected, having ${h} listeners already. MOST frequent listener (${s}):`),console.warn(u)}return()=>{const u=this._stacks.get(f)||0;this._stacks.set(f,u-1)}}}class r{constructor(h){var o;this._disposed=!1,this._options=h,this._leakageMon=z>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(h,o,f)=>{var l;this._listeners||(this._listeners=new P.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(o?[h,o]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,o);const a=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),O=Object(J.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const x=this._listeners&&!this._listeners.isEmpty();x||this._options.onLastListenerRemove(this)}});return f instanceof J.b?f.add(O):Array.isArray(f)&&f.push(O),O}),this._event}fire(h){var o,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let l of this._listeners)this._deliveryQueue.push([l,h]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,u]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,u):l[0].call(l[1],u)}catch(s){Object(ie.f)(s)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var h,o,f,l,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(l=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||l===void 0||l.call(f),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class R extends r{constructor(h){super(h);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class v extends R{constructor(h){var o;super(h);this._delay=(o=h.delay)!==null&&o!==void 0?o:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class m{constructor(){this.buffers=[]}wrapEvent(h){return(o,f,l)=>h(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>o.call(f,u)):o.call(f,u)},void 0,l)}bufferEvents(h){const o=[];this.buffers.push(o);const f=h();return this.buffers.pop(),o.forEach(l=>l()),f}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.a.None,this.emitter=new r({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(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(nt,be,Q){"use strict";(function(ie,J){Q.d(be,"b",function(){return f}),Q.d(be,"i",function(){return a}),Q.d(be,"f",function(){return O}),Q.d(be,"d",function(){return x}),Q.d(be,"g",function(){return S}),Q.d(be,"h",function(){return D}),Q.d(be,"c",function(){return L}),Q.d(be,"k",function(){return A}),Q.d(be,"j",function(){return C}),Q.d(be,"a",function(){return E}),Q.d(be,"e",function(){return y});var P;const Y="en";let j=!1,U=!1,z=!1,W=!1,r=!1,R=!1,v=!1,m,p=Y,h,o;const f=typeof self=="object"?self:typeof ie=="object"?ie:{};let l;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?l=f.vscode.process:typeof J!="undefined"&&(l=J);const u=typeof((P=l==null?void 0:l.versions)===null||P===void 0?void 0:P.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)o=navigator.userAgent,j=o.indexOf("Windows")>=0,U=o.indexOf("Macintosh")>=0,v=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,z=o.indexOf("Linux")>=0,R=!0,m=navigator.language,p=m;else if(typeof l=="object"){j=l.platform==="win32",U=l.platform==="darwin",z=l.platform==="linux",W=z&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,m=Y,p=Y;const b=l.env.VSCODE_NLS_CONFIG;if(b)try{const B=JSON.parse(b),F=B.availableLanguages["*"];m=B.locale,p=F||Y,h=B._translationsConfigFile}catch(B){}r=!0}else console.error("Unable to resolve platform.");let s=0;U?s=1:j?s=3:z&&(s=2);const a=j,O=U,x=z,S=r,D=R,L=v,A=o,C=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let F=[];f.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,g=F.length;I<g;I++){const H=F[I];if(H.id===M.data.vscodeSetImmediateId){F.splice(I,1),H.callback();return}}});let _=0;return M=>{const I=++_;F.push({id:I,callback:M}),f.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const B=Promise.resolve();return F=>B.then(F)}(),E=U||v?2:j?1:3;let d=!0,w=!1;function y(){if(!w){w=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const B=new Uint16Array(b.buffer);d=B[0]===(2<<8)+1}return d}}).call(this,Q("IyRk"),Q("Q2Ig"))},N0LK:function(nt,be,Q){"use strict";Q.d(be,"C",function(){return ie}),Q.d(be,"v",function(){return P}),Q.d(be,"s",function(){return Y}),Q.d(be,"t",function(){return j}),Q.d(be,"U",function(){return U}),Q.d(be,"J",function(){return z}),Q.d(be,"O",function(){return W}),Q.d(be,"p",function(){return r}),Q.d(be,"T",function(){return R}),Q.d(be,"q",function(){return v}),Q.d(be,"N",function(){return m}),Q.d(be,"M",function(){return p}),Q.d(be,"Q",function(){return h}),Q.d(be,"u",function(){return o}),Q.d(be,"x",function(){return f}),Q.d(be,"I",function(){return l}),Q.d(be,"f",function(){return u}),Q.d(be,"h",function(){return s}),Q.d(be,"g",function(){return a}),Q.d(be,"i",function(){return O}),Q.d(be,"G",function(){return x}),Q.d(be,"H",function(){return S}),Q.d(be,"r",function(){return D}),Q.d(be,"R",function(){return L}),Q.d(be,"d",function(){return A}),Q.d(be,"e",function(){return C}),Q.d(be,"E",function(){return E}),Q.d(be,"F",function(){return d}),Q.d(be,"j",function(){return w}),Q.d(be,"z",function(){return y}),Q.d(be,"K",function(){return B}),Q.d(be,"L",function(){return F}),Q.d(be,"m",function(){return M}),Q.d(be,"k",function(){return g}),Q.d(be,"A",function(){return $}),Q.d(be,"a",function(){return ae}),Q.d(be,"n",function(){return ue}),Q.d(be,"l",function(){return Le}),Q.d(be,"D",function(){return ve}),Q.d(be,"B",function(){return Te}),Q.d(be,"b",function(){return _e}),Q.d(be,"S",function(){return De}),Q.d(be,"o",function(){return he}),Q.d(be,"P",function(){return ce}),Q.d(be,"w",function(){return ne}),Q.d(be,"c",function(){return fe}),Q.d(be,"y",function(){return Fe});function ie(se){return!se||typeof se!="string"?!0:se.trim().length===0}const J=/{(\d+)}/g;function P(se,...pe){return pe.length===0?se:se.replace(J,function(ye,Oe){const je=parseInt(Oe,10);return isNaN(je)||je<0||je>=pe.length?ye:pe[je]})}function Y(se){return se.replace(/[<>&]/g,function(pe){switch(pe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return pe}})}function j(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(se,pe=" "){const ye=z(se,pe);return W(ye,pe)}function z(se,pe){if(!se||!pe)return se;const ye=pe.length;if(ye===0||se.length===0)return se;let Oe=0;for(;se.indexOf(pe,Oe)===Oe;)Oe=Oe+ye;return se.substring(Oe)}function W(se,pe){if(!se||!pe)return se;const ye=pe.length,Oe=se.length;if(ye===0||Oe===0)return se;let je=Oe,ze=-1;for(;!(ze=se.lastIndexOf(pe,je-1),ze===-1||ze+ye!==je);){if(ze===0)return"";je=ze}return se.substring(0,je)}function r(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function R(se){return se.replace(/\*/g,"")}function v(se,pe,ye={}){if(!se)throw new Error("Cannot create regex from empty string");pe||(se=j(se)),ye.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Oe="";return ye.global&&(Oe+="g"),ye.matchCase||(Oe+="i"),ye.multiline&&(Oe+="m"),ye.unicode&&(Oe+="u"),new RegExp(se,Oe)}function m(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;const pe=se.exec("");return!!(pe&&se.lastIndex===0)}function p(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function h(se){return se.split(/\r\n|\r|\n/)}function o(se){for(let pe=0,ye=se.length;pe<ye;pe++){const Oe=se.charCodeAt(pe);if(Oe!==32&&Oe!==9)return pe}return-1}function f(se,pe=0,ye=se.length){for(let Oe=pe;Oe<ye;Oe++){const je=se.charCodeAt(Oe);if(je!==32&&je!==9)return se.substring(pe,Oe)}return se.substring(pe,ye)}function l(se,pe=se.length-1){for(let ye=pe;ye>=0;ye--){const Oe=se.charCodeAt(ye);if(Oe!==32&&Oe!==9)return ye}return-1}function u(se,pe){return se<pe?-1:se>pe?1:0}function s(se,pe,ye=0,Oe=se.length,je=0,ze=pe.length){for(;ye<Oe&&je<ze;ye++,je++){let rt=se.charCodeAt(ye),Ze=pe.charCodeAt(je);if(rt<Ze)return-1;if(rt>Ze)return 1}const Je=Oe-ye,Ye=ze-je;return Je<Ye?-1:Je>Ye?1:0}function a(se,pe){return O(se,pe,0,se.length,0,pe.length)}function O(se,pe,ye=0,Oe=se.length,je=0,ze=pe.length){for(;ye<Oe&&je<ze;ye++,je++){let rt=se.charCodeAt(ye),Ze=pe.charCodeAt(je);if(rt===Ze)continue;if(rt>=128||Ze>=128)return s(se.toLowerCase(),pe.toLowerCase(),ye,Oe,je,ze);x(rt)&&(rt-=32),x(Ze)&&(Ze-=32);const et=rt-Ze;if(et===0)continue;return et}const Je=Oe-ye,Ye=ze-je;return Je<Ye?-1:Je>Ye?1:0}function x(se){return se>=97&&se<=122}function S(se){return se>=65&&se<=90}function D(se,pe){return se.length===pe.length&&O(se,pe)===0}function L(se,pe){const ye=pe.length;return pe.length>se.length?!1:O(se,pe,0,ye)===0}function A(se,pe){let ye,Oe=Math.min(se.length,pe.length);for(ye=0;ye<Oe;ye++)if(se.charCodeAt(ye)!==pe.charCodeAt(ye))return ye;return Oe}function C(se,pe){let ye,Oe=Math.min(se.length,pe.length);const je=se.length-1,ze=pe.length-1;for(ye=0;ye<Oe;ye++)if(se.charCodeAt(je-ye)!==pe.charCodeAt(ze-ye))return ye;return Oe}function E(se){return 55296<=se&&se<=56319}function d(se){return 56320<=se&&se<=57343}function w(se,pe){return(se-55296<<10)+(pe-56320)+65536}function y(se,pe,ye){const Oe=se.charCodeAt(ye);if(E(Oe)&&ye+1<pe){const je=se.charCodeAt(ye+1);if(d(je))return w(Oe,je)}return Oe}function b(se,pe){const ye=se.charCodeAt(pe-1);if(d(ye)&&pe>1){const Oe=se.charCodeAt(pe-2);if(E(Oe))return w(Oe,ye)}return ye}function B(se,pe){const ye=le.getInstance(),Oe=pe,je=se.length,ze=y(se,je,pe);pe+=ze>=65536?2:1;let Je=ye.getGraphemeBreakType(ze);for(;pe<je;){const Ye=y(se,je,pe),rt=ye.getGraphemeBreakType(Ye);if(fe(Je,rt))break;pe+=Ye>=65536?2:1,Je=rt}return pe-Oe}function F(se,pe){const ye=le.getInstance(),Oe=pe,je=b(se,pe);pe-=je>=65536?2:1;let ze=ye.getGraphemeBreakType(je);for(;pe>0;){const Je=b(se,pe),Ye=ye.getGraphemeBreakType(Je);if(fe(Ye,ze))break;pe-=Je>=65536?2:1,ze=Ye}return Oe-pe}const _=/(?:[\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 M(se){return _.test(se)}const I=/(?:[\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 g(se){return I.test(se)}const H=/^[\t\n\r\x20-\x7E]*$/;function $(se){return H.test(se)}const ae=/[\u2028\u2029]/;function ue(se){return ae.test(se)}function Le(se){for(let pe=0,ye=se.length;pe<ye;pe++)if(ve(se.charCodeAt(pe)))return!0;return!1}function ve(se){return se=+se,se>=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function Te(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const _e=String.fromCharCode(65279);function De(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function he(se,pe=!1){return se?(pe&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function ce(se){const pe=90-65+1;return se=se%(2*pe),se<pe?String.fromCharCode(97+se):String.fromCharCode(65+se-pe)}function ne(se){const pe=le.getInstance();return pe.getGraphemeBreakType(se)}function fe(se,pe){return se===0?pe!==5&&pe!==7:se===2&&pe===3?!1:se===4||se===2||se===3||(pe===4||pe===2||pe===3)?!0:se===8&&(pe===8||pe===9||pe===11||pe===12)||((se===11||se===9)&&(pe===9||pe===10)||((se===12||se===10)&&pe===10||(pe===5||pe===13||(pe===7||(se===1||se===13&&pe===14)))))?!1:!(se===6&&pe===6)}class le{constructor(){this._data=ke()}static getInstance(){return le._INSTANCE||(le._INSTANCE=new le),le._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const pe=this._data,ye=pe.length/3;let Oe=1;for(;Oe<=ye;)if(se<pe[3*Oe])Oe=2*Oe;else if(se>pe[3*Oe+1])Oe=2*Oe+1;else return pe[3*Oe+2];return 0}}le._INSTANCE=null;function ke(){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 Fe(se,pe){if(se===0)return 0;const ye=Ae(se,pe);if(ye!==void 0)return ye;const Oe=b(pe,se);return se-=Re(Oe),se}function Ae(se,pe){let ye=b(pe,se);for(se-=Re(ye);Pe(ye)||ye===65039||ye===8419;){if(se===0)return;ye=b(pe,se),se-=Re(ye)}if(!Te(ye))return;if(se>=0){const Oe=b(pe,se);Oe===8205&&(se-=Re(Oe))}return se}function Re(se){return se>=65536?2:1}function Pe(se){return 127995<=se&&se<=127999}},Ot1p:function(nt,be,Q){"use strict";var ie=Q("2qtc"),J=Q("kLXV"),P=Q("rAM+"),Y=Q("miYZ"),j=Q("tsqr"),U=Q("9og8"),z=Q("tJVT"),W=Q("jrin"),r=Q("WmNS"),R=Q.n(r),v=Q("q1tI"),m=Q.n(v),p=Q("VrN/"),h=Q.n(p),o=Q("bdgK"),f=Q("p77/"),l=Q("Bd2K"),u=Q("ELLl"),s=Q("19Vz"),a=Q("lZu9"),O=Q("+NIl"),x=Q("kSUc"),S=Q("9Bee"),D=function(Se){var Ue=Se.value,Ve=Ue===void 0?"":Ue,ot=Se.className,mt=Se.showTextOnly,ft=Se.showLines,wt=Se.style,St=wt===void 0?{}:wt,dt=Object(v.useMemo)(function(){return""},[Ve]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},L=Q("0Owb"),A=Q("dejd"),C=Q("C+DQ"),E=Q("1vsH"),d=Q("m3rI"),w=[{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 y(Se){var Ue=Se.onActionCallback,Ve=Se.title,ot=Se.icon,mt=Se.actionName,ft=Se.className,wt=ft===void 0?"":ft,St=Se.children;function dt(){Ue(mt)}return m.a.createElement("a",{title:Ve,className:wt,onClick:dt},m.a.createElement("i",{className:"md-iconfont ".concat(ot)}),St)}var b=function(Se){var Ue=Se.watch,Ve=Se.showNullButton,ot=Se.onActionCallback,mt=Se.fullScreen,ft=Se.insertTemp,wt=Se.hidetoolBar,St=Se.uuid,dt=Se.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(E.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var Bt=[].concat(w,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Bt.map(function(Lt,qt){return m.a.createElement("li",{key:qt},Lt.actionName?m.a.createElement(y,Object(L.a)({},Lt,{onActionCallback:ot})):m.a.createElement("span",{className:"v-line"}))}),Ve?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:ot},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},B=Q("M8RZ"),F=Q("+L6B"),_=Q("2/Rp"),M=Q("y8nQ"),I=Q("Vl3Y"),g=Q("5NDa"),H=Q("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},ae=function(Se){var Ue=Se.callback,Ve=Se.onCancel;function ot(mt){Ue(mt)}return m.a.createElement(I.a,Object(L.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(H.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(H.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))},ue=Q("7ahc"),Le=Q("HmJG"),ve=Q("BjJ7"),Te=I.a.useForm,_e={width:280,marginRight:10},De={labelCol:{span:5},wrapperCol:{span:19}},he=function(Se){var Ue=Se.callback,Ve=Se.onCancel,ot=Te(),mt=Object(z.a)(ot,1),ft=mt[0];function wt(Bt){Ue(Bt)}function St(Bt,Lt){if(Bt.status===-1){j.b.error(Bt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Bt.id),type:Lt.type})}function dt(Bt){var Lt=Bt.target.files[0];ne(Lt,St)}return m.a.createElement(I.a,Object(L.a)({form:ft},De,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(H.a,{style:_e})),m.a.createElement(ce,{onFileChange:dt}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(H.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))};function ce(Se){var Ue=Se.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ue}))}function ne(Se,Ue){if(!Se)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ve=new FormData;Ve.append("editormd-image-file",Se),Ve.append("file_param_name","editormd-image-file"),Ve.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(mt){Ue(JSON.parse(mt.target.responseText),Se)},!1),ot.addEventListener("error",function(mt){console.error(mt)},!1),ot.open("POST","".concat(ve.a,"/api/attachments.json")),ot.send(Ve)}var fe=Q("giR+"),le=Q("fyUT"),ke=Q("7Kak"),Fe=Q("9yH6"),Ae=Fe.a.Group,Re={margin:"0 8px"},Pe=function(Se){var Ue=Se.callback,Ve=Se.onCancel;function ot(mt){Ue(mt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Re},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Re},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(le.a,null)),m.a.createElement("span",{style:Re},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(le.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Re},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Ae,null,m.a.createElement(Fe.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Fe.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Fe.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Fe.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))},se=Q("ErOA"),pe=Q("7Cbv"),ye="link",Oe="upload-image",je="code-block",ze="add-table",Je="------------",Ye={default:Je,left:":".concat(Je),center:":".concat(Je,":"),right:"".concat(Je,":")},rt=Q("9VGf"),Ze,et;function Be(){}var ut=0,st=1e4,He="\u2581",We=`
**\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 Ie(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}var Ee=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ce=Ee?"Cmd":"Ctrl",re=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],oe=(Ze={},Object(W.a)(Ze,Ce+"-B","bold"),Object(W.a)(Ze,Ce+"-I","italic"),Ze),de=(et={},Object(W.a)(et,ye,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(et,je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(et,Oe,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(et,ze,"\u6DFB\u52A0\u8868\u683C"),et),ge=be.a=function(Se){var Ue=Se.defaultValue,Ve=Ue===void 0?"":Ue,ot=Se.onChange,mt=Se.width,ft=mt===void 0?"100%":mt,wt=Se.height,St=wt===void 0?400:wt,dt=Se.miniToolbar,Bt=dt===void 0?!1:dt,Lt=Se.isFocus,qt=Lt===void 0?!1:Lt,Qt=Se.watch,It=Se.insertTemp,Cr=Se.mode,zr=Cr===void 0?"markdown":Cr,yt=Se.id,Lr=yt===void 0?"markdown-editor-id":yt,bt=Se.showResizeBar,xt=bt===void 0?!1:bt,Ft=Se.noStorage,tr=Ft===void 0?!1:Ft,dr=Se.showNullButton,Pt=dr===void 0?!1:dr,ct=Se.hidetoolBar,Br=ct===void 0?!1:ct,Vt=Se.fullScreen,Jt=Vt===void 0?!1:Vt,Ot=Se.onBlur,lr=Se.onCMBeforeChange,Ir=Se.onFullScreen,Yr=Se.className,Qe=Yr===void 0?"":Yr,Ct=Se.disablePaste,mn=Ct===void 0?!1:Ct,gn=Se.placeholder,vn=gn===void 0?"":gn,yn=Se.values,X=yn===void 0?"":yn,T=Object(v.useState)(null),k=Object(z.a)(T,2),G=k[0],ee=k[1],V=Object(v.useState)(Ve),we=Object(z.a)(V,2),Ke=we[0],tt=we[1],pt=Object(v.useState)(Qt),Xe=Object(z.a)(pt,2),_t=Xe[0],jt=Xe[1],$t=Object(v.useState)(Jt),jr=Object(z.a)($t,2),Er=jr[0],xr=jr[1],Qr=Object(v.useState)(""),Dn=Object(z.a)(Qr,2),cr=Dn[0],Kr=Dn[1],un=Object(v.useState)(0),hn=Object(z.a)(un,2),Hr=hn[0],kn=hn[1],bn=Object(v.useState)(St),Kn=Object(z.a)(bn,2),Vn=Kn[0],Zr=Kn[1],$r=Object(v.useState)(!1),_n=Object(z.a)($r,2),di=_n[0],En=_n[1],nr=Object(v.useRef)(Object(pe.a)()),Ht=Object(v.useRef)(!1),yr=Object(v.useRef)(),kt=Object(v.useRef)(),ar=Object(v.useRef)(),zt=Object(v.useRef)(),nn=Object(v.useRef)(),fr=function(){var gt=Object(U.a)(R.a.mark(function At(){var Et,Dt;return R.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Xt.next=2,Object(se.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:nr.current}});case 2:Dt=Xt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",G,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?G.replaceSelection("![,](/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?G.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?G.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):G.replaceSelection("[".concat(Nt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Xt.stop()}},At)}));return function(){return gt.apply(this,arguments)}}();Object(v.useEffect)(function(){tt(X),G==null||G.setValue(X)},[X]),Object(v.useEffect)(function(){Ir==null||Ir(Er)},[Er]),Object(v.useEffect)(function(){if(kt.current){var gt=h.a.fromTextArea(kt.current,{mode:zr,lineNumbers:!Bt,lineWrapping:!0,value:Ve,autoCloseTags:!0,autoCloseBrackets:!0});qt&&gt.focus();function At(Et,Dt){if(mn){Dt.preventDefault();return}var Ut=Dt.clipboardData;if(Ut){var Xt=Ut.types.toString(),Nt=Ut.items;if(Xt==="Files"||Ut.types.indexOf("Files")>-1){if(Dt.preventDefault(),zr=="stex")return;try{var ur,Dr=Nt[1];((ur=Nt[0])===null||ur===void 0?void 0:ur.kind)==="file"&&(Dr=Nt[0]);var Mt=Dr.getAsFile(),dn=Mt.name.split(".").pop();ne(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):re.includes(dn)?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",At),gt.on("dragleave",function(Et,Dt){ar.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ar.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ar.current.classList.add("mouse-hover-md");var Ut;if(Ut=Dt.dataTransfer.files,Ut.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Xt=function(Dr){var Mt=Ut[Dr],dn=Mt.name.split(".").pop();ne(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):re.includes(dn)?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):gt.replaceSelection("[".concat(Mt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt<Ut.length;Nt++)Xt(Nt)}}),ee(gt),function(){gt.off("paste",At)}}},[]);var Ar=Object(v.useCallback)(function(){if(ar.current)try{}catch(gt){console.log(gt,"---- to set md editor body height")}},[Vn,ar,Er]);Object(v.useEffect)(function(){function gt(){var Et=new o.default(function(Dt){var Ut=Object(P.a)(Dt),Xt;try{for(Ut.s();!(Xt=Ut.n()).done;){var Nt=Xt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Ar(),G.setSize("100%","100%"),G.refresh())}}catch(ur){Ut.e(ur)}finally{Ut.f()}});return Et.observe(kt.current.parentElement),Et}if(G){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[G,Ar]),Object(v.useEffect)(function(){if(G){for(var gt=[],At=function(){var Nt=Dt[Et];Ut=Object(z.a)(Nt,2);var ur=Ut[0],Dr=Ut[1],Mt=Object(W.a)({},ur,function(){Xn(Dr)});gt.push(Mt),G.addKeyMap(Mt)},Et=0,Dt=Object.entries(oe);Et<Dt.length;Et++){var Ut;At()}return yr.current=setInterval(function(){Ht.current&&fr()},4e3),function(){clearInterval(yr.current);var Xt=Object(P.a)(gt),Nt;try{for(Xt.s();!(Nt=Xt.n()).done;){var ur=Nt.value;G.removeKeyMap(ur)}}catch(Dr){Xt.e(Dr)}finally{Xt.f()}}}},[G]),Object(v.useEffect)(function(){Jt!==Er&&xr(Jt)},[Jt]),Object(rt.a)(function(){if(!tr&&Hr>0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Lr);gt>=Hr+st&&(!At||At!==Ke)&&(window.sessionStorage.setItem(Lr,Ke),En(!0))}},st),Object(v.useEffect)(function(){jt(Qt)},[G,Qt]),Object(v.useEffect)(function(){G&&(qt&&G.focus())},[G,qt]),Object(v.useEffect)(function(){if(_t&&G){var gt=G.getScrollerElement();function At(Et){var Dt=Et.target;if(nn.current){var Ut=Dt.scrollTop/Dt.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Ut}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[G,_t]),Object(v.useEffect)(function(){if(G&&lr){function gt(At,Et){lr(At,Et)}return G.on("beforeChange",gt),function(){G.off("beforeChange",gt)}}},[G,lr]),Object(v.useEffect)(function(){if(G&&Ot){function gt(){Ot(G.getValue())}return G.on("blur",gt),function(){G.off("blur",gt)}}},[G,Ot]),Object(v.useEffect)(function(){if(G){function gt(At){var Et=At.getValue();tt(Et),kn(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(Et)}return G.on("change",gt),function(){G.off("change",gt)}}},[G,ot]),Object(v.useEffect)(function(){G&&(Ve==null?(G.setValue(""),tt("")):Ve!==G.getValue()&&(G.setValue(Ve),tt(Ve),G.setCursor(G.lineCount(),0)))},[G,Ve]);var Xn=Object(v.useCallback)(function(gt){var At=G.getCursor(),Et=G.getSelection(),Dt=Et.split(`
`);switch(gt){case"bold":return G.replaceSelection("**"+Et+"**"),Et===""&&G.setCursor(At.line,At.ch+2),G.focus();case"italic":return G.replaceSelection("*"+Et+"*"),Et===""&&G.setCursor(At.line,At.ch+1),G.focus();case"code":return G.replaceSelection("`"+Et+"`"),Et===""&&G.setCursor(At.line,At.ch+1),G.focus();case"inline-latex":return G.replaceSelection("`$$"+Et+"$$`"),Et===""&&G.setCursor(At.line,At.ch+3),G.focus();case"latex":return G.replaceSelection("```latex\n"+Et+"\n```"),G.setCursor(At.line+1,Et.length+1),G.focus();case"line-break":return G.replaceSelection(`<br/>
`),G.focus();case"list-ul":return Et===""?G.replaceSelection("- "+Et):G.replaceSelection(Dt.map(function(Ut){return Ut===""?"":"- ".concat(Ut)}).join(`
`)),G.focus();case"list-ol":return Et===""?G.replaceSelection("1. "+Et):G.replaceSelection(Dt.map(function(Ut,Xt){return Ut===""?"":"".concat(Xt+1,". ").concat(Ut)}).join(`
`)),G.focus();case"add-null-ch":return Et===""&&G.setCursor(At.line,At.ch+1),G.replaceSelection(He),G.focus();case"inster-template-1":return Et===""&&G.setCursor(At.line,At.ch),G.replaceSelection(We),G.focus();case"eraser":return G.setValue(""),G.focus();case"trigger-watch":return jt(!_t),G.focus();case"trigger-full-screen":return xr(!Er),G.focus();case ye:Kr(ye);return;case je:Kr(je);return;case Oe:Kr(Oe);return;case ze:Kr(ze);return;default:throw new Error}},[G,_t,Er]),xn=Object(v.useCallback)(function(gt){Kr("");switch(cr){case ye:var At=gt.title,Et=gt.link;return G.replaceSelection("[".concat(At,"](").concat(Et,")")),G.focus();case je:var Dt=gt.language,Ut=gt.content;return G.replaceSelection(["```"+Dt,Ut,"```"].join(`
`)),G.focus();case Oe:var Xt=gt.src,Nt=gt.alt;return Nt?G.replaceSelection("![ ".concat(Nt," ]( ").concat(Xt,' "').concat(Nt,'" )')):G.replaceSelection("![,](".concat(Xt,")")),G.focus();case ze:for(var ur=gt.row,Dr=gt.col,Mt=gt.align,dn=`
`,Wt=0;Wt<ur;Wt++){for(var kr=[],Tr=[],Jr=0;Jr<Dr;Jr++)Wt===1&&Tr.push(Ye[Mt]),kr.push(" ");Wt===1&&(dn+="| ".concat(Tr.join(" | "),` |
`)),dn+="| ".concat(kr.join(Dr===1?"":" | "),` |
`)}return G.replaceSelection(dn+`
`),G.focus();default:throw new Error}},[G,cr]),ci=Object(v.useMemo)(function(){switch(cr){case ye:return m.a.createElement(ae,{callback:xn,onCancel:Tn});case je:return m.a.createElement(ue.b,{callback:xn,onCancel:Tn});case Oe:return m.a.createElement(he,{callback:xn,onCancel:Tn});case ze:return m.a.createElement(Pe,{callback:xn,onCancel:Tn});default:return null}},[cr]);function Tn(){Kr("")}Object(v.useEffect)(function(){if(zt.current){var gt=zt.current,At=!1,Et=0;function Dt(Nt){At=!0,Et=Nt.pageY}function Ut(){At=!1}function Xt(Nt){if(At){var ur=Nt.pageY-Et;ur<0&&(ur=0),ur>300&&(ur=300);var Dr=St+ur+"px";Zr(Dr)}}return gt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Xt),document.addEventListener("mouseup",Ut),function(){gt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Xt),document.removeEventListener("mouseup",Ut)}}},[G,zt]),Object(v.useEffect)(function(){Zr(St)},[St]);var an=Ie(ft),fi=Ie(Vn),qr={width:an,height:fi},pi=Object(v.useMemo)(function(){if(Hr){var gt=new Date(Hr),At=gt.getHours(),Et=gt.getMinutes(),Dt=gt.getSeconds();return At=At<10?"0"+At:At,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(Et,":").concat(Dt)}return 0},[Hr]);function ji(){window.sessionStorage.removeItem(Lr),En(!1),kn(0)}function Mn(){En(!1),kn(0),G.setValue(window.sessionStorage.getItem(Lr))}function ua(gt,At){var Et=G.getValue();Et=Et.replace(gt,At),tt(Et),G==null||G.setValue(Et)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},m.a.createElement("div",{className:"markdown-editor-container ".concat(Qe," ").concat(_t?"on-preview":""," ").concat(Bt?"mini":""," ").concat(Er?"full-screen":""),style:qr},m.a.createElement(b,{insertTemp:It,watch:_t,fullScreen:Er,showNullButton:Pt,onActionCallback:Xn,hidetoolBar:Br,uuid:nr.current,setOpenPhones:function(){Ht.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:kt,placeholder:vn})),_t?m.a.createElement("div",{ref:nn,className:"preview-container"},zr==="stex"&&m.a.createElement(D,{value:Ke}),zr!=="stex"&&m.a.createElement(S.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:zt,className:"editor-resize"}):null,m.a.createElement(B.a,null,de[cr]?m.a.createElement(J.a,{centered:!0,title:de[cr],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},ci):null))}},SJMd:function(nt,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 Q,ie,J,P=!1,Y,j;window.PR_SHOULD_USE_CONTINUATION=!0;var U,z;(function(){var W=window,r=["break,continue,do,else,for,if,return,while"],R=[r,"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"],v=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"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"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[v,"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",u=[r,"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"],s=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[m,h,p,f,l,u,s,a],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",D="kwd",L="com",A="typ",C="lit",E="pun",d="pln",w="tag",y="dec",b="src",B="atn",F="atv",_="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Ae){for(var Re=0,Pe=!1,se=!1,pe=0,ye=Ae.length;pe<ye;++pe){var Oe=Ae[pe];if(Oe.ignoreCase)se=!0;else if(/[a-z]/i.test(Oe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Pe=!0,se=!1;break}}var je={b:8,t:9,n:10,v:11,f:12,r:13};function ze(et){var Be=et.charCodeAt(0);if(Be!==92)return Be;var ut=et.charAt(1);return Be=je[ut],Be||("0"<=ut&&ut<="7"?parseInt(et.substring(1),8):ut==="u"||ut==="x"?parseInt(et.substring(2),16):et.charCodeAt(1))}function Je(et){if(et<32)return(et<16?"\\x0":"\\x")+et.toString(16);var Be=String.fromCharCode(et);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function Ye(et){var Be=et.substring(1,et.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")),ut=[],st=Be[0]==="^",He=["["];st&&He.push("^");for(var We=st?1:0,Ie=Be.length;We<Ie;++We){var Ee=Be[We];if(/\\[bdsw]/i.test(Ee))He.push(Ee);else{var Ce=ze(Ee),re;We+2<Ie&&Be[We+1]==="-"?(re=ze(Be[We+2]),We+=2):re=Ce,ut.push([Ce,re]),re<65||Ce>122||(re<65||Ce>90||ut.push([Math.max(65,Ce)|32,Math.min(re,90)|32]),re<97||Ce>122||ut.push([Math.max(97,Ce)&~32,Math.min(re,122)&~32]))}}ut.sort(function(Se,Ue){return Se[0]-Ue[0]||Ue[1]-Se[1]});for(var oe=[],de=[],We=0;We<ut.length;++We){var ge=ut[We];ge[0]<=de[1]+1?de[1]=Math.max(de[1],ge[1]):oe.push(de=ge)}for(var We=0;We<oe.length;++We){var ge=oe[We];He.push(Je(ge[0])),ge[1]>ge[0]&&(ge[1]+1>ge[0]&&He.push("-"),He.push(Je(ge[1])))}return He.push("]"),He.join("")}function rt(et){for(var Be=et.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")),ut=Be.length,st=[],He=0,We=0;He<ut;++He){var Ie=Be[He];if(Ie==="(")++We;else if(Ie.charAt(0)==="\\"){var Ee=+Ie.substring(1);Ee&&(Ee<=We?st[Ee]=-1:Be[He]=Je(Ee))}}for(var He=1;He<st.length;++He)st[He]===-1&&(st[He]=++Re);for(var He=0,We=0;He<ut;++He){var Ie=Be[He];if(Ie==="(")++We,st[We]||(Be[He]="(?:");else if(Ie.charAt(0)==="\\"){var Ee=+Ie.substring(1);Ee&&Ee<=We&&(Be[He]="\\"+st[Ee])}}for(var He=0;He<ut;++He)Be[He]==="^"&&Be[He+1]!=="^"&&(Be[He]="");if(et.ignoreCase&&Pe)for(var He=0;He<ut;++He){var Ie=Be[He],Ce=Ie.charAt(0);Ie.length>=2&&Ce==="["?Be[He]=Ye(Ie):Ce!=="\\"&&(Be[He]=Ie.replace(/[a-zA-Z]/g,function(de){var ge=de.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Be.join("")}for(var Ze=[],pe=0,ye=Ae.length;pe<ye;++pe){var Oe=Ae[pe];if(Oe.global||Oe.multiline)throw new Error(""+Oe);Ze.push("(?:"+rt(Oe)+")")}return new RegExp(Ze.join("|"),se?"gi":"g")}function g(Ae,Re){var Pe=/(?:^|\s)nocode(?:\s|$)/,se=[],pe=0,ye=[],Oe=0;function je(ze){var Je=ze.nodeType;if(Je==1){if(Pe.test(ze.className))return;for(var Ye=ze.firstChild;Ye;Ye=Ye.nextSibling)je(Ye);var rt=ze.nodeName.toLowerCase();(rt==="br"||rt==="li")&&(se[Oe]=`
`,ye[Oe<<1]=pe++,ye[Oe++<<1|1]=ze)}else if(Je==3||Je==4){var Ze=ze.nodeValue;Ze.length&&(Re?Ze=Ze.replace(/\r\n?/g,`
`):Ze=Ze.replace(/[ \t\r\n]+/g," "),se[Oe]=Ze,ye[Oe<<1]=pe,pe+=Ze.length,ye[Oe++<<1|1]=ze)}}return je(Ae),{sourceCode:se.join("").replace(/\n$/,""),spans:ye}}function H(Ae,Re,Pe,se,pe){if(!Pe)return;var ye={sourceNode:Ae,pre:1,langExtension:null,numberLines:null,sourceCode:Pe,spans:null,basePos:Re,decorations:null};se(ye),pe.push.apply(pe,ye.decorations)}var $=/\S/;function ae(Ae){for(var Re=void 0,Pe=Ae.firstChild;Pe;Pe=Pe.nextSibling){var se=Pe.nodeType;Re=se===1?Re?Ae:Pe:se===3&&$.test(Pe.nodeValue)?Ae:Re}return Re===Ae?void 0:Re}function ue(Ae,Re){var Pe={},se;(function(){for(var Oe=Ae.concat(Re),je=[],ze={},Je=0,Ye=Oe.length;Je<Ye;++Je){var rt=Oe[Je],Ze=rt[3];if(Ze)for(var et=Ze.length;--et>=0;)Pe[Ze.charAt(et)]=rt;var Be=rt[1],ut=""+Be;ze.hasOwnProperty(ut)||(je.push(Be),ze[ut]=null)}je.push(/[\0-\uffff]/),se=I(je)})();var pe=Re.length,ye=function(Oe){for(var je=Oe.sourceCode,ze=Oe.basePos,Je=Oe.sourceNode,Ye=[ze,d],rt=0,Ze=je.match(se)||[],et={},Be=0,ut=Ze.length;Be<ut;++Be){var st=Ze[Be],He=et[st],We=void 0,Ie;if(typeof He=="string")Ie=!1;else{var Ee=Pe[st.charAt(0)];if(Ee)We=st.match(Ee[1]),He=Ee[0];else{for(var Ce=0;Ce<pe;++Ce)if(Ee=Re[Ce],We=st.match(Ee[1]),We){He=Ee[0];break}We||(He=d)}Ie=He.length>=5&&He.substring(0,5)==="lang-",Ie&&!(We&&typeof We[1]=="string")&&(Ie=!1,He=b),Ie||(et[st]=He)}var re=rt;if(rt+=st.length,!Ie)Ye.push(ze+re,He);else{var oe=We[1],de=st.indexOf(oe),ge=de+oe.length;We[2]&&(ge=st.length-We[2].length,de=ge-oe.length);var Se=He.substring(5);H(Je,ze+re,st.substring(0,de),ye,Ye),H(Je,ze+re+de,oe,ce(Se,oe),Ye),H(Je,ze+re+ge,st.substring(ge),ye,Ye)}}Oe.decorations=Ye};return ye}function Le(Ae){var Re=[],Pe=[];Ae.tripleQuotedStrings?Re.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ae.multiLineStrings?Re.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ae.verbatimStrings&&Pe.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var se=Ae.hashComments;se&&(Ae.cStyleComments?(se>1?Re.push([L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Pe.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([L,/^#[^\r\n]*/,null,"#"])),Ae.cStyleComments&&(Pe.push([L,/^\/\/[^\r\n]*/,null]),Pe.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var pe=Ae.regexLiterals;if(pe){var ye=pe>1?"":`
\r`,Oe=ye?".":"[\\S\\s]",je="/(?=[^/*"+ye+"])(?:[^/\\x5B\\x5C"+ye+"]|\\x5C"+Oe+"|\\x5B(?:[^\\x5C\\x5D"+ye+"]|\\x5C"+Oe+")*(?:\\x5D|$))+/";Pe.push(["lang-regex",RegExp("^"+M+"("+je+")")])}var ze=Ae.types;ze&&Pe.push([A,ze]);var Je=(""+Ae.keywords).replace(/^ | $/g,"");Je.length&&Pe.push([D,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([d,/^\s+/,null,` \r
\xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return Ae.regexLiterals&&(Ye+="(?!s*/)"),Pe.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[E,new RegExp(Ye),null]),ue(Re,Pe)}var ve=Le({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(Ae,Re,Pe){for(var se=/(?:^|\s)nocode(?:\s|$)/,pe=/\r\n?|\n/,ye=Ae.ownerDocument,Oe=ye.createElement("li");Ae.firstChild;)Oe.appendChild(Ae.firstChild);var je=[Oe];function ze(Be){var ut=Be.nodeType;if(ut==1&&!se.test(Be.className))if(Be.nodeName==="br")Je(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var st=Be.firstChild;st;st=st.nextSibling)ze(st);else if((ut==3||ut==4)&&Pe){var He=Be.nodeValue,We=He.match(pe);if(We){var Ie=He.substring(0,We.index);Be.nodeValue=Ie;var Ee=He.substring(We.index+We[0].length);if(Ee){var Ce=Be.parentNode;Ce.insertBefore(ye.createTextNode(Ee),Be.nextSibling)}Je(Be),Ie||Be.parentNode.removeChild(Be)}}}function Je(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function ut(We,Ie){var Ee=Ie?We.cloneNode(!1):We,Ce=We.parentNode;if(Ce){var re=ut(Ce,1),oe=We.nextSibling;re.appendChild(Ee);for(var de=oe;de;de=oe)oe=de.nextSibling,re.appendChild(de)}return Ee}for(var st=ut(Be.nextSibling,0),He;(He=st.parentNode)&&He.nodeType===1;)st=He;je.push(st)}for(var Ye=0;Ye<je.length;++Ye)ze(je[Ye]);Re===(Re|0)&&je[0].setAttribute("value",Re);var rt=ye.createElement("ol");rt.className="linenums";for(var Ze=Math.max(0,Re-1|0)||0,Ye=0,et=je.length;Ye<et;++Ye)Oe=je[Ye],Oe.className="L"+(Ye+Ze)%10,Oe.firstChild||Oe.appendChild(ye.createTextNode("\xA0")),rt.appendChild(Oe);Ae.appendChild(rt)}function _e(Ae){var Re=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Re=Re&&+Re[1]<=8;var Pe=/\n/g,se=Ae.sourceCode,pe=se.length,ye=0,Oe=Ae.spans,je=Oe.length,ze=0,Je=Ae.decorations,Ye=Je.length,rt=0;Je[Ye]=pe;var Ze,et;for(et=Ze=0;et<Ye;)Je[et]!==Je[et+2]?(Je[Ze++]=Je[et++],Je[Ze++]=Je[et++]):et+=2;for(Ye=Ze,et=Ze=0;et<Ye;){for(var Be=Je[et],ut=Je[et+1],st=et+2;st+2<=Ye&&Je[st+1]===ut;)st+=2;Je[Ze++]=Be,Je[Ze++]=ut,et=st}Ye=Je.length=Ze;var He=Ae.sourceNode,We="";He&&(We=He.style.display,He.style.display="none");try{for(var Ie=null;ze<je;){var Ee=Oe[ze],Ce=Oe[ze+2]||pe,re=Je[rt+2]||pe,st=Math.min(Ce,re),oe=Oe[ze+1],de;if(oe.nodeType!==1&&(de=se.substring(ye,st))){Re&&(de=de.replace(Pe,"\r")),oe.nodeValue=de;var ge=oe.ownerDocument,Se=ge.createElement("span");Se.className=Je[rt+1];var Ue=oe.parentNode;Ue.replaceChild(Se,oe),Se.appendChild(oe),ye<Ce&&(Oe[ze+1]=oe=ge.createTextNode(se.substring(st,Ce)),Ue.insertBefore(oe,Se.nextSibling))}ye=st,ye>=Ce&&(ze+=2),ye>=re&&(rt+=2)}}finally{He&&(He.style.display=We)}}var De={};function he(Ae,Re){for(var Pe=Re.length;--Pe>=0;){var se=Re[Pe];De.hasOwnProperty(se)?W.console&&console.warn("cannot override language handler %s",se):De[se]=Ae}}function ce(Ae,Re){return Ae&&De.hasOwnProperty(Ae)||(Ae=/^\s*</.test(Re)?"default-markup":"default-code"),De[Ae]}he(ve,["default-code"]),he(ue([],[[d,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),he(ue([[d,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),he(ue([],[[F,/^[\s\S]+/]]),["uq.val"]),he(Le({keywords:m,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),he(Le({keywords:"null,true,false"}),["json"]),he(Le({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),he(Le({keywords:p,cStyleComments:!0}),["java"]),he(Le({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(Le({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(Le({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(Le({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(Le({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(Le({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(ue([],[[S,/^[\s\S]+/]]),["regex"]);function ne(Ae){var Re=Ae.langExtension;try{var Pe=g(Ae.sourceNode,Ae.pre),se=Pe.sourceCode;Ae.sourceCode=se,Ae.spans=Pe.spans,Ae.basePos=0,ce(Re,se)(Ae),_e(Ae)}catch(pe){W.console&&console.log(pe&&pe.stack||pe)}}function fe(Ae,Re,Pe){var se=Pe||!1,pe=Re||null,ye=document.createElement("div");ye.innerHTML="<pre>"+Ae+"</pre>",ye=ye.firstChild,se&&Te(ye,se,!0);var Oe={langExtension:pe,numberLines:se,sourceNode:ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(Oe),ye.innerHTML}function le(Ae,Re){var Pe=Re||document.body,se=Pe.ownerDocument||document;function pe(Ee){return Pe.getElementsByTagName(Ee)}for(var ye=[pe("pre"),pe("code"),pe("xmp")],Oe=[],je=0;je<ye.length;++je)for(var ze=0,Je=ye[je].length;ze<Je;++ze)Oe.push(ye[je][ze]);ye=null;var Ye=Date;Ye.now||(Ye={now:function(){return+new Date}});var rt=0,Ze=/\blang(?:uage)?-([\w.]+)(?!\S)/,et=/\bprettyprint\b/,Be=/\bprettyprinted\b/,ut=/pre|xmp/i,st=/^code$/i,He=/^(?:pre|code|xmp)$/i,We={};function Ie(){for(var Ee=W.PR_SHOULD_USE_CONTINUATION?Ye.now()+250:Infinity;rt<Oe.length&&Ye.now()<Ee;rt++){for(var Ce=Oe[rt],re=We,oe=Ce;oe=oe.previousSibling;){var de=oe.nodeType,ge=(de===7||de===8)&&oe.nodeValue;if(ge?!/^\??prettify\b/.test(ge):de!==3||/\S/.test(oe.nodeValue))break;if(ge){re={},ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Qt,It,Cr){re[It]=Cr});break}}var Se=Ce.className;if((re!==We||et.test(Se))&&!Be.test(Se)){for(var Ue=!1,Ve=Ce.parentNode;Ve;Ve=Ve.parentNode){var ot=Ve.tagName;if(He.test(ot)&&Ve.className&&et.test(Ve.className)){Ue=!0;break}}if(!Ue){Ce.className+=" prettyprinted";var mt=re.lang;if(!mt){mt=Se.match(Ze);var ft;!mt&&(ft=ae(Ce))&&st.test(ft.tagName)&&(mt=ft.className.match(Ze)),mt&&(mt=mt[1])}var wt;if(ut.test(Ce.tagName))wt=1;else{var St=Ce.currentStyle,dt=se.defaultView,Bt=St?St.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(Ce,null).getPropertyValue("white-space"):0;wt=Bt&&Bt.substring(0,3)==="pre"}var Lt=re.linenums;(Lt=Lt==="true"||+Lt)||(Lt=Se.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&Te(Ce,Lt,wt);var qt={langExtension:mt,sourceNode:Ce,numberLines:Lt,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};ne(qt)}}}rt<Oe.length?W.setTimeout(Ie,250):typeof Ae=="function"&&Ae()}Ie()}var ke=W.PR={createSimpleLexer:ue,registerLangHandler:he,sourceDecorator:Le,PR_ATTRIB_NAME:B,PR_ATTRIB_VALUE:F,PR_COMMENT:L,PR_DECLARATION:y,PR_KEYWORD:D,PR_LITERAL:C,PR_NOCODE:_,PR_PLAIN:d,PR_PUNCTUATION:E,PR_SOURCE:b,PR_STRING:S,PR_TAG:w,PR_TYPE:A,prettyPrintOne:P?W.prettyPrintOne=fe:U=fe,prettyPrint:z=P?W.prettyPrint=le:z=le},Fe=W.define;typeof Fe=="function"&&Fe.amd&&Fe("google-code-prettify",[],function(){return ke})})()},T8No:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return z}),Q.d(be,"e",function(){return W}),Q.d(be,"c",function(){return E}),Q.d(be,"b",function(){return d}),Q.d(be,"d",function(){return w}),Q.d(be,"f",function(){return B});var ie=Q("MNsG"),J=Q("N0LK"),P=Q("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 U=Object.prototype.hasOwnProperty;class z{static has(_){return m.create(_)}static equals(_,M){return p.create(_,M)}static regex(_,M){return S.create(_,M)}static not(_){return l.create(_)}static and(..._){return A.create(_,null)}static or(..._){return C.create(_,null,!0)}static deserialize(_,M=!1){return _?this._deserializeOrExpression(_,M):void 0}static _deserializeOrExpression(_,M){let I=_.split("||");return C.create(I.map(g=>this._deserializeAndExpression(g,M)),null,!0)}static _deserializeAndExpression(_,M){let I=_.split("&&");return A.create(I.map(g=>this._deserializeOne(g,M)),null)}static _deserializeOne(_,M){if(_=_.trim(),_.indexOf("!=")>=0){let I=_.split("!=");return f.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("==")>=0){let I=_.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("=~")>=0){let I=_.split("=~");return S.create(I[0].trim(),this._deserializeRegexValue(I[1],M))}if(_.indexOf(" in ")>=0){let I=_.split(" in ");return h.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(_)){const I=_.split(">=");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(_)){const I=_.split(">");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(_)){const I=_.split("<=");return x.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(_)){const I=_.split("<");return O.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(_)?l.create(_.substr(1).trim()):m.create(_)}static _deserializeValue(_,M){if(_=_.trim(),_==="true")return!0;if(_==="false")return!1;let I=/^'([^']*)'$/.exec(_);return I?I[1].trim():_}static _deserializeRegexValue(_,M){if(Object(J.C)(_)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=_.indexOf("/"),g=_.lastIndexOf("/");if(I===g||I<0){if(M)throw new Error(`bad regexp-value '${_}', missing /-enclosure`);return console.warn(`bad regexp-value '${_}', missing /-enclosure`),null}let H=_.slice(I+1,g),$=_[g+1]==="i"?"i":"";try{return new RegExp(H,$)}catch(ae){if(M)throw new Error(`bad regexp-value '${_}', parse error: ${ae}`);return console.warn(`bad regexp-value '${_}', parse error: ${ae}`),null}}}function W(_,M){const I=_?_.substituteConstants():void 0,g=M?M.substituteConstants():void 0;return!I&&!g?!0:!I||!g?!1:I.equals(g)}function r(_,M){return _.cmp(M)}class R{constructor(){this.type=0}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}R.INSTANCE=new R;class v{constructor(){this.type=1}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!0}serialize(){return"true"}keys(){return[]}negate(){return R.INSTANCE}}v.INSTANCE=new v;class m{constructor(_,M){this.key=_,this.negated=M,this.type=2}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?v.INSTANCE:R.INSTANCE:new m(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?v.INSTANCE:R.INSTANCE:this}evaluate(_){return!!_.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 p{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=4}static create(_,M,I=null){if(typeof M=="boolean")return M?m.create(_,I):l.create(_,I);const g=j.get(_);if(typeof g=="boolean"){const H=g?"true":"false";return M===H?v.INSTANCE:R.INSTANCE}return new p(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?v.INSTANCE:R.INSTANCE}return this}evaluate(_){return _.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class h{constructor(_,M){this.key=_,this.valueKey=M,this.type=10,this.negated=null}static create(_,M){return new h(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.valueKey,_.key,_.valueKey)}equals(_){return _.type===this.type?this.key===_.key&&this.valueKey===_.valueKey:!1}substituteConstants(){return this}evaluate(_){const M=_.getValue(this.valueKey),I=_.getValue(this.key);return Array.isArray(M)?M.indexOf(I)>=0:typeof I=="string"&&typeof M=="object"&&M!==null?U.call(M,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(_){this._actual=_,this.type=11}static create(_){return new o(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=5}static create(_,M,I=null){if(typeof M=="boolean")return M?l.create(_,I):m.create(_,I);const g=j.get(_);if(typeof g=="boolean"){const H=g?"true":"false";return M===H?R.INSTANCE:v.INSTANCE}return new f(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?R.INSTANCE:v.INSTANCE}return this}evaluate(_){return _.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 l{constructor(_,M){this.key=_,this.negated=M,this.type=3}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?R.INSTANCE:v.INSTANCE:new l(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?R.INSTANCE:v.INSTANCE:this}evaluate(_){return!_.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function u(_,M){if(typeof _=="string"){const I=parseFloat(_);isNaN(I)||(_=I)}return typeof _=="string"||typeof _=="number"?M(_):R.INSTANCE}class s{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=12}static create(_,M,I=null){return u(M,g=>new s(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.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 a{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=13}static create(_,M,I=null){return u(M,g=>new a(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.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 O{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=14}static create(_,M,I=null){return u(M,g=>new O(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class x{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=15}static create(_,M,I=null){return u(M,g=>new x(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class S{constructor(_,M){this.key=_,this.regexp=M,this.type=7,this.negated=null}static create(_,M){return new S(_,M)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.key<_.key)return-1;if(this.key>_.key)return 1;const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return M<I?-1:M>I?1:0}equals(_){if(_.type===this.type){const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return this.key===_.key&&M===I}return!1}substituteConstants(){return this}evaluate(_){let M=_.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const _=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${_}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(_){this._actual=_,this.type=8}static create(_){return new D(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function L(_){let M=null;for(let I=0,g=_.length;I<g;I++){const H=_[I].substituteConstants();if(_[I]!==H&&M===null){M=[];for(let $=0;$<I;$++)M[$]=_[$]}M!==null&&(M[I]=H)}return M===null?_:M}class A{constructor(_,M){this.expr=_,this.negated=M,this.type=6}static create(_,M){return A._normalizeArr(_,M)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const g=r(this.expr[M],_.expr[M]);if(g!==0)return g}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(_.expr[M]))return!1;return!0}return!1}substituteConstants(){const _=L(this.expr);return _===this.expr?this:A.create(_,this.negated)}evaluate(_){for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].evaluate(_))return!1;return!0}static _normalizeArr(_,M){const I=[];let g=!1;for(const H of _){if(!H)continue;if(H.type===1){g=!0;continue}if(H.type===0)return R.INSTANCE;if(H.type===6){I.push(...H.expr);continue}I.push(H)}if(I.length===0&&g)return v.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(r);for(let H=1;H<I.length;H++)I[H-1].equals(I[H])&&(I.splice(H,1),H--);if(I.length===1)return I[0];for(;I.length>1;){const H=I[I.length-1];if(H.type!==9)break;I.pop();const $=I.pop(),ae=I.length===0,ue=C.create(H.expr.map(Le=>A.create([Le,$],null)),null,ae);ue&&(I.push(ue),I.sort(r))}return I.length===1?I[0]:new A(I,M)}serialize(){return this.expr.map(_=>_.serialize()).join(" && ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){const _=[];for(let M of this.expr)_.push(M.negate());this.negated=C.create(_,this,!0)}return this.negated}}class C{constructor(_,M){this.expr=_,this.negated=M,this.type=9}static create(_,M,I){return C._normalizeArr(_,M,I)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const g=r(this.expr[M],_.expr[M]);if(g!==0)return g}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(_.expr[M]))return!1;return!0}return!1}substituteConstants(){const _=L(this.expr);return _===this.expr?this:C.create(_,this.negated,!1)}evaluate(_){for(let M=0,I=this.expr.length;M<I;M++)if(this.expr[M].evaluate(_))return!0;return!1}static _normalizeArr(_,M,I){let g=[],H=!1;if(_){for(let $=0,ae=_.length;$<ae;$++){const ue=_[$];if(!ue)continue;if(ue.type===0){H=!0;continue}if(ue.type===1)return v.INSTANCE;if(ue.type===9){g=g.concat(ue.expr);continue}g.push(ue)}if(g.length===0&&H)return R.INSTANCE;g.sort(r)}if(g.length===0)return;if(g.length===1)return g[0];for(let $=1;$<g.length;$++)g[$-1].equals(g[$])&&(g.splice($,1),$--);if(g.length===1)return g[0];if(I){for(let $=0;$<g.length;$++)for(let ae=$+1;ae<g.length;ae++)B(g[$],g[ae])&&(g.splice(ae,1),ae--);if(g.length===1)return g[0]}return new C(g,M)}serialize(){return this.expr.map(_=>_.serialize()).join(" || ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){let _=[];for(let M of this.expr)_.push(M.negate());for(;_.length>1;){const M=_.shift(),I=_.shift(),g=[];for(const $ of F(M))for(const ae of F(I))g.push(A.create([$,ae],null));const H=_.length===0;_.unshift(C.create(g,null,H))}this.negated=_[0]}return this.negated}}class E extends m{constructor(_,M,I){super(_,null);this._defaultValue=M,typeof I=="object"?E._info.push(Object.assign(Object.assign({},I),{key:_})):I!==!0&&E._info.push({key:_,description:I,type:M!=null?typeof M:void 0})}static all(){return E._info.values()}bindTo(_){return _.createKey(this.key,this._defaultValue)}getValue(_){return _.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(_){return p.create(this.key,_)}}E._info=[];const d=Object(P.c)("contextKeyService"),w="setContext";function y(_,M){return _<M?-1:_>M?1:0}function b(_,M,I,g){return _<I?-1:_>I?1:M<g?-1:M>g?1:0}function B(_,M){if(M.type===6&&_.type!==9&&_.type!==6){for(const H of M.expr)if(_.equals(H))return!0}const I=_.negate(),g=F(I).concat(F(M));g.sort(r);for(let H=0;H<g.length;H++){const $=g[H],ae=$.negate();for(let ue=H+1;ue<g.length;ue++){const Le=g[ue];if(ae.equals(Le))return!0}}return!1}function F(_){return _.type===9?_.expr:[_]}},TXwP:function(nt,be,Q){var ie,J;(function(){var P;(function(){"use strict";var j=[,,function(r){function R(p){this.__parent=p,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=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(p))return!0;return!1},R.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.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)},R.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},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(`
`);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var o=this.__base_string_length;return h=h||0,p<0&&(o=0),o+=p*this.__indent_size,o+=h,o},v.prototype.get_indent_string=function(p,h){var o=this.__base_string;return h=h||0,p<0&&(p=0,o=""),h+=p*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,o="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),p&&(o+=new Array(p+1).join(" ")),this.__cache.push(o)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return p!==`
`&&(o=o.replace(/[\n]/g,p)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h<p.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var h=this.__lines.length;p<h;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var o=this.__lines.length-2;o>=0;){var f=this.__lines[o];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(o+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},r.exports.Output=m},,,,function(r){function R(p,h){this.raw_options=v(p,h),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"])}R.prototype._get_array=function(p,h){var o=this.raw_options[p],f=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(f=o.concat()):typeof o=="string"&&(f=o.split(/[^a-zA-Z0-9_\/\-]+/)),f},R.prototype._get_boolean=function(p,h){var o=this.raw_options[p],f=o===void 0?!!h:!!o;return f},R.prototype._get_characters=function(p,h){var o=this.raw_options[p],f=h||"";return typeof o=="string"&&(f=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),f},R.prototype._get_number=function(p,h){var o=this.raw_options[p];h=parseInt(h,10),isNaN(h)&&(h=0);var f=parseInt(o,10);return isNaN(f)&&(f=h),f},R.prototype._get_selection=function(p,h,o){var f=this._get_selection_list(p,h,o);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f[0]},R.prototype._get_selection_list=function(p,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var f=this._get_array(p,o);if(!this._is_valid_selection(f,h))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[p]+"'");return f},R.prototype._is_valid_selection=function(p,h){return p.length&&h.length&&!p.some(function(o){return h.indexOf(o)===-1})};function v(p,h){var o={};p=m(p);var f;for(f in p)f!==h&&(o[f]=p[f]);if(h&&p[h])for(f in p[h])o[f]=p[h][f];return o}function m(p){var h={},o;for(o in p){var f=o.replace(/-/g,"_");h[f]=p[o]}return h}r.exports.Options=R,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},,function(r){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var h=m.exec(this.__input);return h&&!(R&&m.sticky)&&(h.index!==p&&(h=null)),h},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var h=this.peek(p);return m.lastIndex=0,h!==null&&m.test(h)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,h){var o="",f;return m&&(f=this.match(m),f&&(o+=f[0])),p&&(f||!m)&&(o+=this.readUntil(p,h)),o},v.prototype.readUntil=function(m,p){var h="",o=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(o=f.index,p&&(o+=f[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var h=null,o="g";return p&&R&&(o="y"),typeof m=="string"&&m!==""?h=new RegExp(m,o):m&&(h=new RegExp(m.source,o)),h},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,h=this.readUntilAfter(m);return this.__position=p,h},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},,,,,function(r){function R(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}R.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},R.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=R},,function(r,R,v){var m=v(16).Beautifier,p=v(17).Options;function h(o,f){var l=new m(o,f);return l.beautify()}r.exports=h,r.exports.defaultOptions=function(){return new p}},function(r,R,v){var m=v(17).Options,p=v(2).Output,h=v(8).InputScanner,o=v(13).Directives,f=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,x=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(D,L){this._source_text=D||"",this._options=new m(L),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"]}S.prototype.eatString=function(D){var L="";for(this._ch=this._input.next();this._ch;){if(L+=this._ch,this._ch==="\\")L+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return L},S.prototype.eatWhitespace=function(D){for(var L=s.test(this._input.peek()),A=0;s.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
`&&((A===0||A<this._options.max_preserve_newlines)&&(A++,this._output.add_new_line(!0)));return L},S.prototype.foundNestedPseudoClass=function(){for(var D=0,L=1,A=this._input.peek(L);A;){if(A==="{")return!0;if(A==="(")D+=1;else if(A===")"){if(D===0)return!1;D-=1}else if(A===";"||A==="}")return!1;L++,A=this._input.peek(L)}return!1},S.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},S.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,L=this._options.eol;L==="auto"&&(L=`
`,D&&l.test(D||"")&&(L=D.match(l)[0])),D=D.replace(u,`
`);var A=D.match(/^[\t ]*/)[0];this._output=new p(this._options,A),this._input=new h(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,E=!1,d=!1,w=!1,y=!1,b=!1,B=!1,F=this._ch,_=!1,M,I,g;M=this._input.read(a),I=M!=="",g=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 H=this._input.read(O),$=f.get_directives(H);$&&$.ignore==="start"&&(H+=f.readIgnored(this._input)),this.print_string(H),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(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?y=!0:ae==="import"&&(b=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!E&&C===0&&ae.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),w?(w=!1,E=this._indentLevel>=this._nestedLevel):E=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&E&&(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)):(g==="("?this._output.space_before_token=!1:g!==","&&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(),g==="{"&&this._output.trim(!0),b=!1,y=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),E=!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 ue=0;ue<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ue++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ue])){_=!0;break}(E||w)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&C===0?(this.print_string(":"),d||(d=!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 Le=g==='"'||g==="'";this.preserveSingleSpace(Le||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")_=!1,C===0?(d&&(this.outdent(),d=!1),y=!1,b=!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(),C++,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(")")),C&&(C--,this.outdent()));else{var ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(I||ve),this.print_string(this._ch),d&&g==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),B=!0):(this.eatWhitespace(),C++,this.indent())}else if(this._ch===")")C&&(C--,this.outdent()),B&&this._input.peek()===";"&&this._options.selector_separator_newline&&(B=!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&&(!d||B)&&C===0&&!b&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&C===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&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(I),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.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 Te=g==='"'||g==="'";this.preserveSingleSpace(Te||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&_&&this._output.add_new_line()}var _e=this._output.get_code(L);return _e},r.exports.Beautifier=S},function(r,R,v){var m=v(6).Options;function p(h){m.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<f.length;l++)f[l]!=="expand"?this.brace_style="collapse":this.brace_style=f[l]}p.prototype=new m,r.exports.Options=p}],U={};function z(r){var R=U[r];if(R!==void 0)return R.exports;var v=U[r]={exports:{}};return j[r](v,v.exports,z),v.exports}var W=z(15);P=W})();var Y=P;!(ie=[],J=function(){return{css_beautify:Y}}.apply(be,ie),J!==void 0&&(nt.exports=J))})()},Vhoy:function(nt,be,Q){"use strict";Q.d(be,"d",function(){return Y}),Q.d(be,"e",function(){return j}),Q.d(be,"c",function(){return U}),Q.d(be,"b",function(){return z}),Q.d(be,"a",function(){return W});var ie=Q("MI8n");class J{constructor(){this._icons=new Map,this._onDidRegister=new ie.b}add(r){const R=this._icons.get(r.id);R?r.description?R.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new J,Y=P;function j(r,R){return new z(r,R)}function U(r){return r?r.replace(/\$\((.*?)\)/g,(R,v)=>` ${v} `).trim():""}class z{constructor(r,R,v){this.id=r,this.definition=R,this.description=v,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const R=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function v(h){if(h instanceof z)return["codicon","codicon-"+h.id];const o=R.exec(h.id);if(!o)return v(z.error);let[,f,l]=o;const u=["codicon","codicon-"+f];return l&&u.push("codicon-modifier-"+l.substr(1)),u}r.asClassNameArray=v;function m(h){return v(h).join(" ")}r.asClassName=m;function p(h){return"."+v(h).join(".")}r.asCSSSelector=p})(W||(W={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(z||(z={}))},"VrN/":function(nt,be,Q){(function(ie,J){nt.exports=J()})(this,function(){"use strict";var ie=navigator.userAgent,J=navigator.platform,P=/gecko\/\d/i.test(ie),Y=/MSIE \d/.test(ie),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),U=/Edge\/(\d+)/.exec(ie),z=Y||j||U,W=z&&(Y?document.documentMode||6:+(U||j)[1]),r=!U&&/WebKit\//.test(ie),R=r&&/Qt\/\d+\.\d+/.test(ie),v=!U&&/Chrome\//.test(ie),m=/Opera\//.test(ie),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),o=/PhantomJS/.test(ie),f=!U&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),l=/Android/.test(ie),u=f||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),s=f||/Mac/.test(J),a=/\bCrOS\b/.test(ie),O=/win/i.test(J),x=m&&ie.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(m=!1,r=!0);var S=s&&(R||m&&(x==null||x<12.11)),D=P||z&&W>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A=function(e,t){var i=e.className,n=L(t).exec(i);if(n){var c=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(c?n[1]+c:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function E(e,t){return C(e).appendChild(t)}function d(e,t,i,n){var c=document.createElement(e);if(i&&(c.className=i),n&&(c.style.cssText=n),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var N=0;N<t.length;++N)c.appendChild(t[N]);return c}function w(e,t,i,n){var c=d(e,t,i,n);return c.setAttribute("role","presentation"),c}var y;document.createRange?y=function(e,t,i,n){var c=document.createRange();return c.setEnd(n||e,i),c.setStart(e,t),c}:y=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(c){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function b(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 B(){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 i=e.className;L(t).test(i)||(e.className+=(i?" ":"")+t)}function _(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!L(i[n]).test(t)&&(t+=" "+i[n]);return t}var M=function(e){e.select()};f?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:z&&(M=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function H(e,t,i,n,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var N=n||0,K=c||0;;){var Z=e.indexOf(" ",N);if(Z<0||Z>=t)return K+(t-N);K+=Z-N,K+=i-K%i,N=Z+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ae(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ue=50,Le={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},Te={origin:"*mouse"},_e={origin:"+move"};function De(e,t,i){for(var n=0,c=0;;){var N=e.indexOf(" ",n);N==-1&&(N=e.length);var K=N-n;if(N==e.length||c+K>=t)return n+Math.min(K,t-c);if(c+=N-n,c+=i-c%i,n=N+1,c>=t)return n}}var he=[""];function ce(e){for(;he.length<=e;)he.push(ne(he)+" ");return he[e]}function ne(e){return e[e.length-1]}function fe(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function le(e,t,i){for(var n=0,c=i(t);n<e.length&&i(e[n])<=c;)n++;e.splice(n,0,t)}function ke(){}function Fe(e,t){var i;return Object.create?i=Object.create(e):(ke.prototype=e,i=new ke),t&&g(t,i),i}var Ae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Re(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ae.test(e))}function Pe(e,t){return t?t.source.indexOf("\\w")>-1&&Re(e)?!0:t.test(e):Re(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var pe=/[\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 ye(e){return e.charCodeAt(0)>=768&&pe.test(e)}function Oe(e,t,i){for(;(i<0?t>0:t<e.length)&&ye(e.charAt(t));)t+=i;return t}function je(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var c=(t+i)/2,N=n<0?Math.ceil(c):Math.floor(c);if(N==t)return e(N)?t:i;e(N)?i=N:t=N+n}}function ze(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var c=!1,N=0;N<e.length;++N){var K=e[N];(K.from<i&&K.to>t||t==i&&K.to==t)&&(n(Math.max(K.from,t),Math.min(K.to,i),K.level==1?"rtl":"ltr",N),c=!0)}c||n(t,i,"ltr")}var Je=null;function Ye(e,t,i){var n;Je=null;for(var c=0;c<e.length;++c){var N=e[c];if(N.from<t&&N.to>t)return c;N.to==t&&(N.from!=N.to&&i=="before"?n=c:Je=c),N.from==t&&(N.from!=N.to&&i!="before"?n=c:Je=c)}return n!=null?n:Je}var rt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(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 n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,N=/[LRr]/,K=/[Lb1n]/,Z=/[1n]/;function q(te,me,xe){this.level=te,this.from=me,this.to=xe}return function(te,me){var xe=me=="ltr"?"L":"R";if(te.length==0||me=="ltr"&&!n.test(te))return!1;for(var Ne=te.length,Me=[],Ge=0;Ge<Ne;++Ge)Me.push(i(te.charCodeAt(Ge)));for(var $e=0,qe=xe;$e<Ne;++$e){var it=Me[$e];it=="m"?Me[$e]=qe:qe=it}for(var lt=0,at=xe;lt<Ne;++lt){var ht=Me[lt];ht=="1"&&at=="r"?Me[lt]="n":N.test(ht)&&(at=ht,ht=="r"&&(Me[lt]="R"))}for(var Tt=1,vt=Me[0];Tt<Ne-1;++Tt){var Rt=Me[Tt];Rt=="+"&&vt=="1"&&Me[Tt+1]=="1"?Me[Tt]="1":Rt==","&&vt==Me[Tt+1]&&(vt=="1"||vt=="n")&&(Me[Tt]=vt),vt=Rt}for(var Yt=0;Yt<Ne;++Yt){var gr=Me[Yt];if(gr==",")Me[Yt]="N";else if(gr=="%"){var er=void 0;for(er=Yt+1;er<Ne&&Me[er]=="%";++er);for(var Gr=Yt&&Me[Yt-1]=="!"||er<Ne&&Me[er]=="1"?"1":"N",Nr=Yt;Nr<er;++Nr)Me[Nr]=Gr;Yt=er-1}}for(var sr=0,Fr=xe;sr<Ne;++sr){var _r=Me[sr];Fr=="L"&&_r=="1"?Me[sr]="L":N.test(_r)&&(Fr=_r)}for(var hr=0;hr<Ne;++hr)if(c.test(Me[hr])){var or=void 0;for(or=hr+1;or<Ne&&c.test(Me[or]);++or);for(var rr=(hr?Me[hr-1]:xe)=="L",Ur=(or<Ne?Me[or]:xe)=="L",ui=rr==Ur?rr?"L":"R":xe,In=hr;In<or;++In)Me[In]=ui;hr=or-1}for(var Sr=[],ln,vr=0;vr<Ne;)if(K.test(Me[vr])){var Va=vr;for(++vr;vr<Ne&&K.test(Me[vr]);++vr);Sr.push(new q(0,Va,vr))}else{var pn=vr,Gn=Sr.length,zn=me=="rtl"?1:0;for(++vr;vr<Ne&&Me[vr]!="L";++vr);for(var Rr=pn;Rr<vr;)if(Z.test(Me[Rr])){pn<Rr&&(Sr.splice(Gn,0,new q(1,pn,Rr)),Gn+=zn);var hi=Rr;for(++Rr;Rr<vr&&Z.test(Me[Rr]);++Rr);Sr.splice(Gn,0,new q(2,hi,Rr)),Gn+=zn,pn=Rr}else++Rr;pn<vr&&Sr.splice(Gn,0,new q(1,pn,vr))}return me=="ltr"&&(Sr[0].level==1&&(ln=te.match(/^\s+/))&&(Sr[0].from=ln[0].length,Sr.unshift(new q(0,0,ln[0].length))),ne(Sr).level==1&&(ln=te.match(/\s+$/))&&(ne(Sr).to-=ln[0].length,Sr.push(new q(0,Ne-ln[0].length,Ne)))),me=="rtl"?Sr.reverse():Sr}}();function Ze(e,t){var i=e.order;return i==null&&(i=e.order=rt(e.text,t)),i}var et=[],Be=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||et).concat(i)}};function ut(e,t){return e._handlers&&e._handlers[t]||et}function st(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,c=n&&n[t];if(c){var N=ae(c,i);N>-1&&(n[t]=c.slice(0,N).concat(c.slice(N+1)))}}}function He(e,t){var i=ut(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),c=0;c<i.length;++c)i[c].apply(null,n)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,i||t.type,e,t),de(t)||t.codemirrorIgnore}function Ie(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ae(i,t[n])==-1&&i.push(t[n])}function Ee(e,t){return ut(e,t).length>0}function Ce(e){e.prototype.on=function(t,i){Be(this,t,i)},e.prototype.off=function(t,i){st(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){re(e),oe(e)}function Se(e){return e.target||e.srcElement}function Ue(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var Ve=function(){if(z&&W<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),ot;function mt(e){if(ot==null){var t=d("span","\u200B");E(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ot=t.offsetWidth<=1&&t.offsetHeight>2&&!(z&&W<8))}var i=ot?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ft;function wt(e){if(ft!=null)return ft;var t=E(e,document.createTextNode("A\u062EA")),i=y(t,0,1).getBoundingClientRect(),n=y(t,1,2).getBoundingClientRect();return C(e),!i||i.left==i.right?!1:ft=n.right-i.right<3}var St=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var c=e.indexOf(`
`,t);c==-1&&(c=e.length);var N=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),K=N.indexOf("\r");K!=-1?(i.push(N.slice(0,K)),t+=K+1):(i.push(N),t=c+1)}return i}:function(e){return e.split(/\r\n?|\n/)},dt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Bt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function qt(e){if(Lt!=null)return Lt;var t=E(e,d("span","x")),i=t.getBoundingClientRect(),n=y(t,0,1).getBoundingClientRect();return Lt=Math.abs(i.left-n.left)>1}var Qt={},It={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function zr(e,t){It[e]=t}function yt(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=Fe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Lr(e,t){t=yt(t);var i=Qt[t.name];if(!i)return Lr(e,"text/plain");var n=i(e,t);if(bt.hasOwnProperty(t.name)){var c=bt[t.name];for(var N in c){if(!c.hasOwnProperty(N))continue;n.hasOwnProperty(N)&&(n["_"+N]=n[N]),n[N]=c[N]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)n[K]=t.modeProps[K];return n}var bt={};function xt(e,t){var i=bt.hasOwnProperty(e)?bt[e]:bt[e]={};g(t,i)}function Ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var c=t[n];c instanceof Array&&(c=c.concat([])),i[n]=c}return i}function tr(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function dr(e,t,i){return e.startState?e.startState(t,i):!0}var Pt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(K){return i?K.toLowerCase():K},c=this.string.substr(this.pos,e.length);if(n(c)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var N=this.string.slice(this.pos).match(e);return N&&N.index>0?null:(N&&t!==!1&&(this.pos+=N[0].length),N)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var c=i.children[n],N=c.chunkSize();if(t<N){i=c;break}t-=N}return i.lines[t]}function Br(e,t,i){var n=[],c=t.line;return e.iter(t.line,i.line+1,function(N){var K=N.text;c==i.line&&(K=K.slice(0,i.ch)),c==t.line&&(K=K.slice(t.ch)),n.push(K),++c}),n}function Vt(e,t,i){var n=[];return e.iter(t,i,function(c){n.push(c.text)}),n}function Jt(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,i=ae(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var c=0;!(n.children[c]==t);++c)i+=n.children[c].chunkSize();return i+t.first}function lr(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var c=e.children[n],N=c.height;if(t<N){e=c;continue e}t-=N,i+=c.chunkSize()}return i}while(!e.lines);for(var K=0;K<e.lines.length;++K){var Z=e.lines[K],q=Z.height;if(t<q)break;t-=q}return i+K}function Ir(e,t){return t>=e.first&&t<e.first+e.size}function Yr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Qe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Qe))return new Qe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function mn(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function gn(e){return Qe(e.line,e.ch)}function vn(e,t){return Ct(e,t)<0?t:e}function yn(e,t){return Ct(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 Qe(e.first,0);var i=e.first+e.size-1;return t.line>i?Qe(i,ct(e,i).text.length):k(t,ct(e,t.line).text.length)}function k(e,t){var i=e.ch;return i==null||i>t?Qe(e.line,t):i<0?Qe(e.line,0):e}function G(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=T(e,t[n]);return i}var ee=function(e,t){this.state=e,this.lookAhead=t},V=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};V.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},V.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}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,i){return t instanceof ee?new V(e,Ft(e.mode,t.state),i,t.lookAhead):new V(e,Ft(e.mode,t),i)},V.prototype.save=function(e){var t=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function we(e,t,i,n){var c=[e.state.modeGen],N={};Er(e,t.text,e.doc.mode,i,function(te,me){return c.push(te,me)},N,n);for(var K=i.state,Z=function(te){i.baseTokens=c;var me=e.state.overlays[te],xe=1,Ne=0;i.state=!0,Er(e,t.text,me.mode,i,function(Me,Ge){for(var $e=xe;Ne<Me;){var qe=c[xe];qe>Me&&c.splice(xe,1,Me,c[xe+1],qe),xe+=2,Ne=Math.min(Me,qe)}if(!Ge)return;if(me.opaque)c.splice($e,xe-$e,Me,"overlay "+Ge),xe=$e+2;else for(;$e<xe;$e+=2){var it=c[$e+1];c[$e+1]=(it?it+" ":"")+"overlay "+Ge}},N),i.state=K,i.baseTokens=null,i.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Z(q);return{styles:c,classes:N.bgClass||N.textClass?N:null}}function Ke(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=tt(e,Ot(t)),c=t.text.length>e.options.maxHighlightLength&&Ft(e.doc.mode,n.state),N=we(e,t,n);c&&(n.state=c),t.stateAfter=n.save(!c),t.styles=N.styles,N.classes?t.styleClasses=N.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function tt(e,t,i){var n=e.doc,c=e.display;if(!n.mode.startState)return new V(n,!0,t);var N=xr(e,t,i),K=N>n.first&&ct(n,N-1).stateAfter,Z=K?V.fromSaved(n,K,N):new V(n,dr(n.mode),N);return n.iter(N,t,function(q){pt(e,q.text,Z);var te=Z.line;q.stateAfter=te==t-1||te%5==0||te>=c.viewFrom&&te<c.viewTo?Z.save():null,Z.nextLine()}),i&&(n.modeFrontier=Z.line),Z}function pt(e,t,i,n){var c=e.doc.mode,N=new Pt(t,e.options.tabSize,i);for(N.start=N.pos=n||0,t==""&&Xe(c,i.state);!N.eol();)_t(c,N,i.state),N.start=N.pos}function Xe(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=tr(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function _t(e,t,i,n){for(var c=0;c<10;c++){n&&(n[0]=tr(e,i).mode);var N=e.token(t,i);if(t.pos>t.start)return N}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function $t(e,t,i,n){var c=e.doc,N=c.mode,K;t=T(c,t);var Z=ct(c,t.line),q=tt(e,t.line,i),te=new Pt(Z.text,e.options.tabSize,q),me;for(n&&(me=[]);(n||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=_t(N,te,q.state),n&&me.push(new jt(te,K,Ft(c.mode,q.state)));return n?me:new jt(te,K,q.state)}function jr(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Er(e,t,i,n,c,N,K){var Z=i.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var q=0,te=null,me=new Pt(t,e.options.tabSize,n),xe,Ne=e.options.addModeClass&&[null];for(t==""&&jr(Xe(i,n.state),N);!me.eol();){if(me.pos>e.options.maxHighlightLength?(Z=!1,K&&pt(e,t,n,me.pos),me.pos=t.length,xe=null):xe=jr(_t(i,me,n.state,Ne),N),Ne){var Me=Ne[0].name;Me&&(xe="m-"+(xe?Me+" "+xe:Me))}if(!Z||te!=xe){for(;q<me.start;)q=Math.min(me.start,q+5e3),c(q,te);te=xe}me.start=me.pos}for(;q<me.pos;){var Ge=Math.min(me.pos,q+5e3);c(Ge,te),q=Ge}}function xr(e,t,i){for(var n,c,N=e.doc,K=i?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>K;--Z){if(Z<=N.first)return N.first;var q=ct(N,Z-1),te=q.stateAfter;if(te&&(!i||Z+(te instanceof ee?te.lookAhead:0)<=N.modeFrontier))return Z;var me=H(q.text,null,e.options.tabSize);(c==null||n>me)&&(c=Z-1,n=me)}return c}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var c=ct(e,n).stateAfter;if(c&&(!(c instanceof ee)||n+c.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Dn=!1,cr=!1;function Kr(){Dn=!0}function un(){cr=!0}function hn(e,t,i){this.marker=e,this.from=t,this.to=i}function Hr(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function kn(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function bn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Kn(e,t,i){var n;if(e)for(var c=0;c<e.length;++c){var N=e[c],K=N.marker,Z=N.from==null||(K.inclusiveLeft?N.from<=t:N.from<t);if(Z||N.from==t&&K.type=="bookmark"&&(!i||!N.marker.insertLeft)){var q=N.to==null||(K.inclusiveRight?N.to>=t:N.to>t);(n||(n=[])).push(new hn(K,N.from,q?null:N.to))}}return n}function Vn(e,t,i){var n;if(e)for(var c=0;c<e.length;++c){var N=e[c],K=N.marker,Z=N.to==null||(K.inclusiveRight?N.to>=t:N.to>t);if(Z||N.from==t&&K.type=="bookmark"&&(!i||N.marker.insertLeft)){var q=N.from==null||(K.inclusiveLeft?N.from<=t:N.from<t);(n||(n=[])).push(new hn(K,q?null:N.from-t,N.to==null?null:N.to-t))}}return n}function Zr(e,t){if(t.full)return null;var i=Ir(e,t.from.line)&&ct(e,t.from.line).markedSpans,n=Ir(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!i&&!n)return null;var c=t.from.ch,N=t.to.ch,K=Ct(t.from,t.to)==0,Z=Kn(i,c,K),q=Vn(n,N,K),te=t.text.length==1,me=ne(t.text).length+(te?c:0);if(Z)for(var xe=0;xe<Z.length;++xe){var Ne=Z[xe];if(Ne.to==null){var Me=Hr(q,Ne.marker);Me?te&&(Ne.to=Me.to==null?null:Me.to+me):Ne.to=c}}if(q)for(var Ge=0;Ge<q.length;++Ge){var $e=q[Ge];if($e.to!=null&&($e.to+=me),$e.from==null){var qe=Hr(Z,$e.marker);qe||($e.from=me,te&&(Z||(Z=[])).push($e))}else $e.from+=me,te&&(Z||(Z=[])).push($e)}Z&&(Z=$r(Z)),q&&q!=Z&&(q=$r(q));var it=[Z];if(!te){var lt=t.text.length-2,at;if(lt>0&&Z)for(var ht=0;ht<Z.length;++ht)Z[ht].to==null&&(at||(at=[])).push(new hn(Z[ht].marker,null,null));for(var Tt=0;Tt<lt;++Tt)it.push(at);it.push(q)}return it}function $r(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _n(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Me){if(Me.markedSpans)for(var Ge=0;Ge<Me.markedSpans.length;++Ge){var $e=Me.markedSpans[Ge].marker;$e.readOnly&&(!n||ae(n,$e)==-1)&&(n||(n=[])).push($e)}}),!n)return null;for(var c=[{from:t,to:i}],N=0;N<n.length;++N)for(var K=n[N],Z=K.find(0),q=0;q<c.length;++q){var te=c[q];if(Ct(te.to,Z.from)<0||Ct(te.from,Z.to)>0)continue;var me=[q,1],xe=Ct(te.from,Z.from),Ne=Ct(te.to,Z.to);(xe<0||!K.inclusiveLeft&&!xe)&&me.push({from:te.from,to:Z.from}),(Ne>0||!K.inclusiveRight&&!Ne)&&me.push({from:Z.to,to:te.to}),c.splice.apply(c,me),q+=me.length-3}return c}function di(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function En(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function nr(e){return e.inclusiveLeft?-1:0}function Ht(e){return e.inclusiveRight?1:0}function yr(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),c=t.find(),N=Ct(n.from,c.from)||nr(e)-nr(t);if(N)return-N;var K=Ct(n.to,c.to)||Ht(e)-Ht(t);return K||t.id-e.id}function kt(e,t){var i=cr&&e.markedSpans,n;if(i)for(var c=void 0,N=0;N<i.length;++N)c=i[N],c.marker.collapsed&&(t?c.from:c.to)==null&&(!n||yr(n,c.marker)<0)&&(n=c.marker);return n}function ar(e){return kt(e,!0)}function zt(e){return kt(e,!1)}function nn(e,t){var i=cr&&e.markedSpans,n;if(i)for(var c=0;c<i.length;++c){var N=i[c];N.marker.collapsed&&(N.from==null||N.from<t)&&(N.to==null||N.to>t)&&(!n||yr(n,N.marker)<0)&&(n=N.marker)}return n}function fr(e,t,i,n,c){var N=ct(e,t),K=cr&&N.markedSpans;if(K)for(var Z=0;Z<K.length;++Z){var q=K[Z];if(!q.marker.collapsed)continue;var te=q.marker.find(0),me=Ct(te.from,i)||nr(q.marker)-nr(c),xe=Ct(te.to,n)||Ht(q.marker)-Ht(c);if(me>=0&&xe<=0||me<=0&&xe>=0)continue;if(me<=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ct(te.to,i)>=0:Ct(te.to,i)>0)||me>=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ct(te.from,n)<=0:Ct(te.from,n)<0))return!0}}function Ar(e){for(var t;t=ar(e);)e=t.find(-1,!0).line;return e}function Xn(e){for(var t;t=zt(e);)e=t.find(1,!0).line;return e}function xn(e){for(var t,i;t=zt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ci(e,t){var i=ct(e,t),n=Ar(i);return i==n?t:Ot(n)}function Tn(e,t){if(t>e.lastLine())return t;var i=ct(e,t),n;if(!an(e,i))return t;for(;n=zt(i);)i=n.find(1,!0).line;return Ot(i)+1}function an(e,t){var i=cr&&t.markedSpans;if(i)for(var n=void 0,c=0;c<i.length;++c){if(n=i[c],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&fi(e,t,n))return!0}}function fi(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return fi(e,n.line,Hr(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var c=void 0,N=0;N<t.markedSpans.length;++N)if(c=t.markedSpans[N],c.marker.collapsed&&!c.marker.widgetNode&&c.from==i.to&&(c.to==null||c.to!=i.from)&&(c.marker.inclusiveLeft||i.marker.inclusiveRight)&&fi(e,t,c))return!0}function qr(e){e=Ar(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var c=i.lines[n];if(c==e)break;t+=c.height}for(var N=i.parent;N;i=N,N=i.parent)for(var K=0;K<N.children.length;++K){var Z=N.children[K];if(Z==i)break;t+=Z.height}return t}function pi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=ar(n);){var c=i.find(0,!0);n=c.from.line,t+=c.from.ch-c.to.ch}for(n=e;i=zt(n);){var N=i.find(0,!0);t-=n.text.length-N.from.ch,n=N.to.line,t+=n.text.length-N.to.ch}return t}function ji(e){var t=e.display,i=e.doc;t.maxLine=ct(i,i.first),t.maxLineLength=pi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var c=pi(n);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=n)})}var Mn=function(e,t,i){this.text=e,En(this,t),this.height=i?i(this):1};Mn.prototype.lineNo=function(){return Ot(this)},Ce(Mn);function ua(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),di(e),En(e,i);var c=n?n(e):1;c!=e.height&&Jt(e,c)}function gt(e){e.parent=null,di(e)}var At={},Et={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Et:At;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ut(e,t){var i=w("span",null,null,r?"padding-right: .1px":null),n={pre:w("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var N=c?t.rest[c-1]:t.line,K=void 0;n.pos=0,n.addToken=Nt,wt(e.display.measure)&&(K=Ze(N,e.doc.direction))&&(n.addToken=Dr(n.addToken,K)),n.map=[];var Z=t!=e.display.externalMeasured&&Ot(N);dn(N,n,Ke(e,N,Z)),N.styleClasses&&(N.styleClasses.bgClass&&(n.bgClass=_(N.styleClasses.bgClass,n.bgClass||"")),N.styleClasses.textClass&&(n.textClass=_(N.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(mt(e.display.measure))),c==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var q=n.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=_(n.pre.className,n.textClass||"")),n}function Xt(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nt(e,t,i,n,c,N,K){if(!t)return;var Z=e.splitSpaces?ur(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,me;if(!q.test(t))e.col+=t.length,me=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,me),z&&W<9&&(te=!0),e.pos+=t.length;else{me=document.createDocumentFragment();for(var xe=0;;){q.lastIndex=xe;var Ne=q.exec(t),Me=Ne?Ne.index-xe:t.length-xe;if(Me){var Ge=document.createTextNode(Z.slice(xe,xe+Me));z&&W<9?me.appendChild(d("span",[Ge])):me.appendChild(Ge),e.map.push(e.pos,e.pos+Me,Ge),e.col+=Me,e.pos+=Me}if(!Ne)break;xe+=Me+1;var $e=void 0;if(Ne[0]==" "){var qe=e.cm.options.tabSize,it=qe-e.col%qe;$e=me.appendChild(d("span",ce(it),"cm-tab")),$e.setAttribute("role","presentation"),$e.setAttribute("cm-text"," "),e.col+=it}else Ne[0]=="\r"||Ne[0]==`
`?($e=me.appendChild(d("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),$e.setAttribute("cm-text",Ne[0]),e.col+=1):($e=e.cm.options.specialCharPlaceholder(Ne[0]),$e.setAttribute("cm-text",Ne[0]),z&&W<9?me.appendChild(d("span",[$e])):me.appendChild($e),e.col+=1);e.map.push(e.pos,e.pos+1,$e),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,i||n||c||te||N||K){var lt=i||"";n&&(lt+=n),c&&(lt+=c);var at=d("span",[me],lt,N);if(K)for(var ht in K)K.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&at.setAttribute(ht,K[ht]);return e.content.appendChild(at)}e.content.appendChild(me)}function ur(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",c=0;c<e.length;c++){var N=e.charAt(c);N==" "&&i&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(N="\xA0"),n+=N,i=N==" "}return n}function Dr(e,t){return function(i,n,c,N,K,Z,q){c=c?c+" cm-force-border":"cm-force-border";for(var te=i.pos,me=te+n.length;;){for(var xe=void 0,Ne=0;Ne<t.length&&!(xe=t[Ne],xe.to>te&&xe.from<=te);Ne++);if(xe.to>=me)return e(i,n,c,N,K,Z,q);e(i,n.slice(0,xe.to-te),c,N,null,Z,q),N=null,n=n.slice(xe.to-te),te=xe.to}}}function Mt(e,t,i,n){var c=!n&&i.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!n&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",i.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function dn(e,t,i){var n=e.markedSpans,c=e.text,N=0;if(!n){for(var K=1;K<i.length;K+=2)t.addToken(t,c.slice(N,N=i[K]),Dt(i[K+1],t.cm.options));return}for(var Z=c.length,q=0,te=1,me="",xe,Ne,Me=0,Ge,$e,qe,it,lt;;){if(Me==q){Ge=$e=qe=Ne="",lt=null,it=null,Me=Infinity;for(var at=[],ht=void 0,Tt=0;Tt<n.length;++Tt){var vt=n[Tt],Rt=vt.marker;if(Rt.type=="bookmark"&&vt.from==q&&Rt.widgetNode)at.push(Rt);else if(vt.from<=q&&(vt.to==null||vt.to>q||Rt.collapsed&&vt.to==q&&vt.from==q)){if(vt.to!=null&&vt.to!=q&&Me>vt.to&&(Me=vt.to,$e=""),Rt.className&&(Ge+=" "+Rt.className),Rt.css&&(Ne=(Ne?Ne+";":"")+Rt.css),Rt.startStyle&&vt.from==q&&(qe+=" "+Rt.startStyle),Rt.endStyle&&vt.to==Me&&(ht||(ht=[])).push(Rt.endStyle,vt.to),Rt.title&&((lt||(lt={})).title=Rt.title),Rt.attributes)for(var Yt in Rt.attributes)(lt||(lt={}))[Yt]=Rt.attributes[Yt];Rt.collapsed&&(!it||yr(it.marker,Rt)<0)&&(it=vt)}else vt.from>q&&Me>vt.from&&(Me=vt.from)}if(ht)for(var gr=0;gr<ht.length;gr+=2)ht[gr+1]==Me&&($e+=" "+ht[gr]);if(!it||it.from==q)for(var er=0;er<at.length;++er)Mt(t,0,at[er]);if(it&&(it.from||0)==q){if(Mt(t,(it.to==null?Z+1:it.to)-q,it.marker,it.from==null),it.to==null)return;it.to==q&&(it=!1)}}if(q>=Z)break;for(var Gr=Math.min(Z,Me);;){if(me){var Nr=q+me.length;if(!it){var sr=Nr>Gr?me.slice(0,Gr-q):me;t.addToken(t,sr,xe?xe+Ge:Ge,qe,q+sr.length==Me?$e:"",Ne,lt)}if(Nr>=Gr){me=me.slice(Gr-q),q=Gr;break}q=Nr,qe=""}me=c.slice(N,N=i[te++]),xe=Dt(i[te++],t.cm.options)}}}function Wt(e,t,i){this.line=t,this.rest=xn(t),this.size=this.rest?Ot(ne(this.rest))-i+1:1,this.node=this.text=null,this.hidden=an(e,t)}function kr(e,t,i){for(var n=[],c,N=t;N<i;N=c){var K=new Wt(e.doc,ct(e.doc,N),N);c=N+K.size,n.push(K)}return n}var Tr=null;function Jr(e){Tr?Tr.ops.push(e):e.ownsGroup=Tr={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var c=e.ops[n];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(i<t.length)}function Io(e,t){var i=e.ownsGroup;if(!i)return;try{Lo(i)}finally{Tr=null,t(i)}}var mi=null;function br(e,t){var i=ut(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),c;Tr?c=Tr.delayedCallbacks:mi?c=mi:(c=mi=[],setTimeout(Do,0));for(var N=function(Z){c.push(function(){return i[Z].apply(null,n)})},K=0;K<i.length;++K)N(K)}function Do(){var e=mi;mi=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,i,n){for(var c=0;c<t.changes.length;c++){var N=t.changes[c];N=="text"?Mo(e,t):N=="gutter"?Ja(e,t,i,n):N=="class"?ha(e,t):N=="widget"&&Po(e,t,n)}t.changes=null}function gi(e){return e.node==e.text&&(e.node=d("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),z&&W<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=gi(t);t.background=n.insertBefore(d("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Ut(e,t)}function Mo(e,t){var i=t.text.className,n=$a(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){ko(e,t),t.line.wrapClass?gi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,n){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 c=gi(t);t.gutterBackground=d("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var N=t.line.gutterMarkers;if(e.options.lineNumbers||N){var K=gi(t),Z=t.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),K.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!N||!N["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(d("div",Yr(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),N)for(var q=0;q<e.display.gutterSpecs.length;++q){var te=e.display.gutterSpecs[q].className,me=N.hasOwnProperty(te)&&N[te];me&&Z.appendChild(d("div",[me],"CodeMirror-gutter-elt","left: "+n.gutterLeft[te]+"px; width: "+n.gutterWidth[te]+"px"))}}}function Po(e,t,i){t.alignable&&(t.alignable=null);for(var n=L("CodeMirror-linewidget"),c=t.node.firstChild,N=void 0;c;c=N)N=c.nextSibling,n.test(c.className)&&t.node.removeChild(c);Qa(e,t,i)}function No(e,t,i,n){var c=$a(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),ha(e,t),Ja(e,t,i,n),Qa(e,t,n),t.node}function Qa(e,t,i){if(Za(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Za(e,t.rest[n],t,i,!1)}function Za(e,t,i,n,c){if(!t.widgets)return;for(var N=gi(i),K=0,Z=t.widgets;K<Z.length;++K){var q=Z[K],te=d("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(q,te,i,n),e.display.input.setUneditable(te),c&&q.above?N.insertBefore(te,i.gutter||i.text):N.appendChild(te),br(q,"redraw")}}function Fo(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var c=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(c-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function vi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),E(t.display.measure,d("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function cn(e,t){for(var i=Se(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Hi(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=E(e.measure,d("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function sn(e){return ue-e.display.nativeBarWidth}function Pn(e){return e.display.scroller.clientWidth-sn(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-sn(e)-e.display.barHeight}function Uo(e,t,i){var n=e.options.lineWrapping,c=n&&Pn(e);if(!t.measure.heights||n&&t.measure.width!=c){var N=t.measure.heights=[];if(n){t.measure.width=c;for(var K=t.text.firstChild.getClientRects(),Z=0;Z<K.length-1;Z++){var q=K[Z],te=K[Z+1];Math.abs(q.bottom-te.bottom)>2&&N.push((q.bottom+te.top)/2-i.top)}}N.push(i.bottom-i.top)}}function es(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var c=0;c<e.rest.length;c++)if(Ot(e.rest[c])>i)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=Ar(t);var i=Ot(t),n=e.display.externalMeasured=new Wt(e.doc,t,i);n.lineN=i;var c=n.built=Ut(e,n);return n.text=c.pre,E(e.display.lineMeasure,c.pre),n}function ts(e,t,i,n){return on(e,Yn(e,t),i,n)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Un(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Yn(e,t){var i=Ot(t),n=fa(e,i);n&&!n.text?n=null:n&&n.changes&&(Ya(e,n,i,ba(e)),e.curOp.forceUpdate=!0),n||(n=Bo(e,t));var c=es(n,t,i);return{line:t,view:n,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function on(e,t,i,n,c){t.before&&(i=-1);var N=i+(n||""),K;return t.cache.hasOwnProperty(N)?K=t.cache[N]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,i,n),K.bogus||(t.cache[N]=K)),{left:K.left,right:K.right,top:c?K.rtop:K.top,bottom:c?K.rbottom:K.bottom}}var rs={left:0,right:0,top:0,bottom:0};function ns(e,t,i){for(var n,c,N,K,Z,q,te=0;te<e.length;te+=3)if(Z=e[te],q=e[te+1],t<Z?(c=0,N=1,K="left"):t<q?(c=t-Z,N=c+1):(te==e.length-3||t==q&&e[te+3]>t)&&(N=q-Z,c=N-1,t>=q&&(K="right")),c!=null){if(n=e[te+2],Z==q&&i==(n.insertLeft?"left":"right")&&(K=i),i=="left"&&c==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],K="left";if(i=="right"&&c==q-Z)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)n=e[(te+=3)+2],K="right";break}return{node:n,start:c,end:N,collapse:K,coverStart:Z,coverEnd:q}}function jo(e,t){var i=rs;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var c=e.length-1;c>=0&&!((i=e[c]).left!=i.right);c--);return i}function Ho(e,t,i,n){var c=ns(t.map,i,n),N=c.node,K=c.start,Z=c.end,q=c.collapse,te;if(N.nodeType==3){for(var me=0;me<4;me++){for(;K&&ye(t.line.text.charAt(c.coverStart+K));)--K;for(;c.coverStart+Z<c.coverEnd&&ye(t.line.text.charAt(c.coverStart+Z));)++Z;if(z&&W<9&&K==0&&Z==c.coverEnd-c.coverStart?te=N.parentNode.getBoundingClientRect():te=jo(y(N,K,Z).getClientRects(),n),te.left||te.right||K==0)break;Z=K,K=K-1,q="right"}z&&W<11&&(te=Wo(e.display.measure,te))}else{K>0&&(q=n="right");var xe;e.options.lineWrapping&&(xe=N.getClientRects()).length>1?te=xe[n=="right"?xe.length-1:0]:te=N.getBoundingClientRect()}if(z&&W<9&&!K&&(!te||!te.left&&!te.right)){var Ne=N.parentNode.getClientRects()[0];Ne?te={left:Ne.left,right:Ne.left+Jn(e.display),top:Ne.top,bottom:Ne.bottom}:te=rs}for(var Me=te.top-t.rect.top,Ge=te.bottom-t.rect.top,$e=(Me+Ge)/2,qe=t.view.measure.heights,it=0;it<qe.length-1&&!($e<qe[it]);it++);var lt=it?qe[it-1]:0,at=qe[it],ht={left:(q=="right"?te.right:te.left)-t.rect.left,right:(q=="left"?te.left:te.right)-t.rect.left,top:lt,bottom:at};return!te.left&&!te.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=Me,ht.rbottom=Ge),ht}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!qt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function is(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,C(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)is(e.display.view[t])}function yi(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 v&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return v&&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 i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=vi(e.widgets[i]));return t}function Wi(e,t,i,n,c){if(!c){var N=pa(t);i.top+=N,i.bottom+=N}if(n=="line")return i;n||(n="local");var K=qr(t);if(n=="local"?K+=Hi(e.display):K-=e.display.viewOffset,n=="page"||n=="window"){var Z=e.display.lineSpace.getBoundingClientRect();K+=Z.top+(n=="window"?0:os());var q=Z.left+(n=="window"?0:ss());i.left+=q,i.right+=q}return i.top+=K,i.bottom+=K,i}function ls(e,t,i){if(i=="div")return t;var n=t.left,c=t.top;if(i=="page")n-=ss(),c-=os();else if(i=="local"||!i){var N=e.display.sizer.getBoundingClientRect();n+=N.left,c+=N.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:n-K.left,top:c-K.top}}function ma(e,t,i,n,c){return n||(n=ct(e.doc,t.line)),Wi(e,n,ts(e,n,t.ch,c),i)}function en(e,t,i,n,c,N){n=n||ct(e.doc,t.line),c||(c=Yn(e,n));function K(Ge,$e){var qe=on(e,c,Ge,$e?"right":"left",N);return $e?qe.left=qe.right:qe.right=qe.left,Wi(e,n,qe,i)}var Z=Ze(n,e.doc.direction),q=t.ch,te=t.sticky;if(q>=n.text.length?(q=n.text.length,te="before"):q<=0&&(q=0,te="after"),!Z)return K(te=="before"?q-1:q,te=="before");function me(Ge,$e,qe){var it=Z[$e],lt=it.level==1;return K(qe?Ge-1:Ge,lt!=qe)}var xe=Ye(Z,q,te),Ne=Je,Me=me(q,xe,te=="before");return Ne!=null&&(Me.other=me(q,Ne,te!="before")),Me}function us(e,t){var i=0;t=T(e.doc,t),e.options.lineWrapping||(i=Jn(e.display)*t.ch);var n=ct(e.doc,t.line),c=qr(n)+Hi(e.display);return{left:i,right:i,top:c,bottom:c+n.height}}function ga(e,t,i,n,c){var N=Qe(e,t,i);return N.xRel=c,n&&(N.outside=n),N}function va(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return ga(n.first,0,null,-1,-1);var c=lr(n,i),N=n.first+n.size-1;if(c>N)return ga(n.first+n.size-1,ct(n,N).text.length,null,1,1);t<0&&(t=0);for(var K=ct(n,c);;){var Z=Go(e,K,c,t,i),q=nn(K,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!q)return Z;var te=q.find(1);if(te.line==c)return te;K=ct(n,c=te.line)}}function hs(e,t,i,n){n-=pa(t);var c=t.text.length,N=je(function(K){return on(e,i,K-1).bottom<=n},c,0);return c=je(function(K){return on(e,i,K).top>n},N,c),{begin:N,end:c}}function ds(e,t,i,n){i||(i=Yn(e,t));var c=Wi(e,t,on(e,i,n),"line").top;return hs(e,t,i,c)}function ya(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Go(e,t,i,n,c){c-=qr(t);var N=Yn(e,t),K=pa(t),Z=0,q=t.text.length,te=!0,me=Ze(t,e.doc.direction);if(me){var xe=(e.options.lineWrapping?Ko:zo)(e,t,i,N,me,n,c);te=xe.level!=1,Z=te?xe.from:xe.to-1,q=te?xe.to:xe.from-1}var Ne=null,Me=null,Ge=je(function(Tt){var vt=on(e,N,Tt);return vt.top+=K,vt.bottom+=K,ya(vt,n,c,!1)?(vt.top<=c&&vt.left<=n&&(Ne=Tt,Me=vt),!0):!1},Z,q),$e,qe,it=!1;if(Me){var lt=n-Me.left<Me.right-n,at=lt==te;Ge=Ne+(at?0:1),qe=at?"after":"before",$e=lt?Me.left:Me.right}else{!te&&(Ge==q||Ge==Z)&&Ge++,qe=Ge==0?"after":Ge==t.text.length?"before":on(e,N,Ge-(te?1:0)).bottom+K<=c==te?"after":"before";var ht=en(e,Qe(i,Ge,qe),"line",t,N);$e=ht.left,it=c<ht.top?-1:c>=ht.bottom?1:0}return Ge=Oe(t.text,Ge,1),ga(i,Ge,qe,it,n-$e)}function zo(e,t,i,n,c,N,K){var Z=je(function(xe){var Ne=c[xe],Me=Ne.level!=1;return ya(en(e,Qe(i,Me?Ne.to:Ne.from,Me?"before":"after"),"line",t,n),N,K,!0)},0,c.length-1),q=c[Z];if(Z>0){var te=q.level!=1,me=en(e,Qe(i,te?q.from:q.to,te?"after":"before"),"line",t,n);ya(me,N,K,!0)&&me.top>K&&(q=c[Z-1])}return q}function Ko(e,t,i,n,c,N,K){var Z=hs(e,t,n,K),q=Z.begin,te=Z.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var me=null,xe=null,Ne=0;Ne<c.length;Ne++){var Me=c[Ne];if(Me.from>=te||Me.to<=q)continue;var Ge=Me.level!=1,$e=on(e,n,Ge?Math.min(te,Me.to)-1:Math.max(q,Me.from)).right,qe=$e<N?N-$e+1e9:$e-N;(!me||xe>qe)&&(me=Me,xe=qe)}return me||(me=c[c.length-1]),me.from<q&&(me={from:q,to:me.to,level:me.level}),me.to>te&&(me={from:me.from,to:te,level:me.level}),me}var Nn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nn==null){Nn=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(d("br"));Nn.appendChild(document.createTextNode("x"))}E(e.measure,Nn);var i=Nn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),C(e.measure),i||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),i=d("pre",[t],"CodeMirror-line-like");E(e.measure,i);var n=t.getBoundingClientRect(),c=(n.right-n.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,i={},n={},c=t.gutters.clientLeft,N=t.gutters.firstChild,K=0;N;N=N.nextSibling,++K){var Z=e.display.gutterSpecs[K].className;i[Z]=N.offsetLeft+N.clientLeft+c,n[Z]=N.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=$n(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(c){if(an(e.doc,c))return 0;var N=0;if(c.widgets)for(var K=0;K<c.widgets.length;K++)c.widgets[K].height&&(N+=c.widgets[K].height);return i?N+(Math.ceil(c.text.length/n)||1)*t:N+t}}function Ea(e){var t=e.doc,i=cs(e);t.iter(function(n){var c=i(n);c!=n.height&&Jt(n,c)})}function Fn(e,t,i,n){var c=e.display;if(!i&&Se(t).getAttribute("cm-not-content")=="true")return null;var N,K,Z=c.lineSpace.getBoundingClientRect();try{N=t.clientX-Z.left,K=t.clientY-Z.top}catch(xe){return null}var q=va(e,N,K),te;if(n&&q.xRel>0&&(te=ct(e.doc,q.line).text).length==q.ch){var me=H(te,te.length,e.options.tabSize)-te.length;q=Qe(q.line,Math.max(0,Math.round((N-qa(e.display).left)/Jn(e.display))-me))}return q}function Un(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Mr(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var c=e.display;if(n&&i<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)cr&&ci(e.doc,t)<c.viewTo&&Sn(e);else if(i<=c.viewFrom)cr&&Tn(e.doc,i+n)>c.viewFrom?Sn(e):(c.viewFrom+=n,c.viewTo+=n);else if(t<=c.viewFrom&&i>=c.viewTo)Sn(e);else if(t<=c.viewFrom){var N=Gi(e,i,i+n,1);N?(c.view=c.view.slice(N.index),c.viewFrom=N.lineN,c.viewTo+=n):Sn(e)}else if(i>=c.viewTo){var K=Gi(e,t,t,-1);K?(c.view=c.view.slice(0,K.index),c.viewTo=K.lineN):Sn(e)}else{var Z=Gi(e,t,t,-1),q=Gi(e,i,i+n,1);Z&&q?(c.view=c.view.slice(0,Z.index).concat(kr(e,Z.lineN,q.lineN)).concat(c.view.slice(q.index)),c.viewTo+=n):Sn(e)}var te=c.externalMeasured;te&&(i<te.lineN?te.lineN+=n:t<te.lineN+te.size&&(c.externalMeasured=null))}function wn(e,t,i){e.curOp.viewChanged=!0;var n=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var N=n.view[Un(e,t)];if(N.node==null)return;var K=N.changes||(N.changes=[]);ae(K,i)==-1&&K.push(i)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gi(e,t,i,n){var c=Un(e,t),N,K=e.display.view;if(!cr||i==e.doc.first+e.doc.size)return{index:c,lineN:i};for(var Z=e.display.viewFrom,q=0;q<c;q++)Z+=K[q].size;if(Z!=t){if(n>0){if(c==K.length-1)return null;N=Z+K[c].size-t,c++}else N=Z-t;t+=N,i+=N}for(;ci(e.doc,i)!=i;){if(c==(n<0?0:K.length-1))return null;i+=n*K[c-(n<0?1:0)].size,c+=n}return{index:c,lineN:i}}function Vo(e,t,i){var n=e.display,c=n.view;c.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=kr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=kr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Un(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(kr(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Un(e,i)))),n.viewTo=i}function fs(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var c=t[n];!c.hidden&&(!c.node||c.changes)&&++i}return i}function bi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},c=n.cursors=document.createDocumentFragment(),N=n.selection=document.createDocumentFragment(),K=0;K<i.sel.ranges.length;K++){if(!t&&K==i.sel.primIndex)continue;var Z=i.sel.ranges[K];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var q=Z.empty();(q||e.options.showCursorWhenSelecting)&&ms(e,Z.head,c),q||Xo(e,Z,N)}return n}function ms(e,t,i){var n=en(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=i.appendChild(d("div","\xA0","CodeMirror-cursor"));if(c.style.left=n.left+"px",c.style.top=n.top+"px",c.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var N=i.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));N.style.display="",N.style.left=n.other.left+"px",N.style.top=n.other.top+"px",N.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function zi(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,i){var n=e.display,c=e.doc,N=document.createDocumentFragment(),K=qa(e.display),Z=K.left,q=Math.max(n.sizerWidth,Pn(e)-n.sizer.offsetLeft)-K.right,te=c.direction=="ltr";function me(at,ht,Tt,vt){ht<0&&(ht=0),ht=Math.round(ht),vt=Math.round(vt),N.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+at+`px;
top: `+ht+"px; width: "+(Tt==null?q-at:Tt)+`px;
height: `+(vt-ht)+"px"))}function xe(at,ht,Tt){var vt=ct(c,at),Rt=vt.text.length,Yt,gr;function er(sr,Fr){return ma(e,Qe(at,sr),"div",vt,Fr)}function Gr(sr,Fr,_r){var hr=ds(e,vt,null,sr),or=Fr=="ltr"==(_r=="after")?"left":"right",rr=_r=="after"?hr.begin:hr.end-(/\s/.test(vt.text.charAt(hr.end-1))?2:1);return er(rr,or)[or]}var Nr=Ze(vt,c.direction);return ze(Nr,ht||0,Tt==null?Rt:Tt,function(sr,Fr,_r,hr){var or=_r=="ltr",rr=er(sr,or?"left":"right"),Ur=er(Fr-1,or?"right":"left"),ui=ht==null&&sr==0,In=Tt==null&&Fr==Rt,Sr=hr==0,ln=!Nr||hr==Nr.length-1;if(Ur.top-rr.top<=3){var vr=(te?ui:In)&&Sr,Va=(te?In:ui)&&ln,pn=vr?Z:(or?rr:Ur).left,Gn=Va?q:(or?Ur:rr).right;me(pn,rr.top,Gn-pn,rr.bottom)}else{var zn,Rr,hi,Xa;or?(zn=te&&ui&&Sr?Z:rr.left,Rr=te?q:Gr(sr,_r,"before"),hi=te?Z:Gr(Fr,_r,"after"),Xa=te&&In&&ln?q:Ur.right):(zn=te?Gr(sr,_r,"before"):Z,Rr=!te&&ui&&Sr?q:rr.right,hi=!te&&In&&ln?Z:Ur.left,Xa=te?Gr(Fr,_r,"after"):q),me(zn,rr.top,Rr-zn,rr.bottom),rr.bottom<Ur.top&&me(Z,rr.bottom,null,Ur.top),me(hi,Ur.top,Xa-hi,Ur.bottom)}(!Yt||zi(rr,Yt)<0)&&(Yt=rr),zi(Ur,Yt)<0&&(Yt=Ur),(!gr||zi(rr,gr)<0)&&(gr=rr),zi(Ur,gr)<0&&(gr=Ur)}),{start:Yt,end:gr}}var Ne=t.from(),Me=t.to();if(Ne.line==Me.line)xe(Ne.line,Ne.ch,Me.ch);else{var Ge=ct(c,Ne.line),$e=ct(c,Me.line),qe=Ar(Ge)==Ar($e),it=xe(Ne.line,Ne.ch,qe?Ge.text.length+1:null).end,lt=xe(Me.line,qe?0:null,Me.ch).start;qe&&(it.top<lt.top-2?(me(it.right,it.top,null,it.bottom),me(Z,lt.top,lt.left,lt.bottom)):me(it.right,it.top,lt.left-it.right,it.bottom)),it.bottom<lt.top&&me(Z,it.bottom,null,lt.top)}i.appendChild(N)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Qn(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(He(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(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Qn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(He(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 Ki(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var c=t.view[n],N=e.options.lineWrapping,K=void 0,Z=0;if(c.hidden)continue;if(z&&W<8){var q=c.node.offsetTop+c.node.offsetHeight;K=q-i,i=q}else{var te=c.node.getBoundingClientRect();K=te.bottom-te.top,!N&&c.text.firstChild&&(Z=c.text.firstChild.getBoundingClientRect().right-te.left-1)}var me=c.line.height-K;if((me>.005||me<-.005)&&(Jt(c.line,K),ys(c.line),c.rest))for(var xe=0;xe<c.rest.length;xe++)ys(c.rest[xe]);if(Z>e.display.sizerWidth){var Ne=Math.ceil(Z/Jn(e.display));Ne>e.display.maxLineLength&&(e.display.maxLineLength=Ne,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Vi(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Hi(e));var c=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,N=lr(t,n),K=lr(t,c);if(i&&i.ensure){var Z=i.ensure.from.line,q=i.ensure.to.line;Z<N?(N=Z,K=lr(t,qr(ct(t,Z))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=K&&(N=lr(t,qr(ct(t,q))-e.wrapper.clientHeight),K=q)}return{from:N,to:Math.max(K,N+1)}}function Yo(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),c=null;if(t.top+n.top<0?c=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!o){var N=d("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Hi(e.display))+`px;
height: `+(t.bottom-t.top+sn(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(N),N.scrollIntoView(c),e.display.lineSpace.removeChild(N)}}function $o(e,t,i,n){n==null&&(n=0);var c;!e.options.lineWrapping&&t==i&&(t=t.ch?Qe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Qe(t.line,t.ch+1,"before"):t);for(var N=0;N<5;N++){var K=!1,Z=en(e,t),q=!i||i==t?Z:en(e,i);c={left:Math.min(Z.left,q.left),top:Math.min(Z.top,q.top)-n,right:Math.max(Z.left,q.left),bottom:Math.max(Z.bottom,q.bottom)+n};var te=wa(e,c),me=e.doc.scrollTop,xe=e.doc.scrollLeft;if(te.scrollTop!=null&&(Ei(e,te.scrollTop),Math.abs(e.doc.scrollTop-me)>1&&(K=!0)),te.scrollLeft!=null&&(Bn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-xe)>1&&(K=!0)),!K)break}return c}function Jo(e,t){var i=wa(e,t);i.scrollTop!=null&&Ei(e,i.scrollTop),i.scrollLeft!=null&&Bn(e,i.scrollLeft)}function wa(e,t){var i=e.display,n=$n(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,N=ca(e),K={};t.bottom-t.top>N&&(t.bottom=t.top+N);var Z=e.doc.height+da(i),q=t.top<n,te=t.bottom>Z-n;if(t.top<c)K.scrollTop=q?0:t.top;else if(t.bottom>c+N){var me=Math.min(t.top,(te?Z:t.bottom)-N);me!=c&&(K.scrollTop=me)}var xe=e.options.fixedGutter?0:i.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-xe,Me=Pn(e)-i.gutters.offsetWidth,Ge=t.right-t.left>Me;return Ge&&(t.right=t.left+Me),t.left<10?K.scrollLeft=0:t.left<Ne?K.scrollLeft=Math.max(0,t.left+xe-(Ge?0:10)):t.right>Me+Ne-3&&(K.scrollLeft=t.right+(Ge?0:10)-Me),K}function Sa(e,t){if(t==null)return;Xi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zn(e){Xi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _i(e,t,i){(t!=null||i!=null)&&Xi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Qo(e,t){Xi(e),e.curOp.scrollToPos=t}function Xi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=us(e,t.from),n=us(e,t.to);bs(e,i,n,t.margin)}}function bs(e,t,i,n){var c=wa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});_i(e,c.scrollLeft,c.scrollTop)}function Ei(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wi(e,100)}function _s(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bn(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xi(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var jn=function(e,t,i){this.cm=i;var n=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=c.tabIndex=-1,e(n),e(c),Be(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Be(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var c=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var N=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+N)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=s&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},jn.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var c=e.getBoundingClientRect(),N=i=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);N!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ti=function(){};Ti.prototype.update=function(){return{bottom:0,right:0}},Ti.prototype.setScrollLeft=function(){},Ti.prototype.setScrollTop=function(){},Ti.prototype.clear=function(){};function qn(e,t){t||(t=xi(e));var i=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var c=0;c<4&&i!=e.display.barWidth||n!=e.display.barHeight;c++)i!=e.display.barWidth&&e.options.lineWrapping&&Ki(e),Es(e,xi(e)),i=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var xs={native:jn,null:Ti};function Ts(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),Be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Bn(e,t):Ei(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function Hn(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},Jr(e.curOp)}function Wn(e){var t=e.curOp;t&&Io(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qo(i)})}function qo(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var c=0;c<t.length;c++)rl(t[c]);for(var N=0;N<t.length;N++)nl(t[N]);for(var K=0;K<t.length;K++)il(t[K])}function el(e){var t=e.cm,i=t.display;sl(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ki(t),e.barMeasure=xi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&gs(e.cm)}function il(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&ws(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bn(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,T(n,e.scrollToPos.from),T(n,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,c)}var N=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(N)for(var Z=0;Z<N.length;++Z)N[Z].lines.length||He(N[Z],"hide");if(K)for(var q=0;q<K.length;++q)K[q].lines.length&&He(K[q],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wr(e,t){if(e.curOp)return t();Hn(e);try{return t()}finally{Wn(e)}}function pr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hn(e);try{return t.apply(e,arguments)}finally{Wn(e)}}}function Or(e){return function(){if(this.curOp)return e.apply(this,arguments);Hn(this);try{return e.apply(this,arguments)}finally{Wn(this)}}}function mr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hn(t);try{return e.apply(this,arguments)}finally{Wn(t)}}}function wi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=tt(e,t.highlightFrontier),c=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(N){if(n.line>=e.display.viewFrom){var K=N.styles,Z=N.text.length>e.options.maxHighlightLength?Ft(t.mode,n.state):null,q=we(e,N,n,!0);Z&&(n.state=Z),N.styles=q.styles;var te=N.styleClasses,me=q.classes;me?N.styleClasses=me:te&&(N.styleClasses=null);for(var xe=!K||K.length!=N.styles.length||te!=me&&(!te||!me||te.bgClass!=me.bgClass||te.textClass!=me.textClass),Ne=0;!xe&&Ne<K.length;++Ne)xe=K[Ne]!=N.styles[Ne];xe&&c.push(n.line),N.stateAfter=n.save(),n.nextLine()}else N.text.length<=e.options.maxHighlightLength&&pt(e,N.text,n),N.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return wi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),c.length&&Wr(e,function(){for(var N=0;N<c.length;N++)wn(e,c[N],"text")})}var Yi=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Vi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Pn(e),this.force=i,this.dims=ba(e),this.events=[]};Yi.prototype.signal=function(e,t){Ee(e,t)&&this.events.push(arguments)},Yi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.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=sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=sn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=B();if(!t||!b(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&b(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Sn(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&fs(e)==0)return!1;Cs(e)&&(Sn(e),t.dims=ba(e));var c=n.first+n.size,N=Math.max(t.visible.from-e.options.viewportMargin,n.first),K=Math.min(c,t.visible.to+e.options.viewportMargin);i.viewFrom<N&&N-i.viewFrom<20&&(N=Math.max(n.first,i.viewFrom)),i.viewTo>K&&i.viewTo-K<20&&(K=Math.min(c,i.viewTo)),cr&&(N=ci(e.doc,N),K=Tn(e.doc,K));var Z=N!=i.viewFrom||K!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vo(e,N,K),i.viewOffset=qr(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var q=fs(e);if(!Z&&q==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var te=ol(e);return q>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),q>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(te),C(i.cursorDiv),C(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Z&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,wi(e,400)),i.updateLineNumbers=null,!0}function ws(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+da(e.display)-ca(e),i.top)}),t.visible=Vi(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vi(e.display,e.doc,i));if(!Ca(e,t))break;Ki(e);var c=xi(e);bi(e),qn(e,c),Ra(e,c),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 i=new Yi(e,t);if(Ca(e,i)){Ki(e),ws(e,i);var n=xi(e);bi(e),qn(e,n),Ra(e,n),i.finish()}}function ul(e,t,i){var n=e.display,c=e.options.lineNumbers,N=n.lineDiv,K=N.firstChild;function Z(Ge){var $e=Ge.nextSibling;return r&&s&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),$e}for(var q=n.view,te=n.viewFrom,me=0;me<q.length;me++){var xe=q[me];if(!xe.hidden)if(!xe.node||xe.node.parentNode!=N){var Ne=No(e,xe,te,i);N.insertBefore(Ne,K)}else{for(;K!=xe.node;)K=Z(K);var Me=c&&t!=null&&t<=te&&xe.lineNumber;xe.changes&&(ae(xe.changes,"gutter")>-1&&(Me=!1),Ya(e,xe,te,i)),Me&&(C(xe.lineNumber),xe.lineNumber.appendChild(document.createTextNode(Yr(e.options,te)))),K=xe.node.nextSibling}te+=xe.size}for(;K;)K=Z(K)}function Oa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(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+sn(e)+"px"}function Ss(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,N=n+"px",K=0;K<i.length;K++)if(!i[K].hidden){e.options.fixedGutter&&(i[K].gutter&&(i[K].gutter.style.left=N),i[K].gutterBackground&&(i[K].gutterBackground.style.left=N));var Z=i[K].alignable;if(Z)for(var q=0;q<Z.length;q++)Z[q].style.left=N}e.options.fixedGutter&&(t.gutters.style.left=n+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Yr(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var c=n.measure.appendChild(d("div",[d("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),N=c.firstChild.offsetWidth,K=c.offsetWidth-N;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(N,n.lineGutter.offsetWidth-K)+1,n.lineNumWidth=n.lineNumInnerWidth+K,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oa(e.display),!0}return!1}function La(e,t){for(var i=[],n=!1,c=0;c<e.length;c++){var N=e[c],K=null;if(typeof N!="string"&&(K=N.style,N=N.className),N=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:N,style:K})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function As(e){var t=e.gutters,i=e.gutterSpecs;C(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var c=i[n],N=c.className,K=c.style,Z=t.appendChild(d("div",null,"CodeMirror-gutter "+N));K&&(Z.style.cssText=K),N=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oa(e)}function Si(e){As(e.display),Mr(e),Ss(e)}function hl(e,t,i,n){var c=this;this.input=i,c.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=w("div",null,"CodeMirror-code"),c.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=d("div",null,"CodeMirror-cursors"),c.measure=d("div",null,"CodeMirror-measure"),c.lineMeasure=d("div",null,"CodeMirror-measure"),c.lineSpace=w("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var N=w("div",[c.lineSpace],"CodeMirror-lines");c.mover=d("div",[N],null,"position: relative"),c.sizer=d("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=d("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),c.gutters=d("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=d("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=d("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),z&&W<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!r&&!(P&&u)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=La(n.gutters,n.lineNumbers),As(c),i.init(c)}var $i=0,Vr=null;z?Vr=-.53:P?Vr=15:v?Vr=-.7:p&&(Vr=-1/3);function Os(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=Os(e);return t.x*=Vr,t.y*=Vr,t}function Rs(e,t){var i=Os(t),n=i.x,c=i.y,N=e.display,K=N.scroller,Z=K.scrollWidth>K.clientWidth,q=K.scrollHeight>K.clientHeight;if(!(n&&Z||c&&q))return;if(c&&s&&r){e:for(var te=t.target,me=N.view;te!=K;te=te.parentNode)for(var xe=0;xe<me.length;xe++)if(me[xe].node==te){e.display.currentWheelTarget=te;break e}}if(n&&!P&&!m&&Vr!=null){c&&q&&Ei(e,Math.max(0,K.scrollTop+c*Vr)),Bn(e,Math.max(0,K.scrollLeft+n*Vr)),(!c||c&&q)&&re(t),N.wheelStartX=null;return}if(c&&Vr!=null){var Ne=c*Vr,Me=e.doc.scrollTop,Ge=Me+N.wrapper.clientHeight;Ne<0?Me=Math.max(0,Me+Ne-50):Ge=Math.min(e.doc.height,Ge+Ne+50),Aa(e,{top:Me,bottom:Ge})}$i<20&&(N.wheelStartX==null?(N.wheelStartX=K.scrollLeft,N.wheelStartY=K.scrollTop,N.wheelDX=n,N.wheelDY=c,setTimeout(function(){if(N.wheelStartX==null)return;var $e=K.scrollLeft-N.wheelStartX,qe=K.scrollTop-N.wheelStartY,it=qe&&N.wheelDY&&qe/N.wheelDY||$e&&N.wheelDX&&$e/N.wheelDX;if(N.wheelStartX=N.wheelStartY=null,!it)return;Vr=(Vr*$i+it)/($i+1),++$i},200)):(N.wheelDX+=n,N.wheelDY+=c))}var Xr=function(e,t){this.ranges=e,this.primIndex=t};Xr.prototype.primary=function(){return this.ranges[this.primIndex]},Xr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!mn(i.anchor,n.anchor)||!mn(i.head,n.head))return!1}return!0},Xr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Gt(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new Xr(e,this.primIndex)},Xr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ct(t,n.from())>=0&&Ct(e,n.to())<=0)return i}return-1};var Gt=function(e,t){this.anchor=e,this.head=t};Gt.prototype.from=function(){return yn(this.anchor,this.head)},Gt.prototype.to=function(){return vn(this.anchor,this.head)},Gt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tn(e,t,i){var n=e&&e.options.selectionsMayTouch,c=t[i];t.sort(function(Ne,Me){return Ct(Ne.from(),Me.from())}),i=ae(t,c);for(var N=1;N<t.length;N++){var K=t[N],Z=t[N-1],q=Ct(Z.to(),K.from());if(n&&!K.empty()?q>0:q>=0){var te=yn(Z.from(),K.from()),me=vn(Z.to(),K.to()),xe=Z.empty()?K.from()==K.head:Z.from()==Z.head;N<=i&&--i,t.splice(--N,2,new Gt(xe?me:te,xe?te:me))}}return new Xr(t,i)}function Cn(e,t){return new Xr([new Gt(e,t||e)],0)}function An(e){return e.text?Qe(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return An(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=An(t).ch-t.to.ch),Qe(i,n)}function Ia(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var c=e.sel.ranges[n];i.push(new Gt(Ls(c.anchor,t),Ls(c.head,t)))}return tn(e.cm,i,e.sel.primIndex)}function Is(e,t,i){return e.line==t.line?Qe(i.line,e.ch-t.ch+i.ch):Qe(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var n=[],c=Qe(e.first,0),N=c,K=0;K<t.length;K++){var Z=t[K],q=Is(Z.from,c,N),te=Is(An(Z),c,N);if(c=Z.to,N=te,i=="around"){var me=e.sel.ranges[K],xe=Ct(me.head,me.anchor)<0;n[K]=new Gt(xe?te:q,xe?q:te)}else n[K]=new Gt(q,q)}return new Xr(n,e.sel.primIndex)}function Da(e){e.doc.mode=Lr(e.options,e.doc.modeOption),Ci(e)}function Ci(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,wi(e,100),e.state.modeGen++,e.curOp&&Mr(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,i,n){function c(lt){return i?i[lt]:null}function N(lt,at,ht){ua(lt,at,ht,n),br(lt,"change",lt,t)}function K(lt,at){for(var ht=[],Tt=lt;Tt<at;++Tt)ht.push(new Mn(te[Tt],c(Tt),n));return ht}var Z=t.from,q=t.to,te=t.text,me=ct(e,Z.line),xe=ct(e,q.line),Ne=ne(te),Me=c(te.length-1),Ge=q.line-Z.line;if(t.full)e.insert(0,K(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var $e=K(0,te.length-1);N(xe,xe.text,Me),Ge&&e.remove(Z.line,Ge),$e.length&&e.insert(Z.line,$e)}else if(me==xe)if(te.length==1)N(me,me.text.slice(0,Z.ch)+Ne+me.text.slice(q.ch),Me);else{var qe=K(1,te.length-1);qe.push(new Mn(Ne+me.text.slice(q.ch),Me,n)),N(me,me.text.slice(0,Z.ch)+te[0],c(0)),e.insert(Z.line+1,qe)}else if(te.length==1)N(me,me.text.slice(0,Z.ch)+te[0]+xe.text.slice(q.ch),c(0)),e.remove(Z.line+1,Ge);else{N(me,me.text.slice(0,Z.ch)+te[0],c(0)),N(xe,Ne+xe.text.slice(q.ch),Me);var it=K(1,te.length-1);Ge>1&&e.remove(Z.line+1,Ge-1),e.insert(Z.line+1,it)}br(e,"change",e,t)}function On(e,t,i){function n(c,N,K){if(c.linked)for(var Z=0;Z<c.linked.length;++Z){var q=c.linked[Z];if(q.doc==N)continue;var te=K&&q.sharedHist;if(i&&!te)continue;t(q.doc,te),n(q.doc,c,te)}}n(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),Ms(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,Mr(e)}function Ms(e){(e.doc.direction=="rtl"?F:A)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wr(e,function(){Ms(e),Mr(e)})}function Ji(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 Ma(e,t){var i={from:gn(t.from),to:An(t),text:Br(e,t.from,t.to)};return Fs(e,i,t.from.line,t.to.line+1),On(e,function(n){return Fs(n,i,t.from.line,t.to.line+1)},!0),i}function Ps(e){for(;e.length;){var t=ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),ne(e.done);if(e.done.length&&!ne(e.done).ranges)return ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ne(e.done)}function Ns(e,t,i,n){var c=e.history;c.undone.length=0;var N=+new Date,K,Z;if((c.lastOp==n||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>N-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(c,c.lastOp==n)))Z=ne(K.changes),Ct(t.from,t.to)==0&&Ct(t.from,Z.to)==0?Z.to=An(t):K.changes.push(Ma(e,t));else{var q=ne(c.done);for((!q||!q.ranges)&&Qi(e.sel,c.done),K={changes:[Ma(e,t)],generation:c.generation},c.done.push(K);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(i),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=N,c.lastOp=c.lastSelOp=n,c.lastOrigin=c.lastSelOrigin=t.origin,Z||He(e,"historyAdded")}function ml(e,t,i,n){var c=t.charAt(0);return c=="*"||c=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var c=e.history,N=n&&n.origin;i==c.lastSelOp||N&&c.lastSelOrigin==N&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==N||ml(e,N,ne(c.done),t))?c.done[c.done.length-1]=t:Qi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=N,c.lastSelOp=i,n&&n.clearRedo!==!1&&Ps(c.undone)}function Qi(e,t){var i=ne(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fs(e,t,i,n){var c=t["spans_"+e.id],N=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(K){K.markedSpans&&((c||(c=t["spans_"+e.id]={}))[N]=K.markedSpans),++N})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],c=0;c<t.text.length;++c)n.push(vl(i[c]));return n}function Us(e,t){var i=yl(e,t),n=Zr(e,t);if(!i)return n;if(!n)return i;for(var c=0;c<i.length;++c){var N=i[c],K=n[c];if(N&&K){e:for(var Z=0;Z<K.length;++Z){for(var q=K[Z],te=0;te<N.length;++te)if(N[te].marker==q.marker)continue e;N.push(q)}}else K&&(i[c]=K)}return i}function ei(e,t,i){for(var n=[],c=0;c<e.length;++c){var N=e[c];if(N.ranges){n.push(i?Xr.prototype.deepCopy.call(N):N);continue}var K=N.changes,Z=[];n.push({changes:Z});for(var q=0;q<K.length;++q){var te=K[q],me=void 0;if(Z.push({from:te.from,to:te.to,text:te.text}),t)for(var xe in te)(me=xe.match(/^spans_(\d+)$/))&&(ae(t,Number(me[1]))>-1&&(ne(Z)[xe]=te[xe],delete te[xe]))}}return n}function Pa(e,t,i,n){if(n){var c=e.anchor;if(i){var N=Ct(t,c)<0;N!=Ct(i,c)<0?(c=t,t=i):N!=Ct(t,i)<0&&(t=i)}return new Gt(c,t)}else return new Gt(i||t,t)}function Zi(e,t,i,n,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Xr([Pa(e.sel.primary(),t,i,c)],0),n)}function Bs(e,t,i){for(var n=[],c=e.cm&&(e.cm.display.shift||e.extend),N=0;N<e.sel.ranges.length;N++)n[N]=Pa(e.sel.ranges[N],t[N],null,c);var K=tn(e.cm,n,e.sel.primIndex);wr(e,K,i)}function Na(e,t,i,n){var c=e.sel.ranges.slice(0);c[t]=i,wr(e,tn(e.cm,c,e.sel.primIndex),n)}function js(e,t,i,n){wr(e,Cn(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(c){this.ranges=[];for(var N=0;N<c.length;N++)this.ranges[N]=new Gt(T(e,c[N].anchor),T(e,c[N].head))},origin:i&&i.origin};return He(e,"beforeSelectionChange",e,n),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?tn(e.cm,n.ranges,n.ranges.length-1):t}function Hs(e,t,i){var n=e.history.done,c=ne(n);c&&c.ranges?(n[n.length-1]=t,qi(e,t,i)):wr(e,t,i)}function wr(e,t,i){qi(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qi(e,t,i){(Ee(e,"beforeSelectionChange")||e.cm&&Ee(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,zs(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Zn(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,Ie(e.cm)),br(e,"cursorActivity",e)}function Gs(e){Ws(e,zs(e,e.sel,null,!1))}function zs(e,t,i,n){for(var c,N=0;N<t.ranges.length;N++){var K=t.ranges[N],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[N],q=ea(e,K.anchor,Z&&Z.anchor,i,n),te=ea(e,K.head,Z&&Z.head,i,n);(c||q!=K.anchor||te!=K.head)&&(c||(c=t.ranges.slice(0,N)),c[N]=new Gt(q,te))}return c?tn(e.cm,c,t.primIndex):t}function ti(e,t,i,n,c){var N=ct(e,t.line);if(N.markedSpans)for(var K=0;K<N.markedSpans.length;++K){var Z=N.markedSpans[K],q=Z.marker,te="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,me="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Z.from==null||(te?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(me?Z.to>=t.ch:Z.to>t.ch))){if(c&&(He(q,"beforeCursorEnter"),q.explicitlyCleared))if(N.markedSpans){--K;continue}else break;if(!q.atomic)continue;if(i){var xe=q.find(n<0?1:-1),Ne=void 0;if((n<0?me:te)&&(xe=Ks(e,xe,-n,xe&&xe.line==t.line?N:null)),xe&&xe.line==t.line&&(Ne=Ct(xe,i))&&(n<0?Ne<0:Ne>0))return ti(e,xe,t,n,c)}var Me=q.find(n<0?-1:1);return(n<0?te:me)&&(Me=Ks(e,Me,n,Me.line==t.line?N:null)),Me?ti(e,Me,t,n,c):null}}return t}function ea(e,t,i,n,c){var N=n||1,K=ti(e,t,i,N,c)||!c&&ti(e,t,i,N,!0)||ti(e,t,i,-N,c)||!c&&ti(e,t,i,-N,!0);return K||(e.cantEdit=!0,Qe(e.first,0))}function Ks(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?T(e,Qe(t.line-1)):null:i>0&&t.ch==(n||ct(e,t.line)).text.length?t.line<e.first+e.size-1?Qe(t.line+1,0):null:new Qe(t.line,t.ch+i)}function Vs(e){e.setSelection(Qe(e.firstLine(),0),Qe(e.lastLine()),ve)}function Xs(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(c,N,K,Z){c&&(n.from=T(e,c)),N&&(n.to=T(e,N)),K&&(n.text=K),Z!==void 0&&(n.origin=Z)}),He(e,"beforeChange",e,n),e.cm&&He(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ri(e,t,i){if(e.cm){if(!e.cm.curOp)return pr(e.cm,ri)(e,t,i);if(e.cm.state.suppressEdits)return}if((Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var n=Dn&&!i&&_n(e,t.from,t.to);if(n)for(var c=n.length-1;c>=0;--c)Ys(e,{from:n[c].from,to:n[c].to,text:c?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Ia(e,t);Ns(e,t,i,e.cm?e.cm.curOp.id:NaN),Ai(e,t,i,Zr(e,t));var n=[];On(e,function(c,N){!N&&ae(n,c.history)==-1&&(Zs(c.history,t),n.push(c.history)),Ai(c,t,null,Zr(c,t))})}function ta(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var c=e.history,N,K=e.sel,Z=t=="undo"?c.done:c.undone,q=t=="undo"?c.undone:c.done,te=0;te<Z.length&&!(N=Z[te],i?N.ranges&&!N.equals(e.sel):!N.ranges);te++);if(te==Z.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(N=Z.pop(),N.ranges){if(Qi(N,q),i&&!N.equals(e.sel)){wr(e,N,{clearRedo:!1});return}K=N}else if(n){Z.push(N);return}else break;var me=[];Qi(K,q),q.push({changes:me,generation:c.generation}),c.generation=N.generation||++c.maxGeneration;for(var xe=Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"),Ne=function($e){var qe=N.changes[$e];if(qe.origin=t,xe&&!Xs(e,qe,!1))return Z.length=0,{};me.push(Ma(e,qe));var it=$e?Ia(e,qe):ne(Z);Ai(e,qe,it,Us(e,qe)),!$e&&e.cm&&e.cm.scrollIntoView({from:qe.from,to:An(qe)});var lt=[];On(e,function(at,ht){!ht&&ae(lt,at.history)==-1&&(Zs(at.history,qe),lt.push(at.history)),Ai(at,qe,null,Us(at,qe))})},Me=N.changes.length-1;Me>=0;--Me){var Ge=Ne(Me);if(Ge)return Ge.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xr(fe(e.sel.ranges,function(c){return new Gt(Qe(c.anchor.line+t,c.anchor.ch),Qe(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)wn(e.cm,n,"gutter")}}function Ai(e,t,i,n){if(e.cm&&!e.cm.curOp)return pr(e.cm,Ai)(e,t,i,n);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 c=t.text.length-1-(e.first-t.from.line);$s(e,c),t={from:Qe(e.first,0),to:Qe(t.to.line+c,t.to.ch),text:[ne(t.text)],origin:t.origin}}var N=e.lastLine();t.to.line>N&&(t={from:t.from,to:Qe(N,ct(e,N).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Br(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),qi(e,i,ve),e.cantEdit&&ea(e,Qe(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,c=e.display,N=t.from,K=t.to,Z=!1,q=N.line;e.options.lineWrapping||(q=Ot(Ar(ct(n,N.line))),n.iter(q,K.line+1,function(Me){if(Me==c.maxLine)return Z=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ie(e),ka(n,t,i,cs(e)),e.options.lineWrapping||(n.iter(q,N.line+t.text.length,function(Me){var Ge=pi(Me);Ge>c.maxLineLength&&(c.maxLine=Me,c.maxLineLength=Ge,c.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),Qr(n,N.line),wi(e,400);var te=t.text.length-(K.line-N.line)-1;t.full?Mr(e):N.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?wn(e,N.line,"text"):Mr(e,N.line,K.line+1,te);var me=Ee(e,"changes"),xe=Ee(e,"change");if(xe||me){var Ne={from:N,to:K,text:t.text,removed:t.removed,origin:t.origin};xe&&br(e,"change",e,Ne),me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function ni(e,t,i,n,c){var N;n||(n=i),Ct(n,i)<0&&(N=[n,i],i=N[0],n=N[1]),typeof t=="string"&&(t=e.splitLines(t)),ri(e,{from:i,to:n,text:t,origin:c})}function Js(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,i,n){for(var c=0;c<e.length;++c){var N=e[c],K=!0;if(N.ranges){N.copied||(N=e[c]=N.deepCopy(),N.copied=!0);for(var Z=0;Z<N.ranges.length;Z++)Js(N.ranges[Z].anchor,t,i,n),Js(N.ranges[Z].head,t,i,n);continue}for(var q=0;q<N.changes.length;++q){var te=N.changes[q];if(i<te.from.line)te.from=Qe(te.from.line+n,te.from.ch),te.to=Qe(te.to.line+n,te.to.ch);else if(t<=te.to.line){K=!1;break}}K||(e.splice(0,c+1),c=0)}}function Zs(e,t){var i=t.from.line,n=t.to.line,c=t.text.length-(n-i)-1;Qs(e.done,i,n,c),Qs(e.undone,i,n,c)}function Oi(e,t,i,n){var c=t,N=t;return typeof t=="number"?N=ct(e,X(e,t)):c=Ot(t),c==null?null:(n(N,c)&&e.cm&&wn(e.cm,c,i),N)}function Ri(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ri.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var c=this.lines[i];this.height-=c.height,gt(c),br(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Li(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var c=e[n];t+=c.chunkSize(),i+=c.height,c.parent=this}this.size=t,this.height=i,this.parent=null}Li.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],c=n.chunkSize();if(e<c){var N=Math.min(t,c-e),K=n.height;if(n.removeInner(e,N),this.height-=K-n.height,c==N&&(this.children.splice(i--,1),n.parent=null),(t-=N)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ri))){var Z=[];this.collapse(Z),this.children=[new Ri(Z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var c=this.children[n],N=c.chunkSize();if(e<=N){if(c.insertInner(e,t,i),c.lines&&c.lines.length>50){for(var K=c.lines.length%25+25,Z=K;Z<c.lines.length;){var q=new Ri(c.lines.slice(Z,Z+=25));c.height-=q.height,this.children.splice(++n,0,q),q.parent=this}c.lines=c.lines.slice(0,K),this.maybeSpill()}break}e-=N}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Li(t);if(e.parent){e.size-=i.size,e.height-=i.height;var c=ae(e.parent.children,e);e.parent.children.splice(c+1,0,i)}else{var n=new Li(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var c=this.children[n],N=c.chunkSize();if(e<N){var K=Math.min(t,N-e);if(c.iterN(e,K,i))return!0;if((t-=K)==0)break;e=0}else e-=N}}};var Ii=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Ii.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Ot(i);if(n==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(i.widgets=null);var N=vi(this);Jt(i,Math.max(0,i.height-N)),e&&(Wr(e,function(){qs(e,i,-N),wn(e,n,"widget")}),br(e,"lineWidgetCleared",e,this,n))},Ii.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var c=vi(this)-t;if(!c)return;an(this.doc,n)||Jt(n,n.height+c),i&&Wr(i,function(){i.curOp.forceUpdate=!0,qs(i,n,c),br(i,"lineWidgetChanged",i,e,Ot(n))})},Ce(Ii);function qs(e,t,i){qr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,i)}function El(e,t,i,n){var c=new Ii(e,i,n),N=e.cm;return N&&c.noHScroll&&(N.display.alignWidgets=!0),Oi(e,t,"widget",function(K){var Z=K.widgets||(K.widgets=[]);if(c.insertAt==null?Z.push(c):Z.splice(Math.min(Z.length-1,Math.max(0,c.insertAt)),0,c),c.line=K,N&&!an(e,K)){var q=qr(K)<e.scrollTop;Jt(K,K.height+vi(c)),q&&Sa(N,c.height),N.curOp.forceUpdate=!0}return!0}),N&&br(N,"lineWidgetAdded",N,c,typeof t=="number"?t:Ot(t)),c}var eo=0,Rn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Rn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hn(e),Ee(this,"clear")){var i=this.find();i&&br(this,"clear",i.from,i.to)}for(var n=null,c=null,N=0;N<this.lines.length;++N){var K=this.lines[N],Z=Hr(K.markedSpans,this);e&&!this.collapsed?wn(e,Ot(K),"text"):e&&(Z.to!=null&&(c=Ot(K)),Z.from!=null&&(n=Ot(K))),K.markedSpans=kn(K.markedSpans,Z),Z.from==null&&this.collapsed&&!an(this.doc,K)&&e&&Jt(K,$n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var te=Ar(this.lines[q]),me=pi(te);me>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=me,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Mr(e,n,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&br(e,"markerCleared",e,this,n,c),t&&Wn(e),this.parent&&this.parent.clear()},Rn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,c=0;c<this.lines.length;++c){var N=this.lines[c],K=Hr(N.markedSpans,this);if(K.from!=null&&(i=Qe(t?N:Ot(N),K.from),e==-1))return i;if(K.to!=null&&(n=Qe(t?N:Ot(N),K.to),e==1))return n}return i&&{from:i,to:n}},Rn.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Wr(n,function(){var c=t.line,N=Ot(t.line),K=fa(n,N);if(K&&(is(K),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!an(i.doc,c)&&i.height!=null){var Z=i.height;i.height=null;var q=vi(i)-Z;q&&Jt(c,c.height+q)}br(n,"markerChanged",n,e)})},Rn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Rn.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ce(Rn);function ii(e,t,i,n,c){if(n&&n.shared)return xl(e,t,i,n,c);if(e.cm&&!e.cm.curOp)return pr(e.cm,ii)(e,t,i,n,c);var N=new Rn(e,c),K=Ct(t,i);if(n&&g(n,N,!1),K>0||K==0&&N.clearWhenEmpty!==!1)return N;if(N.replacedWith&&(N.collapsed=!0,N.widgetNode=w("span",[N.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||N.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(N.widgetNode.insertLeft=!0)),N.collapsed){if(fr(e,t.line,t,i,N)||t.line!=i.line&&fr(e,i.line,t,i,N))throw new Error("Inserting collapsed marker partially overlapping an existing one");un()}N.addToHistory&&Ns(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Z=t.line,q=e.cm,te;if(e.iter(Z,i.line+1,function(xe){q&&N.collapsed&&!q.options.lineWrapping&&Ar(xe)==q.display.maxLine&&(te=!0),N.collapsed&&Z!=t.line&&Jt(xe,0),bn(xe,new hn(N,Z==t.line?t.ch:null,Z==i.line?i.ch:null)),++Z}),N.collapsed&&e.iter(t.line,i.line+1,function(xe){an(e,xe)&&Jt(xe,0)}),N.clearOnEnter&&Be(N,"beforeCursorEnter",function(){return N.clear()}),N.readOnly&&(Kr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),N.collapsed&&(N.id=++eo,N.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),N.collapsed)Mr(q,t.line,i.line+1);else if(N.className||N.startStyle||N.endStyle||N.css||N.attributes||N.title)for(var me=t.line;me<=i.line;me++)wn(q,me,"text");N.atomic&&Gs(q.doc),br(q,"markerAdded",q,N)}return N}var Di=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Di.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();br(this,"clear")},Di.prototype.find=function(e,t){return this.primary.find(e,t)},Ce(Di);function xl(e,t,i,n,c){n=g(n),n.shared=!1;var N=[ii(e,t,i,n,c)],K=N[0],Z=n.widgetNode;return On(e,function(q){Z&&(n.widgetNode=Z.cloneNode(!0)),N.push(ii(q,T(q,t),T(q,i),n,c));for(var te=0;te<q.linked.length;++te)if(q.linked[te].isParent)return;K=ne(N)}),new Di(N,K)}function to(e){return e.findMarks(Qe(e.first,0),e.clipPos(Qe(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],c=n.find(),N=e.clipPos(c.from),K=e.clipPos(c.to);if(Ct(N,K)){var Z=ii(e,N,K,n.primary,n.primary.type);n.markers.push(Z),Z.parent=n}}}function wl(e){for(var t=function(n){var c=e[n],N=[c.primary.doc];On(c.primary.doc,function(q){return N.push(q)});for(var K=0;K<c.markers.length;K++){var Z=c.markers[K];ae(N,Z.doc)==-1&&(Z.parent=null,c.markers.splice(K--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Pr=function(e,t,i,n,c){if(!(this instanceof Pr))return new Pr(e,t,i,n,c);i==null&&(i=0),Li.call(this,[new Ri([new Mn("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var N=Qe(i,0);this.sel=Cn(N),this.history=new Ji(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:N,to:N,text:e}),wr(this,Cn(N),ve)};Pr.prototype=Fe(Li.prototype,{constructor:Pr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Vt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:mr(function(e){var t=Qe(this.first,0),i=this.first+this.size-1;ri(this,{from:t,to:Qe(i,ct(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_i(this.cm,0,0),wr(this,Cn(t),ve)}),replaceRange:function(e,t,i,n){t=T(this,t),i=i?T(this,i):t,ni(this,e,t,i,n)},getRange:function(e,t,i){var n=Br(this,T(this,e),T(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ir(this,e))return ct(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),Ar(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(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:mr(function(e,t,i){js(this,T(this,typeof e=="number"?Qe(e,t||0):e),null,i)}),setSelection:mr(function(e,t,i){js(this,T(this,e),T(this,t||e),i)}),extendSelection:mr(function(e,t,i){Zi(this,T(this,e),t&&T(this,t),i)}),extendSelections:mr(function(e,t){Bs(this,G(this,e),t)}),extendSelectionsBy:mr(function(e,t){var i=fe(this.sel.ranges,e);Bs(this,G(this,i),t)}),setSelections:mr(function(e,t,i){if(!e.length)return;for(var n=[],c=0;c<e.length;c++)n[c]=new Gt(T(this,e[c].anchor),T(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),wr(this,tn(this.cm,n,t),i)}),addSelection:mr(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Gt(T(this,e),T(this,t||e))),wr(this,tn(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var c=Br(this,t[n].from(),t[n].to());i=i?i.concat(c):c}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var c=Br(this,i[n].from(),i[n].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[n]=c}return t},replaceSelection:function(e,t,i){for(var n=[],c=0;c<this.sel.ranges.length;c++)n[c]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:mr(function(e,t,i){for(var n=[],c=this.sel,N=0;N<c.ranges.length;N++){var K=c.ranges[N];n[N]={from:K.from(),to:K.to(),text:this.splitLines(e[N]),origin:i}}for(var Z=t&&t!="end"&&cl(this,n,t),q=n.length-1;q>=0;q--)ri(this,n[q]);Z?Hs(this,Z):this.cm&&Zn(this.cm)}),undo:mr(function(){ta(this,"undo")}),redo:mr(function(){ta(this,"redo")}),undoSelection:mr(function(){ta(this,"undo",!0)}),redoSelection:mr(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Ji(this.history.maxGeneration),On(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:ei(this.history.done),undone:ei(this.history.undone)}},setHistory:function(e){var t=this.history=new Ji(this.history.maxGeneration);t.done=ei(e.done.slice(0),null,!0),t.undone=ei(e.undone.slice(0),null,!0)},setGutterMarker:mr(function(e,t,i){return Oi(this,e,"gutter",function(n){var c=n.gutterMarkers||(n.gutterMarkers={});return c[t]=i,!i&&se(c)&&(n.gutterMarkers=null),!0})}),clearGutter:mr(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Oi(t,i,"gutter",function(){return i.gutterMarkers[e]=null,se(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ir(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Ot(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:mr(function(e,t,i){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[c])n[c]=i;else{if(L(i).test(n[c]))return!1;n[c]+=" "+i}return!0})}),removeLineClass:mr(function(e,t,i){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",N=n[c];if(N)if(i==null)n[c]=null;else{var K=N.match(L(i));if(!K)return!1;var Z=K.index+K[0].length;n[c]=N.slice(0,K.index)+(!K.index||Z==N.length?"":" ")+N.slice(Z)||null}else return!1;return!0})}),addLineWidget:mr(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ii(this,T(this,e),T(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=T(this,e),ii(this,e,e,i,"bookmark")},findMarksAt:function(e){e=T(this,e);var t=[],i=ct(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var c=i[n];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,i){e=T(this,e),t=T(this,t);var n=[],c=e.line;return this.iter(e.line,t.line+1,function(N){var K=N.markedSpans;if(K)for(var Z=0;Z<K.length;Z++){var q=K[Z];!(q.to!=null&&c==e.line&&e.ch>=q.to||q.from==null&&c!=e.line||q.from!=null&&c==t.line&&q.from>=t.ch)&&(!i||i(q.marker))&&n.push(q.marker.parent||q.marker)}++c}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(c){var N=c.text.length+n;if(N>e)return t=e,!0;e-=N,++i}),T(this,Qe(i,t))},indexFromPos:function(e){e=T(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Pr(Vt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Pr(Vt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,to(this)),n},unlinkDoc:function(e){if(e instanceof Zt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var n=[e.id];On(e,function(c){return n.push(c.id)},!0),e.history=new Ji(null),e.history.done=ei(this.history.done,n),e.history.undone=ei(this.history.undone,n)}},iterLinkedDocs:function(e){On(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:mr(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)})}),Pr.prototype.eachLine=Pr.prototype.iter;var ro=0;function Cl(e){var t=this;if(no(t),We(t,e)||cn(t.display,e))return;re(e),z&&(ro=+new Date);var i=Fn(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var c=n.length,N=Array(c),K=0,Z=function(){++K==c&&pr(t,function(){i=T(t.doc,i);var Me={from:i,to:i,text:t.doc.splitLines(N.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};ri(t.doc,Me),Hs(t.doc,Cn(T(t.doc,i),T(t.doc,An(Me))))})()},q=function(Me,Ge){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,Me.type)==-1){Z();return}var $e=new FileReader;$e.onerror=function(){return Z()},$e.onload=function(){var qe=$e.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){Z();return}N[Ge]=qe,Z()},$e.readAsText(Me)},te=0;te<n.length;te++)q(n[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var me=e.dataTransfer.getData("Text");if(me){var xe;if(t.state.draggingText&&!t.state.draggingText.copy&&(xe=t.listSelections()),qi(t.doc,Cn(i,i)),xe)for(var Ne=0;Ne<xe.length;++Ne)ni(t.doc,"",xe[Ne].anchor,xe[Ne].head,"drag");t.replaceSelection(me,"around","paste"),t.display.input.focus()}}catch(Me){}}}function Al(e,t){if(z&&(!e.state.draggingText||+new Date-ro<100)){ge(t);return}if(We(e,t)||cn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var i=d("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),m&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Fn(e,t);if(!i)return;var n=document.createDocumentFragment();ms(e,i,n),e.display.dragCursor||(e.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),E(e.display.dragCursor,n)}function no(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function io(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var c=t[n].CodeMirror;c&&i.push(c)}i.length&&i[0].operation(function(){for(var N=0;N<i.length;N++)e(i[N])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,io(Il)},100))}),Be(window,"blur",function(){return io(Qn)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ln={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"},ki=0;ki<10;ki++)Ln[ki+48]=Ln[ki+96]=String(ki);for(var ra=65;ra<=90;ra++)Ln[ra]=String.fromCharCode(ra);for(var Mi=1;Mi<=12;Mi++)Ln[Mi+111]=Ln[Mi+63235]="F"+Mi;var fn={};fn.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"},fn.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"},fn.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"},fn.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"]},fn.default=s?fn.macDefault:fn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,c,N,K=0;K<t.length-1;K++){var Z=t[K];if(/^(cmd|meta|m)$/i.test(Z))N=!0;else if(/^a(lt)?$/i.test(Z))i=!0;else if(/^(c|ctrl|control)$/i.test(Z))n=!0;else if(/^s(hift)?$/i.test(Z))c=!0;else throw new Error("Unrecognized modifier name: "+Z)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),N&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var c=fe(i.split(" "),Dl),N=0;N<c.length;N++){var K=void 0,Z=void 0;N==c.length-1?(Z=c.join(" "),K=n):(Z=c.slice(0,N+1).join(" "),K="...");var q=t[Z];if(!q)t[Z]=K;else if(q!=K)throw new Error("Inconsistent bindings for "+Z)}delete e[i]}for(var te in t)e[te]=t[te];return e}function ai(e,t,i,n){t=na(t);var c=t.call?t.call(e,n):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&i(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ai(e,t.fallthrough,i,n);for(var N=0;N<t.fallthrough.length;N++){var K=ai(e,t.fallthrough[N],i,n);if(K)return K}}}function so(e){var t=typeof e=="string"?e:Ln[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var i=Ln[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),oo(i,e,t))}function na(e){return typeof e=="string"?fn[e]:e}function si(e,t){for(var i=e.doc.sel.ranges,n=[],c=0;c<i.length;c++){for(var N=t(i[c]);n.length&&Ct(N.from,ne(n).to)<=0;){var K=n.pop();if(Ct(K.from,N.from)<0){N.from=K.from;break}}n.push(N)}Wr(e,function(){for(var Z=n.length-1;Z>=0;Z--)ni(e.doc,"",n[Z].from,n[Z].to,"+delete");Zn(e)})}function Fa(e,t,i){var n=Oe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ua(e,t,i){var n=Fa(e,t.ch,i);return n==null?null:new Qe(t.line,n,i<0?"after":"before")}function Ba(e,t,i,n,c){if(e){t.doc.direction=="rtl"&&(c=-c);var N=Ze(i,t.doc.direction);if(N){var K=c<0?ne(N):N[0],Z=c<0==(K.level==1),q=Z?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var me=Yn(t,i);te=c<0?i.text.length-1:0;var xe=on(t,me,te).top;te=je(function(Ne){return on(t,me,Ne).top==xe},c<0==(K.level==1)?K.from:K.to-1,te),q=="before"&&(te=Fa(i,te,1))}else te=c<0?K.to:K.from;return new Qe(n,te,q)}}return new Qe(n,c<0?i.text.length:0,c<0?"before":"after")}function Ml(e,t,i,n){var c=Ze(t,e.doc.direction);if(!c)return Ua(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var N=Ye(c,i.ch,i.sticky),K=c[N];if(e.doc.direction=="ltr"&&K.level%2==0&&(n>0?K.to>i.ch:K.from<i.ch))return Ua(t,i,n);var Z=function(it,lt){return Fa(t,it instanceof Qe?it.ch:it,lt)},q,te=function(it){return e.options.lineWrapping?(q=q||Yn(e,t),ds(e,t,q,it)):{begin:0,end:t.text.length}},me=te(i.sticky=="before"?Z(i,-1):i.ch);if(e.doc.direction=="rtl"||K.level==1){var xe=K.level==1==n<0,Ne=Z(i,xe?1:-1);if(Ne!=null&&(xe?Ne<=K.to&&Ne<=me.end:Ne>=K.from&&Ne>=me.begin)){var Me=xe?"before":"after";return new Qe(i.line,Ne,Me)}}var Ge=function(it,lt,at){for(var ht=function(Yt,gr){return gr?new Qe(i.line,Z(Yt,1),"before"):new Qe(i.line,Yt,"after")};it>=0&&it<c.length;it+=lt){var Tt=c[it],vt=lt>0==(Tt.level!=1),Rt=vt?at.begin:Z(at.end,-1);if(Tt.from<=Rt&&Rt<Tt.to)return ht(Rt,vt);if(Rt=vt?Tt.from:Z(Tt.to,-1),at.begin<=Rt&&Rt<at.end)return ht(Rt,vt)}},$e=Ge(N+n,n,me);if($e)return $e;var qe=n>0?me.end:Z(me.begin,-1);return qe!=null&&!(n>0&&qe==t.text.length)&&($e=Ge(n>0?0:c.length-1,n,te(qe)),$e)?$e:null}var Pi={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return si(e,function(t){if(t.empty()){var i=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Qe(t.head.line+1,0)}:{from:t.head,to:Qe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return si(e,function(t){return{from:Qe(t.from().line,0),to:T(e.doc,Qe(t.to().line+1,0))}})},delLineLeft:function(e){return si(e,function(t){return{from:Qe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return si(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return si(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},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(Qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Qe(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 Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},_e)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},_e)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ho(e,t.head):n},_e)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,c=0;c<i.length;c++){var N=i[c].from(),K=H(e.getLine(N.line),N.ch,n);t.push(ce(n-K%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wr(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var c=t[n].head,N=ct(e.doc,c.line).text;if(N){if(c.ch==N.length&&(c=new Qe(c.line,c.ch-1)),c.ch>0)c=new Qe(c.line,c.ch+1),e.replaceRange(N.charAt(c.ch-1)+N.charAt(c.ch-2),Qe(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var K=ct(e.doc,c.line-1).text;K&&(c=new Qe(c.line,1),e.replaceRange(N.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Qe(c.line-1,K.length-1),c,"+transpose"))}}i.push(new Gt(c,c))}e.setSelections(i)})},newlineAndIndent:function(e){return Wr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Zn(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var i=ct(e.doc,t),n=Ar(i);return n!=i&&(t=Ot(n)),Ba(!0,e,n,t,1)}function Pl(e,t){var i=ct(e.doc,t),n=Xn(i);return n!=i&&(t=Ot(n)),Ba(!0,e,i,t,-1)}function ho(e,t){var i=uo(e,t.line),n=ct(e.doc,i.line),c=Ze(n,e.doc.direction);if(!c||c[0].level==0){var N=Math.max(i.ch,n.text.search(/\S/)),K=t.line==i.line&&t.ch<=N&&t.ch;return Qe(i.line,K?0:N,i.sticky)}return i}function ia(e,t,i){if(typeof t=="string"&&(t=Pi[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),c=t(e)!=Le}finally{e.display.shift=n,e.state.suppressEdits=!1}return c}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var c=ai(t,e.state.keyMaps[n],i,e);if(c)return c}return e.options.extraKeys&&ai(t,e.options.extraKeys,i,e)||ai(t,e.options.keyMap,i,e)}var Fl=new $;function Ni(e,t,i,n){var c=e.state.keySeq;if(c){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),co(e,c+" "+t,i,n))return!0}return co(e,t,i,n)}function co(e,t,i,n){var c=Nl(e,t,n);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&br(e,"keyHandled",e,t,i),(c=="handled"||c=="multi")&&(re(i),xa(e)),!!c}function fo(e,t){var i=lo(t,!0);return i?t.shiftKey&&!e.state.keySeq?Ni(e,"Shift-"+i,t,function(n){return ia(e,n,!0)})||Ni(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ia(e,n)}):Ni(e,i,t,function(n){return ia(e,n)}):!1}function Ul(e,t,i){return Ni(e,"'"+i+"'",t,function(n){return ia(e,n,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=B(),We(t,e))return;z&&W<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=fo(t,e);m&&(ja=n?i:null,!n&&i==88&&!Bt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!s&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(A(t,"CodeMirror-crosshair"),st(document,"keyup",i),st(document,"mouseover",i))}Be(document,"keyup",i),Be(document,"mouseover",i)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(cn(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(m&&i==ja){ja=null,re(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var c=String.fromCharCode(n==null?i:n);if(c=="\b")return;if(Ul(t,e,c))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ha.prototype.compare=function(e,t,i){return this.time+jl>e&&Ct(t,this.pos)==0&&i==this.button};var Fi,Ui;function Hl(e,t){var i=+new Date;return Ui&&Ui.compare(i,e,t)?(Fi=Ui=null,"triple"):Fi&&Fi.compare(i,e,t)?(Ui=new Ha(i,e,t),Fi=null,"double"):(Fi=new Ha(i,e,t),Ui=null,"single")}function vo(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,cn(i,e)){r||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Fn(t,e),c=Ue(e),N=n?Hl(n,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,c,n,N,e))return;c==1?n?zl(t,n,N,e):Se(e)==i.scroller&&re(e):c==2?(n&&Zi(t.doc,n),setTimeout(function(){return i.input.focus()},20)):c==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,i,n,c){var N="Click";return n=="double"?N="Double"+N:n=="triple"&&(N="Triple"+N),N=(t==1?"Left":t==2?"Middle":"Right")+N,Ni(e,oo(N,c),c,function(K){if(typeof K=="string"&&(K=Pi[K]),!K)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=K(e,i)!=Le}finally{e.state.suppressEdits=!1}return Z})}function Gl(e,t,i){var n=e.getOption("configureMouse"),c=n?n(e,t,i):{};if(c.unit==null){var N=a?i.shiftKey&&i.metaKey:i.altKey;c.unit=N?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||i.shiftKey),c.addNew==null&&(c.addNew=s?i.metaKey:i.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(s?i.altKey:i.ctrlKey)),c}function zl(e,t,i,n){z?setTimeout(I(gs,e),0):e.curOp.focus=B();var c=Gl(e,i,n),N=e.doc.sel,K;e.options.dragDrop&&Ve&&!e.isReadOnly()&&i=="single"&&(K=N.contains(t))>-1&&(Ct((K=N.ranges[K]).from(),t)<0||t.xRel>0)&&(Ct(K.to(),t)>0||t.xRel<0)?Kl(e,n,t,c):Vl(e,n,t,c)}function Kl(e,t,i,n){var c=e.display,N=!1,K=pr(e,function(te){r&&(c.scroller.draggable=!1),e.state.draggingText=!1,st(c.wrapper.ownerDocument,"mouseup",K),st(c.wrapper.ownerDocument,"mousemove",Z),st(c.scroller,"dragstart",q),st(c.scroller,"drop",K),N||(re(te),n.addNew||Zi(e.doc,i,null,null,n.extend),r&&!p||z&&W==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),Z=function(te){N=N||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return N=!0};r&&(c.scroller.draggable=!0),e.state.draggingText=K,K.copy=!n.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),Be(c.wrapper.ownerDocument,"mouseup",K),Be(c.wrapper.ownerDocument,"mousemove",Z),Be(c.scroller,"dragstart",q),Be(c.scroller,"drop",K),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,i){if(i=="char")return new Gt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Gt(Qe(t.line,0),T(e.doc,Qe(t.line+1,0)));var n=i(e,t);return new Gt(n.from,n.to)}function Vl(e,t,i,n){var c=e.display,N=e.doc;re(t);var K,Z,q=N.sel,te=q.ranges;if(n.addNew&&!n.extend?(Z=N.sel.contains(i),Z>-1?K=te[Z]:K=new Gt(i,i)):(K=N.sel.primary(),Z=N.sel.primIndex),n.unit=="rectangle")n.addNew||(K=new Gt(i,i)),i=Fn(e,t,!0,!0),Z=-1;else{var me=yo(e,i,n.unit);n.extend?K=Pa(K,me.anchor,me.head,n.extend):K=me}n.addNew?Z==-1?(Z=te.length,wr(N,tn(e,te.concat([K]),Z),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Z].empty()&&n.unit=="char"&&!n.extend?(wr(N,tn(e,te.slice(0,Z).concat(te.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),q=N.sel):Na(N,Z,K,Te):(Z=0,wr(N,new Xr([K],0),Te),q=N.sel);var xe=i;function Ne(at){if(Ct(xe,at)==0)return;if(xe=at,n.unit=="rectangle"){for(var ht=[],Tt=e.options.tabSize,vt=H(ct(N,i.line).text,i.ch,Tt),Rt=H(ct(N,at.line).text,at.ch,Tt),Yt=Math.min(vt,Rt),gr=Math.max(vt,Rt),er=Math.min(i.line,at.line),Gr=Math.min(e.lastLine(),Math.max(i.line,at.line));er<=Gr;er++){var Nr=ct(N,er).text,sr=De(Nr,Yt,Tt);Yt==gr?ht.push(new Gt(Qe(er,sr),Qe(er,sr))):Nr.length>sr&&ht.push(new Gt(Qe(er,sr),Qe(er,De(Nr,gr,Tt))))}ht.length||ht.push(new Gt(i,i)),wr(N,tn(e,q.ranges.slice(0,Z).concat(ht),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(at)}else{var Fr=K,_r=yo(e,at,n.unit),hr=Fr.anchor,or;Ct(_r.anchor,hr)>0?(or=_r.head,hr=yn(Fr.from(),_r.anchor)):(or=_r.anchor,hr=vn(Fr.to(),_r.head));var rr=q.ranges.slice(0);rr[Z]=Xl(e,new Gt(T(N,hr),or)),wr(N,tn(e,rr,Z),Te)}}var Me=c.wrapper.getBoundingClientRect(),Ge=0;function $e(at){var ht=++Ge,Tt=Fn(e,at,!0,n.unit=="rectangle");if(!Tt)return;if(Ct(Tt,xe)!=0){e.curOp.focus=B(),Ne(Tt);var vt=Vi(c,N);(Tt.line>=vt.to||Tt.line<vt.from)&&setTimeout(pr(e,function(){Ge==ht&&$e(at)}),150)}else{var Rt=at.clientY<Me.top?-20:at.clientY>Me.bottom?20:0;Rt&&setTimeout(pr(e,function(){if(Ge!=ht)return;c.scroller.scrollTop+=Rt,$e(at)}),50)}}function qe(at){e.state.selectingText=!1,Ge=Infinity,at&&(re(at),c.input.focus()),st(c.wrapper.ownerDocument,"mousemove",it),st(c.wrapper.ownerDocument,"mouseup",lt),N.history.lastSelOrigin=null}var it=pr(e,function(at){at.buttons===0||!Ue(at)?qe(at):$e(at)}),lt=pr(e,qe);e.state.selectingText=lt,Be(c.wrapper.ownerDocument,"mousemove",it),Be(c.wrapper.ownerDocument,"mouseup",lt)}function Xl(e,t){var i=t.anchor,n=t.head,c=ct(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var N=Ze(c);if(!N)return t;var K=Ye(N,i.ch,i.sticky),Z=N[K];if(Z.from!=i.ch&&Z.to!=i.ch)return t;var q=K+(Z.from==i.ch==(Z.level!=1)?0:1);if(q==0||q==N.length)return t;var te;if(n.line!=i.line)te=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var me=Ye(N,n.ch,n.sticky),xe=me-K||(n.ch-i.ch)*(Z.level==1?-1:1);me==q-1||me==q?te=xe<0:te=xe>0}var Ne=N[q+(te?-1:0)],Me=te==(Ne.level==1),Ge=Me?Ne.from:Ne.to,$e=Me?"after":"before";return i.ch==Ge&&i.sticky==$e?t:new Gt(new Qe(i.line,Ge,$e),n)}function bo(e,t,i,n){var c,N;if(t.touches)c=t.touches[0].clientX,N=t.touches[0].clientY;else try{c=t.clientX,N=t.clientY}catch(Ne){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&re(t);var K=e.display,Z=K.lineDiv.getBoundingClientRect();if(N>Z.bottom||!Ee(e,i))return de(t);N-=Z.top-K.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var te=K.gutters.childNodes[q];if(te&&te.getBoundingClientRect().right>=c){var me=lr(e.doc,N),xe=e.display.gutterSpecs[q];return He(e,i,e,me,xe.className,t),de(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(cn(e.display,t)||Yl(e,t))return;if(We(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return Ee(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-"),yi(e)}var oi={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function i(n,c,N,K){e.defaults[n]=c,N&&(t[n]=K?function(Z,q,te){te!=oi&&N(Z,q,te)}:N)}e.defineOption=i,e.Init=oi,i("value","",function(n,c){return n.setValue(c)},!0),i("mode",null,function(n,c){n.doc.modeOption=c,Da(n)},!0),i("indentUnit",2,Da,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Ci(n),yi(n),Mr(n)},!0),i("lineSeparator",null,function(n,c){if(n.doc.lineSep=c,!c)return;var N=[],K=n.doc.first;n.doc.iter(function(q){for(var te=0;;){var me=q.text.indexOf(c,te);if(me==-1)break;te=me+c.length,N.push(Qe(K,me))}K++});for(var Z=N.length-1;Z>=0;Z--)ni(n.doc,c,N[Z],Qe(N[Z].line,N[Z].ch+c.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,c,N){n.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),N!=oi&&n.refresh()}),i("specialCharPlaceholder",Xt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,c){return n.getInputField().spellcheck=c},!0),i("autocorrect",!1,function(n,c){return n.getInputField().autocorrect=c},!0),i("autocapitalize",!1,function(n,c){return n.getInputField().autocapitalize=c},!0),i("rtlMoveVisually",!O),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Eo(n),Si(n)},!0),i("keyMap","default",function(n,c,N){var K=na(c),Z=N!=oi&&na(N);Z&&Z.detach&&Z.detach(n,K),K.attach&&K.attach(n,Z||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(n,c){n.display.gutterSpecs=La(c,n.options.lineNumbers),Si(n)},!0),i("fixedGutter",!0,function(n,c){n.display.gutters.style.left=c?_a(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qn(n)},!0),i("scrollbarStyle","native",function(n){Ts(n),qn(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,c){n.display.gutterSpecs=La(n.options.gutters,c),Si(n)},!0),i("firstLineNumber",1,Si,!0),i("lineNumberFormatter",function(n){return n},Si,!0),i("showCursorWhenSelecting",!1,bi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,c){c=="nocursor"&&(Qn(n),n.display.input.blur()),n.display.input.readOnlyChanged(c)}),i("screenReaderLabel",null,function(n,c){c=c===""?null:c,n.display.input.screenReaderLabelChanged(c)}),i("disableInput",!1,function(n,c){c||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bi,!0),i("singleCursorHeightPerLine",!0,bi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Ci,!0),i("addModeClass",!1,Ci,!0),i("pollInterval",100),i("undoDepth",200,function(n,c){return n.doc.history.undoDepth=c}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Ci,!0),i("moveInputWithCursor",!0,function(n,c){c||n.display.input.resetPosition()}),i("tabindex",null,function(n,c){return n.display.input.getField().tabIndex=c||""}),i("autofocus",null),i("direction","ltr",function(n,c){return n.doc.setDirection(c)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=oi;if(!t!=!n){var c=e.display.dragFunctions,N=t?Be:st;N(e.display.scroller,"dragstart",c.start),N(e.display.scroller,"dragenter",c.enter),N(e.display.scroller,"dragover",c.over),N(e.display.scroller,"dragleave",c.leave),N(e.display.scroller,"drop",c.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"),ji(e)),Ea(e),Mr(e),yi(e),setTimeout(function(){return qn(e)},100)}function Zt(e,t){var i=this;if(!(this instanceof Zt))return new Zt(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var n=t.value;typeof n=="string"?n=new Pr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var c=new Zt.inputStyles[t.inputStyle](this),N=this.display=new hl(e,n,c,t);N.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $,keySeq:null,specialChars:null},t.autofocus&&!u&&N.input.focus(),z&&W<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Rl(),Hn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ta(i)},20):Qn(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],oi);Cs(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<Ga.length;++Z)Ga[Z](this);Wn(this),r&&t.lineWrapping&&getComputedStyle(N.lineDiv).textRendering=="optimizelegibility"&&(N.lineDiv.style.textRendering="auto")}Zt.defaults=xo,Zt.optionHandlers=aa;function Zl(e){var t=e.display;Be(t.scroller,"mousedown",pr(e,vo)),z&&W<11?Be(t.scroller,"dblclick",pr(e,function(q){if(We(e,q))return;var te=Fn(e,q);if(!te||Wa(e,q)||cn(e.display,q))return;re(q);var me=e.findWordAt(te);Zi(e.doc,me.anchor,me.head)})):Be(t.scroller,"dblclick",function(q){return We(e,q)||re(q)}),Be(t.scroller,"contextmenu",function(q){return _o(e,q)}),Be(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||_o(e,q)});var i,n={end:0};function c(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function N(q){if(q.touches.length!=1)return!1;var te=q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function K(q,te){if(te.left==null)return!0;var me=te.left-q.left,xe=te.top-q.top;return me*me+xe*xe>20*20}Be(t.scroller,"touchstart",function(q){if(!We(e,q)&&!N(q)&&!Wa(e,q)){t.input.ensurePolled(),clearTimeout(i);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Be(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!cn(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var me=e.coordsChar(t.activeTouch,"page"),xe;!te.prev||K(te,te.prev)?xe=new Gt(me,me):!te.prev.prev||K(te,te.prev.prev)?xe=e.findWordAt(me):xe=new Gt(Qe(me.line,0),T(e.doc,Qe(me.line+1,0))),e.setSelection(xe.anchor,xe.head),e.focus(),re(q)}c()}),Be(t.scroller,"touchcancel",c),Be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ei(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),Be(t.scroller,"mousewheel",function(q){return Rs(e,q)}),Be(t.scroller,"DOMMouseScroll",function(q){return Rs(e,q)}),Be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){We(e,q)||ge(q)},over:function(q){We(e,q)||(Ol(e,q),ge(q))},start:function(q){return Al(e,q)},drop:pr(e,Cl),leave:function(q){We(e,q)||no(e)}};var Z=t.input.getField();Be(Z,"keyup",function(q){return mo.call(e,q)}),Be(Z,"keydown",pr(e,po)),Be(Z,"keypress",pr(e,go)),Be(Z,"focus",function(q){return Ta(e,q)}),Be(Z,"blur",function(q){return Qn(e,q)})}var Ga=[];Zt.defineInitHook=function(e){return Ga.push(e)};function Bi(e,t,i,n){var c=e.doc,N;i==null&&(i="add"),i=="smart"&&(c.mode.indent?N=tt(e,t).state:i="prev");var K=e.options.tabSize,Z=ct(c,t),q=H(Z.text,null,K);Z.stateAfter&&(Z.stateAfter=null);var te=Z.text.match(/^\s*/)[0],me;if(!n&&!/\S/.test(Z.text))me=0,i="not";else if(i=="smart"&&(me=c.mode.indent(N,Z.text.slice(te.length),Z.text),me==Le||me>150)){if(!n)return;i="prev"}i=="prev"?t>c.first?me=H(ct(c,t-1).text,null,K):me=0:i=="add"?me=q+e.options.indentUnit:i=="subtract"?me=q-e.options.indentUnit:typeof i=="number"&&(me=q+i),me=Math.max(0,me);var xe="",Ne=0;if(e.options.indentWithTabs)for(var Me=Math.floor(me/K);Me;--Me)Ne+=K,xe+=" ";if(Ne<me&&(xe+=ce(me-Ne)),xe!=te)return ni(c,xe,Qe(t,0),Qe(t,te.length),"+input"),Z.stateAfter=null,!0;for(var Ge=0;Ge<c.sel.ranges.length;Ge++){var $e=c.sel.ranges[Ge];if($e.head.line==t&&$e.head.ch<te.length){var qe=Qe(t,te.length);Na(c,Ge,new Gt(qe,qe));break}}}var rn=null;function sa(e){rn=e}function za(e,t,i,n,c){var N=e.doc;e.display.shift=!1,n||(n=N.sel);var K=+new Date-200,Z=c=="paste"||e.state.pasteIncoming>K,q=St(t),te=null;if(Z&&n.ranges.length>1)if(rn&&rn.text.join(`
`)==t){if(n.ranges.length%rn.text.length==0){te=[];for(var me=0;me<rn.text.length;me++)te.push(N.splitLines(rn.text[me]))}}else q.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(te=fe(q,function(it){return[it]}));for(var xe=e.curOp.updateInput,Ne=n.ranges.length-1;Ne>=0;Ne--){var Me=n.ranges[Ne],Ge=Me.from(),$e=Me.to();Me.empty()&&(i&&i>0?Ge=Qe(Ge.line,Ge.ch-i):e.state.overwrite&&!Z?$e=Qe($e.line,Math.min(ct(N,$e.line).text.length,$e.ch+ne(q).length)):Z&&rn&&rn.lineWise&&rn.text.join(`
`)==q.join(`
`)&&(Ge=$e=Qe(Ge.line,0)));var qe={from:Ge,to:$e,text:te?te[Ne%te.length]:q,origin:c||(Z?"paste":e.state.cutIncoming>K?"cut":"+input")};ri(e.doc,qe),br(e,"inputRead",e,qe)}t&&!Z&&wo(e,t),Zn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=xe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wr(t,function(){return za(t,i,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var c=i.ranges[n];if(c.head.ch>100||n&&i.ranges[n-1].head.line==c.head.line)continue;var N=e.getModeAt(c.head),K=!1;if(N.electricChars){for(var Z=0;Z<N.electricChars.length;Z++)if(t.indexOf(N.electricChars.charAt(Z))>-1){K=Bi(e,c.head.line,"smart");break}}else N.electricInput&&(N.electricInput.test(ct(e.doc,c.head.line).text.slice(0,c.head.ch))&&(K=Bi(e,c.head.line,"smart")));K&&br(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var c=e.doc.sel.ranges[n].head.line,N={anchor:Qe(c,0),head:Qe(c+1,0)};i.push(N),t.push(e.getRange(N.anchor,N.head))}return{text:t,ranges:i}}function Co(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=d("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,c){var N=this.options,K=N[n];if(N[n]==c&&n!="mode")return;N[n]=c,t.hasOwnProperty(n)&&pr(this,t[n])(this,c,K),He(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,c){this.state.keyMaps[c?"push":"unshift"](na(n))},removeKeyMap:function(n){for(var c=this.state.keyMaps,N=0;N<c.length;++N)if(c[N]==n||c[N].name==n)return c.splice(N,1),!0},addOverlay:Or(function(n,c){var N=n.token?n:e.getMode(this.options,n);if(N.startState)throw new Error("Overlays may not be stateful.");le(this.state.overlays,{mode:N,modeSpec:n,opaque:c&&c.opaque,priority:c&&c.priority||0},function(K){return K.priority}),this.state.modeGen++,Mr(this)}),removeOverlay:Or(function(n){for(var c=this.state.overlays,N=0;N<c.length;++N){var K=c[N].modeSpec;if(K==n||typeof n=="string"&&K.name==n){c.splice(N,1),this.state.modeGen++,Mr(this);return}}}),indentLine:Or(function(n,c,N){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),Ir(this.doc,n)&&Bi(this,n,c,N)}),indentSelection:Or(function(n){for(var c=this.doc.sel.ranges,N=-1,K=0;K<c.length;K++){var Z=c[K];if(Z.empty())Z.head.line>N&&(Bi(this,Z.head.line,n,!0),N=Z.head.line,K==this.doc.sel.primIndex&&Zn(this));else{var q=Z.from(),te=Z.to(),me=Math.max(N,q.line);N=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var xe=me;xe<N;++xe)Bi(this,xe,n);var Ne=this.doc.sel.ranges;q.ch==0&&c.length==Ne.length&&Ne[K].from().ch>0&&Na(this.doc,K,new Gt(q,Ne[K].to()),ve)}}}),getTokenAt:function(n,c){return $t(this,n,c)},getLineTokens:function(n,c){return $t(this,Qe(n),c,!0)},getTokenTypeAt:function(n){n=T(this.doc,n);var c=Ke(this,ct(this.doc,n.line)),N=0,K=(c.length-1)/2,Z=n.ch,q;if(Z==0)q=c[2];else for(;;){var te=N+K>>1;if((te?c[te*2-1]:0)>=Z)K=te;else if(c[te*2+1]<Z)N=te+1;else{q=c[te*2+2];break}}var me=q?q.indexOf("overlay "):-1;return me<0?q:me==0?null:q.slice(0,me-1)},getModeAt:function(n){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(n).state).mode:c},getHelper:function(n,c){return this.getHelpers(n,c)[0]},getHelpers:function(n,c){var N=[];if(!i.hasOwnProperty(c))return N;var K=i[c],Z=this.getModeAt(n);if(typeof Z[c]=="string")K[Z[c]]&&N.push(K[Z[c]]);else if(Z[c])for(var q=0;q<Z[c].length;q++){var te=K[Z[c][q]];te&&N.push(te)}else Z.helperType&&K[Z.helperType]?N.push(K[Z.helperType]):K[Z.name]&&N.push(K[Z.name]);for(var me=0;me<K._global.length;me++){var xe=K._global[me];xe.pred(Z,this)&&ae(N,xe.val)==-1&&N.push(xe.val)}return N},getStateAfter:function(n,c){var N=this.doc;return n=X(N,n==null?N.first+N.size-1:n),tt(this,n+1,c).state},cursorCoords:function(n,c){var N,K=this.doc.sel.primary();return n==null?N=K.head:typeof n=="object"?N=T(this.doc,n):N=n?K.from():K.to(),en(this,N,c||"page")},charCoords:function(n,c){return ma(this,T(this.doc,n),c||"page")},coordsChar:function(n,c){return n=ls(this,n,c||"page"),va(this,n.left,n.top)},lineAtHeight:function(n,c){return n=ls(this,{top:n,left:0},c||"page").top,lr(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,c,N){var K=!1,Z;if(typeof n=="number"){var q=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>q&&(n=q,K=!0),Z=ct(this.doc,n)}else Z=n;return Wi(this,Z,{top:0,left:0},c||"page",N||K).top+(K?this.doc.height-qr(Z):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,c,N,K,Z){var q=this.display;n=en(this,T(this.doc,n));var te=n.bottom,me=n.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),q.sizer.appendChild(c),K=="over")te=n.top;else if(K=="above"||K=="near"){var xe=Math.max(q.wrapper.clientHeight,this.doc.height),Ne=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(K=="above"||n.bottom+c.offsetHeight>xe)&&n.top>c.offsetHeight?te=n.top-c.offsetHeight:n.bottom+c.offsetHeight<=xe&&(te=n.bottom),me+c.offsetWidth>Ne&&(me=Ne-c.offsetWidth)}c.style.top=te+"px",c.style.left=c.style.right="",Z=="right"?(me=q.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(Z=="left"?me=0:Z=="middle"&&(me=(q.sizer.clientWidth-c.offsetWidth)/2),c.style.left=me+"px"),N&&Jo(this,{left:me,top:te,right:me+c.offsetWidth,bottom:te+c.offsetHeight})},triggerOnKeyDown:Or(po),triggerOnKeyPress:Or(go),triggerOnKeyUp:mo,triggerOnMouseDown:Or(vo),execCommand:function(n){if(Pi.hasOwnProperty(n))return Pi[n].call(null,this)},triggerElectric:Or(function(n){wo(this,n)}),findPosH:function(n,c,N,K){var Z=1;c<0&&(Z=-1,c=-c);for(var q=T(this.doc,n),te=0;te<c&&!(q=Ka(this.doc,q,Z,N,K),q.hitSide);++te);return q},moveH:Or(function(n,c){var N=this;this.extendSelectionsBy(function(K){return N.display.shift||N.doc.extend||K.empty()?Ka(N.doc,K.head,n,c,N.options.rtlMoveVisually):n<0?K.from():K.to()},_e)}),deleteH:Or(function(n,c){var N=this.doc.sel,K=this.doc;N.somethingSelected()?K.replaceSelection("",null,"+delete"):si(this,function(Z){var q=Ka(K,Z.head,n,c,!1);return n<0?{from:q,to:Z.head}:{from:Z.head,to:q}})}),findPosV:function(n,c,N,K){var Z=1,q=K;c<0&&(Z=-1,c=-c);for(var te=T(this.doc,n),me=0;me<c;++me){var xe=en(this,te,"div");if(q==null?q=xe.left:xe.left=q,te=Oo(this,xe,Z,N),te.hitSide)break}return te},moveV:Or(function(n,c){var N=this,K=this.doc,Z=[],q=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(me){if(q)return n<0?me.from():me.to();var xe=en(N,me.head,"div");me.goalColumn!=null&&(xe.left=me.goalColumn),Z.push(xe.left);var Ne=Oo(N,xe,n,c);return c=="page"&&me==K.sel.primary()&&Sa(N,ma(N,Ne,"div").top-xe.top),Ne},_e),Z.length)for(var te=0;te<K.sel.ranges.length;te++)K.sel.ranges[te].goalColumn=Z[te]}),findWordAt:function(n){var c=this.doc,N=ct(c,n.line).text,K=n.ch,Z=n.ch;if(N){var q=this.getHelper(n,"wordChars");(n.sticky=="before"||Z==N.length)&&K?--K:++Z;for(var te=N.charAt(K),me=Pe(te,q)?function(xe){return Pe(xe,q)}:/\s/.test(te)?function(xe){return/\s/.test(xe)}:function(xe){return!/\s/.test(xe)&&!Pe(xe)};K>0&&me(N.charAt(K-1));)--K;for(;Z<N.length&&me(N.charAt(Z));)++Z}return new Gt(Qe(n.line,K),Qe(n.line,Z))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):A(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Or(function(n,c){_i(this,n,c)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-sn(this)-this.display.barHeight,width:n.scrollWidth-sn(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Pn(this)}},scrollIntoView:Or(function(n,c){n==null?(n={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Qe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=c||0,n.from.line!=null?Qo(this,n):bs(this,n.from,n.to,n.margin)}),setSize:Or(function(n,c){var N=this,K=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};n!=null&&(this.display.wrapper.style.width=K(n)),c!=null&&(this.display.wrapper.style.height=K(c)),this.options.lineWrapping&&as(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function(q){if(q.widgets){for(var te=0;te<q.widgets.length;te++)if(q.widgets[te].noHScroll){wn(N,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(n){return Wr(this,n)},startOperation:function(){return Hn(this)},endOperation:function(){return Wn(this)},refresh:Or(function(){var n=this.display.cachedTextHeight;Mr(this),this.curOp.forceUpdate=!0,yi(this),_i(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(n==null||Math.abs(n-$n(this.display))>.5||this.options.lineWrapping)&&Ea(this),He(this,"refresh",this)}),swapDoc:Or(function(n){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),yi(this),this.display.input.reset(),_i(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,br(this,"swapDoc",this,c),c}),phrase:function(n){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,n)?c[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ce(e),e.registerHelper=function(n,c,N){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][c]=N},e.registerGlobalHelper=function(n,c,N,K){e.registerHelper(n,c,K),i[n]._global.push({pred:N,val:K})}}function Ka(e,t,i,n,c){var N=t,K=i,Z=ct(e,t.line),q=c&&e.direction=="rtl"?-i:i;function te(){var lt=t.line+q;return lt<e.first||lt>=e.first+e.size?!1:(t=new Qe(lt,t.ch,t.sticky),Z=ct(e,lt))}function me(lt){var at;if(n=="codepoint"){var ht=Z.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ht)?at=null:at=new Qe(t.line,Math.max(0,Math.min(Z.text.length,t.ch+i*(ht>=55296&&ht<56320?2:1))),-i)}else c?at=Ml(e.cm,Z,t,i):at=Ua(Z,t,i);if(at==null)if(!lt&&te())t=Ba(c,e.cm,Z,t.line,q);else return!1;else t=at;return!0}if(n=="char"||n=="codepoint")me();else if(n=="column")me(!0);else if(n=="word"||n=="group")for(var xe=null,Ne=n=="group",Me=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(i<0&&!me(!Ge));Ge=!1){var $e=Z.text.charAt(t.ch)||`
`,qe=Pe($e,Me)?"w":Ne&&$e==`
`?"n":!Ne||/\s/.test($e)?null:"p";if(Ne&&!Ge&&!qe&&(qe="s"),xe&&xe!=qe){i<0&&(i=1,me(),t.sticky="after");break}if(qe&&(xe=qe),i>0&&!me(!Ge))break}var it=ea(e,t,N,K,!0);return mn(N,it)&&(it.hitSide=!0),it}function Oo(e,t,i,n){var c=e.doc,N=t.left,K;if(n=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Z-.5*$n(e.display),3);K=(i>0?t.bottom:t.top)+i*q}else n=="line"&&(K=i>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,N,K),!te.outside);){if(i<0?K<=0:K>=c.height){te.hitSide=!0;break}K+=i*5}return te}var Kt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Kt.prototype.init=function(e){var t=this,i=this,n=i.cm,c=i.div=e.lineDiv;Co(c,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function N(Z){for(var q=Z.target;q;q=q.parentNode){if(q==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Be(c,"paste",function(Z){if(!N(Z)||We(n,Z)||To(Z,n))return;W<=11&&setTimeout(pr(n,function(){return t.updateFromDOM()}),20)}),Be(c,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Be(c,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Be(c,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Be(c,"touchstart",function(){return i.forceCompositionEnd()}),Be(c,"input",function(){t.composing||t.readFromDOMSoon()});function K(Z){if(!N(Z)||We(n,Z))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),Z.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var q=So(n);sa({lineWise:!0,text:q.text}),Z.type=="cut"&&n.operation(function(){n.setSelections(q.ranges,0,ve),n.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var te=rn.text.join(`
`);if(Z.clipboardData.setData("Text",te),Z.clipboardData.getData("Text")==te){Z.preventDefault();return}}var me=Ao(),xe=me.firstChild;n.display.lineSpace.insertBefore(me,n.display.lineSpace.firstChild),xe.value=rn.text.join(`
`);var Ne=document.activeElement;M(xe),setTimeout(function(){n.display.lineSpace.removeChild(me),Ne.focus(),Ne==c&&i.showPrimarySelection()},50)}Be(c,"copy",K),Be(c,"cut",K)},Kt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Kt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Kt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Kt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Kt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),c=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var N=oa(t,e.anchorNode,e.anchorOffset),K=oa(t,e.focusNode,e.focusOffset);if(N&&!N.bad&&K&&!K.bad&&Ct(yn(N,K),n)==0&&Ct(vn(N,K),c)==0)return;var Z=t.display.view,q=n.line>=t.display.viewFrom&&Ro(t,n)||{node:Z[0].measure.map[2],offset:0},te=c.line<t.display.viewTo&&Ro(t,c);if(!te){var me=Z[Z.length-1].measure,xe=me.maps?me.maps[me.maps.length-1]:me.map;te={node:xe[xe.length-1],offset:xe[xe.length-2]-xe[xe.length-3]}}if(!q||!te){e.removeAllRanges();return}var Ne=e.rangeCount&&e.getRangeAt(0),Me;try{Me=y(q.node,q.offset,te.offset,te.node)}catch(Ge){}Me&&(!P&&t.state.focused?(e.collapse(q.node,q.offset),Me.collapsed||(e.removeAllRanges(),e.addRange(Me))):(e.removeAllRanges(),e.addRange(Me)),Ne&&e.anchorNode==null?e.addRange(Ne):P&&this.startGracePeriod()),this.rememberSelection()},Kt.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)},Kt.prototype.showMultipleSelections=function(e){E(this.cm.display.cursorDiv,e.cursors),E(this.cm.display.selectionDiv,e.selection)},Kt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Kt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},Kt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Kt.prototype.blur=function(){this.div.blur()},Kt.prototype.getField=function(){return this.div},Kt.prototype.supportsTouch=function(){return!0},Kt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wr(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)},Kt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Kt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=oa(t,e.anchorNode,e.anchorOffset),n=oa(t,e.focusNode,e.focusOffset);i&&n&&Wr(t,function(){wr(t.doc,Cn(i,n),ve),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Kt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),c=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Qe(n.line-1,ct(e.doc,n.line-1).length)),c.ch==ct(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=Qe(c.line+1,0)),n.line<t.viewFrom||c.line>t.viewTo-1)return!1;var N,K,Z;n.line==t.viewFrom||(N=Un(e,n.line))==0?(K=Ot(t.view[0].line),Z=t.view[0].node):(K=Ot(t.view[N].line),Z=t.view[N-1].node.nextSibling);var q=Un(e,c.line),te,me;if(q==t.view.length-1?(te=t.viewTo-1,me=t.lineDiv.lastChild):(te=Ot(t.view[q+1].line)-1,me=t.view[q+1].node.previousSibling),!Z)return!1;for(var xe=e.doc.splitLines(tu(e,Z,me,K,te)),Ne=Br(e.doc,Qe(K,0),Qe(te,ct(e.doc,te).text.length));xe.length>1&&Ne.length>1;)if(ne(xe)==ne(Ne))xe.pop(),Ne.pop(),te--;else if(xe[0]==Ne[0])xe.shift(),Ne.shift(),K++;else break;for(var Me=0,Ge=0,$e=xe[0],qe=Ne[0],it=Math.min($e.length,qe.length);Me<it&&$e.charCodeAt(Me)==qe.charCodeAt(Me);)++Me;for(var lt=ne(xe),at=ne(Ne),ht=Math.min(lt.length-(xe.length==1?Me:0),at.length-(Ne.length==1?Me:0));Ge<ht&&lt.charCodeAt(lt.length-Ge-1)==at.charCodeAt(at.length-Ge-1);)++Ge;if(xe.length==1&&Ne.length==1&&K==n.line)for(;Me&&Me>n.ch&&lt.charCodeAt(lt.length-Ge-1)==at.charCodeAt(at.length-Ge-1);)Me--,Ge++;xe[xe.length-1]=lt.slice(0,lt.length-Ge).replace(/^\u200b+/,""),xe[0]=xe[0].slice(Me).replace(/\u200b+$/,"");var Tt=Qe(K,Me),vt=Qe(te,Ne.length?ne(Ne).length-Ge:0);if(xe.length>1||xe[0]||Ct(Tt,vt))return ni(e.doc,xe,Tt,vt,"+input"),!0},Kt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Kt.prototype.reset=function(){this.forceCompositionEnd()},Kt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Kt.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)},Kt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wr(this.cm,function(){return Mr(e.cm)})},Kt.prototype.setUneditable=function(e){e.contentEditable="false"},Kt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||pr(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Kt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Kt.prototype.onContextMenu=function(){},Kt.prototype.resetPosition=function(){},Kt.prototype.needsContentAttribute=!0;function Ro(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var n=ct(e.doc,t.line),c=es(i,n,t.line),N=Ze(n,e.doc.direction),K="left";if(N){var Z=Ye(N,t.ch);K=Z%2?"right":"left"}var q=ns(c.map,t.ch,K);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function li(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,c){var N="",K=!1,Z=e.doc.lineSeparator(),q=!1;function te(Me){return function(Ge){return Ge.id==Me}}function me(){K&&(N+=Z,q&&(N+=Z),K=q=!1)}function xe(Me){Me&&(me(),N+=Me)}function Ne(Me){if(Me.nodeType==1){var Ge=Me.getAttribute("cm-text");if(Ge){xe(Ge);return}var $e=Me.getAttribute("cm-marker"),qe;if($e){var it=e.findMarks(Qe(n,0),Qe(c+1,0),te(+$e));it.length&&(qe=it[0].find(0))&&xe(Br(e.doc,qe.from,qe.to).join(Z));return}if(Me.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(Me.nodeName);if(!/^br$/i.test(Me.nodeName)&&Me.textContent.length==0)return;lt&&me();for(var at=0;at<Me.childNodes.length;at++)Ne(Me.childNodes[at]);/^(pre|p)$/i.test(Me.nodeName)&&(q=!0),lt&&(K=!0)}else Me.nodeType==3&&xe(Me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ne(t),t==i);)t=t.nextSibling,q=!1;return N}function oa(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return li(e.clipPos(Qe(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var N=e.display.view[c];if(N.node==n)return ru(N,t,i)}}function ru(e,t,i){var n=e.text.firstChild,c=!1;if(!t||!b(n,t))return li(Qe(Ot(e.line),0),!0);if(t==n&&(c=!0,t=n.childNodes[i],i=0,!t)){var N=e.rest?ne(e.rest):e.line;return li(Qe(Ot(N),N.text.length),c)}var K=t.nodeType==3?t:null,Z=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,i&&(i=K.nodeValue.length));Z.parentNode!=n;)Z=Z.parentNode;var q=e.measure,te=q.maps;function me(qe,it,lt){for(var at=-1;at<(te?te.length:0);at++)for(var ht=at<0?q.map:te[at],Tt=0;Tt<ht.length;Tt+=3){var vt=ht[Tt+2];if(vt==qe||vt==it){var Rt=Ot(at<0?e.line:e.rest[at]),Yt=ht[Tt]+lt;return(lt<0||vt!=qe)&&(Yt=ht[Tt+(lt?1:0)]),Qe(Rt,Yt)}}}var xe=me(K,Z,i);if(xe)return li(xe,c);for(var Ne=Z.nextSibling,Me=K?K.nodeValue.length-i:0;Ne;Ne=Ne.nextSibling){if(xe=me(Ne,Ne.firstChild,0),xe)return li(Qe(xe.line,xe.ch-Me),c);Me+=Ne.textContent.length}for(var Ge=Z.previousSibling,$e=i;Ge;Ge=Ge.previousSibling){if(xe=me(Ge,Ge.firstChild,-1),xe)return li(Qe(xe.line,xe.ch+$e),c);$e+=Ge.textContent.length}}var ir=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};ir.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(c.style.width="0px"),Be(c,"input",function(){z&&W>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Be(c,"paste",function(K){if(We(n,K)||To(K,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function N(K){if(We(n,K))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Z=So(n);sa({lineWise:!0,text:Z.text}),K.type=="cut"?n.setSelections(Z.ranges,null,ve):(i.prevInput="",c.value=Z.text.join(`
`),M(c))}else return;K.type=="cut"&&(n.state.cutIncoming=+new Date)}Be(c,"cut",N),Be(c,"copy",N),Be(e.scroller,"paste",function(K){if(cn(e,K)||We(n,K))return;if(!c.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Z=new Event("paste");Z.clipboardData=K.clipboardData,c.dispatchEvent(Z)}),Be(e.lineSpace,"selectstart",function(K){cn(e,K)||re(K)}),Be(c,"compositionstart",function(){var K=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:K,range:n.markText(K,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(c,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ir.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ir.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ir.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var c=en(e,i.sel.primary().head,"div"),N=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+K.top-N.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+K.left-N.left))}return n},ir.prototype.showSelection=function(e){var t=this.cm,i=t.display;E(i.cursorDiv,e.cursors),E(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ir.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&M(this.textarea),z&&W>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",z&&W>=9&&(this.hasSelection=null))},ir.prototype.getField=function(){return this.textarea},ir.prototype.supportsTouch=function(){return!1},ir.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},ir.prototype.blur=function(){this.textarea.blur()},ir.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ir.prototype.receivedFocus=function(){this.slowPoll()},ir.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()})},ir.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},ir.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||dt(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=i.value;if(c==n&&!t.somethingSelected())return!1;if(z&&W>=9&&this.hasSelection===c||s&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var N=c.charCodeAt(0);if(N==8203&&!n&&(n="\u200B"),N==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,Z=Math.min(n.length,c.length);K<Z&&n.charCodeAt(K)==c.charCodeAt(K);)++K;return Wr(t,function(){za(t,c.slice(K),n.length-K,null,e.composing?"*compose":null),c.length>1e3||c.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ir.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ir.prototype.onKeyPress=function(){z&&W>=9&&(this.hasSelection=null),this.fastPoll()},ir.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var N=Fn(i,e),K=n.scroller.scrollTop;if(!N||m)return;var Z=i.options.resetSelectionOnContextMenu;Z&&i.doc.sel.contains(N)==-1&&pr(i,wr)(i.doc,Cn(N),ve);var q=c.style.cssText,te=t.wrapper.style.cssText,me=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-me.top-5)+"px; left: "+(e.clientX-me.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 xe;r&&(xe=window.scrollY),n.input.focus(),r&&window.scrollTo(null,xe),n.input.reset(),i.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=Me,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Ne(){if(c.selectionStart!=null){var $e=i.somethingSelected(),qe="\u200B"+($e?c.value:"");c.value="\u21DA",c.value=qe,t.prevInput=$e?"":"\u200B",c.selectionStart=1,c.selectionEnd=qe.length,n.selForContextMenu=i.doc.sel}}function Me(){if(t.contextMenuPending!=Me)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,c.style.cssText=q,z&&W<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=K),c.selectionStart!=null){(!z||z&&W<9)&&Ne();var $e=0,qe=function(){n.selForContextMenu==i.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?pr(i,Vs)(i):$e++<10?n.detectingSelectAll=setTimeout(qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(qe,200)}}if(z&&W>=9&&Ne(),D){ge(e);var Ge=function(){st(window,"mouseup",Ge),setTimeout(Me,20)};Be(window,"mouseup",Ge)}else setTimeout(Me,50)},ir.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ir.prototype.setUneditable=function(){},ir.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?g(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=B();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Z.getValue()}var c;if(e.form&&(Be(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var N=e.form;c=N.submit;try{var K=N.submit=function(){n(),N.submit=c,N.submit(),N.submit=K}}catch(q){}}t.finishInit=function(q){q.save=n,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,n(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var Z=Zt(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Z}function iu(e){e.off=st,e.on=Be,e.wheelEventPixels=dl,e.Doc=Pr,e.splitLines=St,e.countColumn=H,e.findColumn=De,e.isWordChar=Re,e.Pass=Le,e.signal=He,e.Line=Mn,e.changeEnd=An,e.scrollbarModel=xs,e.Pos=Qe,e.cmpPos=Ct,e.modes=Qt,e.mimeModes=It,e.resolveMode=yt,e.getMode=Lr,e.modeExtensions=bt,e.extendMode=xt,e.copyState=Ft,e.startState=dr,e.innerMode=tr,e.commands=Pi,e.keyMap=fn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ai,e.normalizeKeyMap=kl,e.StringStream=Pt,e.SharedTextMarker=Di,e.TextMarker=Rn,e.LineWidget=Ii,e.e_preventDefault=re,e.e_stopPropagation=oe,e.e_stop=ge,e.addClass=F,e.contains=b,e.rmClass=A,e.keyNames=Ln}$l(Zt),ql(Zt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Pr.prototype)Pr.prototype.hasOwnProperty(la)&&ae(au,la)<0&&(Zt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pr.prototype[la]));return Ce(Pr),Zt.inputStyles={textarea:ir,contenteditable:Kt},Zt.defineMode=function(e){!Zt.defaults.mode&&e!="null"&&(Zt.defaults.mode=e),Cr.apply(this,arguments)},Zt.defineMIME=zr,Zt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Zt.defineMIME("text/plain","null"),Zt.defineExtension=function(e,t){Zt.prototype[e]=t},Zt.defineDocExtension=function(e,t){Pr.prototype[e]=t},Zt.fromTextArea=nu,iu(Zt),Zt.version="5.58.2",Zt})},Y1PL:function(nt,be,Q){"use strict";Q.r(be),Q.d(be,"ResizableTextArea",function(){return ae});var ie=Q("wx14"),J=Q("1OyB"),P=Q("vuIU"),Y=Q("Ji7U"),j=Q("LK+K"),U=Q("q1tI"),z=Q("VTBJ"),W=Q("rePB"),r=Q("Zm9Q"),R=Q("Kwbf"),v=Q("c+Xe"),m=Q("m+aA"),p=Q("bdgK"),h=new Map;function o(ve){ve.forEach(function(Te){var _e,De=Te.target;(_e=h.get(De))===null||_e===void 0||_e.forEach(function(he){return he(De)})})}var f=new p.default(o),l=null,u=null;function s(ve,Te){h.has(ve)||(h.set(ve,new Set),f.observe(ve)),h.get(ve).add(Te)}function a(ve,Te){h.has(ve)&&(h.get(ve).delete(Te),h.get(ve).size||(f.unobserve(ve),h.delete(ve)))}var O=function(ve){Object(Y.a)(_e,ve);var Te=Object(j.a)(_e);function _e(){return Object(J.a)(this,_e),Te.apply(this,arguments)}return Object(P.a)(_e,[{key:"render",value:function(){return this.props.children}}]),_e}(U.Component),x=U.createContext(null);function S(ve){var Te=ve.children,_e=ve.onBatchResize,De=U.useRef(0),he=U.useRef([]),ce=U.useContext(x),ne=U.useCallback(function(fe,le,ke){De.current+=1;var Fe=De.current;he.current.push({size:fe,element:le,data:ke}),Promise.resolve().then(function(){Fe===De.current&&(_e==null||_e(he.current),he.current=[])}),ce==null||ce(fe,le,ke)},[_e,ce]);return U.createElement(x.Provider,{value:ne},Te)}function D(ve){var Te=ve.children,_e=ve.disabled,De=U.useRef(null),he=U.useRef(null),ce=U.useContext(x),ne=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=U.isValidElement(Te)&&Object(v.c)(Te),le=fe?Te.ref:null,ke=U.useMemo(function(){return Object(v.a)(le,De)},[le,De]),Fe=U.useRef(ve);Fe.current=ve;var Ae=U.useCallback(function(Re){var Pe=Fe.current,se=Pe.onResize,pe=Pe.data,ye=Re.getBoundingClientRect(),Oe=ye.width,je=ye.height,ze=Re.offsetWidth,Je=Re.offsetHeight,Ye=Math.floor(Oe),rt=Math.floor(je);if(ne.current.width!==Ye||ne.current.height!==rt||ne.current.offsetWidth!==ze||ne.current.offsetHeight!==Je){var Ze={width:Ye,height:rt,offsetWidth:ze,offsetHeight:Je};ne.current=Ze;var et=ze===Math.round(Oe)?Oe:ze,Be=Je===Math.round(je)?je:Je,ut=Object(z.a)(Object(z.a)({},Ze),{},{offsetWidth:et,offsetHeight:Be});ce==null||ce(ut,Re,pe),se&&Promise.resolve().then(function(){se(ut,Re)})}},[]);return U.useEffect(function(){var Re=Object(m.a)(De.current)||Object(m.a)(he.current);return Re&&!_e&&s(Re,Ae),function(){return a(Re,Ae)}},[De.current,_e]),U.createElement(O,{ref:he},fe?U.cloneElement(Te,{ref:ke}):Te)}var L="rc-observer-key";function A(ve){var Te=ve.children,_e=Object(r.a)(Te);return _e.map(function(De,he){var ce=(De==null?void 0:De.key)||"".concat(L,"-").concat(he);return U.createElement(D,Object(ie.a)({},ve,{key:ce}),De)})}A.Collection=S;var C=A,E=Q("bT9E"),d=Q("TSYQ"),w=Q.n(d),y=`
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
`,b=["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"],B={},F;function _(ve){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(Te&&B[_e])return B[_e];var De=window.getComputedStyle(ve),he=De.getPropertyValue("box-sizing")||De.getPropertyValue("-moz-box-sizing")||De.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(De.getPropertyValue("padding-bottom"))+parseFloat(De.getPropertyValue("padding-top")),ne=parseFloat(De.getPropertyValue("border-bottom-width"))+parseFloat(De.getPropertyValue("border-top-width")),fe=b.map(function(ke){return"".concat(ke,":").concat(De.getPropertyValue(ke))}).join(";"),le={sizingStyle:fe,paddingSize:ce,borderSize:ne,boxSizing:he};return Te&&_e&&(B[_e]=le),le}function M(ve){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),ve.getAttribute("wrap")?F.setAttribute("wrap",ve.getAttribute("wrap")):F.removeAttribute("wrap");var he=_(ve,Te),ce=he.paddingSize,ne=he.borderSize,fe=he.boxSizing,le=he.sizingStyle;F.setAttribute("style","".concat(le,";").concat(y)),F.value=ve.value||ve.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,Fe=Number.MAX_SAFE_INTEGER,Ae=F.scrollHeight,Re;if(fe==="border-box"?Ae+=ne:fe==="content-box"&&(Ae-=ce),_e!==null||De!==null){F.value=" ";var Pe=F.scrollHeight-ce;_e!==null&&(ke=Pe*_e,fe==="border-box"&&(ke=ke+ce+ne),Ae=Math.max(ke,Ae)),De!==null&&(Fe=Pe*De,fe==="border-box"&&(Fe=Fe+ce+ne),Re=Ae>Fe?"":"hidden",Ae=Math.min(Fe,Ae))}return{height:Ae,minHeight:ke,maxHeight:Fe,overflowY:Re,resize:"none"}}var I=Q("Gytx"),g=Q.n(I),H;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(H||(H={}));var $=function(ve){Object(Y.a)(_e,ve);var Te=Object(j.a)(_e);function _e(De){var he;return Object(J.a)(this,_e),he=Te.call(this,De),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(ce){he.textArea=ce},he.handleResize=function(ce){var ne=he.state.resizeStatus,fe=he.props,le=fe.autoSize,ke=fe.onResize;if(ne!==H.NONE)return;typeof ke=="function"&&ke(ce),le&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var ce=he.props.autoSize;if(!ce||!he.textArea)return;var ne=ce.minRows,fe=ce.maxRows,le=M(he.textArea,!1,ne,fe);he.setState({textareaStyles:le,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var ce=he.props,ne=ce.prefixCls,fe=ne===void 0?"rc-textarea":ne,le=ce.autoSize,ke=ce.onResize,Fe=ce.className,Ae=ce.disabled,Re=he.state,Pe=Re.textareaStyles,se=Re.resizeStatus,pe=Object(E.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ye=w()(fe,Fe,Object(W.a)({},"".concat(fe,"-disabled"),Ae));"value"in pe&&(pe.value=pe.value||"");var Oe=Object(z.a)(Object(z.a)(Object(z.a)({},he.props.style),Pe),se===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return U.createElement(C,{onResize:he.handleResize,disabled:!(le||ke)},U.createElement("textarea",Object(ie.a)({},pe,{className:ye,style:Oe,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(P.a)(_e,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!g()(he.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var he=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,ce)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),_e}(U.Component),ae=$,ue=function(ve){Object(Y.a)(_e,ve);var Te=Object(j.a)(_e);function _e(De){var he;Object(J.a)(this,_e),he=Te.call(this,De),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(ne){he.resizableTextArea=ne},he.handleChange=function(ne){var fe=he.props.onChange;he.setValue(ne.target.value,function(){he.resizableTextArea.resizeTextarea()}),fe&&fe(ne)},he.handleKeyDown=function(ne){var fe=he.props,le=fe.onPressEnter,ke=fe.onKeyDown;ne.keyCode===13&&le&&le(ne),ke&&ke(ne)};var ce=typeof De.value=="undefined"||De.value===null?De.defaultValue:De.value;return he.state={value:ce},he}return Object(P.a)(_e,[{key:"setValue",value:function(he,ce){"value"in this.props||this.setState({value:he},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return U.createElement(ae,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),_e}(U.Component),Le=be.default=ue},ZW9T:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return I});var ie=Q("k1fw"),J=Q("oBTY"),P=Q("miYZ"),Y=Q("tsqr"),j=Q("rAM+"),U=Q("tJVT"),z=Q("PpiC"),W=Q("q1tI"),r=Q.n(W),R=Q("bdgK"),v=Q("9og8"),m=Q("WmNS"),p=Q.n(m),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={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(`
`)}]},u=Q("5VLF"),s=Q.n(u),a={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(H,$){return $.map(function(ae){return{label:ae,kind:H.languages.CompletionItemKind.Keyword,insertText:ae}})},x=function(H){return Object.keys(a.tables).map(function($){return{label:$,kind:H.languages.CompletionItemKind.Variable,insertText:$}})},S=function(H,$){var ae=a.tables[H];return ae?ae.map(function(ue){return{label:ue,kind:$.languages.CompletionItemKind.Field,insertText:ue}}):[]};function D(g,H,$,ae,ue){var Le=H.getWordUntilPosition($),ve={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Te=ae.map(function(_e){return{label:_e,kind:g.languages.CompletionItemKind.Keyword,insertText:_e,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return ue.map(function(_e){Te.push(Object(ie.a)(Object(ie.a)({},_e),{},{range:ve}))}),Te}var L=function(g){a.languages.map(function(ue){return g.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(ve,Te,_e){return Object(v.a)(p.a.mark(function De(){var he;return p.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return he=s()(ve.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ne.abrupt("return",[{range:ve.getFullModelRange(),text:he}]);case 2:case"end":return ne.stop()}},De)}))()}}),ue});var H=f.quickKey.map(function(ue){return{label:ue.label,kind:g.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=l.quickKey.map(function(ue){return{label:ue.label,kind:g.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=o.quickKey.map(function(ue){return{label:ue.label,kind:g.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Le,ve){var Te=Le.getWordUntilPosition(ve),_e={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},De=Le.getLineContent(ve.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(J.a)(f.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}})),Object(J.a)(f.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:De.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Le,ve){var Te=Le.getWordUntilPosition(ve),_e={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn};return{suggestions:Object(J.a)(h.keywords.map(function(De){return{label:De,kind:g.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Le,ve){var Te=Le.getWordUntilPosition(ve),_e={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},De=Le.getLineContent(ve.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(J.a)(o.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}})),Object(J.a)(o.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:De.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Le,ve){var Te=Le.getWordUntilPosition(ve),_e={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},De=Le.getLineContent(ve.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(J.a)(l.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}})),Object(J.a)(l.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:De.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}})))}}})},A="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",C=Q("fjLI"),E=Q("LvDl"),d=Q("+ua5");function w(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var b=!1,B={"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 g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=g;if(Array.isArray(g)){for(var $=0;$<g.length;$++){var ae=B[g[$]];if(ae)return ae}return H[0]}return B[H]||H}var _=null,M=be.b=function(g){var H=g.width,$=H===void 0?"100%":H,ae=g.height,ue=ae===void 0?"100%":ae,Le=g.value,ve=g.language,Te=ve===void 0?"javascript":ve,_e=g.style,De=_e===void 0?{}:_e,he=g.options,ce=he===void 0?{}:he,ne=g.overrideServices,fe=ne===void 0?{}:ne,le=g.theme,ke=le===void 0?"vs-dark":le,Fe=g.onEditBlur,Ae=g.onSave,Re=g.autoHeight,Pe=Re===void 0?!1:Re,se=g.forbidCopy,pe=se===void 0?!1:se,ye=g.onChange,Oe=ye===void 0?y:ye,je=g.editorDidMount,ze=je===void 0?y:je,Je=g.onFocus,Ye=Je===void 0?y:Je,rt=g.filename,Ze=rt===void 0?"educoder.txt":rt,et=g.errorLine,Be=g.errorContent,ut=Be===void 0?"":Be,st=Object(z.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),He=Object(W.useRef)(),We=Object(W.useRef)({}),Ie=Object(W.useRef)(),Ee=Object(W.useRef)(),Ce=Object(W.useRef)(!1),re=Object(W.useRef)(),oe=Object(W.useState)(!1),de=Object(U.a)(oe,2),ge=de[0],Se=de[1];function Ue(){var bt;return He.current&&(bt=new R.default(function(xt){var Ft=Object(j.a)(xt),tr;try{for(Ft.s();!(tr=Ft.n()).done;){var dr=tr.value;(dr.target.offsetHeight>0||dr.target.offsetWidth>0)&&We.current.instance.layout()}}catch(Pt){Ft.e(Pt)}finally{Ft.f()}}),bt.observe(He.current)),bt}function Ve(){Y.b.warn(decodeURIComponent(A))}var ot=function(){var xt=We.current.instance;if(Le!=null&&xt&&ge){var Ft=xt.getModel();Ft&&Le!==Ft.getValue()&&(b=!0,Ft.setValue(Le),xt.layout(),b=!1)}};Object(W.useEffect)(function(){Ee.current&&clearTimeout(Ee.current),Ee.current=setTimeout(function(){ot()},500)},[Le,ge,We.current]),Object(W.useEffect)(function(){if(et&&We.current&&We.current.instance){var bt=We.current.instance;bt.changeViewZones(function(Ft){var tr=document.createElement("div");tr.style.padding="10px 20px",tr.style.width="calc(100% - 20px)",tr.className="my-error-line-wrp",tr.innerHTML=ut,Ft.addZone({afterLineNumber:et||11,heightInLines:3,domNode:tr})});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}};bt.addOverlayWidget(xt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[et,We.current,ge]);function mt(){var bt=We.current.instance;if(bt){var xt=bt.getSelection(),Ft=We.current.pastePos||{},tr=new _.Range(Ft.startLineNumber||xt.endLineNumber,Ft.startColumn||xt.endColumn,Ft.endLineNumber||xt.endLineNumber,Ft.endColumn||xt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:tr,text:""}])},300)}}function ft(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),Ae())}var wt=function(){if(Pe&&We.current.instance){var xt=We.current.instance.getContentHeight();yt(xt<ue?ue:xt)}else yt(ue)};function St(bt){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),bt.dispatchEvent(xt)}function dt(bt,xt){var Ft=window.URL||window.webkitURL||window,tr=new Blob([xt]),dr=document.createElementNS("http://www.w3.org/1999/xhtml","a");dr.href=Ft.createObjectURL(tr),dr.download=bt,St(dr)}Object(W.useEffect)(function(){wt()},[wt]),Object(W.useEffect)(function(){He.current&&!ge&&Promise.all([Q.e(16),Q.e(28)]).then(Q.t.bind(null,"M/lh",7)).then(function(bt){try{_=bt,We.current.instance=_.editor.create(He.current,{value:Le,language:F(Te),theme:ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},fe);var xt=We.current.instance,Ft=C.d._menuItems,tr=Object(J.a)(Ft).find(function(Vt){return Vt[0]._debugName=="EditorContext"}),dr=tr[1],Pt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ct=function(Jt,Ot){var lr=Jt._first;do{var Ir,Yr,Qe=Ot.includes((Ir=lr.element)===null||Ir===void 0||((Yr=Ir.command)===null||Yr===void 0)?void 0:Yr.id);Qe&&Jt._remove(lr)}while(lr=lr.next)};if(ze(xt,_),setTimeout(function(){wt(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){dt(Ze||"educoder.txt",xt.getValue())}}),xt.getDomNode().addEventListener("input",function(){Ie.current.autoFormat&&xt.getAction("editor.action.formatDocument").run()})},500),We.current.subscription=xt.onDidChangeModelContent(function(Vt){Ce.current?clearTimeout(re.current):(wt(),Oe(xt.getValue(),Vt)),re.current=setTimeout(function(){Ce.current=!1},500)}),window.Monaco||L(_,F(Te)),pe&&(ct(dr,Pt),He.current.classList.add("noCopyPaste"),xt.onKeyDown(function(Vt){var Jt=Vt.keyCode,Ot=Vt.ctrlKey,lr=Vt.metaKey;(Jt===33||Jt===52)&&(lr||Ot)&&(Ve(),Vt.preventDefault())})),window.Monaco=_,Fe&&xt.onDidBlurEditorWidget(function(){Fe(xt.getValue())}),Ye&&xt.onDidFocusEditorText(function(){Ye(xt.getValue())}),pe){xt.addCommand(_.KeyMod.CtrlCmd|_.KeyCode.KEY_V,function(){return Ve(),null}),xt.onDidPaste(function(Vt){We.current.pastePos=Vt});try{window.addEventListener("paste",mt)}catch(Vt){}}var Br=Ue();return Se(!0),function(){var Vt=We.current.instance;Vt.dispose();var Jt=Vt.getModel();Jt&&Jt.dispose(),We.current.subscription&&We.current.subscription.dispose(),pe&&window.removeEventListener("paste",mt),Br.unobserve(He.current)}}catch(Vt){}})},[]),Object(W.useEffect)(function(){var bt=We.current.instance;if(bt&&ge)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Ae,ge]),Object(W.useEffect)(function(){var bt=We.current.instance;if(bt&&ge){var xt=F(Te);_.editor.setModelLanguage(bt.getModel(),xt),console.log("language:",Te,bt.getModel(),xt)}},[Te,ge]),Object(W.useEffect)(function(){var bt=We.current.instance;bt&&ge&&_.editor.setTheme(ke)},[ke,ge]),Object(W.useEffect)(function(){var bt=We.current.instance;Ie.current=ce,bt&&ge&&(bt.updateOptions(Object(ie.a)({},ce)),setTimeout(function(){bt.getModel().updateOptions(Object(ie.a)({},ce))},200))},[JSON.stringify(ce),ge]),Object(W.useEffect)(function(){var bt=We.current.instance;bt&&ge&&bt.layout()},[$,ue,ge]);var Bt=Object(W.useState)(w($)),Lt=Object(U.a)(Bt,2),qt=Lt[0],Qt=Lt[1],It=Object(W.useState)(w(ue)),Cr=Object(U.a)(It,2),zr=Cr[0],yt=Cr[1],Lr=Object(ie.a)(Object(ie.a)({},De),{},{width:qt,height:zr});return r.a.createElement("div",{className:"my-monaco-editor",ref:He,style:Lr})};function I(g){var H=g.width,$=H===void 0?"100%":H,ae=g.height,ue=ae===void 0?"100%":ae,Le=g.original,ve=g.modified,Te=g.language,_e=g.options,De=_e===void 0?{}:_e,he=Object(W.useRef)(),ce=Object(W.useState)(null),ne=Object(U.a)(ce,2),fe=ne[0],le=ne[1];function ke(Pe){var se;return he.current&&(se=new R.default(function(pe){var ye=Object(j.a)(pe),Oe;try{for(ye.s();!(Oe=ye.n()).done;){var je=Oe.value;(je.target.offsetHeight>0||je.target.offsetWidth>0)&&Pe.layout()}}catch(ze){ye.e(ze)}finally{ye.f()}}),se.observe(he.current)),se}Object(W.useEffect)(function(){he.current&&Promise.all([Q.e(16),Q.e(28)]).then(Q.t.bind(null,"M/lh",7)).then(function(Pe){_=Pe;var se=_.editor.createDiffEditor(he.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},De),{},{wordWrap:!0}));le(se);var pe=ke(se);return function(){se.dispose();var ye=se.getModel();ye&&ye.dispose(),pe.unobserve(he.current)}})},[]),Object(W.useEffect)(function(){fe&&fe.setModel({original:_.editor.createModel(Le,Te),modified:_.editor.createModel(ve,Te)})},[Le,ve,Te,fe]);var Fe=w($),Ae=w(ue),Re={width:Fe,height:Ae};return r.a.createElement("div",{className:"my-diff-editor",ref:he,style:Re})}},ZpRC:function(nt,be,Q){"use strict";function ie(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function J(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function P(v,m){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var p=getComputedStyle(v,null);return J(p.overflowY,m)||J(p.overflowX,m)||function(h){var o=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(l){return null}}(h);return!!o&&(o.clientHeight<h.scrollHeight||o.clientWidth<h.scrollWidth)}(v)}return!1}function Y(v,m,p,h,o,f,l,u){return f<v&&l>m||f>v&&l<m?0:f<=v&&u<=p||l>=m&&u>=p?f-v-h:l>m&&u<p||f<v&&u>p?l-m+o:0}var j=function(v,m){var p=window,h=m.scrollMode,o=m.block,f=m.inline,l=m.boundary,u=m.skipOverflowHiddenElements,s=typeof l=="function"?l:function(Pe){return Pe!==l};if(!ie(v))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,O=[],x=v;ie(x)&&s(x);){if((x=x.parentElement)===a){O.push(x);break}x!=null&&x===document.body&&P(x)&&!P(document.documentElement)||x!=null&&P(x,u)&&O.push(x)}for(var S=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,L=window.scrollX||pageXOffset,A=window.scrollY||pageYOffset,C=v.getBoundingClientRect(),E=C.height,d=C.width,w=C.top,y=C.right,b=C.bottom,B=C.left,F=o==="start"||o==="nearest"?w:o==="end"?b:w+E/2,_=f==="center"?B+d/2:f==="end"?y:B,M=[],I=0;I<O.length;I++){var g=O[I],H=g.getBoundingClientRect(),$=H.height,ae=H.width,ue=H.top,Le=H.right,ve=H.bottom,Te=H.left;if(h==="if-needed"&&w>=0&&B>=0&&b<=D&&y<=S&&w>=ue&&b<=ve&&B>=Te&&y<=Le)return M;var _e=getComputedStyle(g),De=parseInt(_e.borderLeftWidth,10),he=parseInt(_e.borderTopWidth,10),ce=parseInt(_e.borderRightWidth,10),ne=parseInt(_e.borderBottomWidth,10),fe=0,le=0,ke="offsetWidth"in g?g.offsetWidth-g.clientWidth-De-ce:0,Fe="offsetHeight"in g?g.offsetHeight-g.clientHeight-he-ne:0;if(a===g)fe=o==="start"?F:o==="end"?F-D:o==="nearest"?Y(A,A+D,D,he,ne,A+F,A+F+E,E):F-D/2,le=f==="start"?_:f==="center"?_-S/2:f==="end"?_-S:Y(L,L+S,S,De,ce,L+_,L+_+d,d),fe=Math.max(0,fe+A),le=Math.max(0,le+L);else{fe=o==="start"?F-ue-he:o==="end"?F-ve+ne+Fe:o==="nearest"?Y(ue,ve,$,he,ne+Fe,F,F+E,E):F-(ue+$/2)+Fe/2,le=f==="start"?_-Te-De:f==="center"?_-(Te+ae/2)+ke/2:f==="end"?_-Le+ce+ke:Y(Te,Le,ae,De,ce+ke,_,_+d,d);var Ae=g.scrollLeft,Re=g.scrollTop;F+=Re-(fe=Math.max(0,Math.min(Re+fe,g.scrollHeight-$+Fe))),_+=Ae-(le=Math.max(0,Math.min(Ae+le,g.scrollWidth-ae+ke)))}M.push({el:g,top:fe,left:le})}return M};function U(v){return v===Object(v)&&Object.keys(v).length!==0}function z(v,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(h){var o=h.el,f=h.top,l=h.left;o.scroll&&p?o.scroll({top:f,left:l,behavior:m}):(o.scrollTop=f,o.scrollLeft=l)})}function W(v){return v===!1?{block:"end",inline:"nearest"}:U(v)?v:{block:"start",inline:"nearest"}}function r(v,m){var p=!v.ownerDocument.documentElement.contains(v);if(U(m)&&typeof m.behavior=="function")return m.behavior(p?[]:j(v,m));if(p)return;var h=W(m);return z(j(v,h),h.behavior)}var R=be.a=r},Zss7:function(nt,be,Q){var ie;(function(J){var P=/^\s+/,Y=/\s+$/,j=0,U=J.round,z=J.min,W=J.max,r=J.random;function R(ne,fe){if(ne=ne||"",fe=fe||{},ne instanceof R)return ne;if(!(this instanceof R))return new R(ne,fe);var le=v(ne);this._originalInput=ne,this._r=le.r,this._g=le.g,this._b=le.b,this._a=le.a,this._roundA=U(100*this._a)/100,this._format=fe.format||le.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=le.ok,this._tc_id=j++}R.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ne=this.toRgb();return(ne.r*299+ne.g*587+ne.b*114)/1e3},getLuminance:function(){var ne=this.toRgb(),fe,le,ke,Fe,Ae,Re;return fe=ne.r/255,le=ne.g/255,ke=ne.b/255,fe<=.03928?Fe=fe/12.92:Fe=J.pow((fe+.055)/1.055,2.4),le<=.03928?Ae=le/12.92:Ae=J.pow((le+.055)/1.055,2.4),ke<=.03928?Re=ke/12.92:Re=J.pow((ke+.055)/1.055,2.4),.2126*Fe+.7152*Ae+.0722*Re},setAlpha:function(ne){return this._a=M(ne),this._roundA=U(100*this._a)/100,this},toHsv:function(){var ne=o(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=o(this._r,this._g,this._b),fe=U(ne.h*360),le=U(ne.s*100),ke=U(ne.v*100);return this._a==1?"hsv("+fe+", "+le+"%, "+ke+"%)":"hsva("+fe+", "+le+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var ne=p(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=p(this._r,this._g,this._b),fe=U(ne.h*360),le=U(ne.s*100),ke=U(ne.l*100);return this._a==1?"hsl("+fe+", "+le+"%, "+ke+"%)":"hsla("+fe+", "+le+"%, "+ke+"%, "+this._roundA+")"},toHex:function(ne){return l(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return u(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(I(this._r,255)*100)+"%",g:U(I(this._g,255)*100)+"%",b:U(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%)":"rgba("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[l(this._r,this._g,this._b,!0)]||!1},toFilter:function(ne){var fe="#"+s(this._r,this._g,this._b,this._a),le=fe,ke=this._gradientType?"GradientType = 1, ":"";if(ne){var Fe=R(ne);le="#"+s(Fe._r,Fe._g,Fe._b,Fe._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+fe+",endColorstr="+le+")"},toString:function(ne){var fe=!!ne;ne=ne||this._format;var le=!1,ke=this._a<1&&this._a>=0,Fe=!fe&&ke&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return Fe?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(le=this.toRgbString()),ne==="prgb"&&(le=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(le=this.toHexString()),ne==="hex3"&&(le=this.toHexString(!0)),ne==="hex4"&&(le=this.toHex8String(!0)),ne==="hex8"&&(le=this.toHex8String()),ne==="name"&&(le=this.toName()),ne==="hsl"&&(le=this.toHslString()),ne==="hsv"&&(le=this.toHsvString()),le||this.toHexString())},clone:function(){return R(this.toString())},_applyModification:function(ne,fe){var le=ne.apply(null,[this].concat([].slice.call(fe)));return this._r=le._r,this._g=le._g,this._b=le._b,this.setAlpha(le._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(L,arguments)},desaturate:function(){return this._applyModification(a,arguments)},saturate:function(){return this._applyModification(O,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(ne,fe){return ne.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(E,arguments)},tetrad:function(){return this._applyCombination(d,arguments)}},R.fromRatio=function(ne,fe){if(typeof ne=="object"){var le={};for(var ke in ne)ne.hasOwnProperty(ke)&&(ke==="a"?le[ke]=ne[ke]:le[ke]=Le(ne[ke]));ne=le}return R(ne,fe)};function v(ne){var fe={r:0,g:0,b:0},le=1,ke=null,Fe=null,Ae=null,Re=!1,Pe=!1;return typeof ne=="string"&&(ne=he(ne)),typeof ne=="object"&&(De(ne.r)&&De(ne.g)&&De(ne.b)?(fe=m(ne.r,ne.g,ne.b),Re=!0,Pe=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):De(ne.h)&&De(ne.s)&&De(ne.v)?(ke=Le(ne.s),Fe=Le(ne.v),fe=f(ne.h,ke,Fe),Re=!0,Pe="hsv"):De(ne.h)&&De(ne.s)&&De(ne.l)&&(ke=Le(ne.s),Ae=Le(ne.l),fe=h(ne.h,ke,Ae),Re=!0,Pe="hsl"),ne.hasOwnProperty("a")&&(le=ne.a)),le=M(le),{ok:Re,format:ne.format||Pe,r:z(255,W(fe.r,0)),g:z(255,W(fe.g,0)),b:z(255,W(fe.b,0)),a:le}}function m(ne,fe,le){return{r:I(ne,255)*255,g:I(fe,255)*255,b:I(le,255)*255}}function p(ne,fe,le){ne=I(ne,255),fe=I(fe,255),le=I(le,255);var ke=W(ne,fe,le),Fe=z(ne,fe,le),Ae,Re,Pe=(ke+Fe)/2;if(ke==Fe)Ae=Re=0;else{var se=ke-Fe;Re=Pe>.5?se/(2-ke-Fe):se/(ke+Fe);switch(ke){case ne:Ae=(fe-le)/se+(fe<le?6:0);break;case fe:Ae=(le-ne)/se+2;break;case le:Ae=(ne-fe)/se+4;break}Ae/=6}return{h:Ae,s:Re,l:Pe}}function h(ne,fe,le){var ke,Fe,Ae;ne=I(ne,360),fe=I(fe,100),le=I(le,100);function Re(pe,ye,Oe){return Oe<0&&(Oe+=1),Oe>1&&(Oe-=1),Oe<1/6?pe+(ye-pe)*6*Oe:Oe<1/2?ye:Oe<2/3?pe+(ye-pe)*(2/3-Oe)*6:pe}if(fe===0)ke=Fe=Ae=le;else{var Pe=le<.5?le*(1+fe):le+fe-le*fe,se=2*le-Pe;ke=Re(se,Pe,ne+1/3),Fe=Re(se,Pe,ne),Ae=Re(se,Pe,ne-1/3)}return{r:ke*255,g:Fe*255,b:Ae*255}}function o(ne,fe,le){ne=I(ne,255),fe=I(fe,255),le=I(le,255);var ke=W(ne,fe,le),Fe=z(ne,fe,le),Ae,Re,Pe=ke,se=ke-Fe;if(Re=ke===0?0:se/ke,ke==Fe)Ae=0;else{switch(ke){case ne:Ae=(fe-le)/se+(fe<le?6:0);break;case fe:Ae=(le-ne)/se+2;break;case le:Ae=(ne-fe)/se+4;break}Ae/=6}return{h:Ae,s:Re,v:Pe}}function f(ne,fe,le){ne=I(ne,360)*6,fe=I(fe,100),le=I(le,100);var ke=J.floor(ne),Fe=ne-ke,Ae=le*(1-fe),Re=le*(1-Fe*fe),Pe=le*(1-(1-Fe)*fe),se=ke%6,pe=[le,Re,Ae,Ae,Pe,le][se],ye=[Pe,le,le,Re,Ae,Ae][se],Oe=[Ae,Ae,Pe,le,le,Re][se];return{r:pe*255,g:ye*255,b:Oe*255}}function l(ne,fe,le,ke){var Fe=[ue(U(ne).toString(16)),ue(U(fe).toString(16)),ue(U(le).toString(16))];return ke&&Fe[0].charAt(0)==Fe[0].charAt(1)&&Fe[1].charAt(0)==Fe[1].charAt(1)&&Fe[2].charAt(0)==Fe[2].charAt(1)?Fe[0].charAt(0)+Fe[1].charAt(0)+Fe[2].charAt(0):Fe.join("")}function u(ne,fe,le,ke,Fe){var Ae=[ue(U(ne).toString(16)),ue(U(fe).toString(16)),ue(U(le).toString(16)),ue(ve(ke))];return Fe&&Ae[0].charAt(0)==Ae[0].charAt(1)&&Ae[1].charAt(0)==Ae[1].charAt(1)&&Ae[2].charAt(0)==Ae[2].charAt(1)&&Ae[3].charAt(0)==Ae[3].charAt(1)?Ae[0].charAt(0)+Ae[1].charAt(0)+Ae[2].charAt(0)+Ae[3].charAt(0):Ae.join("")}function s(ne,fe,le,ke){var Fe=[ue(ve(ke)),ue(U(ne).toString(16)),ue(U(fe).toString(16)),ue(U(le).toString(16))];return Fe.join("")}R.equals=function(ne,fe){return!ne||!fe?!1:R(ne).toRgbString()==R(fe).toRgbString()},R.random=function(){return R.fromRatio({r:r(),g:r(),b:r()})};function a(ne,fe){fe=fe===0?0:fe||10;var le=R(ne).toHsl();return le.s-=fe/100,le.s=g(le.s),R(le)}function O(ne,fe){fe=fe===0?0:fe||10;var le=R(ne).toHsl();return le.s+=fe/100,le.s=g(le.s),R(le)}function x(ne){return R(ne).desaturate(100)}function S(ne,fe){fe=fe===0?0:fe||10;var le=R(ne).toHsl();return le.l+=fe/100,le.l=g(le.l),R(le)}function D(ne,fe){fe=fe===0?0:fe||10;var le=R(ne).toRgb();return le.r=W(0,z(255,le.r-U(255*-(fe/100)))),le.g=W(0,z(255,le.g-U(255*-(fe/100)))),le.b=W(0,z(255,le.b-U(255*-(fe/100)))),R(le)}function L(ne,fe){fe=fe===0?0:fe||10;var le=R(ne).toHsl();return le.l-=fe/100,le.l=g(le.l),R(le)}function A(ne,fe){var le=R(ne).toHsl(),ke=(le.h+fe)%360;return le.h=ke<0?360+ke:ke,R(le)}function C(ne){var fe=R(ne).toHsl();return fe.h=(fe.h+180)%360,R(fe)}function E(ne){var fe=R(ne).toHsl(),le=fe.h;return[R(ne),R({h:(le+120)%360,s:fe.s,l:fe.l}),R({h:(le+240)%360,s:fe.s,l:fe.l})]}function d(ne){var fe=R(ne).toHsl(),le=fe.h;return[R(ne),R({h:(le+90)%360,s:fe.s,l:fe.l}),R({h:(le+180)%360,s:fe.s,l:fe.l}),R({h:(le+270)%360,s:fe.s,l:fe.l})]}function w(ne){var fe=R(ne).toHsl(),le=fe.h;return[R(ne),R({h:(le+72)%360,s:fe.s,l:fe.l}),R({h:(le+216)%360,s:fe.s,l:fe.l})]}function y(ne,fe,le){fe=fe||6,le=le||30;var ke=R(ne).toHsl(),Fe=360/le,Ae=[R(ne)];for(ke.h=(ke.h-(Fe*fe>>1)+720)%360;--fe;)ke.h=(ke.h+Fe)%360,Ae.push(R(ke));return Ae}function b(ne,fe){fe=fe||6;for(var le=R(ne).toHsv(),ke=le.h,Fe=le.s,Ae=le.v,Re=[],Pe=1/fe;fe--;)Re.push(R({h:ke,s:Fe,v:Ae})),Ae=(Ae+Pe)%1;return Re}R.mix=function(ne,fe,le){le=le===0?0:le||50;var ke=R(ne).toRgb(),Fe=R(fe).toRgb(),Ae=le/100,Re={r:(Fe.r-ke.r)*Ae+ke.r,g:(Fe.g-ke.g)*Ae+ke.g,b:(Fe.b-ke.b)*Ae+ke.b,a:(Fe.a-ke.a)*Ae+ke.a};return R(Re)},R.readability=function(ne,fe){var le=R(ne),ke=R(fe);return(J.max(le.getLuminance(),ke.getLuminance())+.05)/(J.min(le.getLuminance(),ke.getLuminance())+.05)},R.isReadable=function(ne,fe,le){var ke=R.readability(ne,fe),Fe,Ae;Ae=!1,Fe=ce(le);switch(Fe.level+Fe.size){case"AAsmall":case"AAAlarge":Ae=ke>=4.5;break;case"AAlarge":Ae=ke>=3;break;case"AAAsmall":Ae=ke>=7;break}return Ae},R.mostReadable=function(ne,fe,le){var ke=null,Fe=0,Ae,Re,Pe,se;le=le||{},Re=le.includeFallbackColors,Pe=le.level,se=le.size;for(var pe=0;pe<fe.length;pe++)Ae=R.readability(ne,fe[pe]),Ae>Fe&&(Fe=Ae,ke=R(fe[pe]));return R.isReadable(ne,ke,{level:Pe,size:se})||!Re?ke:(le.includeFallbackColors=!1,R.mostReadable(ne,["#fff","#000"],le))};var B=R.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=R.hexNames=_(B);function _(ne){var fe={};for(var le in ne)ne.hasOwnProperty(le)&&(fe[ne[le]]=le);return fe}function M(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function I(ne,fe){$(ne)&&(ne="100%");var le=ae(ne);return ne=z(fe,W(0,parseFloat(ne))),le&&(ne=parseInt(ne*fe,10)/100),J.abs(ne-fe)<1e-6?1:ne%fe/parseFloat(fe)}function g(ne){return z(1,W(0,ne))}function H(ne){return parseInt(ne,16)}function $(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function ae(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function ue(ne){return ne.length==1?"0"+ne:""+ne}function Le(ne){return ne<=1&&(ne=ne*100+"%"),ne}function ve(ne){return J.round(parseFloat(ne)*255).toString(16)}function Te(ne){return H(ne)/255}var _e=function(){var ne="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",le="(?:"+fe+")|(?:"+ne+")",ke="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?",Fe="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?";return{CSS_UNIT:new RegExp(le),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+Fe),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+Fe),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+Fe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function De(ne){return!!_e.CSS_UNIT.exec(ne)}function he(ne){ne=ne.replace(P,"").replace(Y,"").toLowerCase();var fe=!1;if(B[ne])ne=B[ne],fe=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var le;return(le=_e.rgb.exec(ne))?{r:le[1],g:le[2],b:le[3]}:(le=_e.rgba.exec(ne))?{r:le[1],g:le[2],b:le[3],a:le[4]}:(le=_e.hsl.exec(ne))?{h:le[1],s:le[2],l:le[3]}:(le=_e.hsla.exec(ne))?{h:le[1],s:le[2],l:le[3],a:le[4]}:(le=_e.hsv.exec(ne))?{h:le[1],s:le[2],v:le[3]}:(le=_e.hsva.exec(ne))?{h:le[1],s:le[2],v:le[3],a:le[4]}:(le=_e.hex8.exec(ne))?{r:H(le[1]),g:H(le[2]),b:H(le[3]),a:Te(le[4]),format:fe?"name":"hex8"}:(le=_e.hex6.exec(ne))?{r:H(le[1]),g:H(le[2]),b:H(le[3]),format:fe?"name":"hex"}:(le=_e.hex4.exec(ne))?{r:H(le[1]+""+le[1]),g:H(le[2]+""+le[2]),b:H(le[3]+""+le[3]),a:Te(le[4]+""+le[4]),format:fe?"name":"hex8"}:(le=_e.hex3.exec(ne))?{r:H(le[1]+""+le[1]),g:H(le[2]+""+le[2]),b:H(le[3]+""+le[3]),format:fe?"name":"hex"}:!1}function ce(ne){var fe,le;return ne=ne||{level:"AA",size:"small"},fe=(ne.level||"AA").toUpperCase(),le=(ne.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),le!=="small"&&le!=="large"&&(le="small"),{level:fe,size:le}}nt.exports?nt.exports=R:!(ie=function(){return R}.call(be,Q,be,nt),ie!==void 0&&(nt.exports=ie))})(Math)},bT9E:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return J});var ie=Q("VTBJ");function J(P,Y){var j=Object(ie.a)({},P);return Array.isArray(Y)&&Y.forEach(function(U){delete j[U]}),j}},c5Ni:function(nt,be,Q){},dejd:function(nt,be,Q){},dmUQ:function(nt,be,Q){"use strict";var ie=Q("Ff2n"),J=Q("rePB"),P=Q("1OyB"),Y=Q("vuIU"),j=Q("Ji7U"),U=Q("md7G"),z=Q("foSv"),W=Q("q1tI"),r=Q.n(W),R=Q("TSYQ"),v=Q.n(R),m=Q("4IlW");function p(E,d){var w=Object.keys(E);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(E);d&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(E,b).enumerable})),w.push.apply(w,y)}return w}function h(E){for(var d=1;d<arguments.length;d++){var w=arguments[d]!=null?arguments[d]:{};d%2?p(Object(w),!0).forEach(function(y){Object(J.a)(E,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(w)):p(Object(w)).forEach(function(y){Object.defineProperty(E,y,Object.getOwnPropertyDescriptor(w,y))})}return E}function o(E){var d=f();return function(){var y=Object(z.a)(E),b;if(d){var B=Object(z.a)(this).constructor;b=Reflect.construct(y,arguments,B)}else b=y.apply(this,arguments);return Object(U.a)(this,b)}}function f(){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(E){return!1}}function l(){}function u(E){E.preventDefault()}var s=function(d){return d.replace(/[^\w.-]+/g,"")},a=200,O=600,x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(d){return d!=null},D=function(d,w){return w===d||typeof w=="number"&&typeof d=="number"&&isNaN(w)&&isNaN(d)},L=function(E){Object(j.a)(w,E);var d=o(w);function w(y){var b;Object(P.a)(this,w),b=d.call(this,y),b.onKeyDown=function(_){var M=b.props,I=M.onKeyDown,g=M.onPressEnter;if(_.keyCode===m.a.UP){var H=b.getRatio(_);b.up(_,H,null),b.stop()}else if(_.keyCode===m.a.DOWN){var $=b.getRatio(_);b.down(_,$,null),b.stop()}else _.keyCode===m.a.ENTER&&g&&g(_);if(b.recordCursorPosition(),b.lastKeyCode=_.keyCode,I){for(var ae=arguments.length,ue=new Array(ae>1?ae-1:0),Le=1;Le<ae;Le++)ue[Le-1]=arguments[Le];I.apply(void 0,[_].concat(ue))}},b.onKeyUp=function(_){var M=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),M){for(var I=arguments.length,g=new Array(I>1?I-1:0),H=1;H<I;H++)g[H-1]=arguments[H];M.apply(void 0,[_].concat(g))}},b.onChange=function(_){var M=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(_)),b.setState({inputValue:b.rawInput}),M(b.toNumber(b.rawInput))},b.onMouseUp=function(){var _=b.props.onMouseUp;b.recordCursorPosition(),_&&_.apply(void 0,arguments)},b.onFocus=function(){var _;b.setState({focused:!0}),(_=b.props).onFocus.apply(_,arguments)},b.onBlur=function(){var _=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var M=b.getCurrentValidValue(b.state.inputValue),I=b.setValue(M,l);if(_){var g=b.input.value,H=b.getInputDisplayValue({focus:!1,value:I});b.input.value=H&&Number(H),_.apply(void 0,arguments),b.input.value=g}},b.getRatio=function(_){var M=1;return _.metaKey||_.ctrlKey?M=.1:_.shiftKey&&(M=10),M},b.getFullNum=function(_){return isNaN(_)?_:/e/i.test(String(_))?Number(_).toFixed(18).replace(/\.?0+$/,""):_},b.getPrecision=function(_){if(S(b.props.precision))return b.props.precision;var M=String(_);if(M.indexOf("e-")>=0)return parseInt(M.slice(M.indexOf("e-")+2),10);var I=0;return M.indexOf(".")>=0&&(I=M.length-M.indexOf(".")-1),I},b.getInputDisplayValue=function(_){var M=_||b.state,I=M.focused,g=M.inputValue,H=M.value,$;I?$=g:$=b.toPrecisionAsStep(H),$==null&&($="");var ae=b.formatWrapper($);return S(b.props.decimalSeparator)&&(ae=ae.toString().replace(".",b.props.decimalSeparator)),ae},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(_){}},b.restoreByAfter=function(_){if(_===void 0)return!1;var M=b.input.value,I=M.lastIndexOf(_);if(I===-1)return!1;var g=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(g-1)===_[0]?(b.fixCaret(g,g),!0):I+_.length===M.length?(b.fixCaret(I,I),!0):!1},b.partRestoreByAfter=function(_){return _===void 0?!1:Array.prototype.some.call(_,function(M,I){var g=_.substring(I);return b.restoreByAfter(g)})},b.isNotCompleteNumber=function(_){return isNaN(_)||_===""||_===null||_&&_.toString().indexOf(".")===_.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(_,M,I){b.pressingUpOrDown=!0,b.step("down",_,M,I)},b.up=function(_,M,I){b.pressingUpOrDown=!0,b.step("up",_,M,I)},b.saveInput=function(_){b.input=_};var B=y.value;B===void 0&&(B=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(B));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(Y.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var B=this.props,F=B.value,_=B.onChange,M=B.max,I=B.min,g=this.state.focused;if(b){if(!D(b.value,F)||!D(b.max,M)||!D(b.min,I)){var H=g?F:this.getValidValue(F),$;this.pressingUpOrDown?$=H:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:$})}var ae="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==M&&typeof ae=="number"&&ae>M&&_&&_(M),"min"in this.props&&b.min!==I&&typeof ae=="number"&&ae<I&&_&&_(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Le){}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(b){var B=b;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(b){var B=b.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(b){var B=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,_=parseFloat(b);return isNaN(_)?b:(_<B&&(_=B),_>F&&(_=F),_)}},{key:"setValue",value:function(b,B){var F=this.props.precision,_=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),M=this.state.value,I=M===void 0?null:M,g=this.state.inputValue,H=g===void 0?null:g,$=typeof _=="number"?_.toFixed(F):"".concat(_),ae=_!==I||$!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},B)):this.setState({value:_,inputValue:this.toPrecisionAsStep(b)},B),ae&&this.props.onChange(_),_}},{key:"getMaxPrecision",value:function(b){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,_=F.precision,M=F.step;if(S(_))return _;var I=this.getPrecision(B),g=this.getPrecision(M),H=this.getPrecision(b);return b?Math.max(H,I+g):I+g}},{key:"getPrecisionFactor",value:function(b){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,B);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(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var B=Math.abs(this.getMaxPrecision(b));return isNaN(B)?b.toString():Number(b).toFixed(B)}},{key:"toNumber",value:function(b){var B=this.props.precision,F=this.state.focused,_=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||_?b:S(B)?Math.round(b*Math.pow(10,B))/Math.pow(10,B):Number(b)}},{key:"upStep",value:function(b,B){var F=this.props.step,_=this.getPrecisionFactor(b,B),M=Math.abs(this.getMaxPrecision(b,B)),I=((_*b+_*F*B)/_).toFixed(M);return this.toNumber(I)}},{key:"downStep",value:function(b,B){var F=this.props.step,_=this.getPrecisionFactor(b,B),M=Math.abs(this.getMaxPrecision(b,B)),I=((_*b-_*F*B)/_).toFixed(M);return this.toNumber(I)}},{key:"step",value:function(b,B){var F=this,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var I=this.props;if(I.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var H=this["".concat(b,"Step")](g,_),$=H>I.max||H<I.min;if(H>I.max?H=I.max:H<I.min&&(H=I.min),this.setValue(H,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){F[b](B,_,!0)},M?a:O)}},{key:"fixCaret",value:function(b,B){if(b===void 0||B===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,_=this.input.selectionEnd;(b!==F||B!==_)&&this.input.setSelectionRange(b,B)}catch(M){}}},{key:"render",value:function(){var b,B=this.props,F=B.prefixCls,_=B.disabled,M=B.readOnly,I=B.useTouch,g=B.autoComplete,H=B.upHandler,$=B.downHandler,ae=B.className,ue=B.max,Le=B.min,ve=B.style,Te=B.title,_e=B.onMouseEnter,De=B.onMouseLeave,he=B.onMouseOver,ce=B.onMouseOut,ne=B.required,fe=B.onClick,le=B.tabIndex,ke=B.type,Fe=B.placeholder,Ae=B.id,Re=B.inputMode,Pe=B.pattern,se=B.step,pe=B.maxLength,ye=B.autoFocus,Oe=B.name,je=B.onPaste,ze=B.onInput,Je=Object(ie.a)(B,["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"]),Ye=this.state,rt=Ye.value,Ze=Ye.focused,et=v()(F,(b={},Object(J.a)(b,ae,!!ae),Object(J.a)(b,"".concat(F,"-disabled"),_),Object(J.a)(b,"".concat(F,"-focused"),Ze),b)),Be={};Object.keys(Je).forEach(function(ge){(ge.substr(0,5)==="data-"||ge.substr(0,5)==="aria-"||ge==="role")&&(Be[ge]=Je[ge])});var ut=!M&&!_,st=this.getInputDisplayValue(null),He=(rt||rt===0)&&(isNaN(rt)||Number(rt)>=ue),We=(rt||rt===0)&&(isNaN(rt)||Number(rt)<=Le),Ie=He||_||M,Ee=We||_||M,Ce=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(J.a)({},"".concat(F,"-handler-up-disabled"),Ie)),re=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(J.a)({},"".concat(F,"-handler-down-disabled"),Ee)),oe=I?{onTouchStart:Ie?l:this.up,onTouchEnd:this.stop}:{onMouseDown:Ie?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=I?{onTouchStart:Ee?l:this.down,onTouchEnd:this.stop}:{onMouseDown:Ee?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:et,style:ve,title:Te,onMouseEnter:_e,onMouseLeave:De,onMouseOver:he,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":Ie,className:Ce}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:u})),r.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":Ee,className:re}),$||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:u}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Le,"aria-valuemax":ue,"aria-valuenow":rt,required:ne,type:ke,placeholder:Fe,onPaste:je,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:le,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ut?this.onKeyDown:l,onKeyUp:ut?this.onKeyUp:l,autoFocus:ye,maxLength:pe,readOnly:M,disabled:_,max:ue,min:Le,step:se,name:Oe,title:Te,id:Ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:Pe,inputMode:Re,onInput:ze},Be))))}}]),w}(r.a.Component);L.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:s,required:!1,autoComplete:"off"};var A=L,C=be.a=A},fjLI:function(nt,be,Q){"use strict";Q.d(be,"f",function(){return p}),Q.d(be,"b",function(){return h}),Q.d(be,"a",function(){return o}),Q.d(be,"d",function(){return f}),Q.d(be,"e",function(){return l}),Q.d(be,"c",function(){return u});var ie=Q("8HAY"),J=Q("Vhoy"),P=Q("MI8n"),Y=Q("JYp7"),j=Q("pmY6"),U=Q("24hK"),z=Q("nnTU"),W=Q("T8No"),r=Q("Cg/j"),R=Q("t9D7"),v=function(s,a,O,x){var S=arguments.length,D=S<3?a:x===null?x=Object.getOwnPropertyDescriptor(a,O):x,L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(s,a,O,x);else for(var A=s.length-1;A>=0;A--)(L=s[A])&&(D=(S<3?L(D):S>3?L(a,O,D):L(a,O))||D);return S>3&&D&&Object.defineProperty(a,O,D),D},m=function(s,a){return function(O,x){a(O,x,s)}};function p(s){return s.command!==void 0}class h{constructor(s){this.id=h._idPool++,this._debugName=s}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const o=Object(r.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===h.CommandPalette}}addCommand(s){return this.addCommands(Y.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let a=!1;for(const O of s)a=this._commands.delete(O.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((a,O)=>s.set(O,a)),s}appendMenuItem(s,a){return this.appendMenuItems(Y.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,O=new U.a;for(const{id:x,item:S}of s){let D=this._menuItems.get(x);D||(D=new U.a,this._menuItems.set(x,D)),O.push(D.push(S)),a.add(x)}return this._onDidChangeMenu.fire(a),Object(j.i)(()=>{if(O.size>0){for(let x of O)x();this._onDidChangeMenu.fire(a),O.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===h.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const O of s)p(O)&&(a.add(O.command.id),O.alt&&a.add(O.alt.id));this._commands.forEach((O,x)=>{a.has(x)||s.push({command:O})})}};class l extends ie.e{constructor(s,a,O,x){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=O,this._options=x}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=a.getActions(this._options);a.dispose();for(const[,x]of O)x.length>0&&(s.push(...x),s.push(new ie.d));return s.length&&s.pop(),s}}let u=class s{constructor(a,O,x,S,D){var L,A;if(this._commandService=D,this.id=a.id,this.label=(x==null?void 0:x.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(A=typeof a.tooltip=="string"?a.tooltip:(L=a.tooltip)===null||L===void 0?void 0:L.value)!==null&&A!==void 0?A:"",this.enabled=!a.precondition||S.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const C=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=S.contextMatchesRules(C.condition),this.checked&&C.tooltip&&(this.tooltip=typeof C.tooltip=="string"?C.tooltip:C.tooltip.value),C.title&&(this.label=typeof C.title=="string"?C.title:C.title.value)}this.item=a,this.alt=O?new s(O,void 0,x,S,D):void 0,this._options=x,R.d.isThemeIcon(a.icon)&&(this.class=J.a.asClassName(a.icon))}dispose(){}run(...a){var O,x;let S=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(S=[...S,this._options.arg]),((x=this._options)===null||x===void 0?void 0:x.shouldForwardArgs)&&(S=[...S,...a]),this._commandService.executeCommand(this.id,...S)}};u=v([m(3,W.b),m(4,z.b)],u)},gMzb:function(nt,be,Q){"use strict";var ie=Q("k1fw"),J=Q("oBTY"),P=Q("9og8"),Y=Q("tJVT"),j=Q("sRBo"),U=Q("kaz8"),z=Q("WmNS"),W=Q.n(z),r=Q("q1tI"),R=Q.n(r),v=Q("9kvl"),m=Q("wlus"),p=Q("w5pM"),h=Q("ErOA"),o=Q("OaEy"),f=Q("2fM7"),l=Q("y8nQ"),u=Q("Vl3Y"),s=Q("Ty5D"),a=Q("yQHh"),O=Q.n(a),x=U.a.Group,S=function(d){var w,y,b,B,F,_,M,I,g=d.classroomList,H=d.loading,$=d.user,ae=d.exercise_id,ue=ae===void 0?null:ae,Le=d.homework_common_id,ve=Le===void 0?null:Le,Te=d.setitem,_e=d.item,De=d.type,he=d.rz,ce=d.dispatch,ne=Object(r.useState)([]),fe=Object(Y.a)(ne,2),le=fe[0],ke=fe[1],Fe=Object(r.useState)({zydatas:[],jbdatas:[],kcdatas:[],zsdatas:[],page:1,per_page:20}),Ae=Object(Y.a)(Fe,2),Re=Ae[0],Pe=Ae[1],se=Object(s.i)(),pe=Object(r.useState)(!1),ye=Object(Y.a)(pe,2),Oe=ye[0],je=ye[1],ze=Object(r.useState)(!1),Je=Object(Y.a)(ze,2),Ye=Je[0],rt=Je[1],Ze=u.a.useForm(),et=Object(Y.a)(Ze,1),Be=et[0];Object(r.useEffect)(function(){he&&(Re.zydatas=he,Pe(Object(ie.a)({},Re)),_e!=null&&_e.ec_course_id&&ut())},[_e,he]);function ut(){return st.apply(this,arguments)}function st(){return st=Object(P.a)(W.a.mark(function re(){return W.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return console.log("----",_e),de.next=3,He(_e==null?void 0:_e.ec_major_school_id);case 3:return de.next=5,Ie(_e==null?void 0:_e.ec_year_id);case 5:return de.next=7,Ce(_e==null?void 0:_e.ec_course_id);case 7:Be.setFieldsValue({ec_course_id:_e==null?void 0:_e.ec_course_id,ec_major_school_id:_e==null?void 0:_e.ec_major_school_id,ec_point_ids:_e==null?void 0:_e.ec_point_ids,ec_year_id:_e==null?void 0:_e.ec_year_id});case 8:case"end":return de.stop()}},re)})),st.apply(this,arguments)}function He(re){return We.apply(this,arguments)}function We(){return We=Object(P.a)(W.a.mark(function re(oe){var de;return W.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(h.a)("/api/ec_major_schools/".concat(oe,"/ec_years/get_year_list.json"),{method:"get"});case 2:de=Se.sent,Re.jbdatas=de==null?void 0:de.data,Pe(Object(ie.a)({},Re)),Be.setFieldsValue({ec_year_id:"",ec_course_id:"",ec_point_ids:[]});case 6:case"end":return Se.stop()}},re)})),We.apply(this,arguments)}function Ie(re){return Ee.apply(this,arguments)}function Ee(){return Ee=Object(P.a)(W.a.mark(function re(oe){var de;return W.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(h.a)("/api/ec_years/".concat(oe,"/ec_courses/get_courses.json"),{method:"get"});case 2:de=Se.sent,Re.kcdatas=de==null?void 0:de.data,Pe(Object(ie.a)({},Re)),Be.setFieldsValue({ec_course_id:"",ec_point_ids:[]});case 6:case"end":return Se.stop()}},re)})),Ee.apply(this,arguments)}var Ce=function(){var re=Object(P.a)(W.a.mark(function oe(de){var ge;return W.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,Object(h.a)("/api/ec_courses/".concat(de,"/ec_points.json"),{method:"get",params:{ec_course_id:de}});case 2:ge=Ue.sent,Re.zsdatas=ge==null?void 0:ge.data,Pe(Object(ie.a)({},Re));case 5:case"end":return Ue.stop()}},oe)}));return function(de){return re.apply(this,arguments)}}();return R.a.createElement("div",{className:O.a.from},R.a.createElement(u.a,{form:Be,layout:"inline",onValuesChange:function(oe){console.log("----",oe),oe.ec_major_school_id&&(Re.jbdatas=[],Re.kcdatas=[],Re.zsdatas=[],Pe(Object(ie.a)({},Re)),He(oe.ec_major_school_id)),oe.ec_year_id&&(Re.kcdatas=[],Re.zsdatas=[],Pe(Object(ie.a)({},Re)),Ie(oe.ec_year_id)),oe.ec_course_id&&(Re.zsdatas=[],Pe(Object(ie.a)({},Re)),Ce(oe.ec_course_id))},onFinish:function(){var re=Object(P.a)(W.a.mark(function oe(de){return W.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:Te(de);case 1:case"end":return Se.stop()}},oe)}));return function(oe){return re.apply(this,arguments)}}()},R.a.createElement(u.a.Item,{label:"\u8BA4\u8BC1\u4E13\u4E1A",name:"ec_major_school_id"},R.a.createElement(f.a,{style:{width:150},disabled:((w=Re.zydatas)===null||w===void 0?void 0:w.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u4E13\u4E1A"},Re==null||((y=Re.zydatas)===null||y===void 0)?void 0:y.map(function(re,oe){return R.a.createElement(f.a.Option,{key:oe,value:re==null?void 0:re.ec_major_school_id},re==null?void 0:re.name)}))),R.a.createElement(u.a.Item,{label:"\u8BA4\u8BC1\u5C4A\u522B",name:"ec_year_id"},R.a.createElement(f.a,{style:{width:150},disabled:((b=Re.jbdatas)===null||b===void 0?void 0:b.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u5C4A\u522B"},Re==null||((B=Re.jbdatas)===null||B===void 0)?void 0:B.map(function(re,oe){return R.a.createElement(f.a.Option,{key:oe,value:re==null?void 0:re.ec_year_id},re==null?void 0:re.year)}))),R.a.createElement(u.a.Item,{label:"\u8BFE\u7A0B",name:"ec_course_id"},R.a.createElement(f.a,{style:{width:150},disabled:((F=Re.kcdatas)===null||F===void 0?void 0:F.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"},Re==null||((_=Re.kcdatas)===null||_===void 0)?void 0:_.map(function(re,oe){return R.a.createElement(f.a.Option,{key:oe,value:re==null?void 0:re.id},re==null?void 0:re.name)}))),R.a.createElement(u.a.Item,{label:"\u77E5\u8BC6\u70B9",name:"ec_point_ids"},R.a.createElement(f.a,{onChange:function(){Be.submit()},style:{width:150},mode:"multiple",disabled:((M=Re.zsdatas)===null||M===void 0?void 0:M.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"},Re==null||((I=Re.zsdatas)===null||I===void 0)?void 0:I.map(function(re,oe){return R.a.createElement(f.a.Option,{key:oe,value:re==null?void 0:re.id},re==null?void 0:re.name)})))))},D=Object(v.a)(function(E){var d=E.classroomList,w=E.loading,y=E.globalSetting,b=E.user;return{classroomList:d,globalSetting:y,loading:w.effects,user:b}})(S),L=U.a.Group,A=function(d){var w,y,b,B=d.classroomList,F=d.loading,_=d.user,M=d.exercise_id,I=M===void 0?null:M,g=d.homework_common_id,H=g===void 0?null:g,$=d.setitem,ae=d.type,ue=d.dispatch,Le=Object(r.useState)([{}]),ve=Object(Y.a)(Le,2),Te=ve[0],_e=ve[1],De=Object(r.useState)([]),he=Object(Y.a)(De,2),ce=he[0],ne=he[1];function fe(){return le.apply(this,arguments)}function le(){return le=Object(P.a)(W.a.mark(function Ae(){var Re,Pe,se,pe,ye;return W.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,Object(h.a)("/api/ec_courses/".concat(0,"/ec_points/get_work_points.json"),{method:"get",params:{exercise_id:I,homework_common_id:H}});case 2:Pe=je.sent,(Pe==null||((Re=Pe.data)===null||Re===void 0)?void 0:Re.length)>0&&(ye=[],Pe==null||((se=Pe.data)===null||se===void 0)||se.map(function(ze){var Je;ze==null||((Je=ze.ec_point_ids)===null||Je===void 0)||Je.map(function(Ye){ye.push(Ye)})}),$(Object(ie.a)(Object(ie.a)({},Pe==null||((pe=Pe.data)===null||pe===void 0)?void 0:pe[0]),{},{ec_point_ids:ye})),_e(Pe==null?void 0:Pe.data));case 4:case"end":return je.stop()}},Ae)})),le.apply(this,arguments)}Object(r.useEffect)(function(){var Ae,Re;_!=null&&(Ae=_.userInfo)!==null&&Ae!==void 0&&(Re=Ae.course)!==null&&Re!==void 0&&Re.course_school_id&&ke()},[_==null||((w=_.userInfo)===null||w===void 0||((y=w.course)===null||y===void 0))?void 0:y.course_school_id]);function ke(){return Fe.apply(this,arguments)}function Fe(){return Fe=Object(P.a)(W.a.mark(function Ae(){var Re,Pe,se;return W.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return ye.next=2,Object(h.a)("/api/schools/".concat(_==null||((Re=_.userInfo)===null||Re===void 0||((Pe=Re.course)===null||Pe===void 0))?void 0:Pe.course_school_id,"/ec_majors/get_major_list.json"),{method:"get"});case 2:se=ye.sent,ne(se==null?void 0:se.data),(H||I)&&fe();case 5:case"end":return ye.stop()}},Ae)})),Fe.apply(this,arguments)}return console.log(Te),R.a.createElement("div",{style:{display:(b=_.userInfo.course)!==null&&b!==void 0&&b.is_openengineering?"":"none"}},R.a.createElement("p",{style:{fontSize:"16px",fontWeight:400}},"\u5DE5\u7A0B\u8BA4\u8BC1\u8003\u6838\u77E5\u8BC6\u70B9"),Te==null?void 0:Te.map(function(Ae,Re){return R.a.createElement("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"}},R.a.createElement(D,{rz:ce,item:Ae,type:Re,setitem:function(se){Te.splice(Re,1,se),_e(Object(J.a)(Te));var pe=[];Te==null||Te.map(function(ye){var Oe;ye==null||((Oe=ye.ec_point_ids)===null||Oe===void 0)||Oe.map(function(je){pe.push(je)})}),$(Object(ie.a)(Object(ie.a)({},se),{},{ec_point_ids:pe}))}}),Re!=0&&R.a.createElement(m.a,{onClick:function(){Te.splice(Re,1),_e(Object(J.a)(Te))},style:{marginLeft:10,fontSize:"20px"}}),R.a.createElement(p.a,{onClick:function(){Te.push({}),_e(Object(J.a)(Te))},style:{marginLeft:10,fontSize:"20px"}}))}))},C=be.a=Object(v.a)(function(E){var d=E.classroomList,w=E.loading,y=E.globalSetting,b=E.user;return{classroomList:d,globalSetting:y,loading:w.effects,user:b}})(A)},gnOq:function(nt,be,Q){"use strict";Q.r(be);var ie=Q("+L6B"),J=Q("2/Rp"),P=Q("5NDa"),Y=Q("5rEg"),j=Q("sPJy"),U=Q("bE4q"),z=Q("k1fw"),W=Q("9og8"),r=Q("y8nQ"),R=Q("Vl3Y"),v=Q("tJVT"),m=Q("WmNS"),p=Q.n(m),h=Q("q1tI"),o=Q.n(h),f=Q("9kvl"),l=Q("55Ip"),u=Q("Ot1p"),s=Q("XYT7"),a=Q("we55"),O=Q.n(a),x=Q("500L"),S=Q("1vsH"),D=Q("gMzb"),L=Q("ErOA"),A=function(E){var d,w=E.shixunHomeworks,y=E.newCourse,b=E.globalSetting,B=E.loading,F=E.dispatch,_=E.match,M=R.a.useForm(),I=Object(v.a)(M,1),g=I[0],H=Object(h.useState)({}),$=Object(v.a)(H,2),ae=$[0],ue=$[1],Le=Object(h.useState)(),ve=Object(v.a)(Le,2),Te=ve[0],_e=ve[1],De=Object(h.useRef)(),he=w.commonHomeWorkAddDefaultData,ce=Object(h.useState)({}),ne=Object(v.a)(ce,2),fe=ne[0],le=ne[1];Object(h.useEffect)(function(){var Pe;setTimeout(function(){document.body.scrollIntoView()},300);var se=_.params,pe=se.coursesId,ye=se.categoryId;De.current=(Pe=_.params)===null||Pe===void 0?void 0:Pe.courseId,_e(!!De.current),De.current&&ke(),F({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:ye,coursesId:pe,type:1}})},[]);var ke=function(){var Pe=Object(W.a)(p.a.mark(function se(){var pe;return p.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.next=2,F({type:"newCourse/getEditCourseData",payload:{id:De.current}});case 2:pe=Oe.sent,pe&&(g.setFieldsValue({name:pe.name}),g.setFieldsValue({intro:pe.description}),g.setFieldsValue({notice:pe.learning_notes}),ue({name:pe.name,intro:pe.description,notice:pe.learning_notes}));case 4:case"end":return Oe.stop()}},se)}));return function(){return Pe.apply(this,arguments)}}(),Fe=function(){var Pe=Object(W.a)(p.a.mark(function se(pe){var ye,Oe,je,ze,Je,Ye,rt;return p.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:return ye=Object(z.a)({},ae),ye.attachment_ids&&(ye.attachment_ids=ye==null||((Oe=ye.attachment_ids)===null||Oe===void 0)?void 0:Oe.map(function(Be){return Be.response.id})),ye.reference_attachment_ids&&(ye.reference_attachment_ids=ye==null||((je=ye.reference_attachment_ids)===null||je===void 0)?void 0:je.map(function(Be){return Be.response.id})),ze=_.params,Je=ze.coursesId,Ye=ze.categoryId,et.next=6,Object(s.a)(Object(z.a)(Object(z.a)({coursesId:Je,category:Ye},ye),{},{base_on_project:!0,type:1}));case 6:rt=et.sent,(rt==null?void 0:rt.status)===0&&(Ae(rt.homework_id),Object(S.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u65B0\u5EFA\u56FE\u6587\u4F5C\u4E1A"]),f.d.push("/classrooms/".concat(_.params.coursesId,"/common_homework/").concat(rt.homework_id,"/detail")));case 8:case"end":return et.stop()}},se)}));return function(pe){return Pe.apply(this,arguments)}}();function Ae(Pe){return Re.apply(this,arguments)}function Re(){return Re=Object(W.a)(p.a.mark(function Pe(se){var pe;return p.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(fe!=null&&fe.ec_point_ids){Oe.next=2;break}return Oe.abrupt("return");case 2:return Oe.next=4,Object(L.a)("/api/ec_courses/".concat(fe==null?void 0:fe.ec_course_id,"/ec_points/set_work_points.json"),{method:"post",body:Object(z.a)({homework_common_id:se},fe)});case 4:pe=Oe.sent;case 5:case"end":return Oe.stop()}},Pe)})),Re.apply(this,arguments)}return o.a.createElement("section",{className:O.a.bg},he.course_name&&o.a.createElement("section",{className:"animated fadeIn"},o.a.createElement("aside",{className:"mt10"},he.category&&o.a.createElement(U.a,{separator:">"},o.a.createElement(U.a.Item,null,o.a.createElement(l.a,{to:"/classrooms/".concat(he.course_id,"/common_homework")},he.course_name)),o.a.createElement(U.a.Item,null,o.a.createElement(l.a,{to:"/classrooms/".concat(he.course_id,"/common_homework")},he.category.category_name)),o.a.createElement(U.a.Item,null,"\u65B0\u5EFA\u8BE6\u60C5")))),o.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u65B0\u5EFA\u56FE\u6587\u4F5C\u4E1A"),o.a.createElement(R.a,{form:g,className:O.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){console.log("onchange: ",g.getFieldsValue()),ue(Object(z.a)({},g.getFieldsValue()))},onFinish:Fe},o.a.createElement("div",{className:O.a.fieldWrap},o.a.createElement(R.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},o.a.createElement(Y.a,{maxLength:60,suffix:"".concat(((d=ae.name)===null||d===void 0?void 0:d.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),o.a.createElement("div",{className:O.a.mdWrap},o.a.createElement(R.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},o.a.createElement(u.a,{watch:!0,defaultValue:ae.intro})),o.a.createElement("div",null,o.a.createElement(R.a.Item,{name:"attachment_ids"},o.a.createElement(x.b,null)))),o.a.createElement("div",{className:O.a.mdWrap},o.a.createElement(R.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},o.a.createElement(u.a,{watch:!0,defaultValue:ae.notice})),o.a.createElement("div",null,o.a.createElement(R.a.Item,{name:"reference_attachment_ids"},o.a.createElement(x.b,null))))),o.a.createElement("div",{className:O.a.mdWrap},o.a.createElement(D.a,{setitem:function(se){return le(Object(z.a)({},se))}})),o.a.createElement("div",{className:O.a.backgroundFa},o.a.createElement("div",{className:"pt40 mb30"},o.a.createElement(R.a.Item,null,o.a.createElement(J.a,{size:"large",type:"primary",className:"".concat(O.a.button," mr20"),htmlType:"submit",onClick:function(){g.submit()},loading:B["newCourse/editCourse"]||B["newCourse/submitCourse"]},"\u63D0\u4EA4"),o.a.createElement(J.a,{size:"large",type:"primary",ghost:!0,className:O.a.button,onClick:function(){return f.d.push("/classrooms/".concat(_.params.coursesId,"/common_homework"))}},"\u53D6\u6D88")))))};be.default=Object(f.a)(function(C){var E=C.shixunHomeworks,d=C.newCourse,w=C.loading,y=C.globalSetting;return{shixunHomeworks:E,newCourse:d,globalSetting:y,loading:w.effects}})(A)},h78n:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return b});var ie=Q("q1tI"),J=Q.n(ie),P=Q("TSYQ"),Y=Q.n(P),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},U=function(_){var M=_.map(function(){return Object(ie.useRef)()}),I=Object(ie.useRef)();return Object(ie.useEffect)(function(){var g=Date.now(),H=!1;Object.keys(M).forEach(function($){var ae=M[$].current;if(!ae)return;H=!0;var ue=ae.style;ue.transitionDuration=".3s, .3s, .3s, .06s",I.current&&g-I.current<100&&(ue.transitionDuration="0s, 0s")}),H&&(I.current=Date.now())}),[M]};function z(){return z=Object.assign||function(F){for(var _=1;_<arguments.length;_++){var M=arguments[_];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},z.apply(this,arguments)}function W(F,_){return p(F)||m(F,_)||R(F,_)||r()}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(F,_){if(!F)return;if(typeof F=="string")return v(F,_);var M=Object.prototype.toString.call(F).slice(8,-1);if(M==="Object"&&F.constructor&&(M=F.constructor.name),M==="Map"||M==="Set")return Array.from(F);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return v(F,_)}function v(F,_){(_==null||_>F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function m(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,g=!1,H=void 0;try{for(var $=F[Symbol.iterator](),ae;!(I=(ae=$.next()).done)&&!(M.push(ae.value),_&&M.length===_);I=!0);}catch(ue){g=!0,H=ue}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw H}}return M}function p(F){if(Array.isArray(F))return F}function h(F,_){if(F==null)return{};var M=o(F,_),I,g;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for(g=0;g<H.length;g++){if(I=H[g],_.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function o(F,_){if(F==null)return{};var M={},I=Object.keys(F),g,H;for(H=0;H<I.length;H++){if(g=I[H],_.indexOf(g)>=0)continue;M[g]=F[g]}return M}var f=function(_){var M=_.className,I=_.percent,g=_.prefixCls,H=_.strokeColor,$=_.strokeLinecap,ae=_.strokeWidth,ue=_.style,Le=_.trailColor,ve=_.trailWidth,Te=_.transition,_e=h(_,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete _e.gapPosition;var De=Array.isArray(I)?I:[I],he=Array.isArray(H)?H:[H],ce=U(De),ne=W(ce,1),fe=ne[0],le=ae/2,ke=100-ae/2,Fe="M ".concat($==="round"?le:0,",").concat(le,`
L `).concat($==="round"?ke:100,",").concat(le),Ae="0 0 100 ".concat(ae),Re=0;return J.a.createElement("svg",z({className:Y()("".concat(g,"-line"),M),viewBox:Ae,preserveAspectRatio:"none",style:ue},_e),J.a.createElement("path",{className:"".concat(g,"-line-trail"),d:Fe,strokeLinecap:$,stroke:Le,strokeWidth:ve||ae,fillOpacity:"0"}),De.map(function(Pe,se){var pe={strokeDasharray:"".concat(Pe,"px, 100px"),strokeDashoffset:"-".concat(Re,"px"),transition:Te||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ye=he[se]||he[he.length-1];return Re+=Pe,J.a.createElement("path",{key:se,className:"".concat(g,"-line-path"),d:Fe,strokeLinecap:$,stroke:ye,strokeWidth:ae,fillOpacity:"0",ref:fe[se],style:pe})}))};f.defaultProps=j;var l=f;function u(){return u=Object.assign||function(F){for(var _=1;_<arguments.length;_++){var M=arguments[_];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(F[I]=M[I])}return F},u.apply(this,arguments)}function s(F,_){return D(F)||S(F,_)||O(F,_)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O(F,_){if(!F)return;if(typeof F=="string")return x(F,_);var M=Object.prototype.toString.call(F).slice(8,-1);if(M==="Object"&&F.constructor&&(M=F.constructor.name),M==="Map"||M==="Set")return Array.from(F);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return x(F,_)}function x(F,_){(_==null||_>F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function S(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,g=!1,H=void 0;try{for(var $=F[Symbol.iterator](),ae;!(I=(ae=$.next()).done)&&!(M.push(ae.value),_&&M.length===_);I=!0);}catch(ue){g=!0,H=ue}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw H}}return M}function D(F){if(Array.isArray(F))return F}function L(F,_){if(F==null)return{};var M=A(F,_),I,g;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for(g=0;g<H.length;g++){if(I=H[g],_.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function A(F,_){if(F==null)return{};var M={},I=Object.keys(F),g,H;for(H=0;H<I.length;H++){if(g=I[H],_.indexOf(g)>=0)continue;M[g]=F[g]}return M}var C=0;function E(F){return+F.replace("%","")}function d(F){return Array.isArray(F)?F:[F]}function w(F,_,M,I){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,$=50-I/2,ae=0,ue=-$,Le=0,ve=-2*$;switch(H){case"left":ae=-$,ue=0,Le=2*$,ve=0;break;case"right":ae=$,ue=0,Le=-2*$,ve=0;break;case"bottom":ue=$,ve=2*$;break;default:}var Te="M 50,50 m ".concat(ae,",").concat(ue,`
a `).concat($,",").concat($," 0 1 1 ").concat(Le,",").concat(-ve,`
a `).concat($,",").concat($," 0 1 1 ").concat(-Le,",").concat(ve),_e=Math.PI*2*$,De={stroke:M,strokeDasharray:"".concat(_/100*(_e-g),"px ").concat(_e,"px"),strokeDashoffset:"-".concat(g/2+F/100*(_e-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Te,pathStyle:De}}var y=function(_){var M=_.prefixCls,I=_.strokeWidth,g=_.trailWidth,H=_.gapDegree,$=_.gapPosition,ae=_.trailColor,ue=_.strokeLinecap,Le=_.style,ve=_.className,Te=_.strokeColor,_e=_.percent,De=L(_,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),he=Object(ie.useMemo)(function(){return C+=1,C},[]),ce=w(0,100,ae,I,H,$),ne=ce.pathString,fe=ce.pathStyle,le=d(_e),ke=d(Te),Fe=ke.find(function(pe){return Object.prototype.toString.call(pe)==="[object Object]"}),Ae=U(le),Re=s(Ae,1),Pe=Re[0],se=function(){var ye=0;return le.map(function(Oe,je){var ze=ke[je]||ke[ke.length-1],Je=Object.prototype.toString.call(ze)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(he,")"):"",Ye=w(ye,Oe,ze,I,H,$);return ye+=Oe,J.a.createElement("path",{key:je,className:"".concat(M,"-circle-path"),d:Ye.pathString,stroke:Je,strokeLinecap:ue,strokeWidth:I,opacity:Oe===0?0:1,fillOpacity:"0",style:Ye.pathStyle,ref:Pe[je]})})};return J.a.createElement("svg",u({className:Y()("".concat(M,"-circle"),ve),viewBox:"0 0 100 100",style:Le},De),Fe&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(he),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Fe).sort(function(pe,ye){return E(pe)-E(ye)}).map(function(pe,ye){return J.a.createElement("stop",{key:ye,offset:pe,stopColor:Fe[pe]})}))),J.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:ne,stroke:ae,strokeLinecap:ue,strokeWidth:g||I,fillOpacity:"0",style:fe}),se().reverse())};y.defaultProps=j;var b=y,B={Line:l,Circle:b}},ic2d:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return Y});var ie=Q("FWmy"),J=Q("746U");class P{constructor(){this.data=new Map}add(j,U){ie.a(J.l(j)),ie.a(J.k(U)),ie.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,U)}as(j){return this.data.get(j)||null}}const Y=new P},kSUc:function(nt,be,Q){},lZu9:function(nt,be,Q){(function(ie){ie(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(J,P){var Y=ie.getMode(J,"text/html"),j=Y.name=="null";function U(I){if(ie.findModeByName){var g=ie.findModeByName(I);g&&(I=g.mime||g.mimes[0])}var H=ie.getMode(J,I);return H.name=="null"?null:H}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var 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 W in z)z.hasOwnProperty(W)&&P.tokenTypeOverrides[W]&&(z[W]=P.tokenTypeOverrides[W]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\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]/,u=" ";function s(I,g,H){return g.f=g.inline=H,H(I,g)}function a(I,g,H){return g.f=g.block=H,H(I,g)}function O(I){return!I||!/\S/.test(I.string)}function x(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var g=j;if(!g){var H=ie.innerMode(Y,I.htmlState);g=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}g&&(I.f=E,I.block=S,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function S(I,g){var H=I.column()===g.indentation,$=O(g.prevLine.stream),ae=g.indentedCode,ue=g.prevLine.hr,Le=g.list!==!1,ve=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Te=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Le)){for(g.list=null;Te<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Te-g.listStack[g.listStack.length-1])}var _e=!$&&!ue&&!g.prevLine.header&&(!Le||!ae)&&!g.prevLine.fencedCodeEnd,De=(g.list===!1||ue||$)&&g.indentation<=ve&&I.match(r),he=null;if(g.indentationDiff>=4&&(ae||g.prevLine.fencedCodeEnd||g.prevLine.header||$))return I.skipToEnd(),g.indentedCode=!0,z.code;if(I.eatSpace())return null;if(H&&g.indentation<=ve&&(he=I.match(m))&&he[1].length<=6)return g.quote=0,g.header=he[1].length,g.thisLine.header=!0,P.highlightFormatting&&(g.formatting="header"),g.f=g.inline,A(g);if(g.indentation<=ve&&I.eat(">"))return g.quote=H?1:g.quote+1,P.highlightFormatting&&(g.formatting="quote"),I.eatSpace(),A(g);if(!De&&!g.setext&&H&&g.indentation<=ve&&(he=I.match(R))){var ce=he[1]?"ol":"ul";return g.indentation=Te+I.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,P.taskLists&&I.match(v,!1)&&(g.taskList=!0),g.f=g.inline,P.highlightFormatting&&(g.formatting=["list","list-"+ce]),A(g)}else{if(H&&g.indentation<=ve&&(he=I.match(o,!0)))return g.quote=0,g.fencedEndRE=new RegExp(he[1]+"+ *$"),g.localMode=P.fencedCodeBlockHighlighting&&U(he[2]||P.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=ie.startState(g.localMode)),g.f=g.block=L,P.highlightFormatting&&(g.formatting="code-block"),g.code=-1,A(g);if(g.setext||(!_e||!Le)&&!g.quote&&g.list===!1&&!g.code&&!De&&!f.test(I.string)&&(he=I.lookAhead(1))&&(he=he.match(p)))return g.setext?(g.header=g.setext,g.setext=0,I.skipToEnd(),P.highlightFormatting&&(g.formatting="header")):(g.header=he[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,A(g);if(De)return I.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,z.hr;if(I.peek()==="[")return s(I,g,B)}return s(I,g,g.inline)}function D(I,g){var H=Y.token(I,g.htmlState);if(!j){var $=ie.innerMode(Y,g.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||g.md_inside&&I.current().indexOf(">")>-1)&&(g.f=E,g.block=S,g.htmlState=null)}return H}function L(I,g){var H=g.listStack[g.listStack.length-1]||0,$=g.indentation<H,ae=H+3;if(g.fencedEndRE&&g.indentation<=ae&&($||I.match(g.fencedEndRE))){P.highlightFormatting&&(g.formatting="code-block");var ue;return $||(ue=A(g)),g.localMode=g.localState=null,g.block=S,g.f=E,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,$?a(I,g,g.block):ue}else return g.localMode?g.localMode.token(I,g.localState):(I.skipToEnd(),z.code)}function A(I){var g=[];if(I.formatting){g.push(z.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var H=0;H<I.formatting.length;H++)g.push(z.formatting+"-"+I.formatting[H]),I.formatting[H]==="header"&&g.push(z.formatting+"-"+I.formatting[H]+"-"+I.header),I.formatting[H]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(z.formatting+"-"+I.formatting[H]+"-"+I.quote):g.push("error"))}if(I.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(I.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(I.linkHref?g.push(z.linkHref,"url"):(I.strong&&g.push(z.strong),I.em&&g.push(z.em),I.strikethrough&&g.push(z.strikethrough),I.emoji&&g.push(z.emoji),I.linkText&&g.push(z.linkText),I.code&&g.push(z.code),I.image&&g.push(z.image),I.imageAltText&&g.push(z.imageAltText,"link"),I.imageMarker&&g.push(z.imageMarker)),I.header&&g.push(z.header,z.header+"-"+I.header),I.quote&&(g.push(z.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(z.quote+"-"+I.quote):g.push(z.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var $=(I.listStack.length-1)%3;$?$===1?g.push(z.list2):g.push(z.list3):g.push(z.list1)}return I.trailingSpaceNewLine?g.push("trailing-space-new-line"):I.trailingSpace&&g.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function C(I,g){return I.match(h,!0)?A(g):void 0}function E(I,g){var H=g.text(I,g);if(typeof H!="undefined")return H;if(g.list)return g.list=null,A(g);if(g.taskList){var $=I.match(v,!0)[1]===" ";return $?g.taskOpen=!0:g.taskClosed=!0,P.highlightFormatting&&(g.formatting="task"),g.taskList=!1,A(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(g.formatting="header"),A(g);var ae=I.next();if(g.linkTitle){g.linkTitle=!1;var ue=ae;ae==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Le="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(I.match(new RegExp(Le),!0))return z.linkHref}if(ae==="`"){var ve=g.formatting;P.highlightFormatting&&(g.formatting="code"),I.eatWhile("`");var Te=I.current().length;if(g.code==0&&(!g.quote||Te==1))return g.code=Te,A(g);if(Te==g.code){var _e=A(g);return g.code=0,_e}else return g.formatting=ve,A(g)}else if(g.code)return A(g);if(ae==="\\"&&(I.next(),P.highlightFormatting)){var De=A(g),he=z.formatting+"-escape";return De?De+" "+he:he}if(ae==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ae==="["&&g.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ae==="]"&&g.imageAltText){P.highlightFormatting&&(g.formatting="image");var De=A(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=w,De}if(ae==="["&&!g.image)return g.linkText&&I.match(/^.*?\]/)||(g.linkText=!0,P.highlightFormatting&&(g.formatting="link")),A(g);if(ae==="]"&&g.linkText){P.highlightFormatting&&(g.formatting="link");var De=A(g);return g.linkText=!1,g.inline=g.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?w:E,De}if(ae==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=d,P.highlightFormatting&&(g.formatting="link");var De=A(g);return De?De+=" ":De="",De+z.linkInline}if(ae==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=d,P.highlightFormatting&&(g.formatting="link");var De=A(g);return De?De+=" ":De="",De+z.linkEmail}if(P.xml&&ae==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=I.string.indexOf(">",I.pos);if(ce!=-1){var ne=I.string.substring(I.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(g.md_inside=!0)}return I.backUp(1),g.htmlState=ie.startState(Y),a(I,g,D)}if(P.xml&&ae==="<"&&I.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var fe=1,le=I.pos==1?" ":I.string.charAt(I.pos-2);fe<3&&I.eat(ae);)fe++;var ke=I.peek()||" ",Fe=!/\s/.test(ke)&&(!l.test(ke)||/\s/.test(le)||l.test(le)),Ae=!/\s/.test(le)&&(!l.test(le)||/\s/.test(ke)||l.test(ke)),Re=null,Pe=null;if(fe%2&&(!g.em&&Fe&&(ae==="*"||!Ae||l.test(le))?Re=!0:g.em==ae&&Ae&&(ae==="*"||!Fe||l.test(ke))&&(Re=!1)),fe>1&&(!g.strong&&Fe&&(ae==="*"||!Ae||l.test(le))?Pe=!0:g.strong==ae&&Ae&&(ae==="*"||!Fe||l.test(ke))&&(Pe=!1)),Pe!=null||Re!=null){P.highlightFormatting&&(g.formatting=Re==null?"strong":Pe==null?"em":"strong em"),Re===!0&&(g.em=ae),Pe===!0&&(g.strong=ae);var _e=A(g);return Re===!1&&(g.em=!1),Pe===!1&&(g.strong=!1),_e}}else if(ae===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return A(g);I.backUp(1)}if(P.strikethrough){if(ae==="~"&&I.eatWhile(ae)){if(g.strikethrough){P.highlightFormatting&&(g.formatting="strikethrough");var _e=A(g);return g.strikethrough=!1,_e}else if(I.match(/^[^\s]/,!1))return g.strikethrough=!0,P.highlightFormatting&&(g.formatting="strikethrough"),A(g)}else if(ae===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return A(g);I.backUp(2)}}if(P.emoji&&ae===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,P.highlightFormatting&&(g.formatting="emoji");var se=A(g);return g.emoji=!1,se}return ae===" "&&(I.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),A(g)}function d(I,g){var H=I.next();if(H===">"){g.f=g.inline=E,P.highlightFormatting&&(g.formatting="link");var $=A(g);return $?$+=" ":$="",$+z.linkInline}return I.match(/^[^>]+/,!0),z.linkInline}function w(I,g){if(I.eatSpace())return null;var H=I.next();return H==="("||H==="["?(g.f=g.inline=b(H==="("?")":"]"),P.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,A(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(I){return function(g,H){var $=g.next();if($===I){H.f=H.inline=E,P.highlightFormatting&&(H.formatting="link-string");var ae=A(H);return H.linkHref=!1,ae}return g.match(y[I]),H.linkHref=!0,A(H)}}function B(I,g){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=F,I.next(),P.highlightFormatting&&(g.formatting="link"),g.linkText=!0,A(g)):s(I,g,E)}function F(I,g){if(I.match(/^\]:/,!0)){g.f=g.inline=_,P.highlightFormatting&&(g.formatting="link");var H=A(g);return g.linkText=!1,H}return I.match(/^([^\]\\]|\\.)+/,!0),z.linkText}function _(I,g){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?g.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=E,z.linkHref+" url")}var M={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:E,text:C,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(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ie.copyState(Y,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ie.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,g){if(g.formatting=!1,I!=g.thisLine.stream){if(g.header=0,g.hr=!1,I.match(/^\s*$/,!0))return x(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:I},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=D)){var H=I.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(g.indentation=H,g.indentationDiff=null,H>0)return null}}return g.f(I,g)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:Y}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:M}},indent:function(I,g,H){return I.block==D&&Y.indent?Y.indent(I.htmlState,g,H):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,g,H):ie.Pass},blankLine:x,getType:A,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},nEHx:function(nt,be,Q){"use strict";Q.d(be,"a",function(){return ie});var ie;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(ie||(ie={}))},nnTU:function(nt,be,Q){"use strict";Q.d(be,"b",function(){return z}),Q.d(be,"a",function(){return W});var ie=Q("MI8n"),J=Q("JYp7"),P=Q("pmY6"),Y=Q("24hK"),j=Q("746U"),U=Q("Cg/j");const z=Object(U.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,R){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!R)throw new Error("invalid command");return this.registerCommand({id:r,handler:R})}if(r.description){const o=[];for(let l of r.description.args)o.push(l.constraint);const f=r.handler;r.handler=function(l,...u){return Object(j.o)(u,o),f(l,...u)}}const{id:v}=r;let m=this._commands.get(v);m||(m=new Y.a,this._commands.set(v,m));let p=m.unshift(r),h=Object(P.i)(()=>{p();const o=this._commands.get(v);(o==null?void 0:o.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),h}registerCommandAlias(r,R){return W.registerCommand(r,(v,...m)=>v.get(z).executeCommand(R,...m))}getCommand(r){const R=this._commands.get(r);return!R||R.isEmpty()?void 0:J.a.first(R)}getCommands(){const r=new Map;for(const R of this._commands.keys()){const v=this.getCommand(R);v&&r.set(R,v)}return r}};W.registerCommand("noop",()=>{})},osHv:function(nt,be,Q){(function(ie){ie(Q("VrN/"))})(function(ie){"use strict";var J=ie.Pos;function P(l,u){return l.line-u.line||l.ch-u.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",U=new RegExp("<(/?)(["+Y+"]["+j+"]*)","g");function z(l,u,s,a){this.line=u,this.ch=s,this.cm=l,this.text=l.getLine(u),this.min=a?Math.max(a.from,l.firstLine()):l.firstLine(),this.max=a?Math.min(a.to-1,l.lastLine()):l.lastLine()}function W(l,u){var s=l.cm.getTokenTypeAt(J(l.line,u));return s&&/\btag\b/.test(s)}function r(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function R(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function v(l){for(;;){var u=l.text.indexOf(">",l.ch);if(u==-1){if(r(l))continue;return}if(!W(l,u+1)){l.ch=u+1;continue}var s=l.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,a?"selfClose":"regular"}}function m(l){for(;;){var u=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(u==-1){if(R(l))continue;return}if(!W(l,u+1)){l.ch=u;continue}U.lastIndex=u,l.ch=u;var s=U.exec(l.text);if(s&&s.index==u)return s}}function p(l){for(;;){U.lastIndex=l.ch;var u=U.exec(l.text);if(!u){if(r(l))continue;return}if(!W(l,u.index+1)){l.ch=u.index+1;continue}return l.ch=u.index+u[0].length,u}}function h(l){for(;;){var u=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(u==-1){if(R(l))continue;return}if(!W(l,u+1)){l.ch=u;continue}var s=l.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,a?"selfClose":"regular"}}function o(l,u){for(var s=[];;){var a=p(l),O,x=l.line,S=l.ch-(a?a[0].length:0);if(!a||!(O=v(l)))return;if(O=="selfClose")continue;if(a[1]){for(var D=s.length-1;D>=0;--D)if(s[D]==a[2]){s.length=D;break}if(D<0&&(!u||u==a[2]))return{tag:a[2],from:J(x,S),to:J(l.line,l.ch)}}else s.push(a[2])}}function f(l,u){for(var s=[];;){var a=h(l);if(!a)return;if(a=="selfClose"){m(l);continue}var O=l.line,x=l.ch,S=m(l);if(!S)return;if(S[1])s.push(S[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==S[2]){s.length=D;break}if(D<0&&(!u||u==S[2]))return{tag:S[2],from:J(l.line,l.ch),to:J(O,x)}}}}ie.registerHelper("fold","xml",function(l,u){for(var s=new z(l,u.line,0);;){var a=p(s);if(!a||s.line!=u.line)return;var O=v(s);if(!O)return;if(!a[1]&&O!="selfClose"){var x=J(s.line,s.ch),S=o(s,a[2]);return S&&P(S.from,x)>0?{from:x,to:S.from}:null}}}),ie.findMatchingTag=function(l,u,s){var a=new z(l,u.line,u.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var O=v(a),x=O&&J(a.line,a.ch),S=O&&m(a);if(!O||!S||P(a,u)>0)return;var D={from:J(a.line,a.ch),to:x,tag:S[2]};return O=="selfClose"?{open:D,close:null,at:"open"}:S[1]?{open:f(a,S[2]),close:D,at:"close"}:(a=new z(l,x.line,x.ch,s),{open:D,close:o(a,S[2]),at:"open"})},ie.findEnclosingTag=function(l,u,s,a){for(var O=new z(l,u.line,u.ch,s);;){var x=f(O,a);if(!x)break;var S=new z(l,u.line,u.ch,s),D=o(S,x.tag);if(D)return{open:x,close:D}}},ie.scanForClosingTag=function(l,u,s,a){var O=new z(l,u.line,u.ch,a?{from:0,to:a}:null);return o(O,s)}})},p5ED:function(nt,be,Q){"use strict";var ie=Q("+L6B"),J=Q("2/Rp"),P=Q("5Dmo"),Y=Q("3S7+"),j=Q("k1fw"),U=Q("9og8"),z=Q("tJVT"),W=Q("WmNS"),r=Q.n(W),R=Q("q1tI"),v=Q.n(R),m=Q("vHTk"),p=Q.n(m),h=Q("yEEn"),o=Q("ZW9T"),f=Q("1vsH"),l=Q("V0Rq"),u=Q("m3rI");be.a=function(s){var a,O,x,S,D,L,A,C=s.editOffice,E=C===void 0?"view":C,d=s.data,w=s.theme,y=s.type,b=s.filename,B=s.monacoEditor,F=s.className,_=s.style,M=s.close,I=s.onClose,g=s.hasMask,H=s.disabledDownload,$=Object(R.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(z.a)($,2),ue=ae[0],Le=ae[1],ve=Object(R.useState)(""),Te=Object(z.a)(ve,2),_e=Te[0],De=Te[1],he=Object(R.useState)(),ce=Object(z.a)(he,2),ne=ce[0],fe=ce[1],le=window.ENV==="build"?"/react/build":"",ke=u.a.PROXY_SERVER||location.origin,Fe,Ae=1024*1024,Re=10*Ae,Pe=Object(R.useRef)();(a=d)!==null&&a!==void 0&&a.startsWith("/api")&&y!=="txt"&&(d=u.a.API_SERVER+d),y==="office"&&(Fe=Object(f.T)(d).filesize,Fe>Re&&(y="other")),b&&B&&(B.filename=b),Object(R.useEffect)(function(){var Oe,je,ze=(Oe=document.cookie)===null||Oe===void 0||((je=Oe.replace(/\s/g,""))===null||je===void 0)?void 0:je.split(";");ze==null||ze.map(function(Je){var Ye=Je.split("=");Ye[0]==="_educoder_session"&&De(Ye[1])})},[]),Object(R.useEffect)(function(){y==="office"&&se()},[y,d]);var se=function(){var Oe=Object(U.a)(r.a.mark(function je(){var ze,Je,Ye;return r.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return console.log("data:",d),ze=d,d.startsWith("http")||(ze=location.origin+ze),Je=new URL(ze).pathname.split("/").pop(),Ze.next=6,Object(l.V)({attachment_id:Je});case 6:Ye=Ze.sent,fe(Ye);case 8:case"end":return Ze.stop()}},je)}));return function(){return Oe.apply(this,arguments)}}(),pe=function(){if(d.startsWith("http")||d.startsWith("blob:")){ye();return}Object(f.z)(b||"educoder",d,b)},ye=function(){Object(f.x)(b||"educoder",decodeURIComponent(d))};return v.a.createElement("div",{style:Object(j.a)({},_||{}),className:"".concat(g&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},M&&v.a.createElement("div",{className:p.a.close,ref:Pe},!H&&v.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Pe.current}},v.a.createElement("span",{onClick:ye},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Pe.current}},v.a.createElement("span",{className:"",onClick:I},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[F]," ").concat(F," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(o.b,B)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((O=d)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((x=d)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),y==="video"&&v.a.createElement(v.a.Fragment,null,((S=d)===null||S===void 0?void 0:S.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),y==="office"&&ne&&v.a.createElement("iframe",{src:"".concat(le,"/office.html?key=").concat(ne.key,"&url=").concat(ke+ne.url,"&callbackUrl=").concat(ke+ne.callbackUrl,"&fileType=").concat(ne.fileType,"&title=").concat(ne.title,"&model=").concat(E,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),y==="html"&&v.a.createElement("iframe",{src:d+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(le,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!H)}),y==="image"&&v.a.createElement("img",{src:"".concat(((D=d)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((L=d)===null||L===void 0?void 0:L.indexOf("https://"))>-1||(A=d)!==null&&A!==void 0&&A.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),y==="other"&&v.a.createElement("div",null,v.a.createElement(J.a,{type:"primary",size:"large",onClick:pe},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement(J.a,{type:"primary",size:"large",onClick:pe},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,be,Q){},pmY6:function(nt,be,Q){"use strict";Q.d(be,"h",function(){return R}),Q.d(be,"g",function(){return m}),Q.d(be,"f",function(){return p}),Q.d(be,"e",function(){return h}),Q.d(be,"i",function(){return o}),Q.d(be,"b",function(){return f}),Q.d(be,"a",function(){return l}),Q.d(be,"d",function(){return u}),Q.d(be,"c",function(){return s});var ie=Q("C/vA"),J=Q("JYp7");const P=!1;let Y=null;function j(a){Y=a}if(P){const a="__is_disposable_tracked__";j(new class{trackDisposable(O){const x=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[a]||console.log(x)},3e3)}setParent(O,x){if(O&&O!==l.None)try{O[a]=!0}catch(S){}}markAsDisposed(O){if(O&&O!==l.None)try{O[a]=!0}catch(x){}}markAsSingleton(O){}})}function U(a){return Y==null||Y.trackDisposable(a),a}function z(a){Y==null||Y.markAsDisposed(a)}function W(a,O){Y==null||Y.setParent(a,O)}function r(a,O){if(!Y)return;for(const x of a)Y.setParent(x,O)}function R(a){return Y==null||Y.markAsSingleton(a),a}class v extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function m(a){return typeof a.dispose=="function"&&a.dispose.length===0}function p(a){if(J.a.is(a)){let O=[];for(const x of a)if(x)try{x.dispose()}catch(S){O.push(S)}if(O.length===1)throw O[0];if(O.length>1)throw new v(O);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function h(...a){const O=o(()=>p(a));return r(a,O),O}function o(a){const O=U({dispose:Object(ie.a)(()=>{z(O),a()})});return O}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,U(this)}dispose(){if(this._isDisposed)return;z(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return W(a,this),this._isDisposed?f.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(a),a}}f.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new f,U(this),W(this._store,this)}dispose(){z(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}l.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,U(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var O;if(this._isDisposed||a===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),a&&W(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,z(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&W(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(nt,be,Q){var ie,J;(function(){var P;(function(){"use strict";var z=[,,function(v){function m(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var o=new m(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},m.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},m.prototype.has_match=function(o){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(o))return!0;return!1},m.prototype.set_indent=function(o,f){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(o){this.__items.push(o);var f=o.lastIndexOf(`
`);f!==-1?this.__character_count=o.length-f:this.__character_count+=o.length},m.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function p(o,f){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),f=f||"",o.indent_level>0&&(f=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(o,f){var l=this.__base_string_length;return f=f||0,o<0&&(l=0),l+=o*this.__indent_size,l+=f,l},p.prototype.get_indent_string=function(o,f){var l=this.__base_string;return f=f||0,o<0&&(o=0,l=""),f+=o*this.__indent_size,this.__ensure_cache(f),l+=this.__cache[f],l},p.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var o=this.__cache.length,f=0,l="";this.__indent_size&&o>=this.__indent_size&&(f=Math.floor(o/this.__indent_size),o-=f*this.__indent_size,l=new Array(f+1).join(this.__indent_string)),o&&(l+=new Array(o+1).join(" ")),this.__cache.push(l)};function h(o,f){this.__indent_cache=new p(o,f),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(o,f){return this.__indent_cache.get_indent_string(o,f)},h.prototype.get_indent_size=function(o,f){return this.__indent_cache.get_indent_size(o,f)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(o){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return o!==`
`&&(l=l.replace(/[\n]/g,o)),l},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(o,f){return o=o||0,f=f||0,this.next_line.set_indent(o,f),this.__lines.length>1?(this.current_line.set_indent(o,f),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(o){for(var f=0;f<o.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.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(" "))},h.prototype.remove_indent=function(o){for(var f=this.__lines.length;o<f;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(o,f){for(var l=this.__lines.length-2;l>=0;){var u=this.__lines[l];if(u.is_empty())break;if(u.item(0).indexOf(o)!==0&&u.item(-1)!==f){this.__lines.splice(l+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},v.exports.Output=h},function(v){function m(p,h,o,f){this.type=p,this.text=h,this.comments_before=null,this.newlines=o||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(o,f){this.raw_options=p(o,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(o,f){var l=this.raw_options[o],u=f||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(u=l.concat()):typeof l=="string"&&(u=l.split(/[^a-zA-Z0-9_\/\-]+/)),u},m.prototype._get_boolean=function(o,f){var l=this.raw_options[o],u=l===void 0?!!f:!!l;return u},m.prototype._get_characters=function(o,f){var l=this.raw_options[o],u=f||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},m.prototype._get_number=function(o,f){var l=this.raw_options[o];f=parseInt(f,10),isNaN(f)&&(f=0);var u=parseInt(l,10);return isNaN(u)&&(u=f),u},m.prototype._get_selection=function(o,f,l){var u=this._get_selection_list(o,f,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+f+`
You passed in: '`+this.raw_options[o]+"'");return u[0]},m.prototype._get_selection_list=function(o,f,l){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[f[0]],!this._is_valid_selection(l,f))throw new Error("Invalid Default Value!");var u=this._get_array(o,l);if(!this._is_valid_selection(u,f))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+f+`
You passed in: '`+this.raw_options[o]+"'");return u},m.prototype._is_valid_selection=function(o,f){return o.length&&f.length&&!o.some(function(l){return f.indexOf(l)===-1})};function p(o,f){var l={};o=h(o);var u;for(u in o)u!==f&&(l[u]=o[u]);if(f&&o[f])for(u in o[f])l[u]=o[f][u];return l}function h(o){var f={},l;for(l in o){var u=l.replace(/-/g,"_");f[u]=o[l]}return f}v.exports.Options=m,v.exports.normalizeOpts=h,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},p.prototype.peek=function(h){var o=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(o=this.__input.charAt(h)),o},p.prototype.__match=function(h,o){h.lastIndex=o;var f=h.exec(this.__input);return f&&!(m&&h.sticky)&&(f.index!==o&&(f=null)),f},p.prototype.test=function(h,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(h,o):!1},p.prototype.testChar=function(h,o){var f=this.peek(o);return h.lastIndex=0,f!==null&&h.test(f)},p.prototype.match=function(h){var o=this.__match(h,this.__position);return o?this.__position+=o[0].length:o=null,o},p.prototype.read=function(h,o,f){var l="",u;return h&&(u=this.match(h),u&&(l+=u[0])),o&&(u||!h)&&(l+=this.readUntil(o,f)),l},p.prototype.readUntil=function(h,o){var f="",l=this.__position;h.lastIndex=this.__position;var u=h.exec(this.__input);return u?(l=u.index,o&&(l+=u[0].length)):l=this.__input_length,f=this.__input.substring(this.__position,l),this.__position=l,f},p.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},p.prototype.get_regexp=function(h,o){var f=null,l="g";return o&&m&&(l="y"),typeof h=="string"&&h!==""?f=new RegExp(h,l):h&&(f=new RegExp(h.source,l)),f},p.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(h){var o=this.__position,f=this.readUntilAfter(h);return this.__position=o,f},p.prototype.lookBack=function(h){var o=this.__position-1;return o>=h.length&&this.__input.substring(o-h.length,o).toLowerCase()===h},v.exports.InputScanner=p},function(v,m,p){var h=p(8).InputScanner,o=p(3).Token,f=p(10).TokenStream,l=p(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,O){this._input=new h(a),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var a,O=new o(u.START,""),x=null,S=[],D=new f;O.type!==u.EOF;){for(a=this._get_next_token(O,x);this._is_comment(a);)D.add(a),a=this._get_next_token(O,x);D.isEmpty()||(a.comments_before=D,D=new f),a.parent=x,this._is_opening(a)?(S.push(x),x=a):x&&this._is_closing(a,x)&&(a.opened=x,x.closed=a,x=S.pop(),a.parent=x),a.previous=O,O.next=a,this.__tokens.add(a),O=a}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(a,O){this._readWhitespace();var x=this._input.read(/.+/g);return x?this._create_token(u.RAW,x):this._create_token(u.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,O){return!1},s.prototype._create_token=function(a,O){var x=new o(a,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return x},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=s,v.exports.TOKEN=u},function(v){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(h=this.__tokens[p]),h},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=m},function(v,m,p){var h=p(12).Pattern;function o(f,l){h.call(this,f,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new h,o.prototype.__set_whitespace_patterns=function(f,l){f+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var l=this.__split(this._newline_regexp,f);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return f},o.prototype.matching=function(f,l){var u=this._create();return u.__set_whitespace_patterns(f,l),u._update(),u},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(f,l){f.lastIndex=0;for(var u=0,s=[],a=f.exec(l);a;)s.push(l.substring(u,a.index)),u=a.index+a[0].length,a=f.exec(l);return u<l.length?s.push(l.substring(u,l.length)):s.push(""),s},v.exports.WhitespacePattern=o},function(v){function m(p,h){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(p),h._update(),h},m.prototype.until=function(p){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(p),h._update(),h},m.prototype.starting_with=function(p){var h=this._create();return h._starting_pattern=this._input.get_regexp(p,!0),h._update(),h},m.prototype.matching=function(p){var h=this._create();return h._match_pattern=this._input.get_regexp(p,!0),h._update(),h},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},v.exports.Pattern=m},function(v){function m(p,h){p=typeof p=="string"?p:p.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+h,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(p);o;)h[o[1]]=o[2],o=this.__directive_pattern.exec(p);return h},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=m},function(v,m,p){var h=p(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(l,u){h.call(this,l,u),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new h(l);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new h,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(l){var u=this._create();return u._disabled[l]=!0,u._update(),u},f.prototype.read_options=function(l){var u=this._create();for(var s in o)u._disabled[s]=l.templating.indexOf(s)===-1;return u._update(),u},f.prototype.exclude=function(l){var u=this._create();return u._excluded[l]=!0,u._update(),u},f.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 u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),l+=u,u=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},f.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("|")+")")},f.prototype._read_template=function(){var l="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(l=l||this.__patterns.erb.read())}else u==="{"&&(!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},v.exports.TemplatablePattern=f},,,,function(v,m,p){var h=p(19).Beautifier,o=p(20).Options;function f(l,u,s,a){var O=new h(l,u,s,a);return O.beautify()}v.exports=f,v.exports.defaultOptions=function(){return new o}},function(v,m,p){var h=p(20).Options,o=p(2).Output,f=p(21).Tokenizer,l=p(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(w,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=w.max_preserve_newlines,this.preserve_newlines=w.preserve_newlines,this._output=new o(w,y)};a.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},a.prototype.set_space_before_token=function(w,y){this._output.space_before_token=w,this._output.non_breaking_space=y},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(w){this._output.add_raw_token(w)},a.prototype.print_preserved_newlines=function(w){var y=0;w.type!==l.TEXT&&w.previous.type!==l.TEXT&&(y=w.newlines?1:0),this.preserve_newlines&&(y=w.newlines<this.max_preserve_newlines+1?w.newlines:this.max_preserve_newlines+1);for(var b=0;b<y;b++)this.print_newline(b>0);return y!==0},a.prototype.traverse_whitespace=function(w){return w.whitespace_before||w.newlines?(this.print_preserved_newlines(w)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(w){this._output.add_new_line(w)},a.prototype.print_token=function(w){w.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(w.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(w){return w=this.indent_level+(w||0),w<1?"":this._output.get_indent_string(w)};var O=function(w){for(var y=null,b=w.next;b.type!==l.EOF&&w.closed!==b;){if(b.type===l.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===l.EQUALS&&b.next.next&&b.next.next.type===l.VALUE&&(y=b.next.next.text);break}b=b.next}return y},x=function(w,y){var b=null,B=null;return y.closed?(w==="script"?b="text/javascript":w==="style"&&(b="text/css"),b=O(y)||b,b.search("text/css")>-1?B="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?B="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?B="html":b.search(/test\/null/)>-1&&(B="null"),B):null};function S(w,y){return y.indexOf(w)!==-1}function D(w,y,b){this.parent=w||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function L(w){this._printer=w,this._current_frame=null}L.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},L.prototype.record_tag=function(w){var y=new D(this._current_frame,w,this._printer.indent_level);this._current_frame=y},L.prototype._try_pop_frame=function(w){var y=null;return w&&(y=w.parser_token,this._printer.indent_level=w.indent_level,this._current_frame=w.parent),y},L.prototype._get_frame=function(w,y){for(var b=this._current_frame;b&&!(w.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},L.prototype.try_pop=function(w,y){var b=this._get_frame([w],y);return this._try_pop_frame(b)},L.prototype.indent_to_tag=function(w){var y=this._get_frame(w);y&&(this._printer.indent_level=y.indent_level)};function A(w,y,b,B){this._source_text=w||"",y=y||{},this._js_beautify=b,this._css_beautify=B,this._tag_stack=null;var F=new h(y,"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 w=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,w&&u.test(w)&&(y=w.match(u)[0])),w=w.replace(s,`
`);var b=w.match(/^[\t ]*/)[0],B={text:"",type:""},F=new C,_=new a(this._options,b),M=new f(w,this._options).tokenize();this._tag_stack=new L(_);for(var I=null,g=M.next();g.type!==l.EOF;)g.type===l.TAG_OPEN||g.type===l.COMMENT?(I=this._handle_tag_open(_,g,F,B),F=I):g.type===l.ATTRIBUTE||g.type===l.EQUALS||g.type===l.VALUE||g.type===l.TEXT&&!F.tag_complete?I=this._handle_inside_tag(_,g,F,M):g.type===l.TAG_CLOSE?I=this._handle_tag_close(_,g,F):g.type===l.TEXT?I=this._handle_text(_,g,F):_.add_raw_token(g),B=I,g=M.next();var H=_._output.get_code(y);return H},A.prototype._handle_tag_close=function(w,y,b){var B={text:y.text,type:y.type};return w.alignment_size=0,b.tag_complete=!0,w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?w.add_raw_token(y):(b.tag_start_char==="<"&&(w.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(w.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&w.set_wrap_point(),B},A.prototype._handle_inside_tag=function(w,y,b,B){var F=b.has_wrapped_attrs,_={text:y.text,type:y.type};if(w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)w.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===l.TEXT)w.print_preserved_newlines(y)?(y.newlines=0,w.add_raw_token(y)):w.print_token(y);else{if(y.type===l.ATTRIBUTE?(w.set_space_before_token(!0),b.attr_count+=1):(y.type===l.EQUALS||y.type===l.VALUE&&y.previous.type===l.EQUALS)&&w.set_space_before_token(!1),y.type===l.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(w.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var M=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var I=!0,g=0,H;do{if(H=B.peek(g),H.type===l.ATTRIBUTE){I=!1;break}g+=1}while(g<4&&H.type!==l.EOF&&H.type!==l.TAG_CLOSE);M=!I}M&&(w.print_newline(!1),F=!0)}w.print_token(y),F=F||w.previous_token_wrapped(),b.has_wrapped_attrs=F}return _},A.prototype._handle_text=function(w,y,b){var B={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(w,y,b):b.is_unformatted||b.is_content_unformatted?w.add_raw_token(y):(w.traverse_whitespace(y),w.print_token(y)),B},A.prototype._print_custom_beatifier_text=function(w,y,b){var B=this;if(y.text!==""){var F=y.text,_,M=1,I="",g="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?_=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?_=this._css_beautify:b.custom_beautifier_name==="html"&&(_=function(ve,Te){var _e=new A(ve,Te,B._js_beautify,B._css_beautify);return _e.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-w.indent_level);var H=w.get_full_indent(M);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!$){w.add_raw_token(y);return}I=H+$[1]+`
`,F=$[4],$[5]&&(g=H+$[5]),F=F.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(y.whitespace_before=$[0]))}if(F)if(_){var ae=function(){this.eol=`
`};ae.prototype=this._options.raw_options;var ue=new ae;F=_(H+F,ue)}else{var Le=y.whitespace_before;Le&&(F=F.replace(new RegExp(`
(`+Le+")?","g"),`
`)),F=H+F.replace(/\n/g,`
`+H)}I&&(F?F=I+F+`
`+g:F=I+g),w.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,w.add_raw_token(y),w.print_newline(!0))}},A.prototype._handle_tag_open=function(w,y,b,B){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===l.TAG_OPEN&&y.text.indexOf("</")===0?(w.add_raw_token(y),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(w.traverse_whitespace(y),this._set_tag_position(w,y,F,b,B),F.is_inline_element||w.set_wrap_point(),w.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=y.text.length+1),!F.tag_complete&&!F.is_unformatted&&(w.alignment_size=F.alignment_size),F};var C=function(w,y){if(this.parent=w||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="",!y)this.tag_complete=!0;else{var b;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(b=y.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.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||y.closed&&y.closed.text==="/>";var B=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(B=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(B)))}};A.prototype._get_tag_open_token=function(w){var y=new C(this._tag_stack.get_parser_token(),w);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||S(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&S(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&S(y.tag_check,this._options.content_unformatted),y.is_inline_element=S(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},A.prototype._set_tag_position=function(w,y,b,B,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=x(b.tag_check,y)))),S(b.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var _=w.current_line_has_match(/{{#if/);_||w.print_newline(!1)}b.tag_name==="!--"&&F.type===l.TAG_CLOSE&&B.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,b))}else if(b.is_end_tag){var M=!1;M=b.start_tag_token&&b.start_tag_token.multiline_content,M=M||!b.is_inline_element&&!(B.is_inline_element||B.is_unformatted)&&!(F.type===l.TAG_CLOSE&&b.start_tag_token===B)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(M=!1),M&&w.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,b)},A.prototype._calcluate_parent_multiline=function(w,y){y.parent&&w._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var E=["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"],d=["a","audio","del","ins","map","noscript","video"];A.prototype._do_optional_end_element=function(w){var y=null;if(w.is_empty_element||!w.is_start_tag||!w.parent)return;if(w.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(w.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(w.tag_name==="dd"||w.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(w.parent.tag_name==="p"&&E.indexOf(w.tag_name)!==-1){var b=w.parent.parent;(!b||d.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else w.tag_name==="rp"||w.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):w.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):w.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):w.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):w.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):w.tag_name==="tbody"||w.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):w.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(w.tag_name==="th"||w.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return w.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=A},function(v,m,p){var h=p(6).Options;function o(f){h.call(this,f,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new h,v.exports.Options=o},function(v,m,p){var h=p(9).Tokenizer,o=p(9).TOKEN,f=p(13).Directives,l=p(14).TemplatablePattern,u=p(12).Pattern,s={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},a=new f(/<\!--/,/-->/),O=function(x,S){h.call(this,x,S),this._current_tag_name="";var D=new l(this._input).read_options(this._options),L=new u(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:L.starting_with(/{{!--/).until_after(/--}}/),handlebars:L.starting_with(/{{/).until_after(/}}/),handlebars_open:L.until(/[\n\r\t }]/),handlebars_raw_close:L.until(/}}/),comment:L.starting_with(/<!--/).until_after(/-->/),cdata:L.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:L.starting_with(/<!\[/).until_after(/]>/),processing:L.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=L.matching(A).until_after(A)}};O.prototype=new h,O.prototype._is_comment=function(x){return!1},O.prototype._is_opening=function(x){return x.type===s.TAG_OPEN},O.prototype._is_closing=function(x,S){return x.type===s.TAG_CLOSE&&S&&((x.text===">"||x.text==="/>")&&S.text[0]==="<"||x.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(x,S){var D=null;this._readWhitespace();var L=this._input.peek();return L===null?this._create_token(s.EOF,""):(D=D||this._read_open_handlebars(L,S),D=D||this._read_attribute(L,x,S),D=D||this._read_close(L,S),D=D||this._read_raw_content(L,x,S),D=D||this._read_content_word(L),D=D||this._read_comment_or_cdata(L),D=D||this._read_processing(L),D=D||this._read_open(L,S),D=D||this._create_token(s.UNKNOWN,this._input.next()),D)},O.prototype._read_comment_or_cdata=function(x){var S=null,D=null,L=null;if(x==="<"){var A=this._input.peek(1);A==="!"&&(D=this.__patterns.comment.read(),D?(L=a.get_directives(D),L&&L.ignore==="start"&&(D+=a.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(S=this._create_token(s.COMMENT,D),S.directives=L)}return S},O.prototype._read_processing=function(x){var S=null,D=null,L=null;if(x==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(S=this._create_token(s.COMMENT,D),S.directives=L)}return S},O.prototype._read_open=function(x,S){var D=null,L=null;return S||x==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),L=this._create_token(s.TAG_OPEN,D)),L},O.prototype._read_open_handlebars=function(x,S){var D=null,L=null;return S||this._options.indent_handlebars&&x==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),L=this._create_token(s.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),L=this._create_token(s.TAG_OPEN,D))),L},O.prototype._read_close=function(x,S){var D=null,L=null;return S&&(S.text[0]==="<"&&(x===">"||x==="/"&&this._input.peek(1)===">")?(D=this._input.next(),x==="/"&&(D+=this._input.next()),L=this._create_token(s.TAG_CLOSE,D)):S.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),L=this._create_token(s.TAG_CLOSE,"}}"))),L},O.prototype._read_attribute=function(x,S,D){var L=null,A="";if(D&&D.text[0]==="<")if(x==="=")L=this._create_token(s.EQUALS,this._input.next());else if(x==='"'||x==="'"){var C=this._input.next();x==='"'?C+=this.__patterns.double_quote.read():C+=this.__patterns.single_quote.read(),L=this._create_token(s.VALUE,C)}else A=this.__patterns.attribute.read(),A&&(S.type===s.EQUALS?L=this._create_token(s.VALUE,A):L=this._create_token(s.ATTRIBUTE,A));return L},O.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)},O.prototype._read_raw_content=function(x,S,D){var L="";if(D&&D.text[0]==="{")L=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var A=S.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var C=this._read_comment_or_cdata(x);if(C)return C.type=s.TEXT,C;L=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(A)&&(L=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig")))}return L?this._create_token(s.TEXT,L):null},O.prototype._read_content_word=function(x){var S="";if(this._options.unformatted_content_delimiter&&(x===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},v.exports.Tokenizer=O,v.exports.TOKEN=s}],W={};function r(v){var m=W[v];if(m!==void 0)return m.exports;var p=W[v]={exports:{}};return z[v](p,p.exports,r),p.exports}var R=r(18);P=R})();var Y=P;if(!0)!(ie=[Q,Q("6UM0"),Q("TXwP")],J=function(z){var W=Q("6UM0"),r=Q("TXwP");return{html_beautify:function(R,v){return Y(R,v,W.js_beautify,r.css_beautify)}}}.apply(be,ie),J!==void 0&&(nt.exports=J));else var j,U})()},"rAM+":function(nt,be,Q){"use strict";Q.d(be,"a",function(){return J});var ie=Q("Qw5x");function J(P,Y){var j;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(j=Object(ie.a)(P))||Y&&P&&typeof P.length=="number"){j&&(P=j);var U=0,z=function(){};return{s:z,n:function(){return U>=P.length?{done:!0}:{done:!1,value:P[U++]}},e:function(m){throw m},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 W=!0,r=!1,R;return{s:function(){j=P[Symbol.iterator]()},n:function(){var m=j.next();return W=m.done,m},e:function(m){r=!0,R=m},f:function(){try{!W&&j.return!=null&&j.return()}finally{if(r)throw R}}}}},rUJ1:function(nt,be){const Q=/[&<>"']/,ie=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},j=L=>Y[L];function U(L,A){if(A){if(Q.test(L))return L.replace(ie,j)}else if(J.test(L))return L.replace(P,j);return L}const z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(L){return L.replace(z,(A,C)=>(C=C.toLowerCase(),C==="colon"?":":C.charAt(0)==="#"?C.charAt(1)==="x"?String.fromCharCode(parseInt(C.substring(2),16)):String.fromCharCode(+C.substring(1)):""))}const r=/(^|[^\[])\^/g;function R(L,A){L=L.source||L,A=A||"";const C={replace:(E,d)=>(d=d.source||d,d=d.replace(r,"$1"),L=L.replace(E,d),C),getRegex:()=>new RegExp(L,A)};return C}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(L,A,C){if(L){let E;try{E=decodeURIComponent(W(C)).replace(v,"").toLowerCase()}catch(d){return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}A&&!m.test(C)&&(C=u(A,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(E){return null}return C}const h={},o=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(L,A){h[" "+L]||(o.test(L)?h[" "+L]=L+"/":h[" "+L]=x(L,"/",!0)),L=h[" "+L];const C=L.indexOf(":")===-1;return A.substring(0,2)==="//"?C?A:L.replace(f,"$1")+A:A.charAt(0)==="/"?C?A:L.replace(l,"$1")+A:L+A}const s={exec:function(){}};function a(L){let A=1,C,E;for(;A<arguments.length;A++){C=arguments[A];for(E in C)Object.prototype.hasOwnProperty.call(C,E)&&(L[E]=C[E])}return L}function O(L,A){const C=L.replace(/\|/g,(w,y,b)=>{let B=!1,F=y;for(;--F>=0&&b[F]==="\\";)B=!B;return B?"|":" |"}),E=C.split(/ \|/);let d=0;if(E.length>A)E.splice(A);else for(;E.length<A;)E.push("");for(;d<E.length;d++)E[d]=E[d].trim().replace(/\\\|/g,"|");return E}function x(L,A,C){const E=L.length;if(E===0)return"";let d=0;for(;d<E;){const w=L.charAt(E-d-1);if(w===A&&!C)d++;else if(w!==A&&C)d++;else break}return L.substr(0,E-d)}function S(L,A){if(L.indexOf(A[1])===-1)return-1;const C=L.length;let E=0,d=0;for(;d<C;d++)if(L[d]==="\\")d++;else if(L[d]===A[0])E++;else if(L[d]===A[1]&&(E--,E<0))return d;return-1}function D(L){L&&L.sanitize&&!L.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")}nt.exports={escape:U,unescape:W,edit:R,cleanUrl:p,resolveUrl:u,noopTest:s,merge:a,splitCells:O,rtrim:x,findClosingBracket:S,checkSanitizeDeprecation:D}},t9D7:function(nt,be,Q){"use strict";Q.d(be,"b",function(){return z}),Q.d(be,"g",function(){return r}),Q.d(be,"d",function(){return R}),Q.d(be,"e",function(){return v}),Q.d(be,"a",function(){return m}),Q.d(be,"f",function(){return o}),Q.d(be,"c",function(){return f});var ie=Q("Vhoy"),J=Q("MI8n"),P=Q("pmY6"),Y=Q("Cg/j"),j=Q("ic2d"),U=Q("nEHx");const z=Object(Y.c)("themeService");var W;(function(l){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}l.isThemeColor=u})(W||(W={}));function r(l){return{id:l}}var R;(function(l){function u(D){return D&&typeof D=="object"&&typeof D.id=="string"&&(typeof D.color=="undefined"||W.isThemeColor(D.color))}l.isThemeIcon=u;const s=new RegExp(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function a(D){const L=s.exec(D);if(!L)return;let[,A]=L;return{id:A}}l.fromString=a;function O(D,L){let A=D.id;const C=A.lastIndexOf("~");return C!==-1&&(A=A.substring(0,C)),L&&(A=`${A}~${L}`),{id:A}}l.modify=O;function x(D,L){var A,C;return D.id===L.id&&((A=D.color)===null||A===void 0?void 0:A.id)===((C=L.color)===null||C===void 0?void 0:C.id)}l.isEqual=x;function S(D,L){return{id:D.id,color:L?r(L):void 0}}l.asThemeIcon=S,l.asClassNameArray=ie.a.asClassNameArray,l.asClassName=ie.a.asClassName,l.asCSSSelector=ie.a.asCSSSelector})(R||(R={}));function v(l){switch(l){case U.a.DARK:return"vs-dark";case U.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new J.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(P.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new p;j.a.add(m.ThemingContribution,h);function o(l){return h.onColorThemeChange(l)}class f extends P.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},ulZh:function(nt,be,Q){typeof window!="undefined"&&function(J,P){nt.exports=P()}(this,function(){return function(ie){var J={};function P(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,P),j.l=!0,j.exports}return P.m=ie,P.c=J,P.d=function(Y,j,U){P.o(Y,j)||Object.defineProperty(Y,j,{enumerable:!0,get:U})},P.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},P.t=function(Y,j){if(j&1&&(Y=P(Y)),j&8)return Y;if(j&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var U=Object.create(null);if(P.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:Y}),j&2&&typeof Y!="string")for(var z in Y)P.d(U,z,function(W){return Y[W]}.bind(null,z));return U},P.n=function(Y){var j=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return P.d(j,"a",j),j},P.o=function(Y,j){return Object.prototype.hasOwnProperty.call(Y,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,J,P){"use strict";var Y=Object.prototype.hasOwnProperty,j="~";function U(){}Object.create&&(U.prototype=Object.create(null),new U().__proto__||(j=!1));function z(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function W(v,m,p,h,o){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new z(p,h||v,o),l=j?j+m:m;return v._events[l]?v._events[l].fn?v._events[l]=[v._events[l],f]:v._events[l].push(f):(v._events[l]=f,v._eventsCount++),v}function r(v,m){--v._eventsCount===0?v._events=new U:delete v._events[m]}function R(){this._events=new U,this._eventsCount=0}R.prototype.eventNames=function(){var m=[],p,h;if(this._eventsCount===0)return m;for(h in p=this._events)Y.call(p,h)&&m.push(j?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},R.prototype.listeners=function(m){var p=j?j+m:m,h=this._events[p];if(!h)return[];if(h.fn)return[h.fn];for(var o=0,f=h.length,l=new Array(f);o<f;o++)l[o]=h[o].fn;return l},R.prototype.listenerCount=function(m){var p=j?j+m:m,h=this._events[p];return h?h.fn?1:h.length:0},R.prototype.emit=function(m,p,h,o,f,l){var u=j?j+m:m;if(!this._events[u])return!1;var s=this._events[u],a=arguments.length,O,x;if(s.fn){s.once&&this.removeListener(m,s.fn,void 0,!0);switch(a){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,p),!0;case 3:return s.fn.call(s.context,p,h),!0;case 4:return s.fn.call(s.context,p,h,o),!0;case 5:return s.fn.call(s.context,p,h,o,f),!0;case 6:return s.fn.call(s.context,p,h,o,f,l),!0}for(x=1,O=new Array(a-1);x<a;x++)O[x-1]=arguments[x];s.fn.apply(s.context,O)}else{var S=s.length,D;for(x=0;x<S;x++){s[x].once&&this.removeListener(m,s[x].fn,void 0,!0);switch(a){case 1:s[x].fn.call(s[x].context);break;case 2:s[x].fn.call(s[x].context,p);break;case 3:s[x].fn.call(s[x].context,p,h);break;case 4:s[x].fn.call(s[x].context,p,h,o);break;default:if(!O)for(D=1,O=new Array(a-1);D<a;D++)O[D-1]=arguments[D];s[x].fn.apply(s[x].context,O)}}}return!0},R.prototype.on=function(m,p,h){return W(this,m,p,h,!1)},R.prototype.once=function(m,p,h){return W(this,m,p,h,!0)},R.prototype.removeListener=function(m,p,h,o){var f=j?j+m:m;if(!this._events[f])return this;if(!p)return r(this,f),this;var l=this._events[f];if(l.fn)l.fn===p&&(!o||l.once)&&(!h||l.context===h)&&r(this,f);else{for(var u=0,s=[],a=l.length;u<a;u++)(l[u].fn!==p||o&&!l[u].once||h&&l[u].context!==h)&&s.push(l[u]);s.length?this._events[f]=s.length===1?s[0]:s:r(this,f)}return this},R.prototype.removeAllListeners=function(m){var p;return m?(p=j?j+m:m,this._events[p]&&r(this,p)):(this._events=new U,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=j,R.EventEmitter=R,ie.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,J,P){(function(Y){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,U=/^([^\/?#]*)([^]*)$/,z=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(R,v,m){if(m=m||{},R=R.trim(),v=v.trim(),!v){if(!m.alwaysNormalize)return R;var p=r.parseURL(R);if(!p)throw new Error("Error trying to parse base URL.");return p.path=r.normalizePath(p.path),r.buildURLFromParts(p)}var h=r.parseURL(v);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return m.alwaysNormalize?(h.path=r.normalizePath(h.path),r.buildURLFromParts(h)):v;var o=r.parseURL(R);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var f=U.exec(o.path);o.netLoc=f[1],o.path=f[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(l.netLoc=o.netLoc,h.path[0]!=="/"))if(!h.path)l.path=o.path,h.params||(l.params=o.params,h.query||(l.query=o.query));else{var u=o.path,s=u.substring(0,u.lastIndexOf("/")+1)+h.path;l.path=r.normalizePath(s)}return l.path===null&&(l.path=m.alwaysNormalize?r.normalizePath(h.path):h.path),r.buildURLFromParts(l)},parseURL:function(R){var v=j.exec(R);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(R){for(R=R.split("").reverse().join("").replace(z,"");R.length!==(R=R.replace(W,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};ie.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,J,P){function Y(m){var p={};function h(f){if(p[f])return p[f].exports;var l=p[f]={i:f,l:!1,exports:{}};return m[f].call(l.exports,l,l.exports,h),l.l=!0,l.exports}h.m=m,h.c=p,h.i=function(f){return f},h.d=function(f,l,u){h.o(f,l)||Object.defineProperty(f,l,{configurable:!1,enumerable:!0,get:u})},h.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},h.n=function(f){var l=f&&f.__esModule?function(){return f.default}:function(){return f};return h.d(l,"a",l),l},h.o=function(f,l){return Object.prototype.hasOwnProperty.call(f,l)},h.p="/",h.oe=function(f){throw console.error(f),f};var o=h(h.s=ENTRY_MODULE);return o.default||o}var j="[\\.|\\-|\\+|\\w|/|@]+",U="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function z(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(m){return!isNaN(1*m)}function r(m,p,h){var o={};o[h]=[];var f=p.toString(),l=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return o;for(var u=l[1],s=new RegExp("(\\\\n|\\W)"+z(u)+U,"g"),a;a=s.exec(f);){if(a[3]==="dll-reference")continue;o[h].push(a[3])}for(s=new RegExp("\\("+z(u)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+U,"g");a=s.exec(f);)m[a[2]]||(o[h].push(a[1]),m[a[2]]=P(a[1]).m),o[a[2]]=o[a[2]]||[],o[a[2]].push(a[4]);for(var O=Object.keys(o),x=0;x<O.length;x++)for(var S=0;S<o[O[x]].length;S++)W(o[O[x]][S])&&(o[O[x]][S]=1*o[O[x]][S]);return o}function R(m){var p=Object.keys(m);return p.reduce(function(h,o){return h||m[o].length>0},!1)}function v(m,p){for(var h={main:[p]},o={main:[]},f={main:{}};R(h);)for(var l=Object.keys(h),u=0;u<l.length;u++){var s=l[u],a=h[s],O=a.pop();if(f[s]=f[s]||{},f[s][O]||!m[s][O])continue;f[s][O]=!0,o[s]=o[s]||[],o[s].push(O);for(var x=r(m,m[s][O],s),S=Object.keys(x),D=0;D<S.length;D++)h[S[D]]=h[S[D]]||[],h[S[D]]=h[S[D]].concat(x[S[D]])}return o}ie.exports=function(m,p){p=p||{};var h={main:P.m},o=p.all?{main:Object.keys(h.main)}:v(h,m),f="";Object.keys(o).filter(function(O){return O!=="main"}).forEach(function(O){for(var x=0;o[O][x];)x++;o[O].push(x),h[O][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+O+" = ("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+o[O].map(function(S){return""+JSON.stringify(S)+": "+h[O][S].toString()}).join(",")+`});
`}),f=f+"new (("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+o.main.map(function(O){return""+JSON.stringify(O)+": "+h.main[O].toString()}).join(",")+"}))(self);";var l=new window.Blob([f],{type:"text/javascript"});if(p.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,s=u.createObjectURL(l),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"hlsDefaultConfig",function(){return D}),P.d(J,"mergeConfig",function(){return A}),P.d(J,"enableStreamingMode",function(){return C});var Y=P("./src/controller/abr-controller.ts"),j=P("./src/controller/audio-stream-controller.ts"),U=P("./src/controller/audio-track-controller.ts"),z=P("./src/controller/subtitle-stream-controller.ts"),W=P("./src/controller/subtitle-track-controller.ts"),r=P("./src/controller/buffer-controller.ts"),R=P("./src/controller/timeline-controller.ts"),v=P("./src/controller/cap-level-controller.ts"),m=P("./src/controller/fps-controller.ts"),p=P("./src/controller/eme-controller.ts"),h=P("./src/controller/cmcd-controller.ts"),o=P("./src/utils/xhr-loader.ts"),f=P("./src/utils/fetch-loader.ts"),l=P("./src/utils/cues.ts"),u=P("./src/utils/mediakeys-helper.ts"),s=P("./src/utils/logger.ts");function a(){return a=Object.assign||function(E){for(var d=1;d<arguments.length;d++){var w=arguments[d];for(var y in w)Object.prototype.hasOwnProperty.call(w,y)&&(E[y]=w[y])}return E},a.apply(this,arguments)}function O(E,d){var w=Object.keys(E);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(E);d&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(E,b).enumerable})),w.push.apply(w,y)}return w}function x(E){for(var d=1;d<arguments.length;d++){var w=arguments[d]!=null?arguments[d]:{};d%2?O(Object(w),!0).forEach(function(y){S(E,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(w)):O(Object(w)).forEach(function(y){Object.defineProperty(E,y,Object.getOwnPropertyDescriptor(w,y))})}return E}function S(E,d,w){return d in E?Object.defineProperty(E,d,{value:w,enumerable:!0,configurable:!0,writable:!0}):E[d]=w,E}var D=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:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Y.default,bufferController:r.default,capLevelController:v.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},L()),{},{subtitleStreamController:z.SubtitleStreamController,subtitleTrackController:W.default,timelineController:R.TimelineController,audioStreamController:j.default,audioTrackController:U.default,emeController:p.default,cmcdController:h.default});function L(){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(E,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},E,d)}function C(E){var d=E.loader;if(d!==f.default&&d!==o.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),E.progressive=!1;else{var w=Object(f.fetchSupported)();w&&(E.loader=f.default,E.progressive=!0,E.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/ewma-bandwidth-estimator.ts"),U=P("./src/events.ts"),z=P("./src/utils/buffer-helper.ts"),W=P("./src/errors.ts"),r=P("./src/types/loader.ts"),R=P("./src/utils/logger.ts");function v(h,o){for(var f=0;f<o.length;f++){var l=o[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function m(h,o,f){return o&&v(h.prototype,o),f&&v(h,f),h}var p=function(){function h(f){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=f;var l=f.config;this.bwEstimator=new j.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(U.Events.FRAG_LOADING,this.onFragLoading,this),l.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(U.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(U.Events.FRAG_LOADING,this.onFragLoading,this),l.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(U.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(l,u){var s=u.frag;if(s.type===r.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=u.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(l,u){var s=this.hls.config;u.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,O=s.config,x=s.media;if(!l||!x)return;var S=u?u.stats:l.stats,D=u?u.duration:l.duration;if(S.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||x.paused||!x.playbackRate||!x.readyState)return;var L=performance.now()-S.loading.start,A=Math.abs(x.playbackRate);if(L<=500*D/A)return;var C=s.levels,E=s.minAutoLevel,d=C[l.level],w=S.total||Math.max(S.loaded,Math.round(D*d.maxBitrate/8)),y=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/L),b=(w-S.loaded)/y,B=x.currentTime,F=(z.BufferHelper.bufferInfo(x,B,O.maxBufferHole).end-B)/A;if(F>=2*D/A||b<=F)return;var _=Number.POSITIVE_INFINITY,M;for(M=l.level-1;M>E;M--){var I=C[M].maxBitrate;if(_=D*I/(8*.8*y),_<F)break}if(_>=b)return;var g=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+l.sn+(u?" part "+u.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
Current BW estimate: `+(Object(Y.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+_.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),s.nextLoadLevel=M,this.bwEstimator.sample(L,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),s.trigger(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:u,stats:S})},o.onFragLoaded=function(l,u){var s=u.frag,a=u.part;if(s.type===r.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(s.sn)){var O=a?a.stats:s.stats,x=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],D=(S.loaded?S.loaded.bytes:0)+O.loaded,L=(S.loaded?S.loaded.duration:0)+x;S.loaded={bytes:D,duration:L},S.realBitrate=Math.round(8*D/L)}if(s.bitrateTest){var A={stats:O,frag:s,part:a,id:s.type};this.onFragBuffered(U.Events.FRAG_BUFFERED,A),s.bitrateTest=!1}}},o.onFragBuffered=function(l,u){var s=u.frag,a=u.part,O=a?a.stats:s.stats;if(O.aborted)return;if(s.type!==r.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var x=O.parsing.end-O.loading.start;this.bwEstimator.sample(x,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},o.onError=function(l,u){switch(u.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.maxAutoLevel,O=s.config,x=s.minAutoLevel,S=s.media,D=u?u.duration:l?l.duration:0,L=S?S.currentTime:0,A=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,E=(z.BufferHelper.bufferInfo(S,L,O.maxBufferHole).end-L)/A,d=this.findBestLevel(C,x,a,E,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(d>=0)return d;R.logger.trace((E?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var w=D?Math.min(D,O.maxStarvationDelay):O.maxStarvationDelay,y=O.abrBandWidthFactor,b=O.abrBandWidthUpFactor;if(!E){var B=this.bitrateTestDelay;if(B){var F=D?Math.min(D,O.maxLoadingDelay):O.maxLoadingDelay;w=F-B,R.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),y=b=1}}return d=this.findBestLevel(C,x,a,E+w,y,b),Math.max(d,0)},o.findBestLevel=function(l,u,s,a,O,x){for(var S,D=this.fragCurrent,L=this.partCurrent,A=this.lastLoadedFragLevel,C=this.hls.levels,E=C[A],d=!!(E!=null&&(S=E.details)!==null&&S!==void 0&&S.live),w=E==null?void 0:E.codecSet,y=L?L.duration:D?D.duration:0,b=s;b>=u;b--){var B=C[b];if(!B||w&&B.codecSet!==w)continue;var F=B.details,_=(L?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,M=void 0;b<=A?M=O*l:M=x*l;var I=C[b].maxBitrate,g=I*_/M;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(M)+"/"+I+"/"+_+"/"+a+"/"+g),M>I&&(!g||d&&!this.bitrateTestDelay||g<a))return b}return-1},m(h,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,u=this.bwEstimator;if(l!==-1&&(!u||!u.canEstimate()))return l;var s=this.getNextABRAutoLevel();return l!==-1&&(s=Math.min(l,s)),s},set:function(l){this._nextAutoLevel=l}}]),h}();J.default=p},"./src/controller/audio-stream-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),U=P("./src/events.ts"),z=P("./src/utils/buffer-helper.ts"),W=P("./src/controller/fragment-tracker.ts"),r=P("./src/types/level.ts"),R=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/chunk-cache.ts"),p=P("./src/demux/transmuxer-interface.ts"),h=P("./src/types/transmuxer.ts"),o=P("./src/controller/fragment-finders.ts"),f=P("./src/utils/discontinuities.ts"),l=P("./src/errors.ts"),u=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(D){for(var L=1;L<arguments.length;L++){var A=arguments[L];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(D[C]=A[C])}return D},s.apply(this,arguments)}function a(D,L){D.prototype=Object.create(L.prototype),D.prototype.constructor=D,O(D,L)}function O(D,L){return O=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},O(D,L)}var x=100,S=function(D){a(L,D);function L(C,E){var d;return d=D.call(this,C,E,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var A=L.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var E=this.hls;E.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.on(U.Events.ERROR,this.onError,this),E.on(U.Events.BUFFER_RESET,this.onBufferReset,this),E.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var E=this.hls;E.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.off(U.Events.ERROR,this.onError,this),E.off(U.Events.BUFFER_RESET,this.onBufferReset,this),E.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onInitPtsFound=function(E,d){var w=d.frag,y=d.id,b=d.initPTS;if(y==="main"){var B=w.cc;this.initPTS[w.cc]=b,this.log("InitPTS for cc: "+B+" found from main: "+b),this.videoTrackCC=B,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},A.startLoad=function(E){if(!this.levels){this.startPosition=E,this.state=j.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,d>0&&E===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var E,d=this.levels,w=this.trackId,y=d==null||((E=d[w])===null||E===void 0)?void 0:E.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var b,B=performance.now(),F=this.retryDate;(!F||B>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var _=this.waitingData;if(_){var M=_.frag,I=_.part,g=_.cache,H=_.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var $=g.flush(),ae={frag:M,part:I,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ae),H&&D.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),Le=z.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),ve=Object(o.fragmentWithinToleranceTest)(Le.end,this.config.maxFragLookUpTolerance,M);ve<0&&(u.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+Le.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var E=this.waitingData;E&&(this.fragmentTracker.removeFragment(E.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},A.onTickEnd=function(){var E=this.media;if(!E||!E.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:E,w=d.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=E.currentTime},A.doTickIdle=function(){var E,d,w=this.hls,y=this.levels,b=this.media,B=this.trackId,F=w.config;if(!y||!y[B])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var _=y[B],M=_.details;if(!M||M.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(M)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(),$=this.audioSwitch;if(g>=H&&!$)return;if(!$&&this._streamEnded(I,M)){w.trigger(U.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ae=M.fragments,ue=ae[0].start,Le=I.end;if($){var ve=this.getLoadPosition();Le=ve,M.PTSKnown&&ve<ue&&((I.end>ue||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=ue+.05))}var Te=this.getNextFragment(Le,M);if(!Te){this.bufferFlushed=!0;return}((E=Te.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((d=Te.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(Te,M):this.loadFragment(Te,M,Le)},A.getMaxBufferLength=function(){var E=D.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return d===null?E:Math.max(E,d.len)},A.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(E,d){var w=d.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(y){return new r.Level(y)})},A.onAudioTrackSwitching=function(E,d){var w=!!d.url;this.trackId=d.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),w?this.setInterval(x):this.resetTransmuxer(),w?(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(E,d){this.mainDetails=d.details},A.onAudioTrackLoaded=function(E,d){var w,y=this.levels,b=d.details,B=d.id;if(!y){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[B],_=0;if(b.live||(w=F.details)!==null&&w!==void 0&&w.live){var M=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!M)return;!F.details&&b.hasProgramDateTime&&M.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(b,M),_=b.fragments[0].start):_=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,_),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=j.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(E){var d,w=E.frag,y=E.part,b=E.payload,B=this.config,F=this.trackId,_=this.levels;if(!_){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+w.sn+" of level "+w.level+" will not be buffered");return}var M=_[F];console.assert(M,"Audio track is defined on fragment load progress");var I=M.details;console.assert(I,"Audio track details are defined on fragment load progress");var g=B.defaultAudioCodec||M.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new p.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[w.cc],ae=(d=w.initSegment)===null||d===void 0?void 0:d.data;if($!==void 0){var ue=!1,Le=y?y.index:-1,ve=Le!==-1,Te=new h.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,b.byteLength,Le,ve);H.push(b,ae,g,"",w,y,I.totalduration,ue,Te,$)}else{u.logger.log("Unknown video PTS for cc "+w.cc+", waiting for video PTS before demuxing audio frag "+w.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var _e=this.waitingData=this.waitingData||{frag:w,part:y,cache:new m.default,complete:!1},De=_e.cache;De.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(E){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,E)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(E,d){var w=d.tracks.audio;w&&(this.mediaBuffer=w.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},A.onFragBuffered=function(E,d){var w=d.frag,y=d.part;if(w.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(w)){this.warn("Fragment "+w.sn+(y?" p: "+y.index:"")+" of level "+w.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}w.sn!=="initSegment"&&(this.fragPrevious=w,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,y)},A.onError=function(E,d){switch(d.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(R.PlaylistLevelType.AUDIO,d);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=d.fatal?j.State.ERROR:j.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var w=!0,y=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);y&&y.len>.5&&(w=!this.reduceMaxBufferLength(y.len)),w&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},A.onBufferFlushed=function(E,d){var w=d.type;w===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(E){var d,w="audio",y=this.hls,b=E.remuxResult,B=E.chunkMeta,F=this.getCurrentContext(B);if(!F){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var _=F.frag,M=F.part,I=b.audio,g=b.text,H=b.id3,$=b.initSegment;if(this.fragContextChanged(_))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,_,B),y.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:w,tracks:$.tracks})),I){var ae=I.startPTS,ue=I.endPTS,Le=I.startDTS,ve=I.endDTS;M&&(M.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ue,startDTS:Le,endDTS:ve}),_.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ae,ue,Le,ve),this.bufferFragmentData(I,_,M,B)}if(H!=null&&(d=H.samples)!==null&&d!==void 0&&d.length){var Te=s({frag:_,id:w},H);y.trigger(U.Events.FRAG_PARSING_METADATA,Te)}if(g){var _e=s({frag:_,id:w},g);y.trigger(U.Events.FRAG_PARSING_USERDATA,_e)}},A._bufferInitSegment=function(E,d,w){if(this.state!==j.State.PARSING)return;E.video&&delete E.video;var y=E.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,E);var b=y.initSegment;if(b!=null&&b.byteLength){var B={type:"audio",frag:d,part:null,chunkMeta:w,parent:d.type,data:b};this.hls.trigger(U.Events.BUFFER_APPENDING,B)}this.tick()},A.loadFragment=function(E,d,w){var y=this.fragmentTracker.getState(E);this.fragCurrent=E,(this.audioSwitch||y===W.FragmentState.NOT_LOADED||y===W.FragmentState.PARTIAL)&&(E.sn==="initSegment"?this._loadInitSegment(E):d.live&&!Object(Y.isFiniteNumber)(this.initPTS[E.cc])?(this.log("Waiting for video PTS in continuity counter "+E.cc+" of live stream before loading audio fragment "+E.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,E,d,w)))},A.completeAudioSwitch=function(){var E=this.hls,d=this.media,w=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,E.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:w})},L}(j.default);J.default=S},"./src/controller/audio-track-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/controller/base-playlist-controller.ts"),z=P("./src/types/loader.ts");function W(p,h){for(var o=0;o<h.length;o++){var f=h[o];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function r(p,h,o){return h&&W(p.prototype,h),o&&W(p,o),p}function R(p,h){p.prototype=Object.create(h.prototype),p.prototype.constructor=p,v(p,h)}function v(p,h){return v=Object.setPrototypeOf||function(f,l){return f.__proto__=l,f},v(p,h)}var m=function(p){R(h,p);function h(f){var l;return l=p.call(this,f,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var o=h.prototype;return o.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)},o.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)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(l,u){this.tracks=u.audioTracks||[]},o.onAudioTrackLoaded=function(l,u){var s=u.id,a=u.details,O=this.tracksInGroup[s];if(!O){this.warn("Invalid audio track id "+s);return}var x=O.details;O.details=u.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,u,x))},o.onLevelLoading=function(l,u){this.switchLevel(u.level)},o.onLevelSwitching=function(l,u){this.switchLevel(u.level)},o.switchLevel=function(l){var u=this.hls.levels[l];if(!(u!=null&&u.audioGroupIds))return;var s=u.audioGroupIds[u.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(x){return!s||x.groupId===s});this.selectDefaultTrack&&!a.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var O={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(Y.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},o.onError=function(l,u){if(p.prototype.onError.call(this,l,u),u.fatal||!u.context)return;u.context.type===z.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},o.setAudioTrack=function(l){var u=this.tracksInGroup;if(l<0||l>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=u[this.trackId];this.log("Now switching to audio-track index "+l);var a=u[l],O=a.id,x=a.groupId,S=x===void 0?"":x,D=a.name,L=a.type,A=a.url;if(this.trackId=l,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:S,name:D,type:L,url:A}),a.details&&!a.details.live)return;var C=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(C)},o.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,s=this.findTrackId(u)||this.findTrackId();s!==-1?this.setAudioTrack(s):(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}))},o.findTrackId=function(l){for(var u=this.tracksInGroup,s=0;s<u.length;s++){var a=u[s];if((!this.selectDefaultTrack||a.default)&&(!l||l===a.name))return a.id}return-1},o.loadPlaylist=function(l){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var s=u.id,a=u.groupId,O=u.url;if(l)try{O=l.addDirectives(O)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(Y.Events.AUDIO_TRACK_LOADING,{url:O,id:s,groupId:a,deliveryDirectives:l||null})}},r(h,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),h}(U.default);J.default=m},"./src/controller/base-playlist-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var Y=P("./src/polyfills/number.ts"),j=P("./src/types/level.ts"),U=P("./src/controller/level-helper.ts"),z=P("./src/utils/logger.ts"),W=P("./src/errors.ts"),r=function(){function R(m,p){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,p+":"),this.warn=z.logger.warn.bind(z.logger,p+":"),this.hls=m}var v=R.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,h){h.fatal&&h.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(p,h){var o=h==null?void 0:h.renditionReports;if(o)for(var f=0;f<o.length;f++){var l=o[f],u=""+l.URI;if(u===p.substr(-u.length)){var s=parseInt(l["LAST-MSN"]),a=parseInt(l["LAST-PART"]);if(h&&this.hls.config.lowLatencyMode){var O=Math.min(h.age-h.partTarget,h.targetduration);a!==void 0&&O>h.partTarget&&(a+=1)}if(Object(Y.isFiniteNumber)(s))return new j.HlsUrlParameters(s,Object(Y.isFiniteNumber)(a)?a:void 0,j.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,h,o){var f=this,l=h.details,u=h.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(l.advancedDateTime=Date.now()-s,l.live||o!=null&&o.live){if(l.reloaded(o),o&&this.log("live playlist "+p+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),o&&l.fragments.length>0&&Object(U.mergeDetails)(o,l),!this.canLoad||!l.live)return;var a,O=void 0,x=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var S=this.hls.config.lowLatencyMode,D=l.lastPartSn,L=l.endSN,A=l.lastPartIndex,C=A!==-1,E=D===L,d=S?0:A;C?(O=E?L+1:D,x=E?d:A+1):O=L+1;var w=l.age,y=w+l.ageHeader,b=Math.min(y-l.partTarget,l.targetduration*1.5);if(b>0){if(o&&b>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+b+" with playlist age: "+l.age),b=0;else{var B=Math.floor(b/l.targetduration);if(O+=B,x!==void 0){var F=Math.round(b%l.targetduration/l.partTarget);x+=F}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+b+" skip sn "+B+" to part "+x)}l.tuneInGoal=b}if(a=this.getDeliveryDirectives(l,h.deliveryDirectives,O,x),S||!E){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(l,h.deliveryDirectives,O,x);var _=Object(U.computeReloadInterval)(l,u);O!==void 0&&l.canBlockReload&&(_-=l.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(_)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(a)},_)}else this.clearTimer()},v.getDeliveryDirectives=function(p,h,o,f){var l=Object(j.getSkipValue)(p,o);return h!=null&&h.skip&&p.deltaUpdateFailed&&(o=h.msn,f=h.part,l=j.HlsSkip.No),new j.HlsUrlParameters(o,f,l)},v.retryLoadingOrFail=function(p){var h=this,o=this.hls.config,f=this.retryCount<o.levelLoadingMaxRetry;if(f){var l;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(l=p.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},R}()},"./src/controller/base-stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"State",function(){return L}),P.d(J,"default",function(){return A});var Y=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),U=P("./src/controller/fragment-tracker.ts"),z=P("./src/utils/buffer-helper.ts"),W=P("./src/utils/logger.ts"),r=P("./src/events.ts"),R=P("./src/errors.ts"),v=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),h=P("./src/controller/fragment-finders.ts"),o=P("./src/controller/level-helper.ts"),f=P("./src/loader/fragment-loader.ts"),l=P("./src/crypt/decrypter.ts"),u=P("./src/utils/time-ranges.ts"),s=P("./src/types/loader.ts");function a(C,E){for(var d=0;d<E.length;d++){var w=E[d];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(C,w.key,w)}}function O(C,E,d){return E&&a(C.prototype,E),d&&a(C,d),C}function x(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function S(C,E){C.prototype=Object.create(E.prototype),C.prototype.constructor=C,D(C,E)}function D(C,E){return D=Object.setPrototypeOf||function(w,y){return w.__proto__=y,w},D(C,E)}var L={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(C){S(E,C);function E(w,y,b){var B;return B=C.call(this)||this,B.hls=void 0,B.fragPrevious=null,B.fragCurrent=null,B.fragmentTracker=void 0,B.transmuxer=null,B._state=L.STOPPED,B.media=void 0,B.mediaBuffer=void 0,B.config=void 0,B.bitrateTest=!1,B.lastCurrentTime=0,B.nextLoadPosition=0,B.startPosition=0,B.loadedmetadata=!1,B.fragLoadError=0,B.retryDate=0,B.levels=null,B.fragmentLoader=void 0,B.levelLastLoaded=null,B.startFragRequested=!1,B.decrypter=void 0,B.initPTS=[],B.onvseeking=null,B.onvended=null,B.logPrefix="",B.log=void 0,B.warn=void 0,B.logPrefix=b,B.log=W.logger.log.bind(W.logger,b+":"),B.warn=W.logger.warn.bind(W.logger,b+":"),B.hls=w,B.fragmentLoader=new f.default(w.config),B.fragmentTracker=y,B.config=w.config,B.decrypter=new l.default(w,w.config),w.on(r.Events.KEY_LOADED,B.onKeyLoaded,x(B)),B}var d=E.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(y){},d.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=L.STOPPED},d._streamEnded=function(y,b){var B=this.fragCurrent,F=this.fragmentTracker;if(!b.live&&B&&B.sn===b.endSN&&!y.nextStart){var _=F.getState(B);return _===U.FragmentState.PARTIAL||_===U.FragmentState.OK}return!1},d.onMediaAttached=function(y,b){var B=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),B.addEventListener("seeking",this.onvseeking),B.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===L.STOPPED&&this.startLoad(F.startPosition)},d.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var y=this.config,b=this.fragCurrent,B=this.media,F=this.mediaBuffer,_=this.state,M=B?B.currentTime:0,I=z.BufferHelper.bufferInfo(F||B,M,y.maxBufferHole);if(this.log("media seeking to "+(Object(Y.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+_),_===L.ENDED)this.resetLoadingState();else if(b&&!I.len){var g=y.maxFragLookUpTolerance,H=b.start-g,$=b.start+b.duration+g,ae=M>$;(M<H||ae)&&(ae&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}B&&(this.lastCurrentTime=M),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(y,b){if(this.state!==L.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=L.IDLE;var B=this.levels[b.frag.level].details;B&&this.loadFragment(b.frag,B,b.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),C.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=L.STOPPED,this.hls.off(r.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,C.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(y,b){this.log("Loading key for "+y.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=L.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(r.Events.KEY_LOADING,{frag:y})},d.loadFragment=function(y,b,B){this._loadFragForPlayback(y,b,B)},d._loadFragForPlayback=function(y,b,B){var F=this,_=function(I){if(F.fragContextChanged(y)){F.warn("Fragment "+y.sn+(I.part?" p: "+I.part.index:"")+" of level "+y.level+" was dropped during download."),F.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,F._handleFragmentLoadProgress(I)};this._doFragLoad(y,b,B,_).then(function(M){if(!M)return;F.fragLoadError=0;var I=F.state;if(F.fragContextChanged(y)){(I===L.FRAG_LOADING||I===L.BACKTRACKING||!F.fragCurrent&&I===L.PARSING)&&(F.fragmentTracker.removeFragment(y),F.state=L.IDLE);return}if("payload"in M&&(F.log("Loaded fragment "+y.sn+" of level "+y.level),F.hls.trigger(r.Events.FRAG_LOADED,M),F.state===L.BACKTRACKING)){F.fragmentTracker.backtrack(y,M),F.resetFragmentLoading(y);return}F._handleFragmentLoadComplete(M)}).catch(function(M){F.warn(M),F.resetFragmentLoading(y)})},d.flushMainBuffer=function(y,b,B){if(B===void 0&&(B=null),!(y-b))return;var F={startOffset:y,endOffset:b,type:B};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,F)},d._loadInitSegment=function(y){var b=this;this._doFragLoad(y).then(function(B){if(!B||b.fragContextChanged(y)||!b.levels)throw new Error("init load aborted");return B}).then(function(B){var F=b.hls,_=B.payload,M=y.decryptdata;if(_&&_.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var I=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(_),M.key.buffer,M.iv.buffer).then(function(g){var H=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:I,tdecrypt:H}}),B.payload=g,B})}return B}).then(function(B){var F=b.fragCurrent,_=b.hls,M=b.levels;if(!M)throw new Error("init load aborted, missing levels");var I=M[y.level].details;console.assert(I,"Level details are defined when init segment is loaded");var g=y.stats;b.state=L.IDLE,b.fragLoadError=0,y.data=new Uint8Array(B.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),B.frag===F&&_.trigger(r.Events.FRAG_BUFFERED,{stats:g,frag:F,part:null,id:y.type}),b.tick()}).catch(function(B){b.warn(B),b.resetFragmentLoading(y)})},d.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},d.fragBufferedComplete=function(y,b){var B=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+u.default.toString(z.BufferHelper.getBuffered(B))),this.state=L.IDLE,this.tick()},d._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var B=y.frag,F=y.part,_=y.partsLoaded,M=!_||_.length===0||_.some(function(g){return!g}),I=new v.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,F?F.index:-1,!M);b.flush(I)},d._handleFragmentLoadProgress=function(y){},d._doFragLoad=function(y,b,B,F){var _=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(y.start,B||0),this.config.lowLatencyMode&&b){var M=b.partList;if(M&&F){B>y.end&&b.fragmentHint&&(y=b.fragmentHint);var I=this.getNextPart(M,y,B);if(I>-1){var g=M[I];return this.log("Loading part sn: "+y.sn+" p: "+g.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+I+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=g.start+g.duration,this.state=L.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,part:M[I],targetBufferTime:B}),this.doFragPartsLoad(y,M,I,F).catch(function(H){return _.handleFragLoadError(H)})}else if(!y.url||this.loadedEndOfParts(M,B))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(B.toFixed(3))),Object(Y.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=L.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,targetBufferTime:B}),this.fragmentLoader.load(y,F).catch(function(H){return _.handleFragLoadError(H)})},d.doFragPartsLoad=function(y,b,B,F){var _=this;return new Promise(function(M,I){var g=[],H=function $(ae){var ue=b[ae];_.fragmentLoader.loadPart(y,ue,F).then(function(Le){g[ue.index]=Le;var ve=Le.part;_.hls.trigger(r.Events.FRAG_LOADED,Le);var Te=b[ae+1];if(Te&&Te.fragment===y)$(ae+1);else return M({frag:y,part:ve,partsLoaded:g})}).catch(I)};H(B)})},d.handleFragLoadError=function(y){var b=y.data;return b&&b.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(r.Events.ERROR,b),null},d._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==L.PARSING){this.fragCurrent||(this.state=L.IDLE);return}var B=b.frag,F=b.part,_=b.level,M=self.performance.now();B.stats.parsing.end=M,F&&(F.stats.parsing.end=M),this.updateLevelTiming(B,F,_,y.partial)},d.getCurrentContext=function(y){var b=this.levels,B=y.level,F=y.sn,_=y.part;if(!b||!b[B])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+B+". The current chunk will not be buffered."),null;var M=b[B],I=_>-1?Object(o.getPartWith)(M,F,_):null,g=I?I.fragment:Object(o.getFragmentWithSN)(M,F,this.fragCurrent);return g?{frag:g,part:I,level:M}:null},d.bufferFragmentData=function(y,b,B,F){if(!y||this.state!==L.PARSING)return;var _=y.data1,M=y.data2,I=_;if(_&&M&&(I=Object(m.appendUint8Array)(_,M)),!I||!I.length)return;var g={type:y.type,frag:b,part:B,chunkMeta:F,parent:b.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!B&&this.flushBufferGap(b)},d.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!z.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var B=b.currentTime,F=z.BufferHelper.bufferInfo(b,B,0),_=y.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,_*.25),I=Math.max(Math.min(y.start-M,F.end-M),B+M);y.start-I>M&&this.flushMainBuffer(I,y.start)},d.getFwdBufferInfo=function(y,b){var B=this.config,F=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(F))return null;var _=z.BufferHelper.bufferInfo(y,F,B.maxBufferHole);if(_.len===0&&_.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(F,b);if(M&&_.nextStart<M.end)return z.BufferHelper.bufferInfo(y,F,Math.max(_.nextStart,B.maxBufferHole))}return _},d.getMaxBufferLength=function(y){var b=this.config,B;return y?B=Math.max(8*b.maxBufferSize/y,b.maxBufferLength):B=b.maxBufferLength,Math.min(B,b.maxMaxBufferLength)},d.reduceMaxBufferLength=function(y){var b=this.config,B=y||b.maxBufferLength;return b.maxMaxBufferLength>=B?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(y,b){var B,F,_=b.fragments,M=_.length;if(!M)return null;var I=this.config,g=_[0].start,H;if(b.live){var $=I.initialLiveManifestSize;if(M<$)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+$+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(b,_),this.startPosition=H?this.hls.liveSyncPosition||H.start:y)}else y<=g&&(H=_[0]);if(!H){var ae=I.lowLatencyMode?b.partEnd:b.fragmentEnd;H=this.getFragmentAtPosition(y,ae,b)}return(B=H)!==null&&B!==void 0&&B.initSegment&&!((F=H)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},d.getNextPart=function(y,b,B){for(var F=-1,_=!1,M=!0,I=0,g=y.length;I<g;I++){var H=y[I];if(M=M&&!H.independent,F>-1&&B<H.start)break;var $=H.loaded;!$&&(_||H.independent||M)&&H.fragment===b&&(F=I),_=$}return F},d.loadedEndOfParts=function(y,b){var B=y[y.length-1];return B&&b>B.start&&B.loaded},d.getInitialLiveFragment=function(y,b){var B=this.fragPrevious,F=null;if(B){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),F=Object(h.findFragmentByPDT)(b,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var _=B.sn+1;if(_>=y.startSN&&_<=y.endSN){var M=b[_-y.startSN];B.cc===M.cc&&(F=M,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(h.findFragWithCC)(b,B.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(F=this.getFragmentAtPosition(I,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},d.getFragmentAtPosition=function(y,b,B){var F=this.config,_=this.fragPrevious,M=B.fragments,I=B.endSN,g=B.fragmentHint,H=F.maxFragLookUpTolerance,$=!!(F.lowLatencyMode&&B.partList&&g);$&&g&&!this.bitrateTest&&(M=M.concat(g),I=g.sn);var ae;if(y<b){var ue=y>b-H?0:H;ae=Object(h.findFragmentByPTS)(_,M,y,ue)}else ae=M[M.length-1];if(ae){var Le=ae.sn-B.startSN,ve=_&&ae.level===_.level,Te=M[Le+1],_e=this.fragmentTracker.getState(ae);if(_e===U.FragmentState.BACKTRACKED){ae=null;for(var De=Le;M[De]&&this.fragmentTracker.getState(M[De])===U.FragmentState.BACKTRACKED;)_?ae=M[De--]:ae=M[--De];ae||(ae=Te)}else _&&ae.sn===_.sn&&!$&&(ve&&(ae.sn<I&&this.fragmentTracker.getState(Te)!==U.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+Te.sn),ae=Te):ae=null))}return ae},d.synchronizeToLiveEdge=function(y){var b=this.config,B=this.media;if(!B)return;var F=this.hls.liveSyncPosition,_=B.currentTime,M=y.fragments[0].start,I=y.edge,g=_>=M-b.maxFragLookUpTolerance&&_<=I;if(F!==null&&B.duration>F&&(_<F||!g)){var H=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*y.targetduration;(!g&&B.readyState<4||_<I-H)&&(this.loadedmetadata||(this.nextLoadPosition=F),B.readyState&&(this.warn("Playback: "+_.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+F.toFixed(3)),B.currentTime=F))}},d.alignPlaylists=function(y,b){var B=this.levels,F=this.levelLastLoaded,_=this.fragPrevious,M=F!==null?B[F]:null,I=y.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var g=y.fragments[0].start,H=!b,$=y.alignedSliding&&Object(Y.isFiniteNumber)(g);if(H||!$&&!g){Object(p.alignStream)(_,M,y);var ae=y.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+y.startSN+" prev-sn: "+(_?_.sn:"na")+" fragments: "+I),ae}return g},d.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},d.setStartPosition=function(y,b){var B=this.startPosition;if(B<b&&(B=-1),B===-1||this.lastCurrentTime===-1){var F=y.startTimeOffset;Object(Y.isFiniteNumber)(F)?(B=b+F,F<0&&(B+=y.totalduration),B=Math.min(Math.max(b,B),b+y.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+B),this.startPosition=B):y.live?B=this.hls.liveSyncPosition||b:this.startPosition=B=0,this.lastCurrentTime=B}this.nextLoadPosition=B},d.getLoadPosition=function(){var y=this.media,b=0;return this.loadedmetadata&&y?b=y.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},d.handleFragLoadAborted=function(y,b){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(b?" part"+b.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},d.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=L.IDLE)},d.onFragmentOrKeyLoadError=function(y,b){if(b.fatal)return;var B=b.frag;if(!B||B.type!==y)return;var F=this.fragCurrent;console.assert(F&&B.sn===F.sn&&B.level===F.level&&B.urlId===F.urlId,"Frag load error must match current frag to retry");var _=this.config;if(this.fragLoadError+1<=_.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(B.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*_.fragLoadingRetryDelay,_.fragLoadingMaxRetryTimeout);this.warn("Fragment "+B.sn+" of "+y+" "+B.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=L.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(y===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=L.IDLE):(W.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=L.ERROR)},d.afterBufferFlushed=function(y,b,B){if(!y)return;var F=z.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(b,F,B),this.state===L.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=L.IDLE},d.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[y].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(y,b,B,F){var _=this,M=B.details;console.assert(!!M,"level.details must be defined");var I=Object.keys(y.elementaryStreams).reduce(function(g,H){var $=y.elementaryStreams[H];if($){var ae=$.endPTS-$.startPTS;if(ae<=0)return _.warn("Could not parse fragment "+y.sn+" "+H+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),_.resetTransmuxer(),g||!1;var ue=F?0:Object(o.updateFragPTSDTS)(M,y,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return _.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:M,level:B,drift:ue,type:H,frag:y,start:$.startPTS,end:$.endPTS}),!0}return g},!1);I?(this.state=L.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:y,part:b})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(E,[{key:"state",get:function(){return this._state},set:function(y){var b=this._state;b!==y&&(this._state=y,this.log(b+"->"+y))}}]),E}(j.default)},"./src/controller/buffer-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),z=P("./src/errors.ts"),W=P("./src/utils/buffer-helper.ts"),r=P("./src/utils/mediasource-helper.ts"),R=P("./src/loader/fragment.ts"),v=P("./src/controller/buffer-operation-queue.ts"),m=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function o(l){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=u.hls,a=u.media,O=u.mediaSource;U.logger.log("[buffer-controller]: Media source opened"),a&&(u.updateMediaElementDuration(),s.trigger(j.Events.MEDIA_ATTACHED,{media:a})),O&&O.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){U.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){U.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var f=o.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var u=this.hls;u.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(j.Events.BUFFER_RESET,this.onBufferReset,this),u.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(j.Events.BUFFER_EOS,this.onBufferEos,this),u.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(j.Events.FRAG_PARSED,this.onFragParsed,this),u.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(j.Events.BUFFER_RESET,this.onBufferReset,this),u.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(j.Events.BUFFER_EOS,this.onBufferEos,this),u.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(j.Events.FRAG_PARSED,this.onFragParsed,this),u.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(u,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,U.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(u,s){var a=this.media=s.media;if(a&&m){var O=this.mediaSource=new m;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(O),this._objectUrl=a.src}},f.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(U.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(O){U.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(a&&self.URL.revokeObjectURL(a),u.src===a?(u.removeAttribute("src"),u.load()):U.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)},f.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(s){var a=u.sourceBuffer[s];try{a&&(u.removeBufferListeners(s),u.mediaSource&&u.mediaSource.removeSourceBuffer(a),u.sourceBuffer[s]=void 0)}catch(O){U.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",O)}}),this._initSourceBuffer()},f.onBufferCodecs=function(u,s){var a=this,O=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(x){if(O){var S=a.tracks[x];if(S&&typeof S.buffer.changeType=="function"){var D=s[x],L=D.codec,A=D.levelCodec,C=D.container,E=(S.levelCodec||S.codec).replace(p,"$1"),d=(A||L).replace(p,"$1");if(E!==d){var w=C+";codecs="+(A||L);a.appendChangeType(x,w)}}}else a.pendingTracks[x]=s[x]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(u,s){var a=this,O=this.operationQueue,x={execute:function(){var D=a.sourceBuffer[u];D&&(U.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),D.changeType(s)),O.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(D){U.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",D)}};O.append(x,u)},f.onBufferAppending=function(u,s){var a=this,O=this.hls,x=this.operationQueue,S=this.tracks,D=s.data,L=s.type,A=s.frag,C=s.part,E=s.chunkMeta,d=E.buffering[L],w=self.performance.now();d.start=w;var y=A.stats.buffering,b=C?C.stats.buffering:null;y.start===0&&(y.start=w),b&&b.start===0&&(b.start=w);var B=S.audio,F=L==="audio"&&E.id===1&&(B==null?void 0:B.container)==="audio/mpeg",_={execute:function(){if(d.executeStart=self.performance.now(),F){var I=a.sourceBuffer[L];if(I){var g=A.start-I.timestampOffset;Math.abs(g)>=.1&&(U.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+A.start+" (delta: "+g+") sn: "+A.sn+")"),I.timestampOffset=A.start)}}a.appendExecutor(D,L)},onStart:function(){},onComplete:function(){var I=self.performance.now();d.executeEnd=d.end=I,y.first===0&&(y.first=I),b&&b.first===0&&(b.first=I);var g=a.sourceBuffer,H={};for(var $ in g)H[$]=W.BufferHelper.getBuffered(g[$]);a.appendError=0,a.hls.trigger(j.Events.BUFFER_APPENDED,{type:L,frag:A,part:C,chunkMeta:E,parent:A.type,timeRanges:H})},onError:function(I){U.logger.error("[buffer-controller]: Error encountered while trying to append to the "+L+" SourceBuffer",I);var g={type:z.ErrorTypes.MEDIA_ERROR,parent:A.type,details:z.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=z.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,g.details=z.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>O.config.appendErrorMaxRetry&&(U.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),O.trigger(j.Events.ERROR,g)}};x.append(_,L)},f.onBufferFlushing=function(u,s){var a=this,O=this.operationQueue,x=function(D){return{execute:a.removeExecutor.bind(a,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(j.Events.BUFFER_FLUSHED,{type:D})},onError:function(A){U.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",A)}}};s.type?O.append(x(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){O.append(x(S),S)})},f.onFragParsed=function(u,s){var a=this,O=s.frag,x=s.part,S=[],D=x?x.elementaryStreams:O.elementaryStreams;D[R.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(D[R.ElementaryStreamTypes.AUDIO]&&S.push("audio"),D[R.ElementaryStreamTypes.VIDEO]&&S.push("video"));var L=function(){var C=self.performance.now();O.stats.buffering.end=C,x&&(x.stats.buffering.end=C);var E=x?x.stats:O.stats;a.hls.trigger(j.Events.FRAG_BUFFERED,{frag:O,part:x,stats:E,id:O.type})};S.length===0&&U.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(L,S)},f.onFragChanged=function(u,s){this.flushBackBuffer()},f.onBufferEos=function(u,s){var a=this,O=this.getSourceBufferTypes().reduce(function(x,S){var D=a.sourceBuffer[S];return(!s.type||s.type===S)&&(D&&!D.ended&&(D.ended=!0,U.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),x&&!!(!D||D.ended)},!0);O&&this.blockBuffers(function(){var x=a.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},f.onLevelUpdated=function(u,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var u=this.hls,s=this.details,a=this.media,O=this.sourceBuffer;if(!a||s===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var S=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(Y.isFiniteNumber)(S)||S<0)return;var D=a.currentTime,L=s.levelTargetDuration,A=Math.max(S,L),C=Math.floor(D/L)*L-A;x.forEach(function(E){var d=O[E];if(d){var w=W.BufferHelper.getBuffered(d);w.length>0&&C>w.start(0)&&(u.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),s.live&&u.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),u.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:E}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,a=this.media,O=this.mediaSource,x=u.fragments[0].start+u.totalduration,S=a.duration,D=Object(Y.isFiniteNumber)(O.duration)?O.duration:0;u.live&&s.config.liveDurationInfinity?(U.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(u)):(x>D&&x>S||!Object(Y.isFiniteNumber)(S))&&(U.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),O.duration=x)},f.updateSeekableRange=function(u){var s=this.mediaSource,a=u.fragments,O=a.length;if(O&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var x=Math.max(0,a[0].start),S=Math.max(x,x+u.totalduration);s.setLiveSeekableRange(x,S)}},f.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,O=Object.keys(a).length;if(O&&!u||O===2){this.createSourceBuffers(a),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(S){s.executeNext(S)})}},f.createSourceBuffers=function(u){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var x in u)if(!s[x]){var S=u[x];if(!S)throw Error("source buffer exists for track "+x+", however track does not");var D=S.levelCodec||S.codec,L=S.container+";codecs="+D;U.logger.log("[buffer-controller]: creating sourceBuffer("+L+")");try{var A=s[x]=a.addSourceBuffer(L),C=x;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[x]={buffer:A,codec:D,container:S.container,levelCodec:S.levelCodec,id:S.id},O++}catch(E){U.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+E.message),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:E,mimeType:L})}}O&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(u){var s=this.operationQueue,a=s.current(u);a.onStart()},f._onSBUpdateEnd=function(u){var s=this.operationQueue,a=s.current(u);a.onComplete(),s.shiftAndExecuteNext(u)},f._onSBUpdateError=function(u,s){U.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(u);a&&a.onError(s)},f.removeExecutor=function(u,s,a){var O=this.media,x=this.mediaSource,S=this.operationQueue,D=this.sourceBuffer,L=D[u];if(!O||!x||!L){U.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var A=Object(Y.isFiniteNumber)(O.duration)?O.duration:Infinity,C=Object(Y.isFiniteNumber)(x.duration)?x.duration:Infinity,E=Math.max(0,s),d=Math.min(a,A,C);d>E?(U.logger.log("[buffer-controller]: Removing ["+E+","+d+"] from the "+u+" SourceBuffer"),console.assert(!L.updating,u+" sourceBuffer must not be updating"),L.remove(E,d)):S.shiftAndExecuteNext(u)},f.appendExecutor=function(u,s){var a=this.operationQueue,O=this.sourceBuffer,x=O[s];if(!x){U.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}x.ended=!1,console.assert(!x.updating,s+" sourceBuffer must not be updating"),x.appendBuffer(u)},f.blockBuffers=function(u,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){U.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var O=this.operationQueue,x=s.map(function(S){return O.appendBlocker(S)});Promise.all(x).then(function(){u(),s.forEach(function(S){var D=a.sourceBuffer[S];(!D||!D.updating)&&O.shiftAndExecuteNext(S)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(u,s,a){var O=this.sourceBuffer[u];if(!O)return;var x=a.bind(this,u);this.listeners[u].push({event:s,listener:x}),O.addEventListener(s,x)},f.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(a){s.removeEventListener(a.event,a.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return j});var Y=P("./src/utils/logger.ts"),j=function(){function U(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var z=U.prototype;return z.append=function(r,R){var v=this.queues[R];v.push(r),v.length===1&&this.buffers[R]&&this.executeNext(R)},z.insertAbort=function(r,R){var v=this.queues[R];v.unshift(r),this.executeNext(R)},z.appendBlocker=function(r){var R,v=new Promise(function(p){R=p}),m={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,r),v},z.executeNext=function(r){var R=this.buffers,v=this.queues,m=R[r],p=v[r];if(p.length){var h=p[0];try{h.execute()}catch(o){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(o),(!m||!m.updating)&&(p.shift(),this.executeNext(r))}}},z.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},z.current=function(r){return this.queues[r][0]},U}()},"./src/controller/cap-level-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/events.ts");function j(W,r){for(var R=0;R<r.length;R++){var v=r[R];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(W,v.key,v)}}function U(W,r,R){return r&&j(W.prototype,r),R&&j(W,R),W}var z=function(){function W(R){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=R,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=W.prototype;return r.setStreamController=function(v){this.streamController=v},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var v=this.hls;v.on(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var v=this.hls;v.off(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(v,m){W.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},r.onMediaAttaching=function(v,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},r.onManifestParsed=function(v,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},r.onBufferCodecs=function(v,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},r.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var h=p.filter(function(o,f){return W.isLevelAllowed(f,m.restrictedLevels)&&f<=v});return this.clientRect=null,W.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},r.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()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},W.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},W.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var h=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},o=v.length-1,f=0;f<v.length;f+=1){var l=v[f];if((l.width>=m||l.height>=p)&&h(l,v[f+1])){o=f;break}}return o},U(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),W}();J.default=z},"./src/controller/cmcd-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var Y=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),U=P("./src/utils/buffer-helper.ts"),z=P("./src/utils/logger.ts");function W(o,f){for(var l=0;l<f.length;l++){var u=f[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function r(o,f,l){return f&&W(o.prototype,f),l&&W(o,l),o}function R(o,f){var l=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(l)return(l=l.call(o)).next.bind(l);if(Array.isArray(o)||(l=v(o))||f&&o&&typeof o.length=="number"){l&&(o=l);var u=0;return function(){return u>=o.length?{done:!0}:{done:!1,value:o[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(o,f){if(!o)return;if(typeof o=="string")return m(o,f);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return m(o,f)}function m(o,f){(f==null||f>o.length)&&(f=o.length);for(var l=0,u=new Array(f);l<f;l++)u[l]=o[l];return u}function p(){return p=Object.assign||function(o){for(var f=1;f<arguments.length;f++){var l=arguments[f];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])}return o},p.apply(this,arguments)}var h=function(){function o(l){var u=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(O){try{u.apply(O,{ot:j.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(x){z.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(O){try{var x=O.frag,S=u.hls.levels[x.level],D=u.getObjectType(x),L={d:x.duration*1e3,ot:D};(D===j.CMCDObjectType.VIDEO||D===j.CMCDObjectType.AUDIO||D==j.CMCDObjectType.MUXED)&&(L.br=S.bitrate/1e3,L.tb=u.getTopBandwidth(D),L.bl=u.getBufferLength(D)),u.apply(O,L)}catch(A){z.logger.warn("Could not generate segment CMCD data.",A)}},this.hls=l;var s=this.config=l.config,a=s.cmcd;a!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||o.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var f=o.prototype;return f.registerListeners=function(){var u=this.hls;u.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var u=this.hls;u.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(u,s){var a,O;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(O=s.tracks.video)===null||O===void 0?void 0:O.buffer},f.createData=function(){var u;return{v:j.CMCDVersion,sf:j.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(u,s){s===void 0&&(s={}),p(s,this.createData());var a=s.ot===j.CMCDObjectType.INIT||s.ot===j.CMCDObjectType.VIDEO||s.ot===j.CMCDObjectType.MUXED;if(this.starved&&a&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var O=o.toHeaders(s);if(!Object.keys(O).length)return;u.headers||(u.headers={}),p(u.headers,O)}else{var x=o.toQuery(s);if(!x)return;u.url=o.appendQueryToUri(u.url,x)}},f.getObjectType=function(u){var s=u.type;return s==="subtitle"?j.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?j.CMCDObjectType.INIT:s==="audio"?j.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(u){for(var s=0,a=u===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=R(a),x;!(x=O()).done;){var S=x.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},f.getBufferLength=function(u){var s=this.hls.media,a=u===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var O=U.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return O.len*1e3},f.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,a=u||this.config.loader;return function(){function O(S){this.loader=void 0,this.loader=new a(S)}var x=O.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(D,L,A){s(D),this.loader.load(D,L,A)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},f.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,a=u||this.config.loader;return function(){function O(S){this.loader=void 0,this.loader=new a(S)}var x=O.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(D,L,A){s(D),this.loader.load(D,L,A)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},o.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},o.serialize=function(u){for(var s=[],a=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},O=function(F){return Math.round(F)},x=function(F){return O(F/100)*100},S=function(F){return encodeURIComponent(F)},D={br:O,d:O,bl:x,dl:x,mtp:x,nor:S,rtp:x,tb:O},L=Object.keys(u||{}).sort(),A=R(L),C;!(C=A()).done;){var E=C.value,d=u[E];if(!a(d))continue;if(E==="v"&&d===1)continue;if(E=="pr"&&d===1)continue;var w=D[E];w&&(d=w(d));var y=typeof d,b=void 0;E==="ot"||E==="sf"||E==="st"?b=E+"="+d:y==="boolean"?b=E:y==="number"?b=E+"="+d:b=E+"="+JSON.stringify(d),s.push(b)}return s.join(",")},o.toHeaders=function(u){for(var s=Object.keys(u),a={},O=["Object","Request","Session","Status"],x=[{},{},{},{}],S={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},D=0,L=s;D<L.length;D++){var A=L[D],C=S[A]!=null?S[A]:1;x[C][A]=u[A]}for(var E=0;E<x.length;E++){var d=o.serialize(x[E]);d&&(a["CMCD-"+O[E]]=d)}return a},o.toQuery=function(u){return"CMCD="+encodeURIComponent(o.serialize(u))},o.appendQueryToUri=function(u,s){if(!s)return u;var a=u.includes("?")?"&":"?";return""+u+a+s},o}()},"./src/controller/eme-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/utils/logger.ts"),z=P("./src/utils/mediakeys-helper.ts");function W(h,o){for(var f=0;f<o.length;f++){var l=o[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function r(h,o,f){return o&&W(h.prototype,o),f&&W(h,f),h}var R=3,v=function(o,f,l){var u={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:l.audioRobustness||""})}),f.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:l.videoRobustness||""})}),[u]},m=function(o,f,l,u){switch(o){case z.KeySystems.WIDEVINE:return v(f,l,u);default:throw new Error("Unknown key-system: "+o)}},p=function(){function h(f){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=f,this._config=f.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var o=h.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._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)},o._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)},o.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+'"')},o._attemptKeySystemAccess=function(l,u,s){var a=this,O=m(l,u,s,this._drmSystemOptions);U.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(l,O);this.mediaKeysPromise=x.then(function(S){return a._onMediaKeySystemAccessObtained(l,S)}),x.catch(function(S){U.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},o._onMediaKeySystemAccessObtained=function(l,u){var s=this;U.logger.log('Access for key-system "'+l+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:l};this._mediaKeysList.push(a);var O=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(x){return a.mediaKeys=x,U.logger.log('Media-keys created for key-system "'+l+'"'),s._onMediaKeysCreated(),x});return O.catch(function(x){U.logger.error("Failed to create media-keys:",x)}),O},o._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),l._onNewMediaKeySession(u.mediaKeysSession))})},o._onNewMediaKeySession=function(l){var u=this;U.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(s){u._onKeySessionMessage(l,s.message)},!1)},o._onKeySessionMessage=function(l,u){U.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){U.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),l.update(s)})},o.onMediaEncrypted=function(l){var u=this;if(U.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){U.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 s=function(O){if(!u._media)return;u._attemptSetMediaKeys(O),u._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(s).catch(s)},o._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){U.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}U.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(l,u){var s=this,a=this._mediaKeysList[0];if(!a){U.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(a.mediaKeysSessionInitialized){U.logger.warn("Key-Session already initialized but requested again");return}var O=a.mediaKeysSession;if(!O){U.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(!u){U.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}U.logger.log('Generating key-session request for "'+l+'" init data type'),a.mediaKeysSessionInitialized=!0,O.generateRequest(l,u).then(function(){U.logger.debug("Key-session generation succeeded")}).catch(function(x){U.logger.error("Error generating key-session request:",x),s.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(l,u,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,l,u,s);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,a,l),O=void 0}catch(x){U.logger.error(x)}try{a.readyState||a.open("POST",l,!0),O&&O.call(this.hls,a,l)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return a},o._onLicenseRequestReadyStageChange=function(l,u,s,a){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,U.logger.log("License request succeeded");var O=l.response,x=this._licenseResponseCallback;if(x)try{O=x.call(this.hls,l,u)}catch(D){U.logger.error(D)}a(O)}else{if(U.logger.error("License Request XHR failed ("+u+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=R-this._requestLicenseFailureCount+1;U.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,a)}break}},o._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case z.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,u){U.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){U.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 a=this.getLicenseServerUrl(s.mediaKeySystemDomain),O=this._createLicenseXhr(a,l,u);U.logger.log("Sending license request to URL: "+a);var x=this._generateLicenseRequestChallenge(s,l);O.send(x)}catch(S){U.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(l,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var l=this._media,u=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(l,u){if(!this._emeEnabled)return;var s=u.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),a=u.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(z.KeySystems.WIDEVINE,s,a)},r(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();J.default=p},"./src/controller/fps-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=function(){function z(r){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=r,this.registerListeners()}var W=z.prototype;return W.setStreamController=function(R){this.streamController=R},W.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(R,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(R,v,m){var p=performance.now();if(v){if(this.lastTime){var h=p-this.lastTime,o=m-this.lastDroppedFrames,f=v-this.lastDecodedFrames,l=1e3*o/h,u=this.hls;if(u.trigger(Y.Events.FPS_DROP,{currentDropped:o,currentDecoded:f,totalDroppedFrames:m}),l>0&&o>u.config.fpsDroppedMonitoringThreshold*f){var s=u.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=s)&&(s=s-1,u.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:u.currentLevel}),u.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},W.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var v=R.getVideoPlaybackQuality();this.checkFPS(R,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},z}();J.default=U},"./src/controller/fragment-finders.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"findFragmentByPDT",function(){return U}),P.d(J,"findFragmentByPTS",function(){return z}),P.d(J,"fragmentWithinToleranceTest",function(){return W}),P.d(J,"pdtWithinToleranceTest",function(){return r}),P.d(J,"findFragWithCC",function(){return R});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function U(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(Y.isFiniteNumber)(m))return null;var h=v[0].programDateTime;if(m<(h||0))return null;var o=v[v.length-1].endProgramDateTime;if(m>=(o||0))return null;p=p||0;for(var f=0;f<v.length;++f){var l=v[f];if(r(m,p,l))return l}return null}function z(v,m,p,h){p===void 0&&(p=0),h===void 0&&(h=0);var o=null;if(v?o=m[v.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(o=m[0]),o&&W(p,h,o)===0)return o;var f=j.default.search(m,W.bind(null,p,h));return f||o}function W(v,m,p){v===void 0&&(v=0),m===void 0&&(m=0);var h=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-h<=v?1:p.start-h>v&&p.start?-1:0}function r(v,m,p){var h=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,o=p.endProgramDateTime||0;return o-h>v}function R(v,m){return j.default.search(v,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"FragmentState",function(){return U}),P.d(J,"FragmentTracker",function(){return z});var Y=P("./src/events.ts"),j=P("./src/types/loader.ts"),U;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(U||(U={}));var z=function(){function R(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var v=R.prototype;return v._registerListeners=function(){var p=this.hls;p.on(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,h){if(h===j.PlaylistLevelType.MAIN){var o=this.activeFragment,f=this.activeParts;if(!o)return null;if(f)for(var l=f.length;l--;){var u=f[l],s=u?u.end:o.appendedPTS;if(u.start<=p&&s!==void 0&&p<=s)return l>9&&(this.activeParts=f.slice(l-9)),u}else if(o.start<=p&&o.appendedPTS!==void 0&&p<=o.appendedPTS)return o}return this.getBufferedFrag(p,h)},v.getBufferedFrag=function(p,h){for(var o=this.fragments,f=Object.keys(o),l=f.length;l--;){var u=o[f[l]];if((u==null?void 0:u.body.type)===h&&u.buffered){var s=u.body;if(s.start<=p&&p<=s.end)return s}}return null},v.detectEvictedFragments=function(p,h,o){var f=this;Object.keys(this.fragments).forEach(function(l){var u=f.fragments[l];if(!u)return;if(!u.buffered){u.body.type===o&&f.removeFragment(u.body);return}var s=u.range[p];if(!s)return;s.time.some(function(a){var O=!f.isTimeBuffered(a.startPTS,a.endPTS,h);return O&&f.removeFragment(u.body),O})})},v.detectPartialFragments=function(p){var h=this,o=this.timeRanges,f=p.frag,l=p.part;if(!o||f.sn==="initSegment")return;var u=r(f),s=this.fragments[u];if(!s)return;Object.keys(o).forEach(function(a){var O=f.elementaryStreams[a];if(!O)return;var x=o[a],S=l!==null||O.partial===!0;s.range[a]=h.getBufferedTimes(f,l,S,x)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},v.fragBuffered=function(p){var h=r(p),o=this.fragments[h];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},v.getBufferedTimes=function(p,h,o,f){for(var l={time:[],partial:o},u=h?h.start:p.start,s=h?h.end:p.end,a=p.minEndPTS||s,O=p.maxStartPTS||u,x=0;x<f.length;x++){var S=f.start(x)-this.bufferPadding,D=f.end(x)+this.bufferPadding;if(O>=S&&a<=D){l.time.push({startPTS:Math.max(u,f.start(x)),endPTS:Math.min(s,f.end(x))});break}else if(u<D&&s>S)l.partial=!0,l.time.push({startPTS:Math.max(u,f.start(x)),endPTS:Math.min(s,f.end(x))});else if(s<=S)break}return l},v.getPartialFragment=function(p){var h=null,o,f,l,u=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(O){var x=a[O];if(!x)return;W(x)&&(f=x.body.start-s,l=x.body.end+s,p>=f&&p<=l&&(o=Math.min(p-f,l-p),u<=o&&(h=x.body,u=o)))}),h},v.getState=function(p){var h=r(p),o=this.fragments[h];return o?o.buffered?W(o)?U.PARTIAL:U.OK:o.backtrack?U.BACKTRACKED:U.APPENDING:U.NOT_LOADED},v.backtrack=function(p,h){var o=r(p),f=this.fragments[o];if(!f||f.backtrack)return null;var l=f.backtrack=h||f.loaded;return f.loaded=null,l},v.getBacktrackData=function(p){var h=r(p),o=this.fragments[h];if(o){var f,l=o.backtrack;if(l!=null&&(f=l.payload)!==null&&f!==void 0&&f.byteLength)return l;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,h,o){for(var f,l,u=0;u<o.length;u++){if(f=o.start(u)-this.bufferPadding,l=o.end(u)+this.bufferPadding,p>=f&&h<=l)return!0;if(h<=f)return!1}return!1},v.onFragLoaded=function(p,h){var o=h.frag,f=h.part;if(o.sn==="initSegment"||o.bitrateTest||f)return;var l=r(o);this.fragments[l]={body:o,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,h){var o=this,f=h.frag,l=h.part,u=h.timeRanges;if(f.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=f,l){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(l)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(a){var O=u[a];if(o.detectEvictedFragments(a,O),!l)for(var x=0;x<O.length;x++)f.appendedPTS=Math.max(O.end(x),f.appendedPTS||0)})},v.onFragBuffered=function(p,h){this.detectPartialFragments(h)},v.hasFragment=function(p){var h=r(p);return!!this.fragments[h]},v.removeFragmentsInRange=function(p,h,o){var f=this;Object.keys(this.fragments).forEach(function(l){var u=f.fragments[l];if(!u)return;if(u.buffered){var s=u.body;s.type===o&&s.start<h&&s.end>p&&f.removeFragment(s)}})},v.removeFragment=function(p){var h=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[h]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function W(R){var v,m;return R.buffered&&(((v=R.range.video)===null||v===void 0?void 0:v.partial)||((m=R.range.audio)===null||m===void 0?void 0:m.partial))}function r(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"STALL_MINIMUM_DURATION_MS",function(){return W}),P.d(J,"MAX_START_GAP_JUMP",function(){return r}),P.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),P.d(J,"SKIP_BUFFER_RANGE_START",function(){return v}),P.d(J,"default",function(){return m});var Y=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),U=P("./src/events.ts"),z=P("./src/utils/logger.ts"),W=250,r=2,R=.1,v=.05,m=function(){function p(o,f,l,u){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=o,this.media=f,this.fragmentTracker=l,this.hls=u}var h=p.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(f){var l=this.config,u=this.media,s=this.stalled,a=u.currentTime,O=u.seeking,x=this.seeking&&!O,S=!this.seeking&&O;if(this.seeking=O,a!==f){if(this.moved=!0,s!==null){if(this.stallReported){var D=self.performance.now()-s;z.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||x)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!Y.BufferHelper.getBuffered(u).length)return;var L=Y.BufferHelper.bufferInfo(u,a,0),A=L.len>0,C=L.nextStart||0;if(!A&&!C)return;if(O){var E=L.len>r,d=!C||C-a>r&&!this.fragmentTracker.getPartialFragment(a);if(E||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,y=Math.max(C,L.start||0)-a,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=b==null||((w=b.details)===null||w===void 0)?void 0:w.live,F=B?b.details.targetduration*2:r;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var _=self.performance.now();if(s===null){this.stalled=_;return}var M=_-s;!O&&M>=W&&this._reportStall(L.len);var I=Y.BufferHelper.bufferInfo(u,a,l.maxBufferHole);this._tryFixBufferStall(I,M)},h._tryFixBufferStall=function(f,l){var u=this.config,s=this.fragmentTracker,a=this.media,O=a.currentTime,x=s.getPartialFragment(O);if(x){var S=this._trySkipBufferHole(x);if(S)return}f.len>u.maxBufferHole&&l>u.highBufferWatchdogPeriod*1e3&&(z.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(f){var l=this.hls,u=this.media,s=this.stallReported;s||(this.stallReported=!0,z.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+f+")"),l.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},h._trySkipBufferHole=function(f){for(var l=this.config,u=this.hls,s=this.media,a=s.currentTime,O=0,x=Y.BufferHelper.getBuffered(s),S=0;S<x.length;S++){var D=x.start(S);if(a+l.maxBufferHole>=O&&a<D){var L=Math.max(D+v,s.currentTime+R);return z.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+L),this.moved=!0,this.stalled=null,s.currentTime=L,f&&u.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+L,frag:f}),L}O=x.end(S)}return 0},h._tryNudgeBuffer=function(){var f=this.config,l=this.hls,u=this.media,s=u.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<f.nudgeMaxRetry){var O=s+a*f.nudgeOffset;z.logger.warn("Nudging 'currentTime' from "+s+" to "+O),u.currentTime=O,l.trigger(U.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 @"+s+" after "+f.nudgeMaxRetry+" nudges"),l.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),U=P("./src/demux/id3.ts"),z=.25,W=function(){function r(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var R=r.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var m=this.hls;m.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var m=this.hls;m.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(m,p){this.media=p.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},R.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var h=m[p];if(h.kind==="metadata"&&h.label==="id3")return Object(j.sendAddTrackEvent)(h,this.media),h}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(m,p){if(!this.media)return;var h=p.frag,o=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<o.length;l++){var u=U.getID3Frames(o[l].data);if(u){var s=o[l].pts,a=l<o.length-1?o[l+1].pts:h.end,O=a-s;O<=0&&(a=s+z);for(var x=0;x<u.length;x++){var S=u[x];if(!U.isTimeStampFrame(S)){var D=new f(s,a,"");D.value=S,this.id3Track.addCue(D)}}}}},R.onBufferFlushing=function(m,p){var h=p.startOffset,o=p.endOffset,f=p.type;if(!f||f==="audio"){var l=this.id3Track;l&&Object(j.removeCuesInRange)(l,h,o)}},r}();J.default=W},"./src/controller/latency-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var Y=P("./src/errors.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts");function z(R,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function W(R,v,m){return v&&z(R.prototype,v),m&&z(R,m),R}var r=function(){function R(m){var p=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 p.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var v=R.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.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)},v.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)},v.onMediaAttached=function(p,h){this.media=h.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(p,h){var o=h.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,h){if(h.details!==Y.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,U.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,h=this.levelDetails;if(!p||!h)return;this.currentTime=p.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var f=this.config,l=f.lowLatencyMode,u=f.maxLiveSyncPlaybackRate;if(!l||u===1)return;var s=this.targetLatency;if(s===null)return;var a=o-s,O=Math.min(this.maxLatency,s+h.targetduration),x=a<O;if(h.live&&x&&a>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),D=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;p.playbackRate=Math.min(S,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},W(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,h=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:h?p.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var h=p.holdBack,o=p.partHoldBack,f=p.targetduration,l=this.config,u=l.liveSyncDuration,s=l.liveSyncDurationCount,a=l.lowLatencyMode,O=this.hls.userConfig,x=a&&o||h;(O.liveSyncDuration||O.liveSyncDurationCount||x===0)&&(x=u!==void 0?u:s*f);var S=f,D=1;return x+Math.min(this.stallCount*D,S)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),h=this.targetLatency,o=this.levelDetails;if(p===null||h===null||o===null)return null;var f=o.edge,l=p-h-this.edgeStalled,u=f-o.totalduration,s=f-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(u,l),s)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var h=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-h,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,h=this.levelDetails;if(!p||!h)return 0;var o=p.buffered.length;return o?p.buffered.end(o-1):h.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return l});var Y=P("./src/types/level.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),z=P("./src/utils/codecs.ts"),W=P("./src/controller/level-helper.ts"),r=P("./src/controller/base-playlist-controller.ts"),R=P("./src/types/loader.ts");function v(){return v=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var O in a)Object.prototype.hasOwnProperty.call(a,O)&&(u[O]=a[O])}return u},v.apply(this,arguments)}function m(u,s){for(var a=0;a<s.length;a++){var O=s[a];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(u,O.key,O)}}function p(u,s,a){return s&&m(u.prototype,s),a&&m(u,a),u}function h(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,o(u,s)}function o(u,s){return o=Object.setPrototypeOf||function(O,x){return O.__proto__=x,O},o(u,s)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(u){h(s,u);function s(O){var x;return x=u.call(this,O,"[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 a=s.prototype;return a._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)},a._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)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},a.startLoad=function(){var x=this._levels;x.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},a.onManifestLoaded=function(x,S){var D=[],L=[],A=[],C,E={},d,w=!1,y=!1,b=!1;if(S.levels.forEach(function(M){var I=M.attrs;w=w||!!(M.width&&M.height),y=y||!!M.videoCodec,b=b||!!M.audioCodec,f&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var g=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;d=E[g],d?d.url.push(M.url):(d=new Y.Level(M),E[g]=d,D.push(d)),I&&(I.AUDIO&&Object(W.addGroupId)(d,"audio",I.AUDIO),I.SUBTITLES&&Object(W.addGroupId)(d,"text",I.SUBTITLES))}),(w||y)&&b&&(D=D.filter(function(M){var I=M.videoCodec,g=M.width,H=M.height;return!!I||!!(g&&H)})),D=D.filter(function(M){var I=M.audioCodec,g=M.videoCodec;return(!I||Object(z.isCodecSupportedInMp4)(I,"audio"))&&(!g||Object(z.isCodecSupportedInMp4)(g,"video"))}),S.audioTracks&&(L=S.audioTracks.filter(function(M){return!M.audioCodec||Object(z.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(L)),S.subtitles&&(A=S.subtitles,Object(W.assignTrackIdsByGroup)(A)),D.length>0){C=D[0].bitrate,D.sort(function(M,I){return M.bitrate-I.bitrate}),this._levels=D;for(var B=0;B<D.length;B++)if(D[B].bitrate===C){this._firstLevel=B,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+C);break}var F=b&&!y,_={levels:D,audioTracks:L,subtitleTracks:A,firstLevel:this._firstLevel,stats:S.stats,audio:b,video:y,altAudio:!F&&L.some(function(M){return!!M.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,_),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(x,S){if(u.prototype.onError.call(this,x,S),S.fatal)return;var D=S.context,L=this._levels[this.currentLevelIndex];if(D&&(D.type===R.PlaylistContextType.AUDIO_TRACK&&L.audioGroupIds&&D.groupId===L.audioGroupIds[L.urlId]||D.type===R.PlaylistContextType.SUBTITLE_TRACK&&L.textGroupIds&&D.groupId===L.textGroupIds[L.urlId])){this.redundantFailover(this.currentLevelIndex);return}var A=!1,C=!0,E;switch(S.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:case U.ErrorDetails.KEY_LOAD_ERROR:case U.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var d=this._levels[S.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(E=S.frag.level)):E=S.frag.level}break;case U.ErrorDetails.LEVEL_LOAD_ERROR:case U.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(C=!1),E=D.level),A=!0;break;case U.ErrorDetails.REMUX_ALLOC_ERROR:E=S.level,A=!0;break}E!==void 0&&this.recoverLevel(S,E,A,C)},a.recoverLevel=function(x,S,D,L){var A=x.details,C=this._levels[S];if(C.loadError++,D){var E=this.retryLoadingOrFail(x);if(E)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(L){var d=C.url.length;if(d>1&&C.loadError<d)x.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var w=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==w&&this._levels[w].loadError===0&&(this.warn(A+": switch to "+w),x.levelRetry=!0,this.hls.nextAutoLevel=w)}}},a.redundantFailover=function(x){var S=this._levels[x],D=S.url.length;if(D>1){var L=(S.urlId+1)%D;this.warn("Switching to redundant URL-id "+L),this._levels.forEach(function(A){A.urlId=L}),this.level=x}},a.onFragLoaded=function(x,S){var D=S.frag;if(D!==void 0&&D.type===R.PlaylistLevelType.MAIN){var L=this._levels[D.level];L!==void 0&&(L.fragmentError=0,L.loadError=0)}},a.onLevelLoaded=function(x,S){var D,L=S.level,A=S.details,C=this._levels[L];if(!C){var E;this.warn("Invalid level index "+L),(E=S.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(A.deltaUpdateFailed=!0);return}L===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(L,S,C.details)):(D=S.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(A.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(x,S){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var L=-1,A=this.hls.audioTracks[S.id].groupId,C=0;C<D.audioGroupIds.length;C++)if(D.audioGroupIds[C]===A){L=C;break}L!==D.urlId&&(D.urlId=L,this.startLoad())}},a.loadPlaylist=function(x){var S=this.currentLevelIndex,D=this._levels[S];if(this.canLoad&&D&&D.url.length>0){var L=D.urlId,A=D.url[L];if(x)try{A=x.addDirectives(A)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+S+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+L+" "+A),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:A,level:S,id:L,deliveryDirectives:x||null})}},a.removeLevel=function(x,S){var D=function(C,E){return E!==S},L=this._levels.filter(function(A,C){return C!==x?!0:A.url.length>1&&S!==void 0?(A.url=A.url.filter(D),A.audioGroupIds&&(A.audioGroupIds=A.audioGroupIds.filter(D)),A.textGroupIds&&(A.textGroupIds=A.textGroupIds.filter(D)),A.urlId=0,!0):!1}).map(function(A,C){var E=A.details;return E!=null&&E.fragments&&E.fragments.forEach(function(d){d.level=C}),A});this._levels=L,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:L})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var S,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===x&&(S=D[x])!==null&&S!==void 0&&S.details)return;if(x<0||x>=D.length){var L=x<0;if(this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.OTHER_ERROR,details:U.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:L,reason:"invalid level idx"}),L)return;x=Math.min(x,D.length-1)}this.clearTimer();var A=this.currentLevelIndex,C=D[A],E=D[x];this.log("switching to level "+x+" from "+A),this.currentLevelIndex=x;var d=v({},E,{level:x,maxBitrate:E.maxBitrate,uri:E.uri,urlId:E.urlId});delete d._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,d);var w=E.details;if(!w||w.live){var y=this.switchParams(E.uri,C==null?void 0:C.details);this.loadPlaylist(y)}}},{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)}}]),s}(r.default)},"./src/controller/level-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"addGroupId",function(){return U}),P.d(J,"assignTrackIdsByGroup",function(){return z}),P.d(J,"updatePTS",function(){return W}),P.d(J,"updateFragPTSDTS",function(){return R}),P.d(J,"mergeDetails",function(){return v}),P.d(J,"mapPartIntersection",function(){return m}),P.d(J,"mapFragmentIntersection",function(){return p}),P.d(J,"adjustSliding",function(){return h}),P.d(J,"addSliding",function(){return o}),P.d(J,"computeReloadInterval",function(){return f}),P.d(J,"getFragmentWithSN",function(){return l}),P.d(J,"getPartWith",function(){return u});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function U(s,a,O){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(O);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(O);break}}function z(s){var a={};s.forEach(function(O){var x=O.groupId||"";O.id=a[x]=a[x]||0,a[x]++})}function W(s,a,O){var x=s[a],S=s[O];r(x,S)}function r(s,a){var O=a.startPTS;if(Object(Y.isFiniteNumber)(O)){var x=0,S;a.sn>s.sn?(x=O-s.start,S=s):(x=s.start-O,S=a),S.duration!==x&&(S.duration=x)}else if(a.sn>s.sn){var D=s.cc===a.cc;D&&s.minEndPTS?a.start=s.start+(s.minEndPTS-s.start):a.start=s.start+s.duration}else a.start=Math.max(s.start-a.duration,0)}function R(s,a,O,x,S,D){var L=x-O;L<=0&&(j.logger.warn("Fragment should have a positive duration",a),x=O+a.duration,D=S+a.duration);var A=O,C=x,E=a.startPTS,d=a.endPTS;if(Object(Y.isFiniteNumber)(E)){var w=Math.abs(E-O);Object(Y.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(w,a.deltaPTS):a.deltaPTS=w,A=Math.max(O,E),O=Math.min(O,E),S=Math.min(S,a.startDTS),C=Math.min(x,d),x=Math.max(x,d),D=Math.max(D,a.endDTS)}a.duration=x-O;var y=O-a.start;a.appendedPTS=x,a.start=a.startPTS=O,a.maxStartPTS=A,a.startDTS=S,a.endPTS=x,a.minEndPTS=C,a.endDTS=D;var b=a.sn;if(!s||b<s.startSN||b>s.endSN)return 0;var B,F=b-s.startSN,_=s.fragments;for(_[F]=a,B=F;B>0;B--)r(_[B],_[B-1]);for(B=F;B<_.length-1;B++)r(_[B],_[B+1]);return s.fragmentHint&&r(_[_.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function v(s,a){for(var O=null,x=s.fragments,S=x.length-1;S>=0;S--){var D=x[S].initSegment;if(D){O=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var L=0,A;if(p(s,a,function(B,F){B.relurl&&(L=B.cc-F.cc),Object(Y.isFiniteNumber)(B.startPTS)&&Object(Y.isFiniteNumber)(B.endPTS)&&(F.start=F.startPTS=B.startPTS,F.startDTS=B.startDTS,F.appendedPTS=B.appendedPTS,F.maxStartPTS=B.maxStartPTS,F.endPTS=B.endPTS,F.endDTS=B.endDTS,F.minEndPTS=B.minEndPTS,F.duration=B.endPTS-B.startPTS,F.duration&&(A=F),a.PTSKnown=a.alignedSliding=!0),F.elementaryStreams=B.elementaryStreams,F.loader=B.loader,F.stats=B.stats,F.urlId=B.urlId,B.initSegment&&(F.initSegment=B.initSegment,O=B.initSegment)}),O){var C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;C.forEach(function(B){var F;(!B.initSegment||B.initSegment.relurl===((F=O)===null||F===void 0?void 0:F.relurl))&&(B.initSegment=O)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(B){return!B}),a.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var E=a.skippedSegments;E--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var d=a.fragments;if(L){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w<d.length;w++)d[w].cc+=L}a.skippedSegments&&(a.startCC=a.fragments[0].cc),m(s.partList,a.partList,function(B,F){F.elementaryStreams=B.elementaryStreams,F.stats=B.stats}),A?R(a,A,A.startPTS,A.endPTS,A.startDTS,A.endDTS):h(s,a),d.length&&(a.totalduration=a.edge-d[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var y=a.advancedDateTime;if(a.advanced&&y){var b=a.edge;a.driftStart||(a.driftStartTime=y,a.driftStart=b),a.driftEndTime=y,a.driftEnd=b}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function m(s,a,O){if(s&&a)for(var x=0,S=0,D=s.length;S<=D;S++){var L=s[S],A=a[S+x];L&&A&&L.index===A.index&&L.fragment.sn===A.fragment.sn?O(L,A):x--}}function p(s,a,O){for(var x=a.skippedSegments,S=Math.max(s.startSN,a.startSN)-a.startSN,D=(s.fragmentHint?1:0)+(x?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,L=a.startSN-s.startSN,A=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,C=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,E=S;E<=D;E++){var d=C[L+E],w=A[E];x&&!w&&E<x&&(w=a.fragments[E]=d),d&&w&&O(d,w)}}function h(s,a){var O=a.startSN+a.skippedSegments-s.startSN,x=s.fragments;if(O<0||O>=x.length)return;o(a,x[O].start)}function o(s,a){if(a){for(var O=s.fragments,x=s.skippedSegments;x<O.length;x++)O[x].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function f(s,a){var O=1e3*s.levelTargetDuration,x=O/2,S=s.age,D=S>0&&S<O*3,L=a.loading.end-a.loading.start,A,C=s.availabilityDelay;if(s.updated===!1)if(D){var E=333*s.misses;A=Math.max(Math.min(x,L*2),E),s.availabilityDelay=(s.availabilityDelay||0)+A}else A=x;else D?(C=Math.min(C||O/2,S),s.availabilityDelay=C,A=C+O-S):A=O-L;return Math.round(A)}function l(s,a,O){if(!s||!s.details)return null;var x=s.details,S=x.fragments[a-x.startSN];return S||(S=x.fragmentHint,S&&S.sn===a?S:a<x.startSN&&O&&O.sn===a?O:null)}function u(s,a,O){if(!s||!s.details)return null;var x=s.details.partList;if(x)for(var S=x.length;S--;){var D=x[S];if(D.index===O&&D.fragment.sn===a)return D}return null}},"./src/controller/stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return x});var Y=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),U=P("./src/is-supported.ts"),z=P("./src/events.ts"),W=P("./src/utils/buffer-helper.ts"),r=P("./src/controller/fragment-tracker.ts"),R=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/transmuxer-interface.ts"),p=P("./src/types/transmuxer.ts"),h=P("./src/controller/gap-controller.ts"),o=P("./src/errors.ts"),f=P("./src/utils/logger.ts");function l(S,D){for(var L=0;L<D.length;L++){var A=D[L];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}function u(S,D,L){return D&&l(S.prototype,D),L&&l(S,L),S}function s(S,D){S.prototype=Object.create(D.prototype),S.prototype.constructor=S,a(S,D)}function a(S,D){return a=Object.setPrototypeOf||function(A,C){return A.__proto__=C,A},a(S,D)}var O=100,x=function(S){s(D,S);function D(A,C){var E;return E=S.call(this,A,C,"[stream-controller]")||this,E.audioCodecSwap=!1,E.gapController=null,E.level=-1,E._forceStartLoad=!1,E.altAudio=!1,E.audioOnly=!1,E.fragPlaying=null,E.onvplaying=null,E.onvseeked=null,E.fragLastKbps=0,E.stalled=!1,E.couldBacktrack=!1,E.audioCodecSwitch=!1,E.videoBuffer=null,E._registerListeners(),E}var L=D.prototype;return L._registerListeners=function(){var C=this.hls;C.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),C.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.on(z.Events.ERROR,this.onError,this),C.on(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L._unregisterListeners=function(){var C=this.hls;C.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.off(z.Events.ERROR,this.onError,this),C.off(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},L.startLoad=function(C){if(this.levels){var E=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var w=d.startLevel;w===-1&&(d.config.testBandwidth?(w=0,this.bitrateTest=!0):w=d.nextAutoLevel),this.level=d.nextLoadLevel=w,this.loadedmetadata=!1}E>0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+E.toFixed(3)),C=E),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},L.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},L.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var C,E=this.levels,d=this.level,w=E==null||((C=E[d])===null||C===void 0)?void 0:C.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),B=this.retryDate;(!B||b>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},L.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},L.doTickIdle=function(){var C,E,d=this.hls,w=this.levelLastLoaded,y=this.levels,b=this.media,B=d.config,F=d.nextLoadLevel;if(w===null||!b&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var _=y[F];this.level=d.nextLoadLevel=F;var M=_.details;if(!M||this.state===j.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(_.maxBitrate);if(g>=H)return;if(this._streamEnded(I,M)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(z.Events.BUFFER_EOS,$),this.state=j.State.ENDED;return}var ae=I.end,ue=this.getNextFragment(ae,M);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var Le=ue.sn-M.startSN;Le>1&&(ue=M.fragments[Le-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===r.FragmentState.OK&&this.nextLoadPosition>ae){var ve=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ve,R.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,M)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((C=ue.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((E=ue.decryptdata)!==null&&E!==void 0&&E.key)?this.loadKey(ue,M):this.loadFragment(ue,M,ae)},L.loadFragment=function(C,E,d){var w,y=this.fragmentTracker.getState(C);if(this.fragCurrent=C,y===r.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(C);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=r.FragmentState.NOT_LOADED}y===r.FragmentState.NOT_LOADED||y===r.FragmentState.PARTIAL?C.sn==="initSegment"?this._loadInitSegment(C):this.bitrateTest?(C.bitrateTest=!0,this.log("Fragment "+C.sn+" of level "+C.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(C)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,C,E,d)):y===r.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((w=this.media)===null||w===void 0?void 0:w.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},L.getAppendedFrag=function(C){var E=this.fragmentTracker.getAppendedFrag(C,R.PlaylistLevelType.MAIN);return E&&"fragment"in E?E.fragment:E},L.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,R.PlaylistLevelType.MAIN)},L.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},L.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},L.nextLevelSwitch=function(){var C=this.levels,E=this.media;if(E!=null&&E.readyState){var d,w=this.getAppendedFrag(E.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!E.paused&&C){var y=this.hls.nextLoadLevel,b=C[y],B=this.fragLastKbps;B&&this.fragCurrent?d=this.fragCurrent.duration*b.maxBitrate/(1e3*B)+1:d=0}else d=0;var F=this.getBufferedFrag(E.currentTime+d);if(F){var _=this.followingBufferedFrag(F);if(_){this.abortCurrentFrag();var M=_.maxStartPTS?_.maxStartPTS:_.start,I=_.duration,g=Math.max(F.end,M+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(g,Number.POSITIVE_INFINITY)}}}},L.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},L.flushMainBuffer=function(C,E){S.prototype.flushMainBuffer.call(this,C,E,this.altAudio?"video":null)},L.onMediaAttached=function(C,E){S.prototype.onMediaAttached.call(this,C,E);var d=E.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,d,this.fragmentTracker,this.hls)},L.onMediaDetaching=function(){var C=this.media;C&&(C.removeEventListener("playing",this.onvplaying),C.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},L.onMediaPlaying=function(){this.tick()},L.onMediaSeeked=function(){var C=this.media,E=C?C.currentTime:null;Object(Y.isFiniteNumber)(E)&&this.log("Media seeked to "+E.toFixed(3)),this.tick()},L.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},L.onManifestParsed=function(C,E){var d=!1,w=!1,y;E.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(d=!0),y.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=d&&w&&!Object(U.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=E.levels,this.startFragRequested=!1},L.onLevelLoading=function(C,E){var d=this.levels;if(!d||this.state!==j.State.IDLE)return;var w=d[E.level];(!w.details||w.details.live&&this.levelLastLoaded!==E.level||this.waitForCdnTuneIn(w.details))&&(this.state=j.State.WAITING_LEVEL)},L.onLevelLoaded=function(C,E){var d,w=this.levels,y=E.level,b=E.details,B=b.totalduration;if(!w){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+B);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==E.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var _=w[y],M=0;if(b.live||(d=_.details)!==null&&d!==void 0&&d.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;M=this.alignPlaylists(b,_.details)}if(_.details=b,this.levelLastLoaded=y,this.hls.trigger(z.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=j.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,M),this.tick()},L._handleFragmentLoadProgress=function(C){var E,d=C.frag,w=C.part,y=C.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var B=b[d.level],F=B.details;if(!F){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var _=B.videoCodec,M=F.PTSKnown||!F.live,I=(E=d.initSegment)===null||E===void 0?void 0:E.data,g=this._getAudioCodec(B),H=this.transmuxer=this.transmuxer||new m.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=w?w.index:-1,ae=$!==-1,ue=new p.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,y.byteLength,$,ae),Le=this.initPTS[d.cc];H.push(y,I,g,_,d,w,F.totalduration,M,ue,Le)},L.onAudioTrackSwitching=function(C,E){var d=this.altAudio,w=!!E.url,y=E.id;if(!w){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var B=this.hls;d&&B.trigger(z.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(z.Events.AUDIO_TRACK_SWITCHED,{id:y})}},L.onAudioTrackSwitched=function(C,E){var d=E.id,w=!!this.hls.audioTracks[d].url;if(w){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=w,this.tick()},L.onBufferCreated=function(C,E){var d=E.tracks,w,y,b=!1;for(var B in d){var F=d[B];if(F.id==="main"){if(y=B,w=F,B==="video"){var _=d[B];_&&(this.videoBuffer=_.buffer)}}else b=!0}b&&w?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=w.buffer):this.mediaBuffer=this.media},L.onFragBuffered=function(C,E){var d=E.frag,w=E.part;if(d&&d.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(w?" p: "+w.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var y=w?w.stats:d.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,w)},L.onError=function(C,E){switch(E.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.MAIN,E);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(E.fatal?(this.warn(""+E.details),this.state=j.State.ERROR):!E.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(E.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var d=!0,w=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);w&&w.len>.5&&(d=!this.reduceMaxBufferLength(w.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},L.checkBuffer=function(){var C=this.media,E=this.gapController;if(!C||!E||!C.readyState)return;var d=W.BufferHelper.getBuffered(C);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):E.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},L.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},L.onBufferFlushed=function(C,E){var d=E.type;if(d!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(d===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,d,R.PlaylistLevelType.MAIN)}},L.onLevelsUpdated=function(C,E){this.levels=E.levels},L.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},L.seekToStartPos=function(){var C=this.media,E=C.currentTime,d=this.startPosition;if(d>=0&&E<d){if(C.seeking){f.logger.log("could not seek to "+d+", already seeking at "+E);return}var w=W.BufferHelper.getBuffered(C),y=w.length?w.start(0):0,b=y-d;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+b+" to match buffer start"),d+=b,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+E),C.currentTime=d}},L._getAudioCodec=function(C){var E=this.config.defaultAudioCodec||C.audioCodec;return this.audioCodecSwap&&E&&(this.log("Swapping audio codec"),E.indexOf("mp4a.40.5")!==-1?E="mp4a.40.2":E="mp4a.40.5"),E},L._loadBitrateTestFrag=function(C){var E=this;this._doFragLoad(C).then(function(d){var w=E.hls;if(!d||w.nextLoadLevel||E.fragContextChanged(C))return;E.fragLoadError=0,E.state=j.State.IDLE,E.startFragRequested=!1,E.bitrateTest=!1;var y=C.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),w.trigger(z.Events.FRAG_LOADED,d)})},L._handleTransmuxComplete=function(C){var E,d="main",w=this.hls,y=C.remuxResult,b=C.chunkMeta,B=this.getCurrentContext(b);if(!B){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var F=B.frag,_=B.part,M=B.level,I=y.video,g=y.text,H=y.id3,$=y.initSegment,ae=this.altAudio?void 0:y.audio;if(this.fragContextChanged(F))return;if(this.state=j.State.PARSING,$){$.tracks&&(this._bufferInitSegment(M,$.tracks,F,b),w.trigger(z.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:d,tracks:$.tracks}));var ue=$.initPTS,Le=$.timescale;Object(Y.isFiniteNumber)(ue)&&(this.initPTS[F.cc]=ue,w.trigger(z.Events.INIT_PTS_FOUND,{frag:F,id:d,initPTS:ue,timescale:Le}))}if(I&&y.independent!==!1){if(M.details){var ve=I.startPTS,Te=I.endPTS,_e=I.startDTS,De=I.endDTS;if(_)_.elementaryStreams[I.type]={startPTS:ve,endPTS:Te,startDTS:_e,endDTS:De};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<ve){this.backtrack(F);return}F.setElementaryStreamInfo(I.type,F.start,Te,F.start,De,!0)}F.setElementaryStreamInfo(I.type,ve,Te,_e,De),this.bufferFragmentData(I,F,_,b)}}else if(y.independent===!1){this.backtrack(F);return}if(ae){var ce=ae.startPTS,ne=ae.endPTS,fe=ae.startDTS,le=ae.endDTS;_&&(_.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:ne,startDTS:fe,endDTS:le}),F.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ce,ne,fe,le),this.bufferFragmentData(ae,F,_,b)}if(H!=null&&(E=H.samples)!==null&&E!==void 0&&E.length){var ke={frag:F,id:d,samples:H.samples};w.trigger(z.Events.FRAG_PARSING_METADATA,ke)}if(g){var Fe={frag:F,id:d,samples:g.samples};w.trigger(z.Events.FRAG_PARSING_USERDATA,Fe)}},L._bufferInitSegment=function(C,E,d,w){var y=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!E.audio&&!E.video,this.altAudio&&!this.audioOnly&&delete E.audio;var b=E.audio,B=E.video,F=E.audiovideo;if(b){var _=C.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(_&&(_.indexOf("mp4a.40.5")!==-1?_="mp4a.40.2":_="mp4a.40.5"),b.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(_="mp4a.40.5")),M.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(_="mp4a.40.2",this.log("Android: force audio codec to "+_)),C.audioCodec&&C.audioCodec!==_&&this.log('Swapping manifest audio codec "'+C.audioCodec+'" for "'+_+'"'),b.levelCodec=_,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(_||"")+"/"+(C.audioCodec||"")+"/"+b.codec+"]")}B&&(B.levelCodec=C.videoCodec,B.id="main",this.log("Init video buffer, container:"+B.container+", codecs[level/parsed]=["+(C.videoCodec||"")+"/"+B.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(C.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(z.Events.BUFFER_CODECS,E),Object.keys(E).forEach(function(I){var g=E[I],H=g.initSegment;H!=null&&H.byteLength&&y.hls.trigger(z.Events.BUFFER_APPENDING,{type:I,data:H,frag:d,part:null,chunkMeta:w,parent:d.type})}),this.tick()},L.backtrack=function(C){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(C);var E=this.fragmentTracker.backtrack(C);this.fragPrevious=null,this.nextLoadPosition=C.start,E?this.resetFragmentLoading(C):this.state=j.State.BACKTRACKING},L.checkFragmentChanged=function(){var C=this.media,E=null;if(C&&C.readyState>1&&C.seeking===!1){var d=C.currentTime;if(W.BufferHelper.isBuffered(C,d)?E=this.getAppendedFrag(d):W.BufferHelper.isBuffered(C,d+.1)&&(E=this.getAppendedFrag(d+.1)),E){var w=this.fragPlaying,y=E.level;(!w||E.sn!==w.sn||w.level!==y||E.urlId!==w.urlId)&&(this.hls.trigger(z.Events.FRAG_CHANGED,{frag:E}),(!w||w.level!==y)&&this.hls.trigger(z.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=E)}}},u(D,[{key:"nextLevel",get:function(){var C=this.nextBufferedFrag;return C?C.level:-1}},{key:"currentLevel",get:function(){var C=this.media;if(C){var E=this.getAppendedFrag(C.currentTime);if(E)return E.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var E=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(E)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"SubtitleStreamController",function(){return s});var Y=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=P("./src/utils/buffer-helper.ts"),z=P("./src/controller/fragment-finders.ts"),W=P("./src/utils/discontinuities.ts"),r=P("./src/controller/level-helper.ts"),R=P("./src/controller/fragment-tracker.ts"),v=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function h(a,O){for(var x=0;x<O.length;x++){var S=O[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function o(a,O,x){return O&&h(a.prototype,O),x&&h(a,x),a}function f(a,O){a.prototype=Object.create(O.prototype),a.prototype.constructor=a,l(a,O)}function l(a,O){return l=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},l(a,O)}var u=500,s=function(a){f(O,a);function O(S,D){var L;return L=a.call(this,S,D,"[subtitle-stream-controller]")||this,L.levels=[],L.currentTrackId=-1,L.tracksBuffered=[],L.mainDetails=null,L._registerListeners(),L}var x=O.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var D=this.hls;D.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(Y.Events.ERROR,this.onError,this),D.on(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var D=this.hls;D.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(Y.Events.ERROR,this.onError,this),D.off(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(u),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(D,L){this.mainDetails=L.details},x.onSubtitleFragProcessed=function(D,L){var A=L.frag,C=L.success;if(this.fragPrevious=A,this.state=v.State.IDLE,!C)return;var E=this.tracksBuffered[this.currentTrackId];if(!E)return;for(var d,w=A.start,y=0;y<E.length;y++)if(w>=E[y].start&&w<=E[y].end){d=E[y];break}var b=A.start+A.duration;d?d.end=b:(d={start:w,end:b},E.push(d)),this.fragmentTracker.fragBuffered(A)},x.onBufferFlushing=function(D,L){var A=L.startOffset,C=L.endOffset;if(A===0&&C!==Number.POSITIVE_INFINITY){var E=this.currentTrackId,d=this.levels;if(!d.length||!d[E]||!d[E].details)return;var w=d[E].details,y=w.targetduration,b=C-y;if(b<=0)return;L.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(B){for(var F=0;F<B.length;){if(B[F].end<=b){B.shift();continue}else if(B[F].start<b)B[F].start=b;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(A,b,m.PlaylistLevelType.SUBTITLE)}},x.onError=function(D,L){var A,C=L.frag;if(!C||C.type!==m.PlaylistLevelType.SUBTITLE)return;(A=this.fragCurrent)!==null&&A!==void 0&&A.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},x.onSubtitleTracksUpdated=function(D,L){var A=this,C=L.subtitleTracks;this.tracksBuffered=[],this.levels=C.map(function(E){return new p.Level(E)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(E){A.tracksBuffered[E.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(D,L){if(this.currentTrackId=L.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(u)},x.onSubtitleTrackLoaded=function(D,L){var A,C=L.details,E=L.id,d=this.currentTrackId,w=this.levels;if(!w.length)return;var y=w[d];if(E>=w.length||E!==d||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(A=y.details)!==null&&A!==void 0&&A.live){var b=this.mainDetails;if(C.deltaUpdateFailed||!b)return;var B=b.fragments[0];if(!y.details)C.hasProgramDateTime&&b.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(C,b):B&&Object(r.addSliding)(C,B.start);else{var F=this.alignPlaylists(C,y.details);F===0&&B&&Object(r.addSliding)(C,B.start)}}if(y.details=C,this.levelLastLoaded=E,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var _=Object(z.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);_||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},x._handleFragmentLoadComplete=function(D){var L=D.frag,A=D.payload,C=L.decryptdata,E=this.hls;if(this.fragContextChanged(L))return;if(A&&A.byteLength>0&&C&&C.key&&C.iv&&C.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(A),C.key.buffer,C.iv.buffer).then(function(w){var y=performance.now();E.trigger(Y.Events.FRAG_DECRYPTED,{frag:L,payload:w,stats:{tstart:d,tdecrypt:y}})})}},x.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,L=this.currentTrackId,A=this.levels;if(!A.length||!A[L]||!A[L].details)return;var C=A[L].details,E=C.targetduration,d=this.config,w=this.media,y=U.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-E,d.maxBufferHole),b=y.end,B=y.len,F=this.getMaxBufferLength()+E;if(B>F)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var _=C.fragments,M=_.length,I=C.edge,g,H=this.fragPrevious;if(b<I){var $=d.maxFragLookUpTolerance;H&&C.hasProgramDateTime&&(g=Object(z.findFragmentByPDT)(_,H.endProgramDateTime,$)),g||(g=Object(z.findFragmentByPTS)(H,_,b,$),!g&&H&&H.start<_[0].start&&(g=_[0]))}else g=_[M-1];(D=g)!==null&&D!==void 0&&D.encrypted?(j.logger.log("Loading key for "+g.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(Y.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===R.FragmentState.NOT_LOADED&&this.loadFragment(g,C,b)}},x.loadFragment=function(D,L,A){this.fragCurrent=D,a.prototype.loadFragment.call(this,D,L,A)},o(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(v.default)},"./src/controller/subtitle-track-controller.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),U=P("./src/controller/base-playlist-controller.ts"),z=P("./src/types/loader.ts");function W(h,o){for(var f=0;f<o.length;f++){var l=o[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function r(h,o,f){return o&&W(h.prototype,o),f&&W(h,f),h}function R(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,v(h,o)}function v(h,o){return v=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},v(h,o)}var m=function(h){R(o,h);function o(l){var u;return u=h.call(this,l,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var f=o.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,h.prototype.destroy.call(this)},f.registerListeners=function(){var u=this.hls;u.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(Y.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var u=this.hls;u.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(Y.Events.ERROR,this.onError,this)},f.onMediaAttached=function(u,s){if(this.media=s.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)},f.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=p(this.media.textTracks);u.forEach(function(s){Object(j.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},f.onSubtitleTrackLoaded=function(u,s){var a=s.id,O=s.details,x=this.trackId,S=this.tracksInGroup[x];if(!S){this.warn("Invalid subtitle track id "+a);return}var D=S.details;S.details=s.details,this.log("subtitle track "+a+" loaded ["+O.startSN+"-"+O.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,D))},f.onLevelLoading=function(u,s){this.switchLevel(s.level)},f.onLevelSwitching=function(u,s){this.switchLevel(s.level)},f.switchLevel=function(u){var s=this.hls.levels[u];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(L){return!a||L.groupId===a});this.tracksInGroup=x;var S=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=a;var D={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(Y.Events.SUBTITLE_TRACKS_UPDATED,D),S!==-1&&this.setSubtitleTrack(S,O)}},f.findTrackId=function(u){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var O=s[a];if((!this.selectDefaultTrack||O.default)&&(!u||u===O.name))return O.id}return-1},f.onError=function(u,s){if(h.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===z.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},f.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,O=s.groupId,x=s.url;if(u)try{x=u.addDirectives(x)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(Y.Events.SUBTITLE_TRACK_LOADING,{url:x,id:a,groupId:O,deliveryDirectives:u||null})}},f.toggleTrackModes=function(u){var s=this,a=this.media,O=this.subtitleDisplay,x=this.trackId;if(!a)return;var S=p(a.textTracks),D=S.filter(function(C){return C.groupId===s.groupId});if(u===-1)[].slice.call(S).forEach(function(C){C.mode="disabled"});else{var L=D[x];L&&(L.mode="disabled")}var A=D[u];A&&(A.mode=O?"showing":"hidden")},f.setSubtitleTrack=function(u,s){var a,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(a=O[u])!==null&&a!==void 0&&a.details)||u<-1||u>=O.length)return;this.clearTimer();var x=O[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,x){var S=x.id,D=x.groupId,L=D===void 0?"":D,A=x.name,C=x.type,E=x.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:L,name:A,type:C,url:E});var d=this.switchParams(x.url,s==null?void 0:s.details);this.loadPlaylist(d)}else this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:u})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=p(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")u=a;else if(s[a].mode==="showing"){u=a;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},r(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,s)}}]),o}(U.default);function p(h){for(var o=[],f=0;f<h.length;f++){var l=h[f];l.kind==="subtitles"&&l.label&&o.push(h[f])}return o}J.default=m},"./src/controller/timeline-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"TimelineController",function(){return p});var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/utils/cea-608-parser.ts"),z=P("./src/utils/output-filter.ts"),W=P("./src/utils/webvtt-parser.ts"),r=P("./src/utils/texttrack-utils.ts"),R=P("./src/utils/imsc1-ttml-parser.ts"),v=P("./src/types/loader.ts"),m=P("./src/utils/logger.ts"),p=function(){function l(s){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=f(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var a=new z.default(this,"textTrack1"),O=new z.default(this,"textTrack2"),x=new z.default(this,"textTrack3"),S=new z.default(this,"textTrack4");this.cea608Parser1=new U.default(1,a,O),this.cea608Parser2=new U.default(3,x,S)}s.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(j.Events.FRAG_LOADING,this.onFragLoading,this),s.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=l.prototype;return u.destroy=function(){var a=this.hls;a.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(j.Events.FRAG_LOADING,this.onFragLoading,this),a.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(a,O,x,S,D){for(var L=!1,A=D.length;A--;){var C=D[A],E=o(C[0],C[1],O,x);if(E>=0&&(C[0]=Math.min(C[0],O),C[1]=Math.max(C[1],x),L=!0,E/(x-O)>.5))return}if(L||D.push([O,x]),this.config.renderTextTracksNatively){var d=this.captionsTracks[a];this.Cues.newCue(d,O,x,S)}else{var w=this.Cues.newCue(null,O,x,S);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:w,track:a})}},u.onInitPtsFound=function(a,O){var x=this,S=O.frag,D=O.id,L=O.initPTS,A=O.timescale,C=this.unparsedVttFrags;D==="main"&&(this.initPTS[S.cc]=L,this.timescale[S.cc]=A),C.length&&(this.unparsedVttFrags=[],C.forEach(function(E){x.onFragLoaded(j.Events.FRAG_LOADED,E)}))},u.getExistingTrack=function(a){var O=this.media;if(O)for(var x=0;x<O.textTracks.length;x++){var S=O.textTracks[x];if(S[a])return S}return null},u.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},u.createNativeTrack=function(a){if(this.captionsTracks[a])return;var O=this.captionsProperties,x=this.captionsTracks,S=this.media,D=O[a],L=D.label,A=D.languageCode,C=this.getExistingTrack(a);if(C)x[a]=C,Object(r.clearCurrentCues)(x[a]),Object(r.sendAddTrackEvent)(x[a],S);else{var E=this.createTextTrack("captions",L,A);E&&(E[a]=!0,x[a]=E)}},u.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var O=this.captionsProperties[a];if(!O)return;var x=O.label,S={_id:a,label:x,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[a]=S,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(a,O,x){var S=this.media;return S?S.addTextTrack(a,O,x):void 0},u.onMediaAttaching=function(a,O){this.media=O.media,this._cleanTracks()},u.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(O){Object(r.clearCurrentCues)(a[O]),delete a[O]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var a=this.media;if(!a)return;var O=a.textTracks;if(O)for(var x=0;x<O.length;x++)Object(r.clearCurrentCues)(O[x])},u.onSubtitleTracksUpdated=function(a,O){var x=this;this.textTracks=[];var S=O.subtitleTracks||[],D=S.some(function(E){return E.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var L=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var A=this.media?this.media.textTracks:[];this.tracks.forEach(function(E,d){var w;if(d<A.length){for(var y=null,b=0;b<A.length;b++)if(h(A[b],E)){y=A[b];break}y&&(w=y)}w?Object(r.clearCurrentCues)(w):(w=x.createTextTrack("subtitles",E.name,E.lang),w&&(w.mode="disabled")),w&&(w.groupId=E.groupId,x.textTracks.push(w))})}else if(!L&&this.tracks&&this.tracks.length){var C=this.tracks.map(function(E){return{label:E.name,kind:E.type.toLowerCase(),default:E.default,subtitleTrack:E}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:C})}}},u.onManifestLoaded=function(a,O){var x=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(S){var D=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!D)return;var L="textTrack"+D[1],A=x.captionsProperties[L];if(!A)return;A.label=S.name,S.lang&&(A.languageCode=S.lang),A.media=S})},u.onFragLoading=function(a,O){var x=this.cea608Parser1,S=this.cea608Parser2,D=this.lastSn,L=this.lastPartIndex;if(!this.enabled||!(x&&S))return;if(O.frag.type===v.PlaylistLevelType.MAIN){var A,C,E=O.frag.sn,d=(A=O==null||((C=O.part)===null||C===void 0)?void 0:C.index)!=null?A:-1;E===D+1||E===D&&d===L+1||(x.reset(),S.reset()),this.lastSn=E,this.lastPartIndex=d}},u.onFragLoaded=function(a,O){var x=O.frag,S=O.payload,D=this.initPTS,L=this.unparsedVttFrags;if(x.type===v.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(Y.isFiniteNumber)(D[x.cc])){L.push(O),D.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 C=this.tracks[x.level],E=this.vttCCs;E[x.cc]||(E[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),C&&C.textCodec===R.IMSC1_CODEC?this._parseIMSC1(x,S):this._parseVTTs(x,S,E)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(a,O){var x=this,S=this.hls;Object(R.parseIMSC1)(O,this.initPTS[a.cc],this.timescale[a.cc],function(D){x._appendCues(D,a.level),S.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(D){m.logger.log("Failed to parse IMSC1: "+D),S.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:D})})},u._parseVTTs=function(a,O,x){var S=this,D=this.hls;Object(W.parseWebVTT)(O,this.initPTS[a.cc],this.timescale[a.cc],x,a.cc,a.start,function(L){S._appendCues(L,a.level),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(L){S._fallbackToIMSC1(a,O),m.logger.log("Failed to parse VTT cue: "+L),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:L})})},u._fallbackToIMSC1=function(a,O){var x=this,S=this.tracks[a.level];S.textCodec||Object(R.parseIMSC1)(O,this.initPTS[a.cc],this.timescale[a.cc],function(){S.textCodec=R.IMSC1_CODEC,x._parseIMSC1(a,O)},function(){S.textCodec="wvtt"})},u._appendCues=function(a,O){var x=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[O];if(S.mode==="disabled")return;a.forEach(function(A){return Object(r.addCueToTrack)(S,A)})}else{var D=this.tracks[O],L=D.default?"default":"subtitles"+O;x.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:a,track:L})}},u.onFragDecrypted=function(a,O){var x=O.frag;if(x.type===v.PlaylistLevelType.SUBTITLE){if(!Object(Y.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(j.Events.FRAG_LOADED,O)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(a,O){var x=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(x&&S))return;for(var D=0;D<O.samples.length;D++){var L=O.samples[D].bytes;if(L){var A=this.extractCea608Data(L);x.addData(O.samples[D].pts,A[0]),S.addData(O.samples[D].pts,A[1])}}},u.onBufferFlushing=function(a,O){var x=O.startOffset,S=O.endOffset,D=O.endOffsetSubtitles,L=O.type,A=this.media;if(!A||A.currentTime<S)return;if(!L||L==="video"){var C=this.captionsTracks;Object.keys(C).forEach(function(d){return Object(r.removeCuesInRange)(C[d],x,S)})}if(this.config.renderTextTracksNatively&&(x===0&&D!==void 0)){var E=this.textTracks;Object.keys(E).forEach(function(d){return Object(r.removeCuesInRange)(E[d],x,D)})}},u.extractCea608Data=function(a){for(var O=a[0]&31,x=2,S=[[],[]],D=0;D<O;D++){var L=a[x++],A=127&a[x++],C=127&a[x++],E=(4&L)!==0,d=3&L;if(A===0&&C===0)continue;E&&((d===0||d===1)&&(S[d].push(A),S[d].push(C)))}return S},l}();function h(l,u){return l&&l.label===u.name&&!(l.textTrack1||l.textTrack2)}function o(l,u,s,a){return Math.min(u,a)-Math.max(l,s)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function j(z,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=z,this.aesIV=W}var U=j.prototype;return U.decrypt=function(W,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,W)},j}()},"./src/crypt/aes-decryptor.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"removePadding",function(){return j}),P.d(J,"default",function(){return U});var Y=P("./src/utils/typed-array.ts");function j(z){var W=z.byteLength,r=W&&new DataView(z.buffer).getUint8(W-1);return r?Object(Y.sliceUint8)(z,0,W-r):z}var U=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 W=z.prototype;return W.uint8ArrayToUint32Array_=function(R){for(var v=new DataView(R),m=new Uint32Array(4),p=0;p<4;p++)m[p]=v.getUint32(p*4);return m},W.initTable=function(){var R=this.sBox,v=this.invSBox,m=this.subMix,p=m[0],h=m[1],o=m[2],f=m[3],l=this.invSubMix,u=l[0],s=l[1],a=l[2],O=l[3],x=new Uint32Array(256),S=0,D=0,L=0;for(L=0;L<256;L++)L<128?x[L]=L<<1:x[L]=L<<1^283;for(L=0;L<256;L++){var A=D^D<<1^D<<2^D<<3^D<<4;A=A>>>8^A&255^99,R[S]=A,v[A]=S;var C=x[S],E=x[C],d=x[E],w=x[A]*257^A*16843008;p[S]=w<<24|w>>>8,h[S]=w<<16|w>>>16,o[S]=w<<8|w>>>24,f[S]=w,w=d*16843009^E*65537^C*257^S*16843008,u[A]=w<<24|w>>>8,s[A]=w<<16|w>>>16,a[A]=w<<8|w>>>24,O[A]=w,S?(S=C^x[x[x[d^C]]],D^=x[x[D]]):S=D=1}},W.expandKey=function(R){for(var v=this.uint8ArrayToUint32Array_(R),m=!0,p=0;p<v.length&&m;)m=v[p]===this.key[p],p++;if(m)return;this.key=v;var h=this.keySize=v.length;if(h!==4&&h!==6&&h!==8)throw new Error("Invalid aes key size="+h);var o=this.ksRows=(h+6+1)*4,f,l,u=this.keySchedule=new Uint32Array(o),s=this.invKeySchedule=new Uint32Array(o),a=this.sBox,O=this.rcon,x=this.invSubMix,S=x[0],D=x[1],L=x[2],A=x[3],C,E;for(f=0;f<o;f++){if(f<h){C=u[f]=v[f];continue}E=C,f%h===0?(E=E<<8|E>>>24,E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255],E^=O[f/h|0]<<24):h>6&&f%h===4&&(E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255]),u[f]=C=(u[f-h]^E)>>>0}for(l=0;l<o;l++)f=o-l,l&3?E=u[f]:E=u[f-4],l<4||f<=4?s[l]=E:s[l]=S[a[E>>>24]]^D[a[E>>>16&255]]^L[a[E>>>8&255]]^A[a[E&255]],s[l]=s[l]>>>0},W.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},W.decrypt=function(R,v,m){for(var p=this.keySize+6,h=this.invKeySchedule,o=this.invSBox,f=this.invSubMix,l=f[0],u=f[1],s=f[2],a=f[3],O=this.uint8ArrayToUint32Array_(m),x=O[0],S=O[1],D=O[2],L=O[3],A=new Int32Array(R),C=new Int32Array(A.length),E,d,w,y,b,B,F,_,M,I,g,H,$,ae,ue=this.networkToHostOrderSwap;v<A.length;){for(M=ue(A[v]),I=ue(A[v+1]),g=ue(A[v+2]),H=ue(A[v+3]),b=M^h[0],B=H^h[1],F=g^h[2],_=I^h[3],$=4,ae=1;ae<p;ae++)E=l[b>>>24]^u[B>>16&255]^s[F>>8&255]^a[_&255]^h[$],d=l[B>>>24]^u[F>>16&255]^s[_>>8&255]^a[b&255]^h[$+1],w=l[F>>>24]^u[_>>16&255]^s[b>>8&255]^a[B&255]^h[$+2],y=l[_>>>24]^u[b>>16&255]^s[B>>8&255]^a[F&255]^h[$+3],b=E,B=d,F=w,_=y,$=$+4;E=o[b>>>24]<<24^o[B>>16&255]<<16^o[F>>8&255]<<8^o[_&255]^h[$],d=o[B>>>24]<<24^o[F>>16&255]<<16^o[_>>8&255]<<8^o[b&255]^h[$+1],w=o[F>>>24]<<24^o[_>>16&255]<<16^o[b>>8&255]<<8^o[B&255]^h[$+2],y=o[_>>>24]<<24^o[b>>16&255]<<16^o[B>>8&255]<<8^o[F&255]^h[$+3],C[v]=ue(E^x),C[v+1]=ue(y^S),C[v+2]=ue(w^D),C[v+3]=ue(d^L),x=M,S=I,D=g,L=H,v=v+4}return C.buffer},z}()},"./src/crypt/decrypter.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return v});var Y=P("./src/crypt/aes-crypto.ts"),j=P("./src/crypt/fast-aes-key.ts"),U=P("./src/crypt/aes-decryptor.ts"),z=P("./src/utils/logger.ts"),W=P("./src/utils/mp4-tools.ts"),r=P("./src/utils/typed-array.ts"),R=16,v=function(){function m(h,o,f){var l=f===void 0?{}:f,u=l.removePKCS7Padding,s=u===void 0?!0:u;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=h,this.config=o,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var f=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(U.removePadding)(f):f},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(o,f,l,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),f,l);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),f,l).then(u)},p.softwareDecrypt=function(o,f,l){var u=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(o=Object(W.appendUint8Array)(a,o),this.remainderData=null);var O=this.getValidChunk(o);if(!O.length)return null;u&&(l=u);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new U.default),x.expandKey(f);var S=s;return this.currentResult=x.decrypt(O.buffer,0,l),this.currentIV=Object(r.sliceUint8)(O,-16).buffer,S||null},p.webCryptoDecrypt=function(o,f,l){var u=this,s=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new j.default(s,f)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var O=new Y.default(s,l);return O.decrypt(o.buffer,a)}).catch(function(a){return u.onWebCryptoError(a,o,f,l)})},p.onWebCryptoError=function(o,f,l,u){return z.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,l,u)},p.getValidChunk=function(o){var f=o,l=o.length-o.length%R;return l!==o.length&&(f=Object(r.sliceUint8)(o,0,l),this.remainderData=Object(r.sliceUint8)(o,l)),f},p.logOnce=function(o){if(!this.logEnabled)return;z.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function j(z,W){this.subtle=void 0,this.key=void 0,this.subtle=z,this.key=W}var U=j.prototype;return U.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/adts.ts"),U=P("./src/utils/logger.ts"),z=P("./src/demux/id3.ts");function W(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},r(v,m)}var R=function(v){W(m,v);function m(h,o){var f;return f=v.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=h,f.config=o,f}var p=m.prototype;return p.resetInitSegment=function(o,f,l){v.prototype.resetInitSegment.call(this,o,f,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},m.probe=function(o){if(!o)return!1;for(var f=z.getID3Data(o,0)||[],l=f.length,u=o.length;l<u;l++)if(j.probe(o,l))return U.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(o,f){return j.canParse(o,f)},p.appendFrame=function(o,f,l){j.initTrackConfig(o,this.observer,f,l,o.manifestCodec);var u=j.appendFrame(o,f,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},m}(Y.default);R.minProbeByteLength=9,J.default=R},"./src/demux/adts.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"getAudioConfig",function(){return z}),P.d(J,"isHeaderPattern",function(){return W}),P.d(J,"getHeaderLength",function(){return r}),P.d(J,"getFullFrameLength",function(){return R}),P.d(J,"canGetFrameLength",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return h}),P.d(J,"initTrackConfig",function(){return o}),P.d(J,"getFrameDuration",function(){return f}),P.d(J,"parseFrameHeader",function(){return l}),P.d(J,"appendFrame",function(){return u});var Y=P("./src/utils/logger.ts"),j=P("./src/errors.ts"),U=P("./src/events.ts");function z(s,a,O,x){var S,D,L,A,C=navigator.userAgent.toLowerCase(),E=x,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((a[O+2]&192)>>>6)+1;var w=(a[O+2]&60)>>>2;if(w>d.length-1){s.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+w});return}return L=(a[O+2]&1)<<2,L|=(a[O+3]&192)>>>6,Y.logger.log("manifest codec:"+x+", ADTS type:"+S+", samplingIndex:"+w),/firefox/i.test(C)?w>=6?(S=5,A=new Array(4),D=w-3):(S=2,A=new Array(2),D=w):C.indexOf("android")!==-1?(S=2,A=new Array(2),D=w):(S=5,A=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&w>=6?D=w-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(w>=6&&L===1||/vivaldi/i.test(C))||!x&&L===1)&&(S=2,A=new Array(2)),D=w)),A[0]=S<<3,A[0]|=(w&14)>>1,A[1]|=(w&1)<<7,A[1]|=L<<3,S===5&&(A[1]|=(D&14)>>1,A[2]=(D&1)<<7,A[2]|=2<<2,A[3]=0),{config:A,samplerate:d[w],channelCount:L,codec:"mp4a.40."+S,manifestCodec:E}}function W(s,a){return s[a]===255&&(s[a+1]&246)===240}function r(s,a){return s[a+1]&1?7:9}function R(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function v(s,a){return a+5<s.length}function m(s,a){return a+1<s.length&&W(s,a)}function p(s,a){return v(s,a)&&W(s,a)&&R(s,a)<=s.length-a}function h(s,a){if(m(s,a)){var O=r(s,a);if(a+O>=s.length)return!1;var x=R(s,a);if(x<=O)return!1;var S=a+x;return S===s.length||m(s,S)}return!1}function o(s,a,O,x,S){if(!s.samplerate){var D=z(a,O,x,S);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,Y.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function f(s){return 1024*9e4/s}function l(s,a,O,x,S){var D=r(s,a),L=R(s,a);if(L-=D,L>0){var A=O+x*S;return{headerLength:D,frameLength:L,stamp:A}}}function u(s,a,O,x,S){var D=f(s.samplerate),L=l(a,O,x,S,D);if(L){var A=L.frameLength,C=L.headerLength,E=L.stamp,d=C+A,w=Math.max(0,O+d-a.length),y;w?(y=new Uint8Array(d-C),y.set(a.subarray(O+C,a.length),0)):y=a.subarray(O+C,O+d);var b={unit:y,pts:E};return w||s.samples.push(b),{sample:b,length:d,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"initPTSFn",function(){return R});var Y=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),U=P("./src/demux/dummy-demuxed-track.ts"),z=P("./src/utils/mp4-tools.ts"),W=P("./src/utils/typed-array.ts"),r=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(h,o,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(h,o){return!1},m.appendFrame=function(h,o,f){},m.demux=function(h,o){this.cachedData&&(h=Object(z.appendUint8Array)(this.cachedData,h),this.cachedData=null);var f=j.getID3Data(h,0),l=f?f.length:0,u,s,a=this._audioTrack,O=this._id3Track,x=f?j.getTimeStamp(f):void 0,S=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(x,o)),f&&f.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),s=this.initPTS;l<S;){if(this.canParse(h,l)){var D=this.appendFrame(a,h,l);D?(this.frameIndex++,s=D.sample.pts,l+=D.length,u=l):l=S}else j.canParse(h,l)?(f=j.getID3Data(h,l),O.samples.push({pts:s,dts:s,data:f}),l+=f.length,u=l):l++;if(l===S&&u!==S){var L=Object(W.sliceUint8)(h,u);this.cachedData?this.cachedData=Object(z.appendUint8Array)(this.cachedData,L):this.cachedData=L}}return{audioTrack:a,avcTrack:Object(U.dummyTrack)(),id3Track:O,textTrack:Object(U.dummyTrack)()}},m.demuxSampleAes=function(h,o,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(h){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(U.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(U.dummyTrack)()}},m.destroy=function(){},v}(),R=function(m,p){return Object(Y.isFiniteNumber)(m)?m*90:p*9e4};J.default=r},"./src/demux/chunk-cache.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function U(){this.chunks=[],this.dataLength=0}var z=U.prototype;return z.push=function(r){this.chunks.push(r),this.dataLength+=r.length},z.flush=function(){var r=this.chunks,R=this.dataLength,v;if(r.length)r.length===1?v=r[0]:v=j(r,R);else return new Uint8Array(0);return this.reset(),v},z.reset=function(){this.chunks.length=0,this.dataLength=0},U}();function j(U,z){for(var W=new Uint8Array(z),r=0,R=0;R<U.length;R++){var v=U[R];W.set(v,r),r+=v.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(ie,J,P){"use strict";P.r(J),P.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,P){"use strict";P.r(J);var Y=P("./src/utils/logger.ts"),j=function(){function U(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var z=U.prototype;return z.loadWord=function(){var r=this.data,R=this.bytesAvailable,v=r.byteLength-R,m=new Uint8Array(4),p=Math.min(4,R);if(p===0)throw new Error("no bytes available");m.set(r.subarray(v,v+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},z.skipBits=function(r){var R;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,R=r>>3,r-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},z.readBits=function(r){var R=Math.min(this.bitsAvailable,r),v=this.word>>>32-R;return r>32&&Y.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=r-R,R>0&&this.bitsAvailable?v<<R|this.readBits(R):v},z.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},z.skipUEG=function(){this.skipBits(1+this.skipLZ())},z.skipEG=function(){this.skipBits(1+this.skipLZ())},z.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},z.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>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(r){for(var R=8,v=8,m,p=0;p<r;p++)v!==0&&(m=this.readEG(),v=(R+m+256)%256),R=v===0?R:v},z.readSPS=function(){var r=0,R=0,v=0,m=0,p,h,o,f=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),O=this.skipEG.bind(this),x=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);f();var D=f();if(l(5),a(3),f(),x(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var L=u();if(L===3&&a(1),x(),x(),a(1),s())for(h=L!==3?8:12,o=0;o<h;o++)s()&&(o<6?S(16):S(64))}x();var A=u();if(A===0)u();else if(A===1)for(a(1),O(),O(),p=u(),o=0;o<p;o++)O();x(),a(1);var C=u(),E=u(),d=l(1);d===0&&a(1),a(1),s()&&(r=u(),R=u(),v=u(),m=u());var w=[1,1];if(s()&&s()){var y=f();switch(y){case 1:w=[1,1];break;case 2:w=[12,11];break;case 3:w=[10,11];break;case 4:w=[16,11];break;case 5:w=[40,33];break;case 6:w=[24,11];break;case 7:w=[20,11];break;case 8:w=[32,11];break;case 9:w=[80,33];break;case 10:w=[18,11];break;case 11:w=[15,11];break;case 12:w=[64,33];break;case 13:w=[160,99];break;case 14:w=[4,3];break;case 15:w=[3,2];break;case 16:w=[2,1];break;case 255:{w=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((C+1)*16-r*2-R*2),height:(2-d)*(E+1)*16-(d?2:4)*(v+m),pixelRatio:w}},z.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},U}();J.default=j},"./src/demux/id3.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isHeader",function(){return Y}),P.d(J,"isFooter",function(){return j}),P.d(J,"getID3Data",function(){return U}),P.d(J,"canParse",function(){return W}),P.d(J,"getTimeStamp",function(){return r}),P.d(J,"isTimeStampFrame",function(){return R}),P.d(J,"getID3Frames",function(){return m}),P.d(J,"decodeFrame",function(){return p}),P.d(J,"utf8ArrayToStr",function(){return u}),P.d(J,"testables",function(){return s});var Y=function(S,D){return D+10<=S.length&&(S[D]===73&&S[D+1]===68&&S[D+2]===51&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},j=function(S,D){return D+10<=S.length&&(S[D]===51&&S[D+1]===68&&S[D+2]===73&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},U=function(S,D){for(var L=D,A=0;Y(S,D);){A+=10;var C=z(S,D+6);A+=C,j(S,D+10)&&(A+=10),D+=A}return A>0?S.subarray(L,L+A):void 0},z=function(S,D){var L=0;return L=(S[D]&127)<<21,L|=(S[D+1]&127)<<14,L|=(S[D+2]&127)<<7,L|=S[D+3]&127,L},W=function(S,D){return Y(S,D)&&z(S,D+6)+10<=S.length-D},r=function(S){for(var D=m(S),L=0;L<D.length;L++){var A=D[L];if(R(A))return l(A)}return},R=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},v=function(S){var D=String.fromCharCode(S[0],S[1],S[2],S[3]),L=z(S,4),A=10;return{type:D,size:L,data:S.subarray(A,A+L)}},m=function(S){for(var D=0,L=[];Y(S,D);){var A=z(S,D+6);D+=10;for(var C=D+A;D+8<C;){var E=v(S.subarray(D)),d=p(E);d&&L.push(d),D+=E.size+10}j(S,D)&&(D+=10)}return L},p=function(S){return S.type==="PRIV"?h(S):S.type[0]==="W"?f(S):o(S)},h=function(S){if(S.size<2)return;var D=u(S.data,!0),L=new Uint8Array(S.data.subarray(D.length+1));return{key:S.type,info:D,data:L.buffer}},o=function(S){if(S.size<2)return;if(S.type==="TXXX"){var D=1,L=u(S.data.subarray(D),!0);D+=L.length+1;var A=u(S.data.subarray(D));return{key:S.type,info:L,data:A}}var C=u(S.data.subarray(1));return{key:S.type,data:C}},f=function(S){if(S.type==="WXXX"){if(S.size<2)return;var D=1,L=u(S.data.subarray(D),!0);D+=L.length+1;var A=u(S.data.subarray(D));return{key:S.type,info:L,data:A}}var C=u(S.data);return{key:S.type,data:C}},l=function(S){if(S.data.byteLength===8){var D=new Uint8Array(S.data),L=D[3]&1,A=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return A/=45,L&&(A+=4772185884e-2),Math.round(A)}return},u=function(S,D){D===void 0&&(D=!1);var L=O();if(L){var A=L.decode(S);if(D){var C=A.indexOf("\0");return C!==-1?A.substring(0,C):A}return A.replace(/\0/g,"")}for(var E=S.length,d,w,y,b="",B=0;B<E;){if(d=S[B++],d===0&&D)return b;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(d);break;case 12:case 13:w=S[B++],b+=String.fromCharCode((d&31)<<6|w&63);break;case 14:w=S[B++],y=S[B++],b+=String.fromCharCode((d&15)<<12|(w&63)<<6|(y&63)<<0);break;default:}}return b},s={decodeTextFrame:o},a;function O(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),U=P("./src/utils/logger.ts"),z=P("./src/demux/mpegaudio.ts");function W(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},r(v,m)}var R=function(v){W(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(o,f,l){v.prototype.resetInitSegment.call(this,o,f,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},m.probe=function(o){if(!o)return!1;for(var f=j.getID3Data(o,0)||[],l=f.length,u=o.length;l<u;l++)if(z.probe(o,l))return U.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(o,f){return z.canParse(o,f)},p.appendFrame=function(o,f,l){return this.initPTS===null?void 0:z.appendFrame(o,f,l,this.initPTS,this.frameIndex)},m}(Y.default);R.minProbeByteLength=4,J.default=R},"./src/demux/mp4demuxer.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/utils/mp4-tools.ts"),j=P("./src/demux/dummy-demuxed-track.ts"),U=function(){function z(r,R){this.remainderData=null,this.config=void 0,this.config=R}var W=z.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},z.probe=function(R){return Object(Y.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},W.demux=function(R){var v=R,m=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(Y.appendUint8Array)(this.remainderData,R));var p=Object(Y.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(j.dummyTrack)(),avcTrack:m,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},W.flush=function(){var R=Object(j.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:R,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},W.demuxSampleAes=function(R,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},z}();U.minProbeByteLength=1024,J.default=U},"./src/demux/mpegaudio.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"appendFrame",function(){return r}),P.d(J,"parseHeader",function(){return R}),P.d(J,"isHeaderPattern",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return h});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],U=[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]],W=[0,1,1,4];function r(o,f,l,u,s){if(l+24>f.length)return;var a=R(f,l);if(a&&l+a.frameLength<=f.length){var O=a.samplesPerFrame*9e4/a.sampleRate,x=u+s*O,S={unit:f.subarray(l,l+a.frameLength),pts:x,dts:x};return o.config=[],o.channelCount=a.channelCount,o.samplerate=a.sampleRate,o.samples.push(S),{sample:S,length:a.frameLength,missing:0}}}function R(o,f){var l=o[f+1]>>3&3,u=o[f+1]>>1&3,s=o[f+2]>>4&15,a=o[f+2]>>2&3;if(l!==1&&s!==0&&s!==15&&a!==3){var O=o[f+2]>>1&1,x=o[f+3]>>6,S=l===3?3-u:u===3?3:4,D=j[S*14+s-1]*1e3,L=l===3?0:l===2?1:2,A=U[L*3+a],C=x===3?1:2,E=z[l][u],d=W[u],w=E*8*d,y=Math.floor(E*D/A+O)*d;if(Y===null){var b=navigator.userAgent||"",B=b.match(/Chrome\/(\d+)/i);Y=B?parseInt(B[1]):0}var F=!!Y&&Y<=87;return F&&u===2&&D>=224e3&&x===0&&(o[f+3]=o[f+3]|128),{sampleRate:A,channelCount:C,frameLength:y,samplesPerFrame:w}}}function v(o,f){return o[f]===255&&(o[f+1]&224)===224&&(o[f+1]&6)!==0}function m(o,f){return f+1<o.length&&v(o,f)}function p(o,f){var l=4;return v(o,f)&&l<=o.length-f}function h(o,f){if(f+1<o.length&&v(o,f)){var l=4,u=R(o,f),s=l;u!=null&&u.frameLength&&(s=u.frameLength);var a=f+s;return a===o.length||m(o,a)}return!1}},"./src/demux/sample-aes.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/crypt/decrypter.ts"),j=P("./src/demux/tsdemuxer.ts"),U=function(){function z(r,R,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new Y.default(r,R,{removePKCS7Padding:!1})}var W=z.prototype;return W.decryptBuffer=function(R,v){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,v)},W.decryptAacSample=function(R,v,m,p){var h=R[v].unit,o=h.subarray(16,h.length-h.length%16),f=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),l=this;this.decryptBuffer(f,function(u){var s=new Uint8Array(u);h.set(s,16),p||l.decryptAacSamples(R,v+1,m)})},W.decryptAacSamples=function(R,v,m){for(;;v++){if(v>=R.length){m();return}if(R[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(R,v,m,p),!p)return}},W.getAvcEncryptedData=function(R){for(var v=Math.floor((R.length-48)/160)*16+16,m=new Int8Array(v),p=0,h=32;h<=R.length-16;h+=160,p+=16)m.set(R.subarray(h,h+16),p);return m},W.getAvcDecryptedUnit=function(R,v){for(var m=new Uint8Array(v),p=0,h=32;h<=R.length-16;h+=160,p+=16)R.set(m.subarray(p,p+16),h);return R},W.decryptAvcSample=function(R,v,m,p,h,o){var f=Object(j.discardEPB)(h.data),l=this.getAvcEncryptedData(f),u=this;this.decryptBuffer(l.buffer,function(s){h.data=u.getAvcDecryptedUnit(f,s),o||u.decryptAvcSamples(R,v,m+1,p)})},W.decryptAvcSamples=function(R,v,m,p){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=R.length){p();return}for(var h=R[v].units;!(m>=h.length);m++){var o=h[m];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(R,v,m,p,o,f),!f)return}}},z}();J.default=U},"./src/demux/transmuxer-interface.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var Y=P("./node_modules/webworkify-webpack/index.js"),j=P.n(Y),U=P("./src/events.ts"),z=P("./src/demux/transmuxer.ts"),W=P("./src/utils/logger.ts"),r=P("./src/errors.ts"),R=P("./src/utils/mediasource-helper.ts"),v=P("./node_modules/eventemitter3/index.js"),m=P.n(v),p=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function o(l,u,s,a){var O=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=u,this.onTransmuxComplete=s,this.onFlush=a;var x=l.config,S=function(E,d){d=d||{},d.frag=O.frag,d.id=O.id,l.trigger(E,d)};this.observer=new v.EventEmitter,this.observer.on(U.Events.FRAG_DECRYPTED,S),this.observer.on(U.Events.ERROR,S);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},L=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){W.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(C){l.trigger(U.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},A.postMessage({cmd:"init",typeSupported:D,vendor:L,id:u,config:JSON.stringify(x)})}catch(C){W.logger.warn("Error in worker:",C),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new z.default(this.observer,D,x,L,u),this.worker=null}}else this.transmuxer=new z.default(this.observer,D,x,L,u)}var f=o.prototype;return f.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},f.push=function(u,s,a,O,x,S,D,L,A,C){var E=this;A.transmuxing.start=self.performance.now();var d=this.transmuxer,w=this.worker,y=S?S.start:x.start,b=x.decryptdata,B=this.frag,F=!(B&&x.cc===B.cc),_=!(B&&A.level===B.level),M=B?A.sn-B.sn:-1,I=this.part?A.part-this.part.index:1,g=!_&&(M===1||M===0&&I===1),H=self.performance.now();(_||M||x.stats.parsing.start===0)&&(x.stats.parsing.start=H),S&&(I||!g)&&(S.stats.parsing.start=H);var $=new z.TransmuxState(F,g,L,_,y);if(!g||F){W.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: `+_+`
contiguous: `+g+`
accurateTimeOffset: `+L+`
timeOffset: `+y);var ae=new z.TransmuxConfig(a,O,s,D,C);this.configureTransmuxer(ae)}if(this.frag=x,this.part=S,w)w.postMessage({cmd:"demux",data:u,decryptdata:b,chunkMeta:A,state:$},u instanceof ArrayBuffer?[u]:[]);else if(d){var ue=d.push(u,b,A,$);Object(z.isPromise)(ue)?ue.then(function(Le){E.handleTransmuxComplete(Le)}):this.handleTransmuxComplete(ue)}},f.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var a=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:u});else if(a){var x=a.flush(u);Object(z.isPromise)(x)?x.then(function(S){s.handleFlushResult(S,u)}):this.handleFlushResult(x,u)}},f.handleFlushResult=function(u,s){var a=this;u.forEach(function(O){a.handleTransmuxComplete(O)}),this.onFlush(s)},f.onWorkerMessage=function(u){var s=u.data,a=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,a.trigger(s.event,s.data);break}}},f.configureTransmuxer=function(u){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):a&&a.configure(u)},f.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},o}()},"./src/demux/transmuxer-worker.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var Y=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),z=P("./node_modules/eventemitter3/index.js"),W=P.n(z);function r(h){var o=new z.EventEmitter,f=function(u,s){h.postMessage({event:u,data:s})};o.on(j.Events.FRAG_DECRYPTED,f),o.on(j.Events.ERROR,f),h.addEventListener("message",function(l){var u=l.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);h.transmuxer=new Y.default(o,u.typeSupported,s,u.vendor,u.id),Object(U.enableLogs)(s.debug),f("init",null);break}case"configure":{h.transmuxer.configure(u.config);break}case"demux":{var a=h.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(Y.isPromise)(a)?a.then(function(S){R(h,S)}):R(h,a);break}case"flush":{var O=u.chunkMeta,x=h.transmuxer.flush(O);Object(Y.isPromise)(x)?x.then(function(S){m(h,S,O)}):m(h,x,O);break}default:break}})}function R(h,o){if(p(o.remuxResult))return;var f=[],l=o.remuxResult,u=l.audio,s=l.video;u&&v(f,u),s&&v(f,s),h.postMessage({event:"transmuxComplete",data:o},f)}function v(h,o){o.data1&&h.push(o.data1.buffer),o.data2&&h.push(o.data2.buffer)}function m(h,o,f){o.forEach(function(l){R(h,l)}),h.postMessage({event:"flush",data:f})}function p(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"isPromise",function(){return x}),P.d(J,"TransmuxConfig",function(){return S}),P.d(J,"TransmuxState",function(){return D});var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/crypt/decrypter.ts"),z=P("./src/demux/aacdemuxer.ts"),W=P("./src/demux/mp4demuxer.ts"),r=P("./src/demux/tsdemuxer.ts"),R=P("./src/demux/mp3demuxer.ts"),v=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),h=P("./src/utils/mp4-tools.ts"),o=P("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(L){o.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var l=[{demux:r.default,remux:v.default},{demux:W.default,remux:m.default},{demux:z.default,remux:v.default},{demux:R.default,remux:v.default}],u=1024;l.forEach(function(L){var A=L.demux;u=Math.max(u,A.minProbeByteLength)});var s=function(){function L(C,E,d,w,y){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 p.default,this.observer=C,this.typeSupported=E,this.config=d,this.vendor=w,this.id=y}var A=L.prototype;return A.configure=function(E){this.transmuxConfig=E,this.decrypter&&this.decrypter.reset()},A.push=function(E,d,w,y){var b=this,B=w.transmuxing;B.executeStart=f();var F=new Uint8Array(E),_=this.cache,M=this.config,I=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var H=a(F,d);if(H&&H.method==="AES-128"){var $=this.getDecrypter();if(M.enableSoftwareAES){var ae=$.softwareDecrypt(F,H.key.buffer,H.iv.buffer);if(!ae)return B.executeEnd=f(),O(w);F=new Uint8Array(ae)}else return this.decryptionPromise=$.webCryptoDecrypt(F,H.key.buffer,H.iv.buffer).then(function(Re){var Pe=b.push(Re,null,w);return b.decryptionPromise=null,Pe}),this.decryptionPromise}var ue=y||I,Le=ue.contiguous,ve=ue.discontinuity,Te=ue.trackSwitch,_e=ue.accurateTimeOffset,De=ue.timeOffset,he=g.audioCodec,ce=g.videoCodec,ne=g.defaultInitPts,fe=g.duration,le=g.initSegmentData;if((ve||Te)&&this.resetInitSegment(le,he,ce,fe),ve&&this.resetInitialTimestamp(ne),Le||this.resetContiguity(),this.needsProbing(F,ve,Te)){if(_.dataLength){var ke=_.flush();F=Object(h.appendUint8Array)(ke,F)}this.configureTransmuxer(F,g)}var Fe=this.transmux(F,H,De,_e,w),Ae=this.currentTransmuxState;return Ae.contiguous=!0,Ae.discontinuity=!1,Ae.trackSwitch=!1,B.executeEnd=f(),Fe},A.flush=function(E){var d=this,w=E.transmuxing;w.executeStart=f();var y=this.decrypter,b=this.cache,B=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return d.flush(E)});var _=[],M=B.timeOffset;if(y){var I=y.flush();I&&_.push(this.push(I,null,E))}var g=b.dataLength;b.reset();var H=this.demuxer,$=this.remuxer;if(!H||!$)return g>=u&&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"}),w.executeEnd=f(),[O(E)];var ae=H.flush(M);return x(ae)?ae.then(function(ue){return d.flushRemux(_,ue,E),_}):(this.flushRemux(_,ae,E),_)},A.flushRemux=function(E,d,w){var y=d.audioTrack,b=d.avcTrack,B=d.id3Track,F=d.textTrack,_=this.currentTransmuxState,M=_.accurateTimeOffset,I=_.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var g=this.remuxer.remux(y,b,B,F,I,M,!0,this.id);E.push({remuxResult:g,chunkMeta:w}),w.transmuxing.executeEnd=f()},A.resetInitialTimestamp=function(E){var d=this.demuxer,w=this.remuxer;if(!d||!w)return;d.resetTimeStamp(E),w.resetTimeStamp(E)},A.resetContiguity=function(){var E=this.demuxer,d=this.remuxer;if(!E||!d)return;E.resetContiguity(),d.resetNextTimestamp()},A.resetInitSegment=function(E,d,w,y){var b=this.demuxer,B=this.remuxer;if(!b||!B)return;b.resetInitSegment(d,w,y),B.resetInitSegment(E,d,w)},A.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},A.transmux=function(E,d,w,y,b){var B;return d&&d.method==="SAMPLE-AES"?B=this.transmuxSampleAes(E,d,w,y,b):B=this.transmuxUnencrypted(E,w,y,b),B},A.transmuxUnencrypted=function(E,d,w,y){var b=this.demuxer.demux(E,d,!1,!this.config.progressive),B=b.audioTrack,F=b.avcTrack,_=b.id3Track,M=b.textTrack,I=this.remuxer.remux(B,F,_,M,d,w,!1,this.id);return{remuxResult:I,chunkMeta:y}},A.transmuxSampleAes=function(E,d,w,y,b){var B=this;return this.demuxer.demuxSampleAes(E,d,w).then(function(F){var _=B.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,w,y,!1,B.id);return{remuxResult:_,chunkMeta:b}})},A.configureTransmuxer=function(E,d){for(var w=this.config,y=this.observer,b=this.typeSupported,B=this.vendor,F=d.audioCodec,_=d.defaultInitPts,M=d.duration,I=d.initSegmentData,g=d.videoCodec,H,$=0,ae=l.length;$<ae;$++)if(l[$].demux.probe(E)){H=l[$];break}H||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:W.default,remux:m.default});var ue=this.demuxer,Le=this.remuxer,ve=H.remux,Te=H.demux;(!Le||!(Le instanceof ve))&&(this.remuxer=new ve(y,w,b,B)),(!ue||!(ue instanceof Te))&&(this.demuxer=new Te(y,w,b),this.probe=Te.probe),this.resetInitSegment(I,F,g,M),this.resetInitialTimestamp(_)},A.needsProbing=function(E,d,w){return!this.demuxer||!this.remuxer||d||w},A.getDecrypter=function(){var E=this.decrypter;return E||(E=this.decrypter=new U.default(this.observer,this.config)),E},L}();function a(L,A){var C=null;return L.byteLength>0&&A!=null&&A.key!=null&&A.iv!==null&&A.method!=null&&(C=A),C}var O=function(A){return{remuxResult:{},chunkMeta:A}};function x(L){return"then"in L&&L.then instanceof Function}var S=function(A,C,E,d,w){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=C,this.initSegmentData=E,this.duration=d,this.defaultInitPts=w},D=function(A,C,E,d,w){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=C,this.accurateTimeOffset=E,this.trackSwitch=d,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"discardEPB",function(){return O});var Y=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),U=P("./src/demux/exp-golomb.ts"),z=P("./src/demux/id3.ts"),W=P("./src/demux/sample-aes.ts"),r=P("./src/events.ts"),R=P("./src/utils/mp4-tools.ts"),v=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},h=function(){function x(D,L,A){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=L,this.typeSupported=A}x.probe=function(L){var A=x.syncOffset(L);return A<0?!1:(A&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},x.syncOffset=function(L){for(var A=Math.min(1e3,L.length-3*188),C=0;C<A;){if(L[C]===71&&L[C+188]===71&&L[C+2*188]===71)return C;C++}return-1},x.createTrack=function(L,A){return{container:L==="video"||L==="audio"?"video/mp2t":void 0,type:L,id:p[L],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:L==="audio"?A:void 0}};var S=x.prototype;return S.resetInitSegment=function(L,A,C){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",C),this._audioTrack=x.createTrack("audio",C),this._id3Track=x.createTrack("id3",C),this._txtTrack=x.createTrack("text",C),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=L,this.videoCodec=A,this._duration=C},S.resetTimeStamp=function(){},S.resetContiguity=function(){var L=this._audioTrack,A=this._avcTrack,C=this._id3Track;L&&(L.pesData=null),A&&(A.pesData=null),C&&(C.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(L,A,C,E){C===void 0&&(C=!1),E===void 0&&(E=!1),C||(this.sampleAes=null);var d,w=this._avcTrack,y=this._audioTrack,b=this._id3Track,B=w.pid,F=w.pesData,_=y.pid,M=b.pid,I=y.pesData,g=b.pesData,H=!1,$=this.pmtParsed,ae=this._pmtId,ue=L.length;if(this.remainderData&&(L=Object(R.appendUint8Array)(this.remainderData,L),ue=L.length,this.remainderData=null),ue<188&&!E)return this.remainderData=L,{audioTrack:y,avcTrack:w,id3Track:b,textTrack:this._txtTrack};var Le=Math.max(0,x.syncOffset(L));ue-=(ue+Le)%188,ue<L.byteLength&&!E&&(this.remainderData=new Uint8Array(L.buffer,ue,L.buffer.byteLength-ue));for(var ve=Le;ve<ue;ve+=188)if(L[ve]===71){var Te=!!(L[ve+1]&64),_e=((L[ve+1]&31)<<8)+L[ve+2],De=(L[ve+3]&48)>>4,he=void 0;if(De>1){if(he=ve+5+L[ve+4],he===ve+188)continue}else he=ve+4;switch(_e){case B:Te&&(F&&(d=u(F))&&this.parseAVCPES(d,!1),F={data:[],size:0}),F&&(F.data.push(L.subarray(he,ve+188)),F.size+=ve+188-he);break;case _:Te&&(I&&(d=u(I))&&(y.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),I={data:[],size:0}),I&&(I.data.push(L.subarray(he,ve+188)),I.size+=ve+188-he);break;case M:Te&&(g&&(d=u(g))&&this.parseID3PES(d),g={data:[],size:0}),g&&(g.data.push(L.subarray(he,ve+188)),g.size+=ve+188-he);break;case 0:Te&&(he+=L[he]+1),ae=this._pmtId=f(L,he);break;case ae:{Te&&(he+=L[he]+1);var ce=l(L,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);B=ce.avc,B>0&&(w.pid=B),_=ce.audio,_>0&&(y.pid=_,y.isAAC=ce.isAAC),M=ce.id3,M>0&&(b.pid=M),H&&!$&&(v.logger.log("reparse from beginning"),H=!1,ve=Le-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w.pesData=F,y.pesData=I,b.pesData=g;var ne={audioTrack:y,avcTrack:w,id3Track:b,textTrack:this._txtTrack};return E&&this.extractRemainingSamples(ne),ne},S.flush=function(){var L=this.remainderData;this.remainderData=null;var A;return L?A=this.demux(L,-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},S.extractRemainingSamples=function(L){var A=L.audioTrack,C=L.avcTrack,E=L.id3Track,d=C.pesData,w=A.pesData,y=E.pesData,b;d&&(b=u(d))?(this.parseAVCPES(b,!0),C.pesData=null):C.pesData=d,w&&(b=u(w))?(A.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),A.pesData=null):(w!=null&&w.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),A.pesData=w),y&&(b=u(y))?(this.parseID3PES(b),E.pesData=null):E.pesData=y},S.demuxSampleAes=function(L,A,C){var E=this.demux(L,C,!0,!this.config.progressive),d=this.sampleAes=new W.default(this.observer,this.config,A);return this.decrypt(E,d)},S.decrypt=function(L,A){return new Promise(function(C){var E=L.audioTrack,d=L.avcTrack;E.samples&&E.isAAC?A.decryptAacSamples(E.samples,0,function(){d.samples?A.decryptAvcSamples(d.samples,0,0,function(){C(L)}):C(L)}):d.samples&&A.decryptAvcSamples(d.samples,0,0,function(){C(L)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(L,A){var C=this,E=this._avcTrack,d=this.parseAVCNALu(L.data),w=!1,y=this.avcSample,b,B=!1;L.data=null,y&&d.length&&!E.audFound&&(s(y,E),y=this.avcSample=o(!1,L.pts,L.dts,"")),d.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=C.avcSample=o(!0,L.pts,L.dts,"")),w&&(y.debug+="NDR "),y.frame=!0;var _=F.data;if(B&&_.length>4){var M=new U.default(_).readSliceType();(M===2||M===4||M===7||M===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=C.avcSample=o(!0,L.pts,L.dts,"")),w&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,w&&y&&(y.debug+="SEI ");var I=new U.default(O(F.data));I.readUByte();for(var g=0,H=0,$=!1,ae=0;!$&&I.bytesAvailable>1;){g=0;do ae=I.readUByte(),g+=ae;while(ae===255);H=0;do ae=I.readUByte(),H+=ae;while(ae===255);if(g===4&&I.bytesAvailable!==0){$=!0;var ue=I.readUByte();if(ue===181){var Le=I.readUShort();if(Le===49){var ve=I.readUInt();if(ve===1195456820){var Te=I.readUByte();if(Te===3){for(var _e=I.readUByte(),De=I.readUByte(),he=31&_e,ce=[_e,De],ne=0;ne<he;ne++)ce.push(I.readUByte()),ce.push(I.readUByte()),ce.push(I.readUByte());a(C._txtTrack.samples,{type:3,pts:L.pts,bytes:ce})}}}}}else if(g===5&&I.bytesAvailable!==0){if($=!0,H>16){for(var fe=[],le=0;le<16;le++)fe.push(I.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&fe.push("-");for(var ke=H-16,Fe=new Uint8Array(ke),Ae=0;Ae<ke;Ae++)Fe[Ae]=I.readUByte();a(C._txtTrack.samples,{pts:L.pts,payloadType:g,uuid:fe.join(""),userData:Object(z.utf8ArrayToStr)(Fe),userDataBytes:Fe})}}else if(H<I.bytesAvailable)for(var Re=0;Re<H;Re++)I.readUByte()}break}case 7:if(b=!0,B=!0,w&&y&&(y.debug+="SPS "),!E.sps){var Pe=new U.default(F.data),se=Pe.readSPS();E.width=se.width,E.height=se.height,E.pixelRatio=se.pixelRatio,E.sps=[F.data],E.duration=C._duration;for(var pe=F.data.subarray(1,4),ye="avc1.",Oe=0;Oe<3;Oe++){var je=pe[Oe].toString(16);je.length<2&&(je="0"+je),ye+=je}E.codec=ye}break;case 8:b=!0,w&&y&&(y.debug+="PPS "),E.pps||(E.pps=[F.data]);break;case 9:b=!1,E.audFound=!0,y&&s(y,E),y=C.avcSample=o(!1,L.pts,L.dts,w?"AUD ":"");break;case 12:b=!1;break;default:b=!1,y&&(y.debug+="unknown NAL "+F.type+" ");break}if(y&&b){var ze=y.units;ze.push(F)}}),A&&y&&(s(y,E),this.avcSample=null)},S.getLastNalUnit=function(){var L,A=this.avcSample,C;if(!A||A.units.length===0){var E=this._avcTrack.samples;A=E[E.length-1]}if((L=A)!==null&&L!==void 0&&L.units){var d=A.units;C=d[d.length-1]}return C},S.parseAVCNALu=function(L){var A=L.byteLength,C=this._avcTrack,E=C.naluState||0,d=E,w=[],y=0,b,B,F,_=-1,M=0;for(E===-1&&(_=0,M=L[0]&31,E=0,y=1);y<A;){if(b=L[y++],!E){E=b?0:1;continue}if(E===1){E=b?0:2;continue}if(!b)E=3;else if(b===1){if(_>=0){var I={data:L.subarray(_,y-E-1),type:M};w.push(I)}else{var g=this.getLastNalUnit();if(g&&(d&&y<=4-d&&(g.state&&(g.data=g.data.subarray(0,g.data.byteLength-d))),B=y-E-1,B>0)){var H=new Uint8Array(g.data.byteLength+B);H.set(g.data,0),H.set(L.subarray(0,B),g.data.byteLength),g.data=H,g.state=0}}y<A?(F=L[y]&31,_=y,M=F,E=0):E=-1}else E=0}if(_>=0&&E>=0){var $={data:L.subarray(_,A),type:M,state:E};w.push($)}if(w.length===0){var ae=this.getLastNalUnit();if(ae){var ue=new Uint8Array(ae.data.byteLength+L.byteLength);ue.set(ae.data,0),ue.set(L,ae.data.byteLength),ae.data=ue}}return C.naluState=E,w},S.parseAACPES=function(L){var A=0,C=this._audioTrack,E=this.aacOverFlow,d=L.data;if(E){this.aacOverFlow=null;var w=E.sample.unit.byteLength,y=Math.min(E.missing,w),b=w-y;E.sample.unit.set(d.subarray(0,y),b),C.samples.push(E.sample),A=E.missing}var B,F;for(B=A,F=d.length;B<F-1&&!Y.isHeader(d,B);B++);if(B!==A){var _,M;if(B<F-1?(_="AAC PES did not start with ADTS header,offset:"+B,M=!1):(_="no ADTS header found in AAC PES",M=!0),v.logger.warn("parsing error:"+_),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:_}),M)return}Y.initTrackConfig(C,this.observer,d,B,this.audioCodec);var I;if(L.pts!==void 0)I=L.pts;else if(E){var g=Y.getFrameDuration(C.samplerate);I=E.sample.pts+g}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;B<F;)if(Y.isHeader(d,B)){if(B+5<F){var $=Y.appendFrame(C,d,B,I,H);if($)if($.missing)this.aacOverFlow=$;else{B+=$.length,H++;continue}}break}else B++},S.parseMPEGPES=function(L){var A=L.data,C=A.length,E=0,d=0,w=L.pts;if(w===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<C;)if(j.isHeader(A,d)){var y=j.appendFrame(this._audioTrack,A,d,w,E);if(y)d+=y.length,E++;else break}else d++},S.parseID3PES=function(L){if(L.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(L)},x}();h.minProbeByteLength=188;function o(x,S,D,L){return{key:x,frame:!1,pts:S,dts:D,units:[],debug:L,length:0}}function f(x,S){return(x[S+10]&31)<<8|x[S+11]}function l(x,S,D,L){var A={audio:-1,avc:-1,id3:-1,isAAC:!0},C=(x[S+1]&15)<<8|x[S+2],E=S+3+C-4,d=(x[S+10]&15)<<8|x[S+11];for(S+=12+d;S<E;){var w=(x[S+1]&31)<<8|x[S+2];switch(x[S]){case 207:if(!L){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:A.audio===-1&&(A.audio=w);break;case 21:A.id3===-1&&(A.id3=w);break;case 219:if(!L){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:A.avc===-1&&(A.avc=w);break;case 3:case 4:D?A.audio===-1&&(A.audio=w,A.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((x[S+3]&15)<<8|x[S+4])+5}return A}function u(x){var S=0,D,L,A,C,E,d=x.data;if(!x||x.size===0)return null;for(;d[0].length<19&&d.length>1;){var w=new Uint8Array(d[0].length+d[1].length);w.set(d[0]),w.set(d[1],d[0].length),d[0]=w,d.splice(1,1)}D=d[0];var y=(D[0]<<16)+(D[1]<<8)+D[2];if(y===1){if(L=(D[4]<<8)+D[5],L&&L>x.size-6)return null;var b=D[7];b&192&&(C=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(E=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,C-E>60*9e4&&(v.logger.warn(Math.round((C-E)/9e4)+"s delta between PTS and DTS, align them"),C=E)):E=C),A=D[8];var B=A+9;if(x.size<=B)return null;x.size-=B;for(var F=new Uint8Array(x.size),_=0,M=d.length;_<M;_++){D=d[_];var I=D.byteLength;if(B)if(B>I){B-=I;continue}else D=D.subarray(B),I-=B,B=0;F.set(D,S),S+=I}return L&&(L-=A+3),{data:F,pts:C,dts:E,len:L}}return null}function s(x,S){if(x.units.length&&x.frame){if(x.pts===void 0){var D=S.samples,L=D.length;if(L){var A=D[L-1];x.pts=A.pts,x.dts=A.dts}else{S.dropped++;return}}S.samples.push(x)}x.debug.length&&v.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function a(x,S){var D=x.length;if(D>0){if(S.pts>=x[D-1].pts)x.push(S);else for(var L=D-1;L>=0;L--)if(S.pts<x[L].pts){x.splice(L,0,S);break}}else x.push(S)}function O(x){for(var S=x.byteLength,D=[],L=1;L<S-2;)x[L]===0&&x[L+1]===0&&x[L+2]===3?(D.push(L+2),L+=2):L++;if(D.length===0)return x;var A=S-D.length,C=new Uint8Array(A),E=0;for(L=0;L<A;E++,L++)E===D[0]&&(E++,D.shift()),C[L]=x[E];return C}J.default=h},"./src/errors.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"ErrorTypes",function(){return Y}),P.d(J,"ErrorDetails",function(){return j});var Y;(function(U){U.NETWORK_ERROR="networkError",U.MEDIA_ERROR="mediaError",U.KEY_SYSTEM_ERROR="keySystemError",U.MUX_ERROR="muxError",U.OTHER_ERROR="otherError"})(Y||(Y={}));var j;(function(U){U.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",U.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",U.KEY_SYSTEM_NO_SESSION="keySystemNoSession",U.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",U.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",U.MANIFEST_LOAD_ERROR="manifestLoadError",U.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",U.MANIFEST_PARSING_ERROR="manifestParsingError",U.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",U.LEVEL_EMPTY_ERROR="levelEmptyError",U.LEVEL_LOAD_ERROR="levelLoadError",U.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",U.LEVEL_SWITCH_ERROR="levelSwitchError",U.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",U.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",U.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",U.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",U.FRAG_LOAD_ERROR="fragLoadError",U.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",U.FRAG_DECRYPT_ERROR="fragDecryptError",U.FRAG_PARSING_ERROR="fragParsingError",U.REMUX_ALLOC_ERROR="remuxAllocError",U.KEY_LOAD_ERROR="keyLoadError",U.KEY_LOAD_TIMEOUT="keyLoadTimeOut",U.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",U.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",U.BUFFER_APPEND_ERROR="bufferAppendError",U.BUFFER_APPENDING_ERROR="bufferAppendingError",U.BUFFER_STALLED_ERROR="bufferStalledError",U.BUFFER_FULL_ERROR="bufferFullError",U.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",U.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",U.INTERNAL_EXCEPTION="internalException",U.INTERNAL_ABORTED="aborted",U.UNKNOWN="unknown"})(j||(j={}))},"./src/events.ts":function(ie,J,P){"use strict";P.r(J),P.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,P){"use strict";P.r(J),P.d(J,"default",function(){return x});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(Y),U=P("./src/loader/playlist-loader.ts"),z=P("./src/loader/key-loader.ts"),W=P("./src/controller/id3-track-controller.ts"),r=P("./src/controller/latency-controller.ts"),R=P("./src/controller/level-controller.ts"),v=P("./src/controller/fragment-tracker.ts"),m=P("./src/controller/stream-controller.ts"),p=P("./src/is-supported.ts"),h=P("./src/utils/logger.ts"),o=P("./src/config.ts"),f=P("./node_modules/eventemitter3/index.js"),l=P.n(f),u=P("./src/events.ts"),s=P("./src/errors.ts");function a(S,D){for(var L=0;L<D.length;L++){var A=D[L];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}function O(S,D,L){return D&&a(S.prototype,D),L&&a(S,L),S}var x=function(){S.isSupported=function(){return Object(p.isSupported)()};function S(L){L===void 0&&(L={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.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(o.mergeConfig)(S.DefaultConfig,L);this.userConfig=L,Object(h.enableLogs)(A.debug),this._autoLevelCapping=-1,A.progressive&&Object(o.enableStreamingMode)(A);var C=A.abrController,E=A.bufferController,d=A.capLevelController,w=A.fpsController,y=this.abrController=new C(this),b=this.bufferController=new E(this),B=this.capLevelController=new d(this),F=new w(this),_=new U.default(this),M=new z.default(this),I=new W.default(this),g=this.levelController=new R.default(this),H=new v.FragmentTracker(this),$=this.streamController=new m.default(this,H);B.setStreamController($),F.setStreamController($);var ae=[g,$];this.networkControllers=ae;var ue=[_,M,y,b,B,F,I,H];this.audioTrackController=this.createController(A.audioTrackController,null,ae),this.createController(A.audioStreamController,H,ae),this.subtitleTrackController=this.createController(A.subtitleTrackController,null,ae),this.createController(A.subtitleStreamController,H,ae),this.createController(A.timelineController,null,ue),this.emeController=this.createController(A.emeController,null,ue),this.cmcdController=this.createController(A.cmcdController,null,ue),this.latencyController=this.createController(r.default,null,ue),this.coreComponents=ue}var D=S.prototype;return D.createController=function(A,C,E){if(A){var d=C?new A(this,C):new A(this);return E&&E.push(d),d}return null},D.on=function(A,C,E){E===void 0&&(E=this),this._emitter.on(A,C,E)},D.once=function(A,C,E){E===void 0&&(E=this),this._emitter.once(A,C,E)},D.removeAllListeners=function(A){this._emitter.removeAllListeners(A)},D.off=function(A,C,E,d){E===void 0&&(E=this),this._emitter.off(A,C,E,d)},D.listeners=function(A){return this._emitter.listeners(A)},D.emit=function(A,C,E){return this._emitter.emit(A,C,E)},D.trigger=function(A,C){if(this.config.debug)return this.emit(A,A,C);try{return this.emit(A,A,C)}catch(E){h.logger.error("An internal error happened while handling event "+A+'. Error message: "'+E.message+'". Here is a stacktrace:',E),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:A,error:E})}return!1},D.listenerCount=function(A){return this._emitter.listenerCount(A)},D.destroy=function(){h.logger.log("destroy"),this.trigger(u.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},D.attachMedia=function(A){h.logger.log("attachMedia"),this._media=A,this.trigger(u.Events.MEDIA_ATTACHING,{media:A})},D.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(A){this.stopLoad();var C=this.media,E=this.url,d=this.url=Y.buildAbsoluteURL(self.location.href,A,{alwaysNormalize:!0});h.logger.log("loadSource:"+d),C&&E&&E!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(C)),this.trigger(u.Events.MANIFEST_LOADING,{url:A})},D.startLoad=function(A){A===void 0&&(A=-1),h.logger.log("startLoad("+A+")"),this.networkControllers.forEach(function(C){C.startLoad(A)})},D.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach(function(A){A.stopLoad()})},D.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){h.logger.log("recoverMediaError");var A=this._media;this.detachMedia(),A&&this.attachMedia(A)},D.removeLevel=function(A,C){C===void 0&&(C=0),this.levelController.removeLevel(A,C)},O(S,[{key:"levels",get:function(){var A=this.levelController.levels;return A||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(A){h.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){h.logger.log("set nextLevel:"+A),this.levelController.manualLevel=A,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(A){h.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){h.logger.log("set firstLevel:"+A),this.levelController.firstLevel=A}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(A){h.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 C=!!A;C!==this.config.capLevelToPlayerSize&&(C?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=C)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(A){this._autoLevelCapping!==A&&(h.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,C=this.config.minAutoBitrate;if(!A)return 0;for(var E=A.length,d=0;d<E;d++)if(A[d].maxBitrate>C)return d;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,C=this.autoLevelCapping,E;return C===-1&&A&&A.length?E=A.length-1:E=C,E}},{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 C=this.audioTrackController;C&&(C.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 C=this.subtitleTrackController;C&&(C.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 C=this.subtitleTrackController;C&&(C.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 u.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:o.hlsDefaultConfig},set:function(A){S.defaultConfig=A}}]),S}();x.defaultConfig=void 0},"./src/is-supported.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isSupported",function(){return U}),P.d(J,"changeTypeSupported",function(){return z});var Y=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function U(){var W=Object(Y.getMediaSource)();if(!W)return!1;var r=j(),R=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!R&&!!v}function z(){var W,r=j();return typeof(r==null||((W=r.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h}),P.d(J,"LoadError",function(){return f});var Y=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function U(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,v(l,u)}function z(l){var u=typeof Map=="function"?new Map:void 0;return z=function(a){if(a===null||!R(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(a))return u.get(a);u.set(a,O)}function O(){return W(a,arguments,m(this).constructor)}return O.prototype=Object.create(a.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v(O,a)},z(l)}function W(l,u,s){return r()?W=Reflect.construct:W=function(O,x,S){var D=[null];D.push.apply(D,x);var L=Function.bind.apply(O,D),A=new L;return S&&v(A,S.prototype),A},W.apply(null,arguments)}function r(){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 R(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function v(l,u){return v=Object.setPrototypeOf||function(a,O){return a.__proto__=O,a},v(l,u)}function m(l){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},m(l)}var p=Math.pow(2,17),h=function(){function l(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var u=l.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(a,O){var x=this,S=a.url;if(!S)return Promise.reject(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var D=this.config,L=D.fLoader,A=D.loader;return new Promise(function(C,E){x.loader&&x.loader.destroy();var d=x.loader=a.loader=L?new L(D):new A(D),w=o(a),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};a.stats=d.stats,d.load(w,y,{onSuccess:function(B,F,_,M){x.resetLoader(a,d),C({frag:a,part:null,payload:B.data,networkDetails:M})},onError:function(B,F,_){x.resetLoader(a,d),E(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:B,networkDetails:_}))},onAbort:function(B,F,_){x.resetLoader(a,d),E(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:_}))},onTimeout:function(B,F,_){x.resetLoader(a,d),E(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:_}))},onProgress:function(B,F,_,M){O&&O({frag:a,part:null,payload:_,networkDetails:M})}})})},u.loadPart=function(a,O,x){var S=this;this.abort();var D=this.config,L=D.fLoader,A=D.loader;return new Promise(function(C,E){S.loader&&S.loader.destroy();var d=S.loader=a.loader=L?new L(D):new A(D),w=o(a,O),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};O.stats=d.stats,d.load(w,y,{onSuccess:function(B,F,_,M){S.resetLoader(a,d),S.updateStatsFromPart(a,O);var I={frag:a,part:O,payload:B.data,networkDetails:M};x(I),C(I)},onError:function(B,F,_){S.resetLoader(a,d),E(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:O,response:B,networkDetails:_}))},onAbort:function(B,F,_){a.stats.aborted=O.stats.aborted,S.resetLoader(a,d),E(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:O,networkDetails:_}))},onTimeout:function(B,F,_){S.resetLoader(a,d),E(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:O,networkDetails:_}))}})})},u.updateStatsFromPart=function(a,O){var x=a.stats,S=O.stats,D=S.total;if(x.loaded+=S.loaded,D){var L=Math.round(a.duration/O.duration),A=Math.min(Math.round(x.loaded/D),L),C=L-A,E=C*Math.round(x.loaded/A);x.total=x.loaded+E}else x.total=Math.max(x.loaded,x.total);var d=x.loading,w=S.loading;d.start?d.first+=w.first-w.start:(d.start=w.start,d.first=w.first),d.end=w.end},u.resetLoader=function(a,O){a.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},l}();function o(l,u){u===void 0&&(u=null);var s=u||l,a={frag:l,part:u,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},O=s.byteRangeStartOffset,x=s.byteRangeEndOffset;return Object(Y.isFiniteNumber)(O)&&Object(Y.isFiniteNumber)(x)&&(a.rangeStart=O,a.rangeEnd=x),a}var f=function(l){U(u,l);function u(s){for(var a,O=arguments.length,x=new Array(O>1?O-1:0),S=1;S<O;S++)x[S-1]=arguments[S];return a=l.call.apply(l,[this].concat(x))||this,a.data=void 0,a.data=s,a}return u}(z(Error))},"./src/loader/fragment.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"ElementaryStreamTypes",function(){return h}),P.d(J,"BaseSegment",function(){return o}),P.d(J,"Fragment",function(){return f}),P.d(J,"Part",function(){return l});var Y=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(j),z=P("./src/utils/logger.ts"),W=P("./src/loader/level-key.ts"),r=P("./src/loader/load-stats.ts");function R(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,v(u,s)}function v(u,s){return v=Object.setPrototypeOf||function(O,x){return O.__proto__=x,O},v(u,s)}function m(u,s){for(var a=0;a<s.length;a++){var O=s[a];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(u,O.key,O)}}function p(u,s,a){return s&&m(u.prototype,s),a&&m(u,a),u}var h;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(h||(h={}));var o=function(){function u(a){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[h.AUDIO]=null,O[h.VIDEO]=null,O[h.AUDIOVIDEO]=null,O),this.baseurl=a}var s=u.prototype;return s.setByteRange=function(O,x){var S=O.split("@",2),D=[];S.length===1?D[0]=x?x.byteRangeEndOffset:0:D[0]=parseInt(S[1]),D[1]=parseInt(S[0])+D[0],this._byteRange=D},p(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(j.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(O){this._url=O}}]),u}(),f=function(u){R(s,u);function s(O,x){var S;return S=u.call(this,x)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new r.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=O,S}var a=s.prototype;return a.createInitializationVector=function(x){for(var S=new Uint8Array(16),D=12;D<16;D++)S[D]=x>>8*(15-D)&255;return S},a.setDecryptDataFromLevelKey=function(x,S){var D=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(D=W.LevelKey.fromURI(x.uri),D.method=x.method,D.iv=this.createInitializationVector(S),D.keyFormat="identity"),D},a.setElementaryStreamInfo=function(x,S,D,L,A,C){C===void 0&&(C=!1);var E=this.elementaryStreams,d=E[x];if(!d){E[x]={startPTS:S,endPTS:D,startDTS:L,endDTS:A,partial:C};return}d.startPTS=Math.min(d.startPTS,S),d.endPTS=Math.max(d.endPTS,D),d.startDTS=Math.min(d.startDTS,L),d.endDTS=Math.max(d.endDTS,A)},a.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[h.AUDIO]=null,x[h.VIDEO]=null,x[h.AUDIOVIDEO]=null},p(s,[{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)}}]),s}(o),l=function(u){R(s,u);function s(a,O,x,S,D){var L;L=u.call(this,x)||this,L.fragOffset=0,L.duration=0,L.gap=!1,L.independent=!1,L.relurl=void 0,L.fragment=void 0,L.index=void 0,L.stats=new r.LoadStats,L.duration=a.decimalFloatingPoint("DURATION"),L.gap=a.bool("GAP"),L.independent=a.bool("INDEPENDENT"),L.relurl=a.enumeratedString("URI"),L.fragment=O,L.index=S;var A=a.enumeratedString("BYTERANGE");return A&&L.setByteRange(A,D),D&&(L.fragOffset=D.fragOffset+D.duration),L}return p(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),s}(o)},"./src/loader/key-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return z});var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/utils/logger.ts"),z=function(){function W(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var r=W.prototype;return r._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(Y.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},r.onKeyLoading=function(v,m){var p=m.frag,h=p.type,o=this.loaders[h];if(!p.decryptdata){U.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(o&&(U.logger.warn("abort previous key loader for type:"+h),o.abort()),!f){U.logger.warn("key uri is falsy");return}var u=l.loader,s=p.loader=this.loaders[h]=new u(l);this.decrypturl=f,this.decryptkey=null;var a={url:f,frag:p,responseType:"arraybuffer"},O={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)};s.load(a,O,x)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,m,p){var h=p.frag;if(!h.decryptdata){U.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(v.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(Y.Events.KEY_LOADED,{frag:h})},r.loaderror=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},r.loadtimeout=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},W}()},"./src/loader/level-details.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"LevelDetails",function(){return W});var Y=P("./src/polyfills/number.ts");function j(r,R){for(var v=0;v<R.length;v++){var m=R[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(r,m.key,m)}}function U(r,R,v){return R&&j(r.prototype,R),v&&j(r,v),r}var z=10,W=function(){function r(v){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=v}var R=r.prototype;return R.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,h=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!h||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},U(r,[{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 m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"LevelKey",function(){return W});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(Y);function U(r,R){for(var v=0;v<R.length;v++){var m=R[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(r,m.key,m)}}function z(r,R,v){return R&&U(r.prototype,R),v&&U(r,v),r}var W=function(){r.fromURL=function(v,m){return new r(v,m)},r.fromURI=function(v){return new r(v)};function r(R,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(Y.buildAbsoluteURL)(R,v,{alwaysNormalize:!0}):this._uri=R}return z(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(ie,J,P){"use strict";P.r(J),P.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,P){"use strict";P.r(J),P.d(J,"default",function(){return s});var Y=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(j),z=P("./src/loader/fragment.ts"),W=P("./src/loader/level-details.ts"),r=P("./src/loader/level-key.ts"),R=P("./src/utils/attr-list.ts"),v=P("./src/utils/logger.ts"),m=P("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,h=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=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 u(D){var L,A;return l.test((L=(A=j.parseURL(D))===null||A===void 0?void 0:A.path)!=null?L:"")}var s=function(){function D(){}return D.findGroup=function(A,C){for(var E=0;E<A.length;E++){var d=A[E];if(d.id===C)return d}},D.convertAVC1ToAVCOTI=function(A){var C=A.split(".");if(C.length>2){var E=C.shift()+".";return E+=parseInt(C.shift()).toString(16),E+=("000"+parseInt(C.shift()).toString(16)).substr(-4),E}return A},D.resolve=function(A,C){return j.buildAbsoluteURL(C,A,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(A,C){var E=[],d={},w=!1;p.lastIndex=0;for(var y;(y=p.exec(A))!=null;)if(y[1]){var b=new R.AttrList(y[1]),B={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(y[2],C)},F=b.decimalResolution("RESOLUTION");F&&(B.width=F.width,B.height=F.height),a((b.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=D.convertAVC1ToAVCOTI(B.videoCodec)),E.push(B)}else if(y[3]){var _=new R.AttrList(y[3]);_["DATA-ID"]&&(w=!0,d[_["DATA-ID"]]=_)}return{levels:E,sessionData:w?d:null}},D.parseMasterPlaylistMedia=function(A,C,E,d){d===void 0&&(d=[]);var w,y=[],b=0;for(h.lastIndex=0;(w=h.exec(A))!==null;){var B=new R.AttrList(w[1]);if(B.TYPE===E){var F={attrs:B,bitrate:0,id:b++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:E,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?D.resolve(B.URI,C):""};if(d.length){var _=D.findGroup(d,F.groupId)||d[0];O(F,_,"audioCodec"),O(F,_,"textCodec")}y.push(F)}}return y},D.parseLevelPlaylist=function(A,C,E,d,w){var y=new W.LevelDetails(C),b=y.fragments,B=null,F=0,_=0,M=0,I=0,g=null,H=new z.Fragment(d,C),$,ae,ue,Le=-1,ve=!1;for(o.lastIndex=0,y.m3u8=A;($=o.exec(A))!==null;){ve&&(ve=!1,H=new z.Fragment(d,C),H.start=M,H.sn=F,H.cc=I,H.level=E,B&&(H.initSegment=B,H.rawProgramDateTime=B.rawProgramDateTime));var Te=$[1];if(Te){H.duration=parseFloat(Te);var _e=(" "+$[2]).slice(1);H.title=_e||null,H.tagList.push(_e?["INF",Te,_e]:["INF",Te])}else if($[3])Object(Y.isFiniteNumber)(H.duration)&&(H.start=M,ue&&(H.levelkey=ue),H.sn=F,H.level=E,H.cc=I,H.urlId=w,b.push(H),H.relurl=(" "+$[3]).slice(1),S(H,g),g=H,M+=H.duration,F++,_=0,ve=!0);else if($[4]){var De=(" "+$[4]).slice(1);g?H.setByteRange(De,g):H.setByteRange(De)}else if($[5])H.rawProgramDateTime=(" "+$[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),Le===-1&&(Le=b.length);else{if($=$[0].match(f),!$){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<$.length&&!(typeof $[ae]!="undefined");ae++);var he=(" "+$[ae]).slice(1),ce=(" "+$[ae+1]).slice(1),ne=$[ae+2]?(" "+$[ae+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":y.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":F=y.startSN=parseInt(ce);break;case"SKIP":{var fe=new R.AttrList(ce),le=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(Y.isFiniteNumber)(le)){y.skippedSegments=le;for(var ke=le;ke--;)b.unshift(null);F+=le}var Fe=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Fe&&(y.recentlyRemovedDateranges=Fe.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(ce);break;case"VERSION":y.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(ce||ne)&&H.tagList.push(ne?[ce,ne]:[ce]);break;case"DIS":I++;case"GAP":H.tagList.push([he]);break;case"BITRATE":H.tagList.push([he,ce]);break;case"DISCONTINUITY-SEQ":I=parseInt(ce);break;case"KEY":{var Ae,Re=new R.AttrList(ce),Pe=Re.enumeratedString("METHOD"),se=Re.URI,pe=Re.hexadecimalInteger("IV"),ye=Re.enumeratedString("KEYFORMATVERSIONS"),Oe=Re.enumeratedString("KEYID"),je=(Ae=Re.enumeratedString("KEYFORMAT"))!=null?Ae:"identity",ze=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ze.indexOf(je)>-1){v.logger.warn("Keyformat "+je+" is not supported from the manifest");continue}else if(je!=="identity")continue;Pe&&(ue=r.LevelKey.fromURL(C,se),se&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Pe)>=0&&(ue.method=Pe,ue.keyFormat=je,Oe&&(ue.keyID=Oe),ye&&(ue.keyFormatVersions=ye),ue.iv=pe));break}case"START":{var Je=new R.AttrList(ce),Ye=Je.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(Ye)&&(y.startTimeOffset=Ye);break}case"MAP":{var rt=new R.AttrList(ce);H.relurl=rt.URI,rt.BYTERANGE&&H.setByteRange(rt.BYTERANGE),H.level=E,H.sn="initSegment",ue&&(H.levelkey=ue),H.initSegment=null,B=H,ve=!0;break}case"SERVER-CONTROL":{var Ze=new R.AttrList(ce);y.canBlockReload=Ze.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=Ze.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&Ze.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=Ze.optionalFloat("PART-HOLD-BACK",0),y.holdBack=Ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var et=new R.AttrList(ce);y.partTarget=et.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=y.partList;Be||(Be=y.partList=[]);var ut=_>0?Be[Be.length-1]:void 0,st=_++,He=new z.Part(new R.AttrList(ce),H,C,st,ut);Be.push(He),H.duration+=He.duration;break}case"PRELOAD-HINT":{var We=new R.AttrList(ce);y.preloadHint=We;break}case"RENDITION-REPORT":{var Ie=new R.AttrList(ce);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Ie);break}default:v.logger.warn("line parsed but not handled: "+$);break}}}g&&!g.relurl?(b.pop(),M-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(S(H,g),H.cc=I,y.fragmentHint=H);var Ee=b.length,Ce=b[0],re=b[Ee-1];if(M+=y.skippedSegments*y.targetduration,M>0&&Ee&&re){y.averagetargetduration=M/Ee;var oe=re.sn;y.endSN=oe!=="initSegment"?oe:0,Ce&&(y.startCC=Ce.cc,Ce.initSegment||y.fragments.every(function(de){return de.relurl&&u(de.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new z.Fragment(d,C),H.relurl=re.relurl,H.level=E,H.sn="initSegment",Ce.initSegment=H,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(M+=y.fragmentHint.duration),y.totalduration=M,y.endCC=I,Le>0&&x(b,Le),y},D}();function a(D,L){["video","audio","text"].forEach(function(A){var C=D.filter(function(d){return Object(m.isCodecType)(d,A)});if(C.length){var E=C.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});L[A+"Codec"]=E.length>0?E[0]:C[0],D=D.filter(function(d){return C.indexOf(d)===-1})}}),L.unknownCodecs=D}function O(D,L,A){var C=L[A];C&&(D[A]=C)}function x(D,L){for(var A=D[L],C=L;C--;){var E=D[C];if(!E)return;E.programDateTime=A.programDateTime-E.duration*1e3,A=E}}function S(D,L){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):L!=null&&L.programDateTime&&(D.programDateTime=L.endProgramDateTime),Object(Y.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),z=P("./src/utils/logger.ts"),W=P("./src/utils/mp4-tools.ts"),r=P("./src/loader/m3u8-parser.ts"),R=P("./src/types/loader.ts"),v=P("./src/utils/attr-list.ts");function m(o){var f=o.type;switch(f){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function p(o,f){var l=o.url;return(l===void 0||l.indexOf("data:")===0)&&(l=f.url),l}var h=function(){function o(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var f=o.prototype;return f.registerListeners=function(){var u=this.hls;u.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(u){var s=this.hls.config,a=s.pLoader,O=s.loader,x=a||O,S=new x(s);return u.loader=S,this.loaders[u.type]=S,S},f.getInternalLoader=function(u){return this.loaders[u.type]},f.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},f.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(u,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},f.onLevelLoading=function(u,s){var a=s.id,O=s.level,x=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:null,level:O,responseType:"text",type:R.PlaylistContextType.LEVEL,url:x,deliveryDirectives:S})},f.onAudioTrackLoading=function(u,s){var a=s.id,O=s.groupId,x=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:S})},f.onSubtitleTrackLoading=function(u,s){var a=s.id,O=s.groupId,x=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:S})},f.load=function(u){var s,a=this.hls.config,O=this.getInternalLoader(u);if(O){var x=O.context;if(x&&x.url===u.url){z.logger.trace("[playlist-loader]: playlist request ongoing");return}z.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),O.abort()}var S,D,L,A;switch(u.type){case R.PlaylistContextType.MANIFEST:S=a.manifestLoadingMaxRetry,D=a.manifestLoadingTimeOut,L=a.manifestLoadingRetryDelay,A=a.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:S=0,D=a.levelLoadingTimeOut;break;default:S=a.levelLoadingMaxRetry,D=a.levelLoadingTimeOut,L=a.levelLoadingRetryDelay,A=a.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var C;if(u.type===R.PlaylistContextType.LEVEL&&u.level!==null?C=this.hls.levels[u.level].details:u.type===R.PlaylistContextType.AUDIO_TRACK&&u.id!==null?C=this.hls.audioTracks[u.id].details:u.type===R.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(C=this.hls.subtitleTracks[u.id].details),C){var E=C.partTarget,d=C.targetduration;E&&d&&(D=Math.min(Math.max(E*3,d*.8)*1e3,D))}}var w={timeout:D,maxRetry:S,retryDelay:L,maxRetryDelay:A,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(u,w,y)},f.loadsuccess=function(u,s,a,O){if(O===void 0&&(O=null),a.isSidxRequest){this.handleSidxRequest(u,a),this.handlePlaylistLoaded(u,s,a,O);return}this.resetInternalLoader(a.type);var x=u.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,a,"no EXTM3U delimiter",O);return}s.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,a,O):this.handleMasterPlaylist(u,s,a,O)},f.loaderror=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,u)},f.loadtimeout=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},f.handleMasterPlaylist=function(u,s,a,O){var x=this.hls,S=u.data,D=p(u,a),L=r.default.parseMasterPlaylist(S,D),A=L.levels,C=L.sessionData;if(!A.length){this.handleManifestParsingError(u,a,"no level found in manifest",O);return}var E=A.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),d=A.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),w=r.default.parseMasterPlaylistMedia(S,D,"AUDIO",E),y=r.default.parseMasterPlaylistMedia(S,D,"SUBTITLES",d),b=r.default.parseMasterPlaylistMedia(S,D,"CLOSED-CAPTIONS");if(w.length){var B=w.some(function(F){return!F.url});!B&&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"),w.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}x.trigger(j.Events.MANIFEST_LOADED,{levels:A,audioTracks:w,subtitles:y,captions:b,url:D,stats:s,networkDetails:O,sessionData:C})},f.handleTrackOrLevelPlaylist=function(u,s,a,O){var x=this.hls,S=a.id,D=a.level,L=a.type,A=p(u,a),C=Object(Y.isFiniteNumber)(S)?S:0,E=Object(Y.isFiniteNumber)(D)?D:C,d=m(a),w=r.default.parseLevelPlaylist(u.data,A,E,d,C);if(!w.fragments.length){x.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:A,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(L===R.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:w,name:"",url:A};x.trigger(j.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:A,stats:s,networkDetails:O,sessionData:null})}if(s.parsing.end=performance.now(),w.needSidxRanges){var b,B=(b=w.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:B,isSidxRequest:!0,type:L,level:D,levelDetails:w,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=w,this.handlePlaylistLoaded(u,s,a,O)},f.handleSidxRequest=function(u,s){var a=Object(W.parseSegmentIndex)(new Uint8Array(u.data));if(!a)return;var O=a.references,x=s.levelDetails;O.forEach(function(S,D){var L=S.info,A=x.fragments[D];A.byteRange.length===0&&A.setByteRange(String(1+L.end-L.start)+"@"+String(L.start)),A.initSegment&&A.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(u,s,a,O){this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===R.PlaylistContextType.MANIFEST,url:u.url,reason:a,response:u,context:s,networkDetails:O})},f.handleNetworkError=function(u,s,a,O){a===void 0&&(a=!1),z.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var x=U.ErrorDetails.UNKNOWN,S=!1,D=this.getInternalLoader(u);switch(u.type){case R.PlaylistContextType.MANIFEST:x=a?U.ErrorDetails.MANIFEST_LOAD_TIMEOUT:U.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case R.PlaylistContextType.LEVEL:x=a?U.ErrorDetails.LEVEL_LOAD_TIMEOUT:U.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case R.PlaylistContextType.AUDIO_TRACK:x=a?U.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:x=a?U.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:U.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}D&&this.resetInternalLoader(u.type);var L={type:U.ErrorTypes.NETWORK_ERROR,details:x,fatal:S,url:u.url,loader:D,context:u,networkDetails:s};O&&(L.response=O),this.hls.trigger(j.Events.ERROR,L)},f.handlePlaylistLoaded=function(u,s,a,O){var x=a.type,S=a.level,D=a.id,L=a.groupId,A=a.loader,C=a.levelDetails,E=a.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(u,a,"invalid target duration",O);return}if(!A)return;C.live&&(A.getCacheAge&&(C.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(x){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:C,level:S||0,id:D||0,stats:s,networkDetails:O,deliveryDirectives:E});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:C,id:D||0,groupId:L||"",stats:s,networkDetails:O,deliveryDirectives:E});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:C,id:D||0,groupId:L||"",stats:s,networkDetails:O,deliveryDirectives:E});break}},o}();J.default=h},"./src/polyfills/number.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isFiniteNumber",function(){return Y}),P.d(J,"MAX_SAFE_INTEGER",function(){return j});var Y=Number.isFinite||function(U){return typeof U=="number"&&isFinite(U)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,J,P){"use strict";P.r(J);var Y=function(){function j(){}return j.getSilentFrame=function(z,W){switch(z){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(W===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(W===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},j}();J.default=Y},"./src/remux/mp4-generator.ts":function(ie,J,P){"use strict";P.r(J);var Y=Math.pow(2,32)-1,j=function(){function U(){}return U.init=function(){U.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var W;for(W in U.types)U.types.hasOwnProperty(W)&&(U.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var r=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]),R=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]);U.HDLR_TYPES={video:r,audio:R};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=m,U.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),U.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),U.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,p,o,p,h),U.DINF=U.box(U.types.dinf,U.box(U.types.dref,v))},U.box=function(W){for(var r=8,R=arguments.length,v=new Array(R>1?R-1:0),m=1;m<R;m++)v[m-1]=arguments[m];for(var p=v.length,h=p;p--;)r+=v[p].byteLength;var o=new Uint8Array(r);for(o[0]=r>>24&255,o[1]=r>>16&255,o[2]=r>>8&255,o[3]=r&255,o.set(W,4),p=0,r=8;p<h;p++)o.set(v[p],r),r+=v[p].byteLength;return o},U.hdlr=function(W){return U.box(U.types.hdlr,U.HDLR_TYPES[W])},U.mdat=function(W){return U.box(U.types.mdat,W)},U.mdhd=function(W,r){r*=W;var R=Math.floor(r/(Y+1)),v=Math.floor(r%(Y+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},U.mdia=function(W){return U.box(U.types.mdia,U.mdhd(W.timescale,W.duration),U.hdlr(W.type),U.minf(W))},U.mfhd=function(W){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},U.minf=function(W){return W.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(W)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(W))},U.moof=function(W,r,R){return U.box(U.types.moof,U.mfhd(W),U.traf(R,r))},U.moov=function(W){for(var r=W.length,R=[];r--;)R[r]=U.trak(W[r]);return U.box.apply(null,[U.types.moov,U.mvhd(W[0].timescale,W[0].duration)].concat(R).concat(U.mvex(W)))},U.mvex=function(W){for(var r=W.length,R=[];r--;)R[r]=U.trex(W[r]);return U.box.apply(null,[U.types.mvex].concat(R))},U.mvhd=function(W,r){r*=W;var R=Math.floor(r/(Y+1)),v=Math.floor(r%(Y+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&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 U.box(U.types.mvhd,m)},U.sdtp=function(W){var r=W.samples||[],R=new Uint8Array(4+r.length),v,m;for(v=0;v<r.length;v++)m=r[v].flags,R[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return U.box(U.types.sdtp,R)},U.stbl=function(W){return U.box(U.types.stbl,U.stsd(W),U.box(U.types.stts,U.STTS),U.box(U.types.stsc,U.STSC),U.box(U.types.stsz,U.STSZ),U.box(U.types.stco,U.STCO))},U.avc1=function(W){var r=[],R=[],v,m,p;for(v=0;v<W.sps.length;v++)m=W.sps[v],p=m.byteLength,r.push(p>>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(m));for(v=0;v<W.pps.length;v++)m=W.pps[v],p=m.byteLength,R.push(p>>>8&255),R.push(p&255),R=R.concat(Array.prototype.slice.call(m));var h=U.box(U.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|W.sps.length].concat(r).concat([W.pps.length]).concat(R))),o=W.width,f=W.height,l=W.pixelRatio[0],u=W.pixelRatio[1];return U.box(U.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,o&255,f>>8&255,f&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]),h,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},U.esds=function(W){var r=W.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(W.config).concat([6,1,2]))},U.mp4a=function(W){var r=W.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),U.box(U.types.esds,U.esds(W)))},U.mp3=function(W){var r=W.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},U.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(W)):U.box(U.types.stsd,U.STSD,U.mp4a(W)):U.box(U.types.stsd,U.STSD,U.avc1(W))},U.tkhd=function(W){var r=W.id,R=W.duration*W.timescale,v=W.width,m=W.height,p=Math.floor(R/(Y+1)),h=Math.floor(R%(Y+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,h>>24,h>>16&255,h>>8&255,h&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,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},U.traf=function(W,r){var R=U.sdtp(W),v=W.id,m=Math.floor(r/(Y+1)),p=Math.floor(r%(Y+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),U.trun(W,R.length+16+20+8+16+8+8),R)},U.trak=function(W){return W.duration=W.duration||4294967295,U.box(U.types.trak,U.tkhd(W),U.mdia(W))},U.trex=function(W){var r=W.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(W,r){var R=W.samples||[],v=R.length,m=12+16*v,p=new Uint8Array(m),h,o,f,l,u,s;for(r+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),h=0;h<v;h++)o=R[h],f=o.duration,l=o.size,u=o.flags,s=o.cts,p.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*h);return U.box(U.types.trun,p)},U.initSegment=function(W){U.types||U.init();var r=U.moov(W),R=new Uint8Array(U.FTYP.byteLength+r.byteLength);return R.set(U.FTYP),R.set(r,U.FTYP.byteLength),R},U}();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,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"normalizePts",function(){return a});var Y=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),U=P("./src/remux/mp4-generator.ts"),z=P("./src/events.ts"),W=P("./src/errors.ts"),r=P("./src/utils/logger.ts"),R=P("./src/types/loader.ts"),v=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var L=1;L<arguments.length;L++){var A=arguments[L];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(D[C]=A[C])}return D},m.apply(this,arguments)}var p=10*1e3,h=1024,o=1152,f=null,l=null,u=!1,s=function(){function D(A,C,E,d){if(d===void 0&&(d=""),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=C,this.typeSupported=E,this.ISGenerated=!1,f===null){var w=navigator.userAgent||"",y=w.match(/Chrome\/(\d+)/i);f=y?parseInt(y[1]):0}if(l===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);l=b?parseInt(b[1]):0}u=!!f&&f<75||!!l&&l<600}var L=D.prototype;return L.destroy=function(){},L.resetTimeStamp=function(C){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=C},L.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},L.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},L.getVideoStartPts=function(C){var E=!1,d=C.reduce(function(w,y){var b=y.pts-w;return b<-4294967296?(E=!0,a(w,y.pts)):b>0?w:y.pts},C[0].pts);return E&&r.logger.debug("PTS rollover detected"),d},L.remux=function(C,E,d,w,y,b,B,F){var _,M,I,g,H,$,ae=y,ue=y,Le=C.pid>-1,ve=E.pid>-1,Te=E.samples.length,_e=C.samples.length>0,De=Te>1,he=(!Le||_e)&&(!ve||De)||this.ISGenerated||B;if(he){this.ISGenerated||(I=this.generateIS(C,E,y));var ce=this.isVideoContiguous,ne=-1;if(De&&(ne=O(E.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,ne>0){r.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Te+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(E.samples);E.samples=E.samples.slice(ne),E.dropped+=ne,ue+=(E.samples[0].pts-fe)/(E.timescale||9e4)}else ne===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),$=!1);if(this.ISGenerated){if(_e&&De){var le=this.getVideoStartPts(E.samples),ke=a(C.samples[0].pts,le)-le,Fe=ke/E.inputTimeScale;ae+=Math.max(0,Fe),ue+=Math.max(0,-Fe)}if(_e){if(C.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(C,E,y)),M=this.remuxAudio(C,ae,this.isAudioContiguous,b,ve||De||F===R.PlaylistLevelType.AUDIO?ue:void 0),De){var Ae=M?M.endPTS-M.startPTS:0;E.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(C,E,y)),_=this.remuxVideo(E,ue,ce,Ae)}}else De&&(_=this.remuxVideo(E,ue,ce,0));_&&(_.firstKeyFrame=ne,_.independent=ne!==-1)}}return this.ISGenerated&&(d.samples.length&&(H=this.remuxID3(d,y)),w.samples.length&&(g=this.remuxText(w,y))),{audio:M,video:_,initSegment:I,independent:$,text:g,id3:H}},L.generateIS=function(C,E,d){var w=C.samples,y=E.samples,b=this.typeSupported,B={},F=!Object(Y.isFiniteNumber)(this._initPTS),_="audio/mp4",M,I,g;if(F&&(M=I=Infinity),C.config&&w.length&&(C.timescale=C.samplerate,C.isAAC||(b.mpeg?(_="audio/mpeg",C.codec=""):b.mp3&&(C.codec="mp3")),B.audio={id:"audio",container:_,codec:C.codec,initSegment:!C.isAAC&&b.mpeg?new Uint8Array(0):U.default.initSegment([C]),metadata:{channelCount:C.channelCount}},F&&(g=C.inputTimeScale,M=I=w[0].pts-Math.round(g*d))),E.sps&&E.pps&&y.length&&(E.timescale=E.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:E.codec,initSegment:U.default.initSegment([E]),metadata:{width:E.width,height:E.height}},F)){g=E.inputTimeScale;var H=this.getVideoStartPts(y),$=Math.round(g*d);I=Math.min(I,a(y[0].dts,H)-$),M=Math.min(M,H-$)}if(Object.keys(B).length)return this.ISGenerated=!0,F&&(this._initPTS=M,this._initDTS=I),{tracks:B,initPTS:M,timescale:g}},L.remuxVideo=function(C,E,d,w){var y=C.inputTimeScale,b=C.samples,B=[],F=b.length,_=this._initPTS,M=this.nextAvcDts,I=8,g,H,$,ae=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,Le=0,ve=!1;if(!d||M===null){var Te=E*y,_e=b[0].pts-a(b[0].dts,b[0].pts);M=Te-_e}for(var De=0;De<F;De++){var he=b[De];if(he.pts=a(he.pts-_,M),he.dts=a(he.dts-_,M),he.dts>he.pts){var ce=9e4*.2;Le=Math.max(Math.min(Le,he.pts-he.dts),-1*ce)}he.dts<b[De>0?De-1:De].dts&&(ve=!0)}ve&&b.sort(function(wt,St){var dt=wt.dts-St.dts,Bt=wt.pts-St.pts;return dt||Bt}),H=b[0].dts,$=b[b.length-1].dts;var ne=Math.round(($-H)/(F-1));if(Le<0){if(Le<ne*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var fe=Le,le=0;le<F;le++)b[le].dts=fe=Math.max(fe,b[le].pts-ne),b[le].pts=Math.max(fe,b[le].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Le,!0)+" ms to overcome this issue");for(var ke=0;ke<F;ke++)b[ke].dts=b[ke].dts+Le}H=b[0].dts}if(d){var Fe=H-M,Ae=Fe>ne,Re=Fe<-1;if(Ae||Re){Ae?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Fe,!0)+" ms ("+Fe+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Fe,!0)+" ms ("+Fe+"dts) overlapping between fragments detected"),H=M;var Pe=b[0].pts-Fe;b[0].dts=H,b[0].pts=Pe,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Pe,!0)+"/"+Object(v.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Fe,!0)+" ms")}}u&&(H=Math.max(0,H));for(var se=0,pe=0,ye=0;ye<F;ye++){for(var Oe=b[ye],je=Oe.units,ze=je.length,Je=0,Ye=0;Ye<ze;Ye++)Je+=je[Ye].data.length;pe+=Je,se+=ze,Oe.length=Je,Oe.dts=Math.max(Oe.dts,H),Oe.pts=Math.max(Oe.pts,Oe.dts,0),ae=Math.min(Oe.pts,ae),ue=Math.max(Oe.pts,ue)}$=b[F-1].dts;var rt=pe+4*se+8,Ze;try{Ze=new Uint8Array(rt)}catch(wt){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:rt,reason:"fail allocating video mdat "+rt});return}var et=new DataView(Ze.buffer);et.setUint32(0,rt),Ze.set(U.default.types.mdat,4);for(var Be=0;Be<F;Be++){for(var ut=b[Be],st=ut.units,He=0,We=0,Ie=st.length;We<Ie;We++){var Ee=st[We],Ce=Ee.data,re=Ee.data.byteLength;et.setUint32(I,re),I+=4,Ze.set(Ce,I),I+=re,He+=4+re}if(Be<F-1)g=b[Be+1].dts-ut.dts;else{var oe=this.config,de=ut.dts-b[Be>0?Be-1:Be].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(oe.maxBufferHole*y),Se=(w?ae+w*y:this.nextAudioPts)-ut.pts;Se>ge?(g=Se-de,g<0&&(g=de),r.logger.log("[mp4-remuxer]: It is approximately "+Se/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=de}else g=de}var Ue=Math.round(ut.pts-ut.dts);B.push(new x(ut.key,g,He,Ue))}if(B.length&&f&&f<70){var Ve=B[0].flags;Ve.dependsOn=2,Ve.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=$+g,this.isVideoContiguous=!0;var ot=U.default.moof(C.sequenceNumber++,H,m({},C,{samples:B})),mt="video",ft={data1:ot,data2:Ze,startPTS:ae/y,endPTS:(ue+g)/y,startDTS:H/y,endDTS:M/y,type:mt,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(Ze.length,"MDAT length must not be zero"),ft},L.remuxAudio=function(C,E,d,w,y){var b=C.inputTimeScale,B=C.samplerate?C.samplerate:b,F=b/B,_=C.isAAC?h:o,M=_*F,I=this._initPTS,g=!C.isAAC&&this.typeSupported.mpeg,H=[],$=C.samples,ae=g?0:8,ue=this.nextAudioPts||-1,Le=E*b;if(this.isAudioContiguous=d=d||$.length&&ue>0&&(w&&Math.abs(Le-ue)<9e3||Math.abs(a($[0].pts-I,Le)-ue)<20*M),$.forEach(function(Ce){Ce.pts=a(Ce.pts-I,Le)}),!d||ue<0){if($=$.filter(function(Ce){return Ce.pts>=0}),!$.length)return;y===0?ue=0:w?ue=Math.max(0,Le):ue=$[0].pts}if(C.isAAC)for(var ve=y!==void 0,Te=this.config.maxAudioFramesDrift,_e=0,De=ue;_e<$.length;_e++){var he=$[_e],ce=he.pts,ne=ce-De,fe=Math.abs(1e3*ne/b);if(ne<=-Te*M&&ve)_e===0&&(r.logger.warn("Audio frame @ "+(ce/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/b)+" ms."),this.nextAudioPts=ue=De=ce);else if(ne>=Te*M&&fe<p&&ve){var le=Math.round(ne/M);De=ce-le*M,De<0&&(le--,De+=M),_e===0&&(this.nextAudioPts=ue=De),r.logger.warn("[mp4-remuxer]: Injecting "+le+" audio frame @ "+(De/b).toFixed(3)+"s due to "+Math.round(1e3*ne/b)+" ms gap.");for(var ke=0;ke<le;ke++){var Fe=Math.max(De,0),Ae=j.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);Ae||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ae=he.unit.subarray()),$.splice(_e,0,{unit:Ae,pts:Fe}),De+=M,_e++}}he.pts=De,De+=M}for(var Re=null,Pe=null,se,pe=0,ye=$.length;ye--;)pe+=$[ye].unit.byteLength;for(var Oe=0,je=$.length;Oe<je;Oe++){var ze=$[Oe],Je=ze.unit,Ye=ze.pts;if(Pe!==null){var rt=H[Oe-1];rt.duration=Math.round((Ye-Pe)/F)}else if(d&&C.isAAC&&(Ye=ue),Re=Ye,pe>0){pe+=ae;try{se=new Uint8Array(pe)}catch(Ce){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:pe,reason:"fail allocating audio mdat "+pe});return}if(!g){var Ze=new DataView(se.buffer);Ze.setUint32(0,pe),se.set(U.default.types.mdat,4)}}else return;se.set(Je,ae);var et=Je.byteLength;ae+=et,H.push(new x(!0,_,et,0)),Pe=Ye}var Be=H.length;if(!Be)return;var ut=H[H.length-1];this.nextAudioPts=ue=Pe+F*ut.duration;var st=g?new Uint8Array(0):U.default.moof(C.sequenceNumber++,Re/F,m({},C,{samples:H}));C.samples=[];var He=Re/b,We=ue/b,Ie="audio",Ee={data1:st,data2:se,startPTS:He,endPTS:We,startDTS:He,endDTS:We,type:Ie,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(se.length,"MDAT length must not be zero"),Ee},L.remuxEmptyAudio=function(C,E,d,w){var y=C.inputTimeScale,b=C.samplerate?C.samplerate:y,B=y/b,F=this.nextAudioPts,_=(F!==null?F:w.startDTS*y)+this._initDTS,M=w.endDTS*y+this._initDTS,I=B*h,g=Math.ceil((M-_)/I),H=j.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ae=0;ae<g;ae++){var ue=_+ae*I;$.push({unit:H,pts:ue,dts:ue})}return C.samples=$,this.remuxAudio(C,E,d,!1)},L.remuxID3=function(C,E){var d=C.samples.length;if(!d)return;for(var w=C.inputTimeScale,y=this._initPTS,b=this._initDTS,B=0;B<d;B++){var F=C.samples[B];F.pts=a(F.pts-y,E*w)/w,F.dts=a(F.dts-b,E*w)/w}var _=C.samples;return C.samples=[],{samples:_}},L.remuxText=function(C,E){var d=C.samples.length;if(!d)return;for(var w=C.inputTimeScale,y=this._initPTS,b=0;b<d;b++){var B=C.samples[b];B.pts=a(B.pts-y,E*w)/w}C.samples.sort(function(_,M){return _.pts-M.pts});var F=C.samples;return C.samples=[],{samples:F}},D}();function a(D,L){var A;if(L===null)return D;for(L<D?A=-8589934592:A=8589934592;Math.abs(D-L)>4294967296;)D+=A;return D}function O(D){for(var L=0;L<D.length;L++)if(D[L].key)return L;return-1}var x=function(L,A,C,E){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=A,this.size=C,this.cts=E,this.flags=new S(L)},S=function(L){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=L?2:1,this.isNonSync=L?0:1}},"./src/remux/passthrough-remuxer.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/mp4-tools.ts"),U=P("./src/loader/fragment.ts"),z=P("./src/utils/logger.ts"),W=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=v.prototype;return m.destroy=function(){},m.resetTimeStamp=function(h){this.initPTS=h,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(h,o,f){this.audioCodec=o,this.videoCodec=f,this.generateInitSegment(h),this.emitInitSegment=!0},m.generateInitSegment=function(h){var o=this.audioCodec,f=this.videoCodec;if(!h||!h.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(j.parseInitSegment)(h);o||(o=R(l.audio,U.ElementaryStreamTypes.AUDIO)),f||(f=R(l.video,U.ElementaryStreamTypes.VIDEO));var u={};l.audio&&l.video?u.audiovideo={container:"video/mp4",codec:o+","+f,initSegment:h,id:"main"}:l.audio?u.audio={container:"audio/mp4",codec:o,initSegment:h,id:"audio"}:l.video?u.video={container:"video/mp4",codec:f,initSegment:h,id:"main"}:z.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},m.remux=function(h,o,f,l,u){var s=this.initPTS,a=this.lastEndDTS,O={audio:void 0,video:void 0,text:l,id3:f,initSegment:void 0};Object(Y.isFiniteNumber)(a)||(a=this.lastEndDTS=u||0);var x=o.samples;if(!x||!x.length)return O;var S={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(x),D=this.initData),!D||!D.length)return z.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(Y.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=r(D,x,a));var L=Object(j.getDuration)(x,D),A=a,C=L+A;Object(j.offsetStartDTS)(D,x,s),L>0?this.lastEndDTS=C:(z.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var E=!!D.audio,d=!!D.video,w="";E&&(w+="audio"),d&&(w+="video");var y={data1:x,startPTS:A,startDTS:A,endPTS:C,endDTS:C,type:w,hasAudio:E,hasVideo:d,nb:1,dropped:0};return O.audio=y.type==="audio"?y:void 0,O.video=y.type!=="audio"?y:void 0,O.text=l,O.id3=f,O.initSegment=S,O},v}(),r=function(m,p,h){return Object(j.getStartDTS)(m,p)-h};function R(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===U.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=W},"./src/task-loop.ts":function(ie,J,P){"use strict";P.r(J),P.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 U=j.prototype;return U.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},U.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},U.onHandlerDestroyed=function(){},U.hasInterval=function(){return!!this._tickInterval},U.hasNextTick=function(){return!!this._tickTimer},U.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},U.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},U.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},U.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},U.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},U.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"CMCDVersion",function(){return Y}),P.d(J,"CMCDObjectType",function(){return j}),P.d(J,"CMCDStreamingFormat",function(){return U}),P.d(J,"CMCDStreamType",function(){return z});var Y=1,j;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(j||(j={}));var U;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(U||(U={}));var z;(function(W){W.VOD="v",W.LIVE="l"})(z||(z={}))},"./src/types/level.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"HlsSkip",function(){return U}),P.d(J,"getSkipValue",function(){return z}),P.d(J,"HlsUrlParameters",function(){return W}),P.d(J,"Level",function(){return r});function Y(R,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function j(R,v,m){return v&&Y(R.prototype,v),m&&Y(R,m),R}var U;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(U||(U={}));function z(R,v){var m=R.canSkipUntil,p=R.canSkipDateRanges,h=R.endSN,o=v!==void 0?v-h:0;return m&&o<m?p?U.v2:U.Yes:U.No}var W=function(){function R(m,p,h){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=h}var v=R.prototype;return v.addDirectives=function(p){var h=new self.URL(p);return this.msn!==void 0&&h.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&h.searchParams.set("_HLS_part",this.part.toString()),this.skip&&h.searchParams.set("_HLS_skip",this.skip),h.toString()},R}(),r=function(){function R(v){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=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return j(R,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),R}()},"./src/types/loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"PlaylistContextType",function(){return Y}),P.d(J,"PlaylistLevelType",function(){return j});var Y;(function(U){U.MANIFEST="manifest",U.LEVEL="level",U.AUDIO_TRACK="audioTrack",U.SUBTITLE_TRACK="subtitleTrack"})(Y||(Y={}));var j;(function(U){U.MAIN="main",U.AUDIO="audio",U.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"ChunkMetadata",function(){return Y});var Y=function(z,W,r,R,v,m){R===void 0&&(R=0),v===void 0&&(v=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=j(),this.buffering={audio:j(),video:j(),audiovideo:j()},this.level=z,this.sn=W,this.id=r,this.size=R,this.part=v,this.partial=m};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"AttrList",function(){return U});var Y=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,U=function(){function z(r){typeof r=="string"&&(r=z.parseAttrList(r));for(var R in r)r.hasOwnProperty(R)&&(this[R]=r[R])}var W=z.prototype;return W.decimalInteger=function(R){var v=parseInt(this[R],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},W.hexadecimalInteger=function(R){if(this[R]){var v=(this[R]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)m[p]=parseInt(v.slice(p*2,p*2+2),16);return m}else return null},W.hexadecimalIntegerAsNumber=function(R){var v=parseInt(this[R],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},W.decimalFloatingPoint=function(R){return parseFloat(this[R])},W.optionalFloat=function(R,v){var m=this[R];return m?parseFloat(m):v},W.enumeratedString=function(R){return this[R]},W.bool=function(R){return this[R]==="YES"},W.decimalResolution=function(R){var v=Y.exec(this[R]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},z.parseAttrList=function(R){var v,m={},p='"';for(j.lastIndex=0;(v=j.exec(R))!==null;){var h=v[2];h.indexOf(p)===0&&h.lastIndexOf(p)===h.length-1&&(h=h.slice(1,-1)),m[v[1]]=h}return m},z}()},"./src/utils/binary-search.ts":function(ie,J,P){"use strict";P.r(J);var Y={search:function(U,z){for(var W=0,r=U.length-1,R=null,v=null;W<=r;){R=(W+r)/2|0,v=U[R];var m=z(v);if(m>0)W=R+1;else if(m<0)r=R-1;else return v}return null}};J.default=Y},"./src/utils/buffer-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"BufferHelper",function(){return U});var Y=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},U=function(){function z(){}return z.isBuffered=function(r,R){try{if(r){for(var v=z.getBuffered(r),m=0;m<v.length;m++)if(R>=v.start(m)&&R<=v.end(m))return!0}}catch(p){}return!1},z.bufferInfo=function(r,R,v){try{if(r){var m=z.getBuffered(r),p=[],h;for(h=0;h<m.length;h++)p.push({start:m.start(h),end:m.end(h)});return this.bufferedInfo(p,R,v)}}catch(o){}return{len:0,start:R,end:R,nextStart:void 0}},z.bufferedInfo=function(r,R,v){R=Math.max(0,R),r.sort(function(S,D){var L=S.start-D.start;return L||D.end-S.end});var m=[];if(v)for(var p=0;p<r.length;p++){var h=m.length;if(h){var o=m[h-1].end;r[p].start-o<v?r[p].end>o&&(m[h-1].end=r[p].end):m.push(r[p])}else m.push(r[p])}else m=r;for(var f=0,l,u=R,s=R,a=0;a<m.length;a++){var O=m[a].start,x=m[a].end;if(R+v>=O&&R<x)u=O,s=x,f=s-R;else if(R+v<O){l=O;break}}return{len:f,start:u||0,end:s||0,nextStart:l}},z.getBuffered=function(r){try{return r.buffered}catch(R){return Y.logger.log("failed to get media.buffered",R),j}},z}()},"./src/utils/cea-608-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"Row",function(){return s}),P.d(J,"CaptionScreen",function(){return a});var Y=P("./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},U=function(C){var E=C;return j.hasOwnProperty(C)&&(E=j[C]),String.fromCharCode(E)},z=15,W=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},R={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h;(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"})(h||(h={}));var o=function(){function A(){this.time=null,this.verboseLevel=h.ERROR}var C=A.prototype;return C.log=function(d,w){this.verboseLevel>=d&&Y.logger.log(this.time+" ["+d+"] "+w)},A}(),f=function(C){for(var E=[],d=0;d<C.length;d++)E.push(C[d].toString(16));return E},l=function(){function A(E,d,w,y,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=E||"white",this.underline=d||!1,this.italics=w||!1,this.background=y||"black",this.flash=b||!1}var C=A.prototype;return C.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},C.setStyles=function(d){for(var w=["foreground","underline","italics","background","flash"],y=0;y<w.length;y++){var b=w[y];d.hasOwnProperty(b)&&(this[b]=d[b])}},C.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},C.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},C.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},C.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},A}(),u=function(){function A(E,d,w,y,b,B){this.uchar=void 0,this.penState=void 0,this.uchar=E||" ",this.penState=new l(d,w,y,b,B)}var C=A.prototype;return C.reset=function(){this.uchar=" ",this.penState.reset()},C.setChar=function(d,w){this.uchar=d,this.penState.copy(w)},C.setPenState=function(d){this.penState.copy(d)},C.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},C.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},C.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},A}(),s=function(){function A(E){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var d=0;d<W;d++)this.chars.push(new u);this.logger=E,this.pos=0,this.currPenState=new l}var C=A.prototype;return C.equals=function(d){for(var w=!0,y=0;y<W;y++)if(!this.chars[y].equals(d.chars[y])){w=!1;break}return w},C.copy=function(d){for(var w=0;w<W;w++)this.chars[w].copy(d.chars[w])},C.isEmpty=function(){for(var d=!0,w=0;w<W;w++)if(!this.chars[w].isEmpty()){d=!1;break}return d},C.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(h.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},C.moveCursor=function(d){var w=this.pos+d;if(d>1)for(var y=this.pos+1;y<w+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(w)},C.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},C.insertChar=function(d){d>=144&&this.backSpace();var w=U(d);if(this.pos>=W){this.logger.log(h.ERROR,"Cannot insert "+d.toString(16)+" ("+w+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(w,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(d){var w;for(w=d;w<W;w++)this.chars[w].reset()},C.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},C.clearToEndOfRow=function(){this.clearFromPos(this.pos)},C.getTextString=function(){for(var d=[],w=!0,y=0;y<W;y++){var b=this.chars[y].uchar;b!==" "&&(w=!1),d.push(b)}return w?"":d.join("")},C.setPenStyles=function(d){this.currPenState.setStyles(d);var w=this.chars[this.pos];w.setPenState(this.currPenState)},A}(),a=function(){function A(E){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var d=0;d<z;d++)this.rows.push(new s(E));this.logger=E,this.currRow=z-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var C=A.prototype;return C.reset=function(){for(var d=0;d<z;d++)this.rows[d].clear();this.currRow=z-1},C.equals=function(d){for(var w=!0,y=0;y<z;y++)if(!this.rows[y].equals(d.rows[y])){w=!1;break}return w},C.copy=function(d){for(var w=0;w<z;w++)this.rows[w].copy(d.rows[w])},C.isEmpty=function(){for(var d=!0,w=0;w<z;w++)if(!this.rows[w].isEmpty()){d=!1;break}return d},C.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},C.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},C.insertChar=function(d){var w=this.rows[this.currRow];w.insertChar(d)},C.setPen=function(d){var w=this.rows[this.currRow];w.setPenStyles(d)},C.moveCursor=function(d){var w=this.rows[this.currRow];w.moveCursor(d)},C.setCursor=function(d){this.logger.log(h.INFO,"setCursor: "+d);var w=this.rows[this.currRow];w.setCursor(d)},C.setPAC=function(d){this.logger.log(h.INFO,"pacData = "+JSON.stringify(d));var w=d.row-1;if(this.nrRollUpRows&&w<this.nrRollUpRows-1&&(w=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==w){for(var y=0;y<z;y++)this.rows[y].clear();var b=this.currRow+1-this.nrRollUpRows,B=this.lastOutputScreen;if(B){var F=B.rows[b].cueStartTime,_=this.logger.time;if(F&&_!==null&&F<_)for(var M=0;M<this.nrRollUpRows;M++)this.rows[w-this.nrRollUpRows+M+1].copy(B.rows[b+M])}}this.currRow=w;var I=this.rows[this.currRow];if(d.indent!==null){var g=d.indent,H=Math.max(g-1,0);I.setCursor(d.indent),d.color=I.chars[H].penState.foreground}var $={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen($)},C.setBkgData=function(d){this.logger.log(h.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},C.setRollUpRows=function(d){this.nrRollUpRows=d},C.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(h.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(h.TEXT,this.getDisplayText());var d=this.currRow+1-this.nrRollUpRows,w=this.rows.splice(d,1)[0];w.clear(),this.rows.splice(this.currRow,0,w),this.logger.log(h.INFO,"Rolling up")},C.getDisplayText=function(d){d=d||!1;for(var w=[],y="",b=-1,B=0;B<z;B++){var F=this.rows[B].getTextString();F&&(b=B+1,d?w.push("Row "+b+": '"+F+"'"):w.push(F.trim()))}return w.length>0&&(d?y="["+w.join(" | ")+"]":y=w.join(`
`)),y},C.getTextAndFormat=function(){return this.rows},A}(),O=function(){function A(E,d,w){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=E,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new a(w),this.nonDisplayedMemory=new a(w),this.lastOutputScreen=new a(w),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=w}var C=A.prototype;return C.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},C.getHandler=function(){return this.outputFilter},C.setHandler=function(d){this.outputFilter=d},C.setPAC=function(d){this.writeScreen.setPAC(d)},C.setBkgData=function(d){this.writeScreen.setBkgData(d)},C.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(h.INFO,"MODE="+d),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=d},C.insertChars=function(d){for(var w=0;w<d.length;w++)this.writeScreen.insertChar(d[w]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(h.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(h.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},C.ccRCL=function(){this.logger.log(h.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},C.ccBS=function(){if(this.logger.log(h.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},C.ccAOF=function(){},C.ccAON=function(){},C.ccDER=function(){this.logger.log(h.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},C.ccRU=function(d){this.logger.log(h.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},C.ccFON=function(){this.logger.log(h.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},C.ccRDC=function(){this.logger.log(h.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},C.ccTR=function(){this.logger.log(h.INFO,"TR"),this.setMode("MODE_TEXT")},C.ccRTD=function(){this.logger.log(h.INFO,"RTD"),this.setMode("MODE_TEXT")},C.ccEDM=function(){this.logger.log(h.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},C.ccCR=function(){this.logger.log(h.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},C.ccENM=function(){this.logger.log(h.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},C.ccEOC=function(){if(this.logger.log(h.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(h.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},C.ccTO=function(d){this.logger.log(h.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},C.ccMIDROW=function(d){var w={flash:!1};if(w.underline=d%2===1,w.italics=d>=46,w.italics)w.foreground="white";else{var y=Math.floor(d/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=b[y]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},C.outputDataUpdate=function(d){d===void 0&&(d=!1);var w=this.logger.time;if(w===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=w:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,w,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:w),this.lastOutputScreen.copy(this.displayedMemory))},C.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},A}(),x=function(){function A(E,d,w){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new o;this.channels=[null,new O(E,d,y),new O(E+1,w,y)],this.cmdHistory=L(),this.logger=y}var C=A.prototype;return C.getHandler=function(d){return this.channels[d].getHandler()},C.setHandler=function(d,w){this.channels[d].setHandler(w)},C.addData=function(d,w){var y,b,B,F=!1;this.logger.time=d;for(var _=0;_<w.length;_+=2){if(b=w[_]&127,B=w[_+1]&127,b===0&&B===0)continue;if(this.logger.log(h.DATA,"["+f([w[_],w[_+1]])+"] -> ("+f([b,B])+")"),y=this.parseCmd(b,B),y||(y=this.parseMidrow(b,B)),y||(y=this.parsePAC(b,B)),y||(y=this.parseBackgroundAttributes(b,B)),!y&&(F=this.parseChars(b,B),F)){var M=this.currentChannel;if(M&&M>0){var I=this.channels[M];I.insertChars(F)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+f([b,B])+" orig: "+f([w[_],w[_+1]]))}},C.parseCmd=function(d,w){var y=this.cmdHistory,b=(d===20||d===28||d===21||d===29)&&w>=32&&w<=47,B=(d===23||d===31)&&w>=33&&w<=35;if(!(b||B))return!1;if(D(d,w,y))return S(null,null,y),this.logger.log(h.DEBUG,"Repeated command ("+f([d,w])+") is dropped"),!0;var F=d===20||d===21||d===23?1:2,_=this.channels[F];return d===20||d===21||d===28||d===29?w===32?_.ccRCL():w===33?_.ccBS():w===34?_.ccAOF():w===35?_.ccAON():w===36?_.ccDER():w===37?_.ccRU(2):w===38?_.ccRU(3):w===39?_.ccRU(4):w===40?_.ccFON():w===41?_.ccRDC():w===42?_.ccTR():w===43?_.ccRTD():w===44?_.ccEDM():w===45?_.ccCR():w===46?_.ccENM():w===47&&_.ccEOC():_.ccTO(w-32),S(d,w,y),this.currentChannel=F,!0},C.parseMidrow=function(d,w){var y=0;if((d===17||d===25)&&w>=32&&w<=47){if(d===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(w),this.logger.log(h.DEBUG,"MIDROW ("+f([d,w])+")"),!0):!1}return!1},C.parsePAC=function(d,w){var y,b=this.cmdHistory,B=(d>=17&&d<=23||d>=25&&d<=31)&&w>=64&&w<=127,F=(d===16||d===24)&&w>=64&&w<=95;if(!(B||F))return!1;if(D(d,w,b))return S(null,null,b),!0;var _=d<=23?1:2;w>=64&&w<=95?y=_===1?r[d]:v[d]:y=_===1?R[d]:m[d];var M=this.channels[_];return M?(M.setPAC(this.interpretPAC(y,w)),S(d,w,b),this.currentChannel=_,!0):!1},C.interpretPAC=function(d,w){var y,b={color:null,italics:!1,indent:null,underline:!1,row:d};return w>95?y=w-96:y=w-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},C.parseChars=function(d,w){var y,b=null,B=null;if(d>=25?(y=2,B=d-8):(y=1,B=d),B>=17&&B<=19){var F;B===17?F=w+80:B===18?F=w+112:F=w+144,this.logger.log(h.INFO,"Special char '"+U(F)+"' in channel "+y),b=[F]}else d>=32&&d<=127&&(b=w===0?[d]:[d,w]);if(b){var _=f(b);this.logger.log(h.DEBUG,"Char codes = "+_.join(",")),S(d,w,this.cmdHistory)}return b},C.parseBackgroundAttributes=function(d,w){var y=(d===16||d===24)&&w>=32&&w<=47,b=(d===23||d===31)&&w>=45&&w<=47;if(!(y||b))return!1;var B,F={};d===16||d===24?(B=Math.floor((w-32)/2),F.background=p[B],w%2===1&&(F.background=F.background+"_semi")):w===45?F.background="transparent":(F.foreground="black",w===47&&(F.underline=!0));var _=d<=23?1:2,M=this.channels[_];return M.setBkgData(F),S(d,w,this.cmdHistory),!0},C.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var w=this.channels[d];w&&w.reset()}this.cmdHistory=L()},C.cueSplitAtTime=function(d){for(var w=0;w<this.channels.length;w++){var y=this.channels[w];y&&y.cueSplitAtTime(d)}},A}();function S(A,C,E){E.a=A,E.b=C}function D(A,C,E){return E.a===A&&E.b===C}function L(){return{a:null,b:null}}J.default=x},"./src/utils/codecs.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isCodecType",function(){return j}),P.d(J,"isCodecSupportedInMp4",function(){return U});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,W){var r=Y[W];return!!r&&r[z.slice(0,4)]===!0}function U(z,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+z+'"')}},"./src/utils/cues.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/utils/vttparser.ts"),j=P("./src/utils/webvtt-parser.ts"),U=P("./src/utils/texttrack-utils.ts"),z=/\s/,W={newCue:function(R,v,m,p){for(var h=[],o,f,l,u,s,a=self.VTTCue||self.TextTrackCue,O=0;O<p.rows.length;O++)if(o=p.rows[O],l=!0,u=0,s="",!o.isEmpty()){for(var x=0;x<o.chars.length;x++)z.test(o.chars[x].uchar)&&l?u++:(s+=o.chars[x].uchar,l=!1);o.cueStartTime=v,v===m&&(m+=1e-4),u>=16?u--:u++;var S=Object(Y.fixLineBreaks)(s.trim()),D=Object(j.generateCueId)(v,m,S);(!R||!R.cues||!R.cues.getCueById(D))&&(f=new a(v,m,S),f.id=D,f.line=O+1,f.align="left",f.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(f))}return R&&h.length&&(h.sort(function(L,A){return L.line==="auto"||A.line==="auto"?0:L.line>8&&A.line>8?A.line-L.line:L.line-A.line}),h.forEach(function(L){return Object(U.addCueToTrack)(R,L)})),h}};J.default=W},"./src/utils/discontinuities.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"findFirstFragWithCC",function(){return z}),P.d(J,"shouldAlignOnDiscontinuities",function(){return W}),P.d(J,"findDiscontinuousReferenceFrag",function(){return r}),P.d(J,"adjustSlidingStart",function(){return v}),P.d(J,"alignStream",function(){return m}),P.d(J,"alignPDT",function(){return h}),P.d(J,"alignFragmentByPDTDelta",function(){return o}),P.d(J,"alignMediaPlaylistByPDT",function(){return f});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),U=P("./src/controller/level-helper.ts");function z(l,u){for(var s=null,a=0,O=l.length;a<O;a++){var x=l[a];if(x&&x.cc===u){s=x;break}}return s}function W(l,u,s){return!!(u.details&&(s.endCC>s.startCC||l&&l.cc<s.startCC))}function r(l,u){var s=l.fragments,a=u.fragments;if(!a.length||!s.length){j.logger.log("No fragments to align");return}var O=z(s,a[0].cc);if(!O||O&&!O.startPTS){j.logger.log("No frag in previous level to align on");return}return O}function R(l,u){if(l){var s=l.start+u;l.start=l.startPTS=s,l.endPTS=s+l.duration}}function v(l,u){for(var s=u.fragments,a=0,O=s.length;a<O;a++)R(s[a],l);u.fragmentHint&&R(u.fragmentHint,l),u.alignedSliding=!0}function m(l,u,s){if(!u)return;p(l,s,u),!s.alignedSliding&&u.details&&h(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(U.adjustSliding)(u.details,s)}function p(l,u,s){if(W(l,s,u)){var a=r(s.details,u);a&&Object(Y.isFiniteNumber)(a.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),v(a.start,u))}}function h(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=l.fragments[0].programDateTime,O=(a-s)/1e3+u.fragments[0].start;O&&Object(Y.isFiniteNumber)(O)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+O.toFixed(3)+" "+l.url+" "),v(O,l))}function o(l,u){var s=l.programDateTime;if(!s)return;var a=(s-u)/1e3;l.start=l.startPTS=a,l.endPTS=a+l.duration}function f(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=u.fragments[0].start,O=s-a*1e3;l.fragments.forEach(function(x){o(x,O)}),l.fragmentHint&&o(l.fragmentHint,O),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/utils/ewma.ts"),j=function(){function U(W,r,R){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=R,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Y.default(W),this.fast_=new Y.default(r)}var z=U.prototype;return z.update=function(r,R){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new Y.default(r,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new Y.default(R,m.getEstimate(),m.getTotalWeight()))},z.sample=function(r,R){r=Math.max(r,this.minDelayMs_);var v=8*R,m=r/1e3,p=v/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},z.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},z.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},z.destroy=function(){},U}();J.default=j},"./src/utils/ewma.ts":function(ie,J,P){"use strict";P.r(J);var Y=function(){function j(z,W,r){W===void 0&&(W=0),r===void 0&&(r=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_=W,this.totalWeight_=r}var U=j.prototype;return U.sample=function(W,r){var R=Math.pow(this.alpha_,W);this.estimate_=r*(1-R)+R*this.estimate_,this.totalWeight_+=W},U.getTotalWeight=function(){return this.totalWeight_},U.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},j}();J.default=Y},"./src/utils/fetch-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"fetchSupported",function(){return o});var Y=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),U=P("./src/demux/chunk-cache.ts");function z(a,O){a.prototype=Object.create(O.prototype),a.prototype.constructor=a,m(a,O)}function W(a){var O=typeof Map=="function"?new Map:void 0;return W=function(S){if(S===null||!v(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(S))return O.get(S);O.set(S,D)}function D(){return r(S,arguments,p(this).constructor)}return D.prototype=Object.create(S.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,S)},W(a)}function r(a,O,x){return R()?r=Reflect.construct:r=function(D,L,A){var C=[null];C.push.apply(C,L);var E=Function.bind.apply(D,C),d=new E;return A&&m(d,A.prototype),d},r.apply(null,arguments)}function R(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function v(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function m(a,O){return m=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},m(a,O)}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},p(a)}function h(){return h=Object.assign||function(a){for(var O=1;O<arguments.length;O++){var x=arguments[O];for(var S in x)Object.prototype.hasOwnProperty.call(x,S)&&(a[S]=x[S])}return a},h.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var f=function(){function a(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||u,this.controller=new self.AbortController,this.stats=new j.LoadStats}var O=a.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(S,D,L){var A=this,C=this.stats;if(C.loading.start)throw new Error("Loader can only be used once.");C.loading.start=self.performance.now();var E=l(S,this.controller.signal),d=L.onProgress,w=S.responseType==="arraybuffer",y=w?"byteLength":"length";this.context=S,this.config=D,this.callbacks=L,this.request=this.fetchSetup(S,E),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){A.abortInternal(),L.onTimeout(C,S,A.response)},D.timeout),self.fetch(this.request).then(function(b){if(A.response=A.loader=b,!b.ok){var B=b.status,F=b.statusText;throw new s(F||"fetch, bad network response",B,b)}return C.loading.first=Math.max(self.performance.now(),C.loading.start),C.total=parseInt(b.headers.get("Content-Length")||"0"),d&&Object(Y.isFiniteNumber)(D.highWaterMark)?A.loadProgressively(b,C,S,D.highWaterMark,d):w?b.arrayBuffer():b.text()}).then(function(b){var B=A.response;self.clearTimeout(A.requestTimeout),C.loading.end=Math.max(self.performance.now(),C.loading.first),C.loaded=C.total=b[y];var F={url:B.url,data:b};d&&!Object(Y.isFiniteNumber)(D.highWaterMark)&&d(C,S,b,B),L.onSuccess(F,C,S,B)}).catch(function(b){if(self.clearTimeout(A.requestTimeout),C.aborted)return;var B=b.code||0;L.onError({code:B,text:b.message},S,b.details)})},O.getCacheAge=function(){var S=null;if(this.response){var D=this.response.headers.get("age");S=D?parseFloat(D):null}return S},O.loadProgressively=function(S,D,L,A,C){A===void 0&&(A=0);var E=new U.default,d=S.body.getReader(),w=function y(){return d.read().then(function(b){if(b.done)return E.dataLength&&C(D,L,E.flush(),S),Promise.resolve(new ArrayBuffer(0));var B=b.value,F=B.length;return D.loaded+=F,F<A||E.dataLength?(E.push(B),E.dataLength>=A&&C(D,L,E.flush(),S)):C(D,L,B,S),y()}).catch(function(){return Promise.reject()})};return w()},a}();function l(a,O){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(h({},a.headers))};return a.rangeEnd&&x.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),x}function u(a,O){return new self.Request(a.url,O)}var s=function(a){z(O,a);function O(x,S,D){var L;return L=a.call(this,x)||this,L.code=void 0,L.details=void 0,L.code=S,L.details=D,L}return O}(W(Error));J.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"IMSC1_CODEC",function(){return v}),P.d(J,"parseIMSC1",function(){return o});var Y=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/utils/vttcue.ts"),z=P("./src/demux/id3.ts"),W=P("./src/utils/timescale-conversion.ts"),r=P("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(A){for(var C=1;C<arguments.length;C++){var E=arguments[C];for(var d in E)Object.prototype.hasOwnProperty.call(E,d)&&(A[d]=E[d])}return A},R.apply(this,arguments)}var v="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,h={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(A,C,E,d,w){var y=Object(Y.findBox)(new Uint8Array(A),["mdat"]);if(y.length===0){w(new Error("Could not parse IMSC1 mdat"));return}var b=y[0],B=Object(z.utf8ArrayToStr)(new Uint8Array(A,b.start,b.end-b.start)),F=Object(W.toTimescaleFromScale)(C,1,E);try{d(f(B,F))}catch(_){w(_)}}function f(A,C){var E=new DOMParser,d=E.parseFromString(A,"text/xml"),w=d.getElementsByTagName("tt")[0];if(!w)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(y).reduce(function(I,g){return I[g]=w.getAttribute("ttp:"+g)||y[g],I},{}),B=w.getAttribute("xml:space")!=="preserve",F=u(l(w,"styling","style")),_=u(l(w,"layout","region")),M=l(w,"body","[begin]");return[].map.call(M,function(I){var g=s(I,B);if(!g||!I.hasAttribute("begin"))return null;var H=S(I.getAttribute("begin"),b),$=S(I.getAttribute("dur"),b),ae=S(I.getAttribute("end"),b);if(H===null)throw x(I);if(ae===null){if($===null)throw x(I);ae=H+$}var ue=new U.default(H-C,ae-C,g);ue.id=Object(r.generateCueId)(ue.startTime,ue.endTime,ue.text);var Le=_[I.getAttribute("region")],ve=F[I.getAttribute("style")];ue.position=10,ue.size=80;var Te=a(Le,ve),_e=Te.textAlign;if(_e){var De=h[_e];De&&(ue.lineAlign=De),ue.align=_e}return R(ue,Te),ue}).filter(function(I){return I!==null})}function l(A,C,E){var d=A.getElementsByTagName(C)[0];return d?[].slice.call(d.querySelectorAll(E)):[]}function u(A){return A.reduce(function(C,E){var d=E.getAttribute("xml:id");return d&&(C[d]=E),C},{})}function s(A,C){return[].slice.call(A.childNodes).reduce(function(E,d,w){var y;return d.nodeName==="br"&&w?E+`
`:(y=d.childNodes)!==null&&y!==void 0&&y.length?s(d,C):C?E+d.textContent.trim().replace(/\s+/g," "):E+d.textContent},"")}function a(A,C){var E="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(w,y){var b=O(C,E,y)||O(A,E,y);return b&&(w[y]=b),w},{})}function O(A,C,E){return A.hasAttributeNS(C,E)?A.getAttributeNS(C,E):null}function x(A){return new Error("Could not parse ttml timestamp "+A)}function S(A,C){if(!A)return null;var E=Object(j.parseTimeStamp)(A);return E===null&&(m.test(A)?E=D(A,C):p.test(A)&&(E=L(A,C))),E}function D(A,C){var E=m.exec(A),d=(E[4]|0)+(E[5]|0)/C.subFrameRate;return(E[1]|0)*3600+(E[2]|0)*60+(E[3]|0)+d/C.frameRate}function L(A,C){var E=p.exec(A),d=Number(E[1]),w=E[2];switch(w){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/C.frameRate;case"t":return d/C.tickRate}return d}},"./src/utils/logger.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"enableLogs",function(){return r}),P.d(J,"logger",function(){return R});var Y=function(){},j={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y},U=j;function z(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):Y}function W(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),h=1;h<m;h++)p[h-1]=arguments[h];p.forEach(function(o){U[o]=v[o]?v[o].bind(v):z(o)})}function r(v){if(self.console&&v===!0||typeof v=="object"){W(v,"debug","log","info","warn","error");try{U.log()}catch(m){U=j}}else U=j}var R=U},"./src/utils/mediakeys-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"KeySystems",function(){return Y}),P.d(J,"requestMediaKeySystemAccess",function(){return j});var Y;(function(U){U.WIDEVINE="com.widevine.alpha",U.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,P){"use strict";P.r(J),P.d(J,"getMediaSource",function(){return Y});function Y(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"bin2str",function(){return W}),P.d(J,"readUint16",function(){return r}),P.d(J,"readUint32",function(){return R}),P.d(J,"writeUint32",function(){return v}),P.d(J,"findBox",function(){return m}),P.d(J,"parseSegmentIndex",function(){return p}),P.d(J,"parseInitSegment",function(){return h}),P.d(J,"getStartDTS",function(){return o}),P.d(J,"getDuration",function(){return f}),P.d(J,"computeRawDurationFromSamples",function(){return l}),P.d(J,"offsetStartDTS",function(){return u}),P.d(J,"segmentValidRange",function(){return s}),P.d(J,"appendUint8Array",function(){return a});var Y=P("./src/utils/typed-array.ts"),j=P("./src/loader/fragment.ts"),U=Math.pow(2,32)-1,z=[].push;function W(O){return String.fromCharCode.apply(null,O)}function r(O,x){"data"in O&&(x+=O.start,O=O.data);var S=O[x]<<8|O[x+1];return S<0?65536+S:S}function R(O,x){"data"in O&&(x+=O.start,O=O.data);var S=O[x]<<24|O[x+1]<<16|O[x+2]<<8|O[x+3];return S<0?4294967296+S:S}function v(O,x,S){"data"in O&&(x+=O.start,O=O.data),O[x]=S>>24,O[x+1]=S>>16&255,O[x+2]=S>>8&255,O[x+3]=S&255}function m(O,x){var S=[];if(!x.length)return S;var D,L,A;"data"in O?(D=O.data,L=O.start,A=O.end):(D=O,L=0,A=D.byteLength);for(var C=L;C<A;){var E=R(D,C),d=W(D.subarray(C+4,C+8)),w=E>1?C+E:A;if(d===x[0])if(x.length===1)S.push({data:D,start:C+8,end:w});else{var y=m({data:D,start:C+8,end:w},x.slice(1));y.length&&z.apply(S,y)}C=w}return S}function p(O){var x=m(O,["moov"]),S=x[0],D=S?S.end:null,L=m(O,["sidx"]);if(!L||!L[0])return null;var A=[],C=L[0],E=C.data[0],d=E===0?8:16,w=R(C,d);d+=4;var y=0,b=0;E===0?d+=8:d+=16,d+=2;var B=C.end+b,F=r(C,d);d+=2;for(var _=0;_<F;_++){var M=d,I=R(C,M);M+=4;var g=I&2147483647,H=(I&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=R(C,M);M+=4,A.push({referenceSize:g,subsegmentDuration:$,info:{duration:$/w,start:B,end:B+g-1}}),B+=g,M+=4,d=M}return{earliestPresentationTime:y,timescale:w,version:E,referencesCount:F,references:A,moovEndOffset:D}}function h(O){for(var x=[],S=m(O,["moov","trak"]),D=0;D<S.length;D++){var L=S[D],A=m(L,["tkhd"])[0];if(A){var C=A.data[A.start],E=C===0?12:20,d=R(A,E),w=m(L,["mdia","mdhd"])[0];if(w){C=w.data[w.start],E=C===0?12:20;var y=R(w,E),b=m(L,["mdia","hdlr"])[0];if(b){var B=W(b.data.subarray(b.start+8,b.start+12)),F={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[B];if(F){var _=m(L,["mdia","minf","stbl","stsd"])[0],M=void 0;_&&(M=W(_.data.subarray(_.start+12,_.start+16))),x[d]={timescale:y,type:F},x[F]={timescale:y,id:d,codec:M}}}}}}var I=m(O,["moov","mvex","trex"]);return I.forEach(function(g){var H=R(g,4),$=x[H];$&&($.default={duration:R(g,12),flags:R(g,20)})}),x}function o(O,x){return m(x,["moof","traf"]).reduce(function(S,D){var L=m(D,["tfdt"])[0],A=L.data[L.start],C=m(D,["tfhd"]).reduce(function(E,d){var w=R(d,4),y=O[w];if(y){var b=R(L,4);A===1&&(b*=Math.pow(2,32),b+=R(L,8));var B=y.timescale||9e4,F=b/B;if(isFinite(F)&&(E===null||F<E))return F}return E},null);return C!==null&&isFinite(C)&&(S===null||C<S)?C:S},null)||0}function f(O,x){for(var S=0,D=0,L=0,A=m(O,["moof","traf"]),C=0;C<A.length;C++){var E=A[C],d=m(E,["tfhd"])[0],w=R(d,4),y=x[w];if(!y)continue;var b=y.default,B=R(d,0)|(b==null?void 0:b.flags),F=b==null?void 0:b.duration;B&8&&(B&2?F=R(d,12):F=R(d,8));for(var _=y.timescale||9e4,M=m(E,["trun"]),I=0;I<M.length;I++){if(F){var g=R(M[I],4);S=F*g}else S=l(M[I]);y.type===j.ElementaryStreamTypes.VIDEO?D+=S/_:y.type===j.ElementaryStreamTypes.AUDIO&&(L+=S/_)}}if(D===0&&L===0){var H=p(O);if(H!=null&&H.references)return H.references.reduce(function($,ae){return $+ae.info.duration||0},0)}return D||L}function l(O){var x=R(O,0),S=8;x&1&&(S+=4),x&4&&(S+=4);for(var D=0,L=R(O,4),A=0;A<L;A++){if(x&256){var C=R(O,S);D+=C,S+=4}x&512&&(S+=4),x&1024&&(S+=4),x&2048&&(S+=4)}return D}function u(O,x,S){m(x,["moof","traf"]).forEach(function(D){m(D,["tfhd"]).forEach(function(L){var A=R(L,4),C=O[A];if(!C)return;var E=C.timescale||9e4;m(D,["tfdt"]).forEach(function(d){var w=d.data[d.start],y=R(d,4);if(w===0)v(d,4,y-S*E);else{y*=Math.pow(2,32),y+=R(d,8),y-=S*E,y=Math.max(y,0);var b=Math.floor(y/(U+1)),B=Math.floor(y%(U+1));v(d,4,b),v(d,8,B)}})})})}function s(O){var x={valid:null,remainder:null},S=m(O,["moof"]);if(S){if(S.length<2)return x.remainder=O,x}else return x;var D=S[S.length-1];return x.valid=Object(Y.sliceUint8)(O,0,D.start-8),x.remainder=Object(Y.sliceUint8)(O,D.start-8),x}function a(O,x){var S=new Uint8Array(O.length+x.length);return S.set(O),S.set(x,O.length),S}},"./src/utils/output-filter.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return Y});var Y=function(){function j(z,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=z,this.trackName=W}var U=j.prototype;return U.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},U.newCue=function(W,r,R){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=r,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},U.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"sendAddTrackEvent",function(){return j}),P.d(J,"addCueToTrack",function(){return U}),P.d(J,"clearCurrentCues",function(){return z}),P.d(J,"removeCuesInRange",function(){return W}),P.d(J,"getCuesInRange",function(){return R});var Y=P("./src/utils/logger.ts");function j(v,m){var p;try{p=new Event("addtrack")}catch(h){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function U(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(o){Y.logger.debug("[texttrack-utils]: "+o);var h=new self.TextTrackCue(m.startTime,m.endTime,m.text);h.id=m.id,v.addCue(h)}p==="disabled"&&(v.mode=p)}function z(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function W(v,m,p){var h=v.mode;if(h==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var o=R(v.cues,m,p),f=0;f<o.length;f++)v.removeCue(o[f]);h==="disabled"&&(v.mode=h)}function r(v,m){if(m<v[0].startTime)return 0;var p=v.length-1;if(m>v[p].endTime)return-1;for(var h=0,o=p;h<=o;){var f=Math.floor((o+h)/2);if(m<v[f].startTime)o=f-1;else if(m>v[f].startTime&&h<p)h=f+1;else return f}return v[h].startTime-m<m-v[o].startTime?h:o}function R(v,m,p){var h=[],o=r(v,m);if(o>-1)for(var f=o,l=v.length;f<l;f++){var u=v[f];if(u.startTime>=m&&u.endTime<=p)h.push(u);else if(u.startTime>p)return h}return h}},"./src/utils/time-ranges.ts":function(ie,J,P){"use strict";P.r(J);var Y={toString:function(U){for(var z="",W=U.length,r=0;r<W;r++)z+="["+U.start(r).toFixed(3)+","+U.end(r).toFixed(3)+"]";return z}};J.default=Y},"./src/utils/timescale-conversion.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"toTimescaleFromBase",function(){return j}),P.d(J,"toTimescaleFromScale",function(){return U}),P.d(J,"toMsFromMpegTsClock",function(){return z}),P.d(J,"toMpegTsClockFromTimescale",function(){return W});var Y=9e4;function j(r,R,v,m){v===void 0&&(v=1),m===void 0&&(m=!1);var p=r*R*v;return m?Math.round(p):p}function U(r,R,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),j(r,R,1/v,m)}function z(r,R){return R===void 0&&(R=!1),j(r,1e3,1/Y,R)}function W(r,R){return R===void 0&&(R=1),j(r,Y,1/R)}},"./src/utils/typed-array.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"sliceUint8",function(){return Y});function Y(j,U,z){return Uint8Array.prototype.slice?j.slice(U,z):new Uint8Array(Array.prototype.slice.call(j,U,z))}},"./src/utils/vttcue.ts":function(ie,J,P){"use strict";P.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 U(v,m){if(typeof m!="string")return!1;if(!Array.isArray(v))return!1;var p=m.toLowerCase();return~v.indexOf(p)?p:!1}function z(v){return U(Y,v)}function W(v){return U(j,v)}function r(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),h=1;h<m;h++)p[h-1]=arguments[h];for(var o=1;o<arguments.length;o++){var f=arguments[o];for(var l in f)v[l]=f[l]}return v}function R(v,m,p){var h=this,o={enumerable:!0};h.hasBeenReset=!1;var f="",l=!1,u=v,s=m,a=p,O=null,x="",S=!0,D="auto",L="start",A=50,C="middle",E=50,d="middle";Object.defineProperty(h,"id",r({},o,{get:function(){return f},set:function(y){f=""+y}})),Object.defineProperty(h,"pauseOnExit",r({},o,{get:function(){return l},set:function(y){l=!!y}})),Object.defineProperty(h,"startTime",r({},o,{get:function(){return u},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");u=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",r({},o,{get:function(){return s},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");s=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",r({},o,{get:function(){return a},set:function(y){a=""+y,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",r({},o,{get:function(){return O},set:function(y){O=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",r({},o,{get:function(){return x},set:function(y){var b=z(y);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",r({},o,{get:function(){return S},set:function(y){S=!!y,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",r({},o,{get:function(){return D},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",r({},o,{get:function(){return L},set:function(y){var b=W(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");L=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",r({},o,{get:function(){return A},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},o,{get:function(){return C},set:function(y){var b=W(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");C=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},o,{get:function(){return E},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");E=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},o,{get:function(){return d},set:function(y){var b=W(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");d=b,this.hasBeenReset=!0}})),h.displayState=void 0}return R.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"parseTimeStamp",function(){return U}),P.d(J,"fixLineBreaks",function(){return m}),P.d(J,"VTTParser",function(){return p});var Y=P("./src/utils/vttcue.ts"),j=function(){function h(){}var o=h.prototype;return o.decode=function(l,u){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},h}();function U(h){function o(l,u,s,a){return(l|0)*3600+(u|0)*60+(s|0)+parseFloat(a||0)}var f=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?o(f[2],f[3],0,f[4]):o(f[1],f[2],f[3],f[4]):null}var z=function(){function h(){this.values=Object.create(null)}var o=h.prototype;return o.set=function(l,u){!this.get(l)&&u!==""&&(this.values[l]=u)},o.get=function(l,u,s){return s?this.has(l)?this.values[l]:u[s]:this.has(l)?this.values[l]:u},o.has=function(l){return l in this.values},o.alt=function(l,u,s){for(var a=0;a<s.length;++a)if(u===s[a]){this.set(l,u);break}},o.integer=function(l,u){/^-?\d+$/.test(u)&&this.set(l,parseInt(u,10))},o.percent=function(l,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var s=parseFloat(u);if(s>=0&&s<=100)return this.set(l,s),!0}return!1},h}();function W(h,o,f,l){var u=l?h.split(l):[h];for(var s in u){if(typeof u[s]!="string")continue;var a=u[s].split(f);if(a.length!==2)continue;var O=a[0],x=a[1];o(O,x)}}var r=new Y.default(0,0,""),R=r.align==="middle"?"middle":"center";function v(h,o,f){var l=h;function u(){var O=U(h);if(O===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),O}function s(O,x){var S=new z;W(O,function(A,C){var E;switch(A){case"region":for(var d=f.length-1;d>=0;d--)if(f[d].id===C){S.set(A,f[d].region);break}break;case"vertical":S.alt(A,C,["rl","lr"]);break;case"line":E=C.split(","),S.integer(A,E[0]),S.percent(A,E[0])&&S.set("snapToLines",!1),S.alt(A,E[0],["auto"]),E.length===2&&S.alt("lineAlign",E[1],["start",R,"end"]);break;case"position":E=C.split(","),S.percent(A,E[0]),E.length===2&&S.alt("positionAlign",E[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":S.percent(A,C);break;case"align":S.alt(A,C,["start",R,"end","left","right"]);break}},/:/,/\s/),x.region=S.get("region",null),x.vertical=S.get("vertical","");var D=S.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),x.line=D,x.lineAlign=S.get("lineAlign","start"),x.snapToLines=S.get("snapToLines",!0),x.size=S.get("size",100),x.align=S.get("align",R);var L=S.get("position","auto");L==="auto"&&r.position===50&&(L=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=L}function a(){h=h.replace(/^\s+/,"")}if(a(),o.startTime=u(),a(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);h=h.substr(3),a(),o.endTime=u(),a(),s(h,o)}function m(h){return h.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function h(){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 o=h.prototype;return o.parse=function(l){var u=this;l&&(u.buffer+=u.decoder.decode(l,{stream:!0}));function s(){var L=u.buffer,A=0;for(L=m(L);A<L.length&&L[A]!=="\r"&&L[A]!==`
`;)++A;var C=L.substr(0,A);return L[A]==="\r"&&++A,L[A]===`
`&&++A,u.buffer=L.substr(A),C}function a(L){W(L,function(A,C){},/:/)}try{var O="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;O=s();var x=O.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:O=s();switch(u.state){case"HEADER":/:/.test(O)?a(O):O||(u.state="ID");continue;case"NOTE":O||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){u.state="NOTE";break}if(!O)continue;if(u.cue=new Y.default(0,0,""),u.state="CUE",O.indexOf("-->")===-1){u.cue.id=O;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{v(O,u.cue,u.regionList)}catch(L){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var D=O.indexOf("-->")!==-1;if(!O||D&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
`),u.cue.text+=O}continue;case"BADCUE":O||(u.state="ID")}}}catch(L){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.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(u){l.onparsingerror&&l.onparsingerror(u)}return l.onflush&&l.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"generateCueId",function(){return p}),P.d(J,"parseWebVTT",function(){return o});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/demux/id3.ts"),z=P("./src/utils/timescale-conversion.ts"),W=P("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,R=function(l,u,s){return s===void 0&&(s=0),l.substr(s,u.length)===u},v=function(l){var u=parseInt(l.substr(-3)),s=parseInt(l.substr(-6,2)),a=parseInt(l.substr(-9,2)),O=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(u)||!Object(Y.isFiniteNumber)(s)||!Object(Y.isFiniteNumber)(a)||!Object(Y.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return u+=1e3*s,u+=60*1e3*a,u+=60*60*1e3*O,u},m=function(l){for(var u=5381,s=l.length;s;)u=u*33^l.charCodeAt(--s);return(u>>>0).toString()};function p(f,l,u){return m(f.toString())+m(l.toString())+m(u)}var h=function(l,u,s){var a=l[u],O=l[a.prevCC];if(!O||!O.new&&a.new){l.ccOffset=l.presentationOffset=a.start,a.new=!1;return}for(;(x=O)!==null&&x!==void 0&&x.new;){var x;l.ccOffset+=a.start-O.start,a.new=!1,a=O,O=l[a.prevCC]}l.presentationOffset=s};function o(f,l,u,s,a,O,x,S){var D=new j.VTTParser,L=Object(U.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(r,`
`).split(`
`),A=[],C=Object(z.toMpegTsClockFromTimescale)(l,u),E="00:00.000",d=0,w=0,y,b=!0,B=!1;D.oncue=function(F){var _=s[a],M=s.ccOffset,I=(d-C)/9e4;if(_!=null&&_.new&&(w!==void 0?M=s.ccOffset=_.start:h(s,a,I)),I&&(M=I-s.presentationOffset),B){var g=F.endTime-F.startTime,H=Object(W.normalizePts)((F.startTime+M-w)*9e4,O*9e4)/9e4;F.startTime=H,F.endTime=H+g}var $=F.text.trim();F.text=decodeURIComponent(encodeURIComponent($)),F.id||(F.id=p(F.startTime,F.endTime,$)),F.endTime>0&&A.push(F)},D.onparsingerror=function(F){y=F},D.onflush=function(){if(y){S(y);return}x(A)},L.forEach(function(F){if(b)if(R(F,"X-TIMESTAMP-MAP=")){b=!1,B=!0,F.substr(16).split(",").forEach(function(_){R(_,"LOCAL:")?E=_.substr(6):R(_,"MPEGTS:")&&(d=parseInt(_.substr(7)))});try{w=v(E)/1e3}catch(_){B=!1,y=_}return}else F===""&&(b=!1);D.parse(F+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ie,J,P){"use strict";P.r(J);var Y=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),U=/^age:\s*[\d.]+\s*$/m,z=function(){function W(R){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=R?R.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var r=W.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},r.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(v,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},r.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var o=this.xhrSetup;try{if(o)try{o(p,m.url)}catch(u){p.open("GET",m.url,!0),o(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var l in f)p.setRequestHeader(l,f[l])}catch(u){this.callbacks.onError({code:p.status,text:u.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},r.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var h=m.readyState,o=this.config;if(p.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),h===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var l,u;if(v.responseType==="arraybuffer"?(l=m.response,u=l.byteLength):(l=m.responseText,u=l.length),p.loaded=p.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,v,l,m),!this.callbacks)return;var a={url:m.responseURL,data:l};this.callbacks.onSuccess(a,p,v,m)}else p.retry>=o.maxRetry||f>=400&&f<499?(Y.logger.error(f+" while loading "+v.url),this.callbacks.onError({code:f,text:m.statusText},v,m)):(Y.logger.warn(f+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},r.loadtimeout=function(){Y.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},r.getCacheAge=function(){var v=null;if(this.loader&&U.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},W}();J.default=z}}).default})},vHTk:function(nt,be,Q){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},we55:function(nt,be,Q){nt.exports={bg:"bg___3PaSA",flexRow:"flexRow___1k1iY",flexJustifyCenter:"flexJustifyCenter___MzzvD",flexAlignEnd:"flexAlignEnd___1KYBf",flexAlignCenter:"flexAlignCenter___3XoYY",flexColumn:"flexColumn___28jeJ",formWrap:"formWrap___2IoYS",titleWrap:"titleWrap___2LenH",fieldWrap:"fieldWrap___3zhLT",mdWrap:"mdWrap___3fVSN",backgroundFa:"backgroundFa___21qxJ",button:"button___3eTeL"}},wzkS:function(nt,be,Q){"use strict";Q.d(be,"c",function(){return j}),Q.d(be,"b",function(){return U}),Q.d(be,"d",function(){return z}),Q.d(be,"a",function(){return r}),Q.d(be,"e",function(){return R});var ie=Q("9og8"),J=Q("WmNS"),P=Q.n(J),Y=Q("ErOA");function j(v){return Object(Y.c)("libraries/".concat(v,".json"))}function U(){return Object(Y.c)("library_tags.json")}function z(v){return W.apply(this,arguments)}function W(){return W=Object(ie.a)(P.a.mark(function v(m){var p;return P.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Object(Y.b)("attachments/".concat(m,".json"));case 2:return p=o.sent,o.abrupt("return",p.status===0);case 4:case"end":return o.stop()}},v)})),W.apply(this,arguments)}function r(v){return Object(Y.f)("libraries.json",v)}function R(v,m){return Object(Y.g)("libraries/".concat(v,".json"),m)}},y5JW:function(nt,be,Q){"use strict";Q.d(be,"c",function(){return f}),Q.d(be,"a",function(){return l});var ie=Q("DZo9"),J=Q("8z0m"),P=Q("+L6B"),Y=Q("2/Rp"),j=Q("9og8"),U=Q("miYZ"),z=Q("tsqr"),W=Q("k1fw"),r=Q("oBTY"),R=Q("WmNS"),v=Q.n(R),m=Q("q1tI"),p=Q.n(m),h=Q("m3rI"),o=Q("wzkS"),f="\u3000\u3000";function l(u){var s=["Bytes","KB","MB","GB","TB"];if(u==0)return"0 Byte";var a=parseInt(""+Math.floor(Math.log(u)/Math.log(1024)),10);return(u/Math.pow(1024,a)).toFixed(1)+" "+s[a]}be.b=function(u){var s=u.value,a=s===void 0?[]:s,O=u.action,x=u.onChange,S=u.className,D=u.maxSize,L=D===void 0?150:D,A=u.title,C=A===void 0?"\u6587\u4EF6\u4E0A\u4F20":A,E=u.accept,d=E===void 0?null:E,w={multiple:!1,fileList:a,accept:d,withCredentials:!0,beforeUpload:function(B){var F=B.size/1024/1024;return!0},action:"".concat(h.a.API_SERVER,"/api/attachments.json"),onChange:function(B){var F,_,M=Object(r.a)(B.fileList);if(M=M.map(function(H){return H.name.indexOf(f)===-1&&(H.name="".concat(H.name).concat(f).concat(l(H.size))),Object(W.a)({},H)}),B.file.status==="done"&&((F=B.file)===null||F===void 0||((_=F.response)===null||_===void 0)?void 0:_.status)===-1){var I,g;z.b.error((I=B.file)===null||I===void 0||((g=I.response)===null||g===void 0)?void 0:g.message),x([]);return}x(M)},onRemove:function(){var b=Object(j.a)(v.a.mark(function F(_){var M,I,g;return v.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:if(M=_.size/1024/1024,!(_.status==="uploading")){$.next=3;break}return $.abrupt("return",!0);case 3:if(M<L){$.next=7;break}return $.abrupt("return",!0);case 7:if(I=_.response?_.response.id:_.uid,!I){$.next=15;break}return $.next=11,Object(o.d)(_.response?_.response.id:_.id);case 11:return g=$.sent,$.abrupt("return",g);case 15:return $.abrupt("return",!0);case 16:case"end":return $.stop()}},F)}));function B(F){return b.apply(this,arguments)}return B}()};function y(b){b.preventDefault(),b.stopPropagation()}return p.a.createElement("div",{className:"single-upload ".concat(S||"")},p.a.createElement(J.a,w,p.a.createElement(Y.a,{type:"primary",title:a.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:a.length>0,ghost:!0},C),p.a.createElement("span",{onClick:y,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",L,"M)"," ")))}},yQHh:function(nt,be,Q){}}]);