You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
445 lines
1.2 MiB
445 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[49,5,6,7,9,12],{"+NIl":function(Ye,we,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";se.defineMode("stex",function(X,N){"use strict";function $(h,o){h.cmdState.push(o)}function H(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function P(h){var o=h.cmdState.pop();o&&o.closeBracket()}function K(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 G(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=G("importmodule","tag",["string","builtin"]),r.documentclass=G("documentclass","tag",["","atom"]),r.usepackage=G("usepackage","tag",["atom"]),r.begin=G("begin","tag",["atom"]),r.end=G("end","tag",["atom"]),r.label=G("label","tag",["atom"]),r.ref=G("ref","tag",["atom"]),r.eqref=G("eqref","tag",["atom"]),r.cite=G("cite","tag",["atom"]),r.bibitem=G("bibitem","tag",["atom"]),r.Bibitem=G("Bibitem","tag",["atom"]),r.RBibitem=G("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,$(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=H(o),f)f.closeBracket(u),R(o,p);else return"error";return"bracket"}else return u=="{"||u=="["?(f=r.DEFAULT,f=new f,$(o,f),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),f=K(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=H(o),l.openBracket(f),h.eat(f),R(o,v),"bracket"):/[ \t\r]/.test(f)?(h.eat(f),null):(R(o,v),P(o),v(h,o))}return{startState:function(){var h=N.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:"%"}}),se.defineMIME("text/x-stex","stex"),se.defineMIME("text/x-latex","stex")})},"+ua5":function(Ye,we,Q){},"/cxE":function(Ye,we,Q){"use strict";Q.d(we,"f",function(){return N}),Q.d(we,"g",function(){return $}),Q.d(we,"h",function(){return H}),Q.d(we,"e",function(){return K}),Q.d(we,"b",function(){return G}),Q.d(we,"c",function(){return r}),Q.d(we,"d",function(){return R}),Q.d(we,"a",function(){return v});class se{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 X=new se;function N(m){K(m)||X.onUnexpectedError(m);return}function $(m){K(m)||X.onUnexpectedExternalError(m);return}function H(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 P="Canceled";function K(m){return m instanceof Error&&m.name===P&&m.message===P}function G(){const m=new Error(P);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(Ye,we,Q){(function(se){se(Q("VrN/"))})(function(se){se.defineOption("placeholder","",function(G,r,R){var v=R&&R!=se.Init;if(r&&!v)G.on("blur",H),G.on("change",P),G.on("swapDoc",P),se.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){$(G)}),P(G);else if(!r&&v){G.off("blur",H),G.off("change",P),G.off("swapDoc",P),se.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),X(G);var m=G.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}r&&!G.hasFocus()&&H(G)});function X(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function N(G){X(G);var r=G.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=G.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var R=G.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),r.appendChild(R),G.display.lineSpace.insertBefore(r,G.display.lineSpace.firstChild)}function $(G){setTimeout(function(){var r=!1,R=G.getInputField();R.nodeName=="TEXTAREA"?r=!R.value:G.lineCount()==1&&(r=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),r?N(G):X(G)},20)}function H(G){K(G)&&N(G)}function P(G){var r=G.getWrapperElement(),R=K(G);r.className=r.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?N(G):X(G)}function K(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(Ye,we,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";var X={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};se.defineMode("xml",function($,H){var P=$.indentUnit,K={},G=H.htmlMode?X:N;for(var r in G)K[r]=G[r];for(var r in H)K[r]=H[r];var R,v;function m(d,w){function y(U){return w.tokenize=U,U(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 j;return d.eat("#")?d.eat("x")?j=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):j=d.eatWhile(/[\d]/)&&d.eat(";"):j=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),j?"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,(K.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,!K.contextGrabbers.hasOwnProperty(y)||!K.contextGrabbers[y].hasOwnProperty(w))return;u(d)}}function a(d,w,y){return d=="openTag"?(y.tagStart=w.column(),O):d=="closeTag"?T:a}function O(d,w,y){return d=="word"?(y.tagName=w.current(),v="tag",L):K.allowMissingTagName&&d=="endTag"?(v="tag bracket",L(d,w,y)):(v="error",O)}function T(d,w,y){if(d=="word"){var b=w.current();return y.context&&y.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(y.context.tagName)&&u(y),y.context&&y.context.tagName==b||K.matchClosing===!1?(v="tag",S):(v="tag error",D)}else return K.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,j=y.tagStart;return y.tagName=y.tagStart=null,d=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?s(y,b):(s(y,b),y.context=new l(y,b,j==y.indented)),a}return v="error",L}function A(d,w,y){return d=="equals"?C:(K.allowMissing||(v="error"),L(d,w,y))}function C(d,w,y){return d=="string"?x:d=="word"&&K.allowUnquoted?(v="string",L):(v="error",L(d,w,y))}function x(d,w,y){return d=="string"?x: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+P;if(b&&b.noIndent)return se.Pass;if(d.tokenize!=p&&d.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(d.tagName)return K.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+P*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(w))return 0;var j=w&&/^<(\/)?([\w_:\.-]*)/.exec(w);if(j&&j[1])for(;b;)if(b.tagName==j[2]){b=b.prev;break}else if(K.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(j)for(;b;){var U=K.contextGrabbers[b.tagName];if(U&&U.hasOwnProperty(j[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+P:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.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()}}}),se.defineMIME("text/xml","xml"),se.defineMIME("application/xml","xml"),se.mimeModes.hasOwnProperty("text/html")||se.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return X});class se{constructor(N){this.element=N,this.next=se.Undefined,this.prev=se.Undefined}}se.Undefined=new se(void 0);class X{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let N=this._first;for(;N!==se.Undefined;){const $=N.next;N.prev=se.Undefined,N.next=se.Undefined,N=$}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,$){const H=new se(N);if(this._first===se.Undefined)this._first=H,this._last=H;else if($){const K=this._last;this._last=H,H.prev=K,K.next=H}else{const K=this._first;this._first=H,H.next=K,K.prev=H}this._size+=1;let P=!1;return()=>{P||(P=!0,this._remove(H))}}shift(){if(this._first===se.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===se.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==se.Undefined&&N.next!==se.Undefined){const $=N.prev;$.next=N.next,N.next.prev=$}else N.prev===se.Undefined&&N.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):N.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):N.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==se.Undefined;)yield N.element,N=N.next}}},"3/fG":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return X});function se(N,$){let H;return $.length===0?H=N:H=N.replace(/\{(\d+)\}/g,function(P,K){const G=K[0];return typeof $[G]!="undefined"?$[G]:P}),H}function X(N,$,...H){return se($,H)}},"500L":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return T});var se=Q("+L6B"),X=Q("2/Rp"),N=Q("2qtc"),$=Q("kLXV"),H=Q("9og8"),P=Q("k1fw"),K=Q("miYZ"),G=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 T(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}we.b=function(S){var D=S.value,L=S.onChange,A=S.action,C=S.className,x=S.maxSize,d=x===void 0?150:x,w=S.title,y=w===void 0?"\u4E0A\u4F20\u9644\u4EF6":w,b=S.showRemoveModal,j=b===void 0?!1:b,U=S.accept,E=U===void 0?"":U,M=S.additionalText,I=S.isDragger,g=S.number,W=g===void 0?1e3:g,J=S.aloneClear,le=J===void 0?!1:J,ce=Object(o.useState)(!1),Re=Object(R.a)(ce,2),Ee=Re[0],Oe=Re[1],Te=Object(o.useState)(D||[]),Le=Object(R.a)(Te,2),ye=Le[0],Y=Le[1];Object(o.useEffect)(function(){D&&(Y(Object(r.a)(D)),W===(D==null?void 0:D.length)&&Oe(!0))},[D]);var _=function(){setTimeout(function(){ye.pop(),Y(Object(r.a)(ye))},500)},k={multiple:!0,disabled:Ee,accept:E,withCredentials:!0,fileList:ye,beforeUpload:function(z,he){var ve=z.size/1024/1024;return ye.concat(he).length>W?(ye.pop(),Y(Object(r.a)(ye)),G.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(W,"\u4E2A\u6587\u4EF6")),le?Promise.reject():(_(),!1)):!0},action:A||"".concat(l.a.API_SERVER,"/api/attachments.json"),onChange:function(z){var he,ve,Ae=Object(r.a)(z.fileList);if(z.file.status==="done"&&((he=z.file)===null||he===void 0||((ve=he.response)===null||ve===void 0)?void 0:ve.status)===-1){var ue,me;G.b.error((ue=z.file)===null||ue===void 0||((me=ue.response)===null||me===void 0)?void 0:me.message);return}Ae.length>=W?Oe(!0):Oe(!1),Y(Object(r.a)(Ae)),Ae=Ae.map(function(be){var Ce;if(be!=null&&(Ce=be.response)!==null&&Ce!==void 0&&Ce.id){var Pe;be.url="/api/attachments/".concat(be==null||((Pe=be.response)===null||Pe===void 0)?void 0:Pe.id)}return be.name.indexOf(s.c)===-1&&(be.name="".concat(be.name).concat(s.c).concat(Object(s.a)(be.size))),Object(P.a)({},be)}),console.log("info:",z),L(Ae)},onRemove:function(){var Z=Object(H.a)(h.a.mark(function he(ve){var Ae;return h.a.wrap(function(me){for(;;)switch(me.prev=me.next){case 0:if(Ae=function(){var be=Object(H.a)(h.a.mark(function Ce(){var Pe,Ue;return h.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(Pe=ve.response?ve.response.id:ve.id,!Pe){Be.next=8;break}return Be.next=4,Object(u.d)(ve.response?ve.response.id:ve.uid);case 4:return Ue=Be.sent,Be.abrupt("return",Ue);case 8:return Be.abrupt("return",!0);case 9:case"end":return Be.stop()}},Ce)}));return function(){return be.apply(this,arguments)}}(),!j){me.next=5;break}return me.abrupt("return",new Promise(function(be,Ce){$.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 Pe=Object(H.a)(h.a.mark(function He(){var Be;return h.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:return Ge.next=2,Ae();case 2:Be=Ge.sent,G.b.success("\u5220\u9664\u6210\u529F"),be(!0);case 5:case"end":return Ge.stop()}},He)}));function Ue(){return Pe.apply(this,arguments)}return Ue}(),onCancel:function(){return be(!1)}})}));case 5:return me.next=7,Ae();case 7:return me.abrupt("return",me.sent);case 8:case"end":return me.stop()}},he)}));function z(he){return Z.apply(this,arguments)}return z}()};function B(Z){Z.preventDefault(),Z.stopPropagation()}return f.a.createElement("div",{className:"multi-upload ".concat(C||"")},I&&f.a.createElement(O,k,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,k,f.a.createElement(X.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:Ee},y),f.a.createElement("span",{onClick:B,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",d,"MB)"," ")))}},"55Ip":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return s});var se=Q("Ty5D"),X=Q("dI71"),N=Q("q1tI"),$=Q.n(N),H=Q("YS25"),P=Q("17x9"),K=Q.n(P),G=Q("wx14"),r=Q("zLVn"),R=Q("9R94"),v=function(C){Object(X.a)(x,C);function x(){for(var w,y=arguments.length,b=new Array(y),j=0;j<y;j++)b[j]=arguments[j];return w=C.call.apply(C,[this].concat(b))||this,w.history=Object(H.a)(w.props),w}var d=x.prototype;return d.render=function(){return $.a.createElement(se.c,{history:this.history,children:this.props.children})},x}($.a.Component),m=function(C){Object(X.a)(x,C);function x(){for(var w,y=arguments.length,b=new Array(y),j=0;j<y;j++)b[j]=arguments[j];return w=C.call.apply(C,[this].concat(b))||this,w.history=Object(H.b)(w.props),w}var d=x.prototype;return d.render=function(){return $.a.createElement(se.c,{history:this.history,children:this.props.children})},x}($.a.Component),p=function(x,d){return typeof x=="function"?x(d):x},h=function(x,d){return typeof x=="string"?Object(H.c)(x,null,null,d):x},o=function(x){return x},f=$.a.forwardRef;typeof f=="undefined"&&(f=o);function l(C){return!!(C.metaKey||C.altKey||C.ctrlKey||C.shiftKey)}var u=f(function(C,x){var d=C.innerRef,w=C.navigate,y=C.onClick,b=Object(r.a)(C,["innerRef","navigate","onClick"]),j=b.target,U=Object(G.a)({},b,{onClick:function(M){try{y&&y(M)}catch(I){throw M.preventDefault(),I}!M.defaultPrevented&&M.button===0&&(!j||j==="_self")&&!l(M)&&(M.preventDefault(),w())}});return o!==f?U.ref=x||d:U.ref=d,$.a.createElement("a",U)}),s=f(function(C,x){var d=C.component,w=d===void 0?u:d,y=C.replace,b=C.to,j=C.innerRef,U=Object(r.a)(C,["component","replace","to","innerRef"]);return $.a.createElement(se.e.Consumer,null,function(E){E||Object(R.a)(!1);var M=E.history,I=h(p(b,E.location),E.location),g=I?M.createHref(I):"",W=Object(G.a)({},U,{href:g,navigate:function(){var le=p(b,E.location),ce=y?M.replace:M.push;ce(le)}});return o!==f?W.ref=x||j:W.innerRef=j,$.a.createElement(w,W)})});if(!1)var a,O;var T=function(x){return x},S=$.a.forwardRef;typeof S=="undefined"&&(S=T);function D(){for(var C=arguments.length,x=new Array(C),d=0;d<C;d++)x[d]=arguments[d];return x.filter(function(w){return w}).join(" ")}var L=S(function(C,x){var d=C["aria-current"],w=d===void 0?"page":d,y=C.activeClassName,b=y===void 0?"active":y,j=C.activeStyle,U=C.className,E=C.exact,M=C.isActive,I=C.location,g=C.sensitive,W=C.strict,J=C.style,le=C.to,ce=C.innerRef,Re=Object(r.a)(C,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return $.a.createElement(se.e.Consumer,null,function(Ee){Ee||Object(R.a)(!1);var Oe=I||Ee.location,Te=h(p(le,Oe),Oe),Le=Te.pathname,ye=Le&&Le.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Y=ye?Object(se.f)(Oe.pathname,{path:ye,exact:E,sensitive:g,strict:W}):null,_=!!(M?M(Y,Oe):Y),k=_?D(U,b):U,B=_?Object(G.a)({},J,{},j):J,Z=Object(G.a)({"aria-current":_&&w||null,className:k,style:B,to:Te},Re);return T!==S?Z.ref=x||ce:Z.innerRef=ce,$.a.createElement(s,Z)})});if(!1)var A},"5VLF":function(Ye,we,Q){"use strict";var se,X;function N($,H,P){var K=function(G,r){return $.js_beautify(G,r)};return K.js=$.js_beautify,K.css=H.css_beautify,K.html=P.html_beautify,K.js_beautify=$.js_beautify,K.css_beautify=H.css_beautify,K.html_beautify=P.html_beautify,K}!(se=[Q("6UM0"),Q("TXwP"),Q("psGv")],X=function($,H,P){return N($,H,P)}.apply(we,se),X!==void 0&&(Ye.exports=X))},"5Y4S":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return N});var se=Q("MNsG");const X=se.b.performance&&typeof se.b.performance.now=="function";class N{constructor($){this._highResolution=X&&$,this._startTime=this._now(),this._stopTime=-1}static create($=!0){return new N($)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?se.b.performance.now():Date.now()}}},"6UM0":function(Ye,we,Q){var se,X;(function(){var N;(function(){"use strict";var H=[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,W){return W.indexOf(g)!==-1}function O(g){return g.replace(/^\s+/g,"")}function T(g){for(var W={},J=0;J<g.length;J++)W[g[J].replace(/-/g,"_")]=g[J];return W}function S(g,W){return g&&g.type===s.RESERVED&&g.text===W}function D(g,W){return g&&g.type===s.RESERVED&&a(g.text,W)}var L=["case","return","do","if","throw","else","await","break","continue","async"],A=["before-newline","after-newline","preserve-newline"],C=T(A),x=[C.before_newline,C.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(g,W){if(W.multiline_frame||W.mode===d.ForInitializer||W.mode===d.Conditional)return;g.remove_indent(W.start_line_index)}function y(g){g=g.replace(h.allLineBreaks,`
|
|
`);for(var W=[],J=g.indexOf(`
|
|
`);J!==-1;)W.push(g.substring(0,J)),g=g.substring(J+1),J=g.indexOf(`
|
|
`);return g.length&&W.push(g),W}function b(g){return g===d.ArrayLiteral}function j(g){return a(g,[d.Expression,d.ForInitializer,d.Conditional])}function U(g,W){for(var J=0;J<g.length;J++){var le=g[J].trim();if(le.charAt(0)!==W)return!1}return!0}function E(g,W){for(var J=0,le=g.length,ce;J<le;J++)if(ce=g[J],ce&&ce.indexOf(W)!==0)return!1;return!0}function M(g,W){W=W||{},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(W)}M.prototype.create_flags=function(g,W){var J=0;g&&(J=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>J&&(J=g.line_indent_level));var le={mode:W,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:J,alignment:0,line_indent_level:g?g.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return le},M.prototype._reset=function(g){var W=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var J=new f(g,this._options);return this._tokens=J.tokenize(),g},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,W=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=`
|
|
`,W&&h.lineBreak.test(W||"")&&(J=W.match(h.lineBreak)[0]));for(var le=this._tokens.next();le;)this.handle_token(le),this._last_last_text=this._flags.last_token.text,this._flags.last_token=le,le=this._tokens.next();return g=this._output.get_code(J),g},M.prototype.handle_token=function(g,W){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,W):g.type===s.COMMENT?this.handle_comment(g,W):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,W):this.handle_unknown(g,W)},M.prototype.handle_whitespace_and_comments=function(g,W){var J=g.newlines,le=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var ce=g.comments_before.next();ce;)this.handle_whitespace_and_comments(ce,W),this.handle_token(ce,W),ce=g.comments_before.next();if(le)for(var Re=0;Re<J;Re+=1)this.print_newline(Re>0,W);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,W);for(var Ee=1;Ee<J;Ee+=1)this.print_newline(!0,W)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(g,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var J=this._options.preserve_newlines&&g.newlines||W,le=a(this._flags.last_token.text,u)||a(g.text,u);if(le){var ce=a(this._flags.last_token.text,u)&&a(this._options.operator_position,x)||a(g.text,u);J=J&&ce}if(J)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,W){if(!W&&(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 J=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(J,"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 W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(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 W=!1;return W=W||D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,W=W||S(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&D(this._flags.last_token,I)&&!g.newlines,W=W||S(this._flags.last_token,"else")&&!(S(g,"if")&&!g.comments_before),W=W||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),W=W||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,W=W||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),W?(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 W=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(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=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,W=d.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=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 J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var le=this._tokens.peek(-4);D(J,["async","function"])||J.text==="*"&&D(le,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(le.text==="{"||le.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(W),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 W=this._tokens.peek(),J=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):J&&(a(J.text,[":",","])&&a(W.type,[s.STRING,s.WORD,s.RESERVED])||a(W.text,["get","set","..."])&&a(J.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(J.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 le=!W.comments_before&&W.text==="}",ce=le&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,Ee=null;this._flags.inline_frame=!0;do if(Re+=1,Ee=this._tokens.peek(Re-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==s.EOF&&!(Ee.type===s.END_BLOCK&&Ee.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&&(ce||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(),!le&&!(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 W=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(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 W=this._tokens.peek();W.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&&!j(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&&(j(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var J="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?J="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?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===d.BlockStatement?J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&j(this._flags.mode)?J="SPACE":this._flags.last_token.type===s.STRING?J="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,["{",","]))?J="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,J="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"?J="SPACE":J="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 le=this._output.current_line;le.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="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():J==="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 W=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(W,"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?(j(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 W=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])),J=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 le=!W;this.handle_whitespace_and_comments(g,le)}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,x)&&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 ce=!0,Re=!0,Ee=!1;if(g.text===":"?this._flags.ternary_depth===0?ce=!1:(this._flags.ternary_depth-=1,Ee=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!J&&!W&&this._options.preserve_newlines&&a(g.text,u)){var Oe=g.text===":",Te=Oe&&Ee,Le=Oe&&!Ee;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!Le,this.print_token(g),(!Oe||Te)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!Oe||Te?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:Le||this.allow_wrap_or_preserved_newline(g),ce=!(this._output.just_added_newline()||Le),this._output.space_before_token=ce,this.print_token(g),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(g),ce=!1;var ye=this._tokens.peek();Re=ye&&a(ye.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),ce=this._flags.last_token.type===s.START_BLOCK,Re=!1;else if(a(g.text,["--","++","!","~"])||J){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),ce=!1,Re=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var Y=D(this._flags.last_token,L)&&g.newlines;Y&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Y,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(ce=!0),this._flags.last_token.type===s.RESERVED?ce=!0:this._flags.last_token.type===s.END_EXPR?ce=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ce=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Re=!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||ce,this.print_token(g),this._output.space_before_token=Re},M.prototype.handle_block_comment=function(g,W){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,W),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,W)},M.prototype.print_block_commment=function(g,W){var J=y(g.text),le,ce=!1,Re=!1,Ee=g.whitespace_before,Oe=Ee.length;if(this.print_newline(!1,W),this.print_token_line_indentation(g),this._output.add_token(J[0]),this.print_newline(!1,W),J.length>1){for(J=J.slice(1),ce=U(J,"*"),Re=E(J,Ee),ce&&(this._flags.alignment=1),le=0;le<J.length;le++)ce?(this.print_token_line_indentation(g),this._output.add_token(O(J[le]))):Re&&J[le]?(this.print_token_line_indentation(g),this._output.add_token(J[le].substring(Oe))):(this._output.current_line.set_indent(-1),this._output.add_token(J[le])),this.print_newline(!1,W);this._flags.alignment=0}},M.prototype.handle_comment=function(g,W){g.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,W)},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,W){this.print_token(g),g.text[g.text.length-1]===`
|
|
`&&this.print_newline(!1,W)},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(U,E){return E.indexOf(U)!==-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(/\/\*/,/\*\//),T=/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),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=x.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(U,E){p.call(this,U,E),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(T),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(U){return U.type===a.COMMENT||U.type===a.BLOCK_COMMENT||U.type===a.UNKNOWN},b.prototype._is_opening=function(U){return U.type===a.START_BLOCK||U.type===a.START_EXPR},b.prototype._is_closing=function(U,E){return(U.type===a.END_BLOCK||U.type===a.END_EXPR)&&E&&(U.text==="]"&&E.text==="["||U.text===")"&&E.text==="("||U.text==="}"&&E.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(U,E){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(U),M=M||this._read_singles(I),M=M||this._read_comment(I),M=M||this._read_regexp(I,U),M=M||this._read_xml(I,U),M=M||this._read_punctuation(),M=M||this._create_token(a.UNKNOWN,this._input.next()),M)},b.prototype._read_word=function(U){var E;if(E=this.__patterns.identifier.read(),E!=="")return E=E.replace(f.allLineBreaks,`
|
|
`),!(U.type===a.DOT||U.type===a.RESERVED&&(U.text==="set"||U.text==="get"))&&w.test(E)?(E==="in"||E==="of")&&(U.type===a.WORD||U.type===a.STRING)?this._create_token(a.OPERATOR,E):this._create_token(a.RESERVED,E):this._create_token(a.WORD,E);if(E=this.__patterns.number.read(),E!=="")return this._create_token(a.WORD,E)},b.prototype._read_singles=function(U){var E=null;return U==="("||U==="["?E=this._create_token(a.START_EXPR,U):U===")"||U==="]"?E=this._create_token(a.END_EXPR,U):U==="{"?E=this._create_token(a.START_BLOCK,U):U==="}"?E=this._create_token(a.END_BLOCK,U):U===";"?E=this._create_token(a.SEMICOLON,U):U==="."&&D.test(this._input.peek(1))?E=this._create_token(a.DOT,U):U===","&&(E=this._create_token(a.COMMA,U)),E&&this._input.next(),E},b.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(a.EQUALS,U):U==="?."?this._create_token(a.DOT,U):this._create_token(a.OPERATOR,U)},b.prototype._read_non_javascript=function(U){var E="";if(U==="#"){if(this._is_first_token()&&(E=this.__patterns.shebang.read(),E))return this._create_token(a.UNKNOWN,E.trim()+`
|
|
`);if(E=this.__patterns.include.read(),E)return this._create_token(a.UNKNOWN,E.trim()+`
|
|
`);U=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(S)){do U=this._input.next(),M+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(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(U==="<"&&this._is_first_token()){if(E=this.__patterns.html_comment_start.read(),E){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)E+=this._input.next();return y=!0,this._create_token(a.COMMENT,E)}}else if(y&&U==="-"&&(E=this.__patterns.html_comment_end.read(),E))return y=!1,this._create_token(a.COMMENT,E);return null},b.prototype._read_comment=function(U){var E=null;if(U==="/"){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,`
|
|
`),E=this._create_token(a.BLOCK_COMMENT,M),E.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),E=this._create_token(a.COMMENT,M))}return E},b.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var E=this._input.next();return this.has_char_escapes=!1,U==="`"?E+=this._read_string_recursive("`",!0,"${"):E+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(E=j(E)),this._input.peek()===U&&(E+=this._input.next()),E=E.replace(f.allLineBreaks,`
|
|
`),this._create_token(a.STRING,E)}return null},b.prototype._allow_regexp_or_xml=function(U){return U.type===a.RESERVED&&s(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===a.END_EXPR&&U.text===")"&&U.opened.previous.type===a.RESERVED&&s(U.opened.previous.text,["if","while","for"])||s(U.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(U,E){if(U==="/"&&this._allow_regexp_or_xml(E)){for(var M=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==U)&&!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()===U&&(M+=this._input.next(),M+=this._input.read(f.identifier)),this._create_token(a.STRING,M)}return null},b.prototype._read_xml=function(U,E){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(E)){var M="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=g.indexOf("{")===0,J=0;I;){var le=!!I[1],ce=I[2],Re=!!I[I.length-1]||ce.slice(0,8)==="![CDATA[";if(!Re&&(ce===g||W&&ce.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(le?--J:++J),M+=I[0],J<=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 j(U){for(var E="",M=0,I=new m(U),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(E+=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{E+="\\",I.hasNext()&&(E+=I.next());continue}if(!g)return U;if(M=parseInt(g[1],16),M>126&&M<=255&&g[0].indexOf("x")===0)return U;if(M>=0&&M<32){E+="\\"+g[0];continue}else M===34||M===39||M===92?E+="\\"+String.fromCharCode(M):E+=String.fromCharCode(M)}return E}b.prototype._read_string_recursive=function(U,E,M){var I,g;U==="'"?g=this.__patterns.single_quote:U==='"'?g=this.__patterns.double_quote:U==="`"?g=this.__patterns.template_text:U==="}"&&(g=this.__patterns.template_expression);for(var W=g.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===U||!E&&f.newline.test(J)){this._input.back();break}else J==="\\"&&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(),J+=this._input.next()):M&&(M==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),M===J&&(U==="`"?J+=this._read_string_recursive("}",E,"`"):J+=this._read_string_recursive("`",E,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=g.read(),W+=J}return W},r.exports.Tokenizer=b,r.exports.TOKEN=a,r.exports.positionable_operators=L.slice(),r.exports.line_starters=x.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=[],T=new h;s.type!==f.EOF;){for(u=this._get_next_token(s,a);this._is_comment(u);)T.add(u),u=this._get_next_token(s,a);T.isEmpty()||(u.comments_before=T,T=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}],P={};function K(r){var R=P[r];if(R!==void 0)return R.exports;var v=P[r]={exports:{}};return H[r](v,v.exports,K),v.exports}var G=K(0);N=G})();var $=N;!(se=[],X=function(){return{js_beautify:$}}.apply(we,se),X!==void 0&&(Ye.exports=X))})()},"746U":function(Ye,we,Q){"use strict";Q.d(we,"f",function(){return se}),Q.d(we,"l",function(){return X}),Q.d(we,"k",function(){return N}),Q.d(we,"j",function(){return $}),Q.d(we,"g",function(){return H}),Q.d(we,"m",function(){return P}),Q.d(we,"h",function(){return K}),Q.d(we,"n",function(){return G}),Q.d(we,"c",function(){return r}),Q.d(we,"a",function(){return R}),Q.d(we,"i",function(){return v}),Q.d(we,"o",function(){return m}),Q.d(we,"e",function(){return o}),Q.d(we,"d",function(){return f}),Q.d(we,"p",function(){return l}),Q.d(we,"b",function(){return u});function se(s){return Array.isArray(s)}function X(s){return typeof s=="string"}function N(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function $(s){return typeof s=="number"&&!isNaN(s)}function H(s){return s===!0||s===!1}function P(s){return typeof s=="undefined"}function K(s){return!G(s)}function G(s){return P(s)||s===null}function r(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function R(s){if(G(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 T=0;T<O;T++)p(s[T],a[T])}function p(s,a){if(X(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(!G(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 T={};for(const S of s)T[S]=O(S);return T}function l(s){return s===null?void 0:s}function u(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(Ye,we,Q){"use strict";var se=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),X=new Uint8Array(16);function N(){if(!se)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return se(X)}var $=/^(?:[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 H(p){return typeof p=="string"&&$.test(p)}for(var P=H,K=[],G=0;G<256;++G)K.push((G+256).toString(16).substr(1));function r(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(K[p[h+0]]+K[p[h+1]]+K[p[h+2]]+K[p[h+3]]+"-"+K[p[h+4]]+K[p[h+5]]+"-"+K[p[h+6]]+K[p[h+7]]+"-"+K[p[h+8]]+K[p[h+9]]+"-"+K[p[h+10]]+K[p[h+11]]+K[p[h+12]]+K[p[h+13]]+K[p[h+14]]+K[p[h+15]]).toLowerCase();if(!P(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||N)();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=we.a=v},"7ahc":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return O});var se=Q("k1fw"),X=Q("0Owb"),N=Q("+L6B"),$=Q("2/Rp"),H=Q("y8nQ"),P=Q("Vl3Y"),K=Q("tJVT"),G=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"]};we.b=function(T){var S=T.callback,D=T.onCancel,L=Object(R.useState)("python"),A=Object(K.a)(L,2),C=A[0],x=A[1];function d(y){x(a[y][1])}function w(y){S(y)}return v.a.createElement(P.a,Object(X.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),v.a.createElement(P.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(P.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($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement($.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function O(T){var S=T.value,D=T.onChange,L=T.mode,A=T.options,C=A===void 0?{}:A,x=Object(R.useRef)(),d=Object(R.useState)(),w=Object(K.a)(d,2),y=w[0],b=w[1];return Object(R.useEffect)(function(){if(y){function j(U){var E=U.getValue();D&&D(E)}return y.on("change",j),function(){y.off("change",j)}}},[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(x.current&&!y){var j=p.a.fromTextArea(x.current,Object(se.a)({mode:L,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));b(j)}},[x.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:x}))}},"8EBN":function(Ye,we,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";se.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var X=0;X<se.modeInfo.length;X++){var N=se.modeInfo[X];N.mimes&&(N.mime=N.mimes[0])}se.findModeByMIME=function($){$=$.toLowerCase();for(var H=0;H<se.modeInfo.length;H++){var P=se.modeInfo[H];if(P.mime==$)return P;if(P.mimes){for(var K=0;K<P.mimes.length;K++)if(P.mimes[K]==$)return P}}if(/\+xml$/.test($))return se.findModeByMIME("application/xml");if(/\+json$/.test($))return se.findModeByMIME("application/json")},se.findModeByExtension=function($){$=$.toLowerCase();for(var H=0;H<se.modeInfo.length;H++){var P=se.modeInfo[H];if(P.ext){for(var K=0;K<P.ext.length;K++)if(P.ext[K]==$)return P}}},se.findModeByFileName=function($){for(var H=0;H<se.modeInfo.length;H++){var P=se.modeInfo[H];if(P.file&&P.file.test($))return P}var K=$.lastIndexOf("."),G=K>-1&&$.substring(K+1,$.length);if(G)return se.findModeByExtension(G)},se.findModeByName=function($){$=$.toLowerCase();for(var H=0;H<se.modeInfo.length;H++){var P=se.modeInfo[H];if(P.name.toLowerCase()==$)return P;if(P.alias){for(var K=0;K<P.alias.length;K++)if(P.alias[K].toLowerCase()==$)return P}}}})},"8HAY":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return H}),Q.d(we,"b",function(){return P}),Q.d(we,"d",function(){return K}),Q.d(we,"e",function(){return G}),Q.d(we,"c",function(){return r});var se=Q("MI8n"),X=Q("pmY6"),N=Q("3/fG"),$=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 H extends X.a{constructor(R,v="",m="",p=!0,h){super();this._onDidChange=this._register(new se.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 $(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(R))})}}class P extends X.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new se.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new se.b),this.onDidRun=this._onDidRun.event}run(R,v){return $(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 $(this,void 0,void 0,function*(){yield R.run(v)})}}class K extends H{constructor(R){super(K.ID,R,R?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class G{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 $(this,void 0,void 0,function*(){})}}class r extends H{constructor(){super(r.ID,N.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(Ye,we,Q){Ye.exports={button:"button___1wy9m"}},"9Bee":function(Ye,we,Q){"use strict";var se=Q("DYRE"),X=Q("zeV3"),N=Q("+L6B"),$=Q("2/Rp"),H=Q("k1fw"),P=Q("9og8"),K=Q("tJVT"),G=Q("WmNS"),r=Q.n(G),R=Q("q1tI"),v=Q.n(R),m=Q("vg9a"),p=Q("DlQD"),h=Q.n(p),o=Q("rUJ1");function f(de,ee){var ne=de.match(/^(\s+)(?:```)/);if(ne===null)return ee;var oe=ne[1];return ee.split(`
|
|
`).map(function(fe){var re=fe.match(/^\s+/);if(re===null)return fe;var ie=Object(K.a)(re,1),pe=ie[0];return pe.length>=oe.length?fe.slice(oe.length):fe}).join(`
|
|
`)}var l=[],u=["<ul>"],s=new h.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){l.length=0,u=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(de,ee,ne,oe){if(ee>=de.length||de[ee].level<=ne)return ee;var fe=de[ee];oe.push("<li><a href='#"+fe.anchor+"'>"+fe.text+"</a>"),ee++;var re=[];return ee=S(de,ee,fe.level,re),re.length>0&&(oe.push("<ul>"),re.forEach(function(ie){oe.push(ie)}),oe.push("</ul>")),oe.push("</li>"),ee=S(de,ee,ne,oe),ee}function D(){return S(l,0,0,u),u.push("</ul>"),u.join("")}var L={heading:function(ee){var ne=a.exec(ee);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},fences:function(ee){var ne=this.rules.block.fences.exec(ee);if(ne){var oe=ne[0],fe=f(oe,ne[3]||""),re=ne[2]?ne[2].trim():ne[2];if(["latex","katex","math"].indexOf(re)>=0){var ie=x(),pe=fe;fe=ie,d[ie]={type:"block",expression:pe}}return{type:"code",raw:oe,lang:re,text:fe}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,x=function(){return"__special_katext_id_".concat(C++,"__")},d={};function w(){return d}function y(){C=0,d={}}function b(de){return de=de.replace(A,function(ee,ne){var oe=x();return d[oe]={type:"inline",expression:ne},oe}),de}var j=s.listitem;s.listitem=function(de){return j(b(de))};var U=s.paragraph;s.paragraph=function(de){return U(b(de))};var E=s.tablecell;s.tablecell=function(de,ee){return E(b(de),ee)},s.code=function(de,ee,ne){var oe=(ee||"").match(/\S*/)[0];return oe?["latex","katex","math"].indexOf(oe)>=0?"<p class='editormd-tex'>".concat(de,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ee,'">').concat(ne?de:Object(o.escape)(de,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(ne?de:Object(o.escape)(de,!0))+"</code></pre>"},s.heading=function(de,ee,ne){var oe=this.options.headerPrefix+ne.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:oe,level:ee,text:de}),"<h"+ee+' id="'+oe+'">'+de+"</h"+ee+">"},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"),W=Q.n(g),J=Q("m3rI"),le=Q("Oy/b"),ce=Q("p5ED"),Re=Q("ErOA"),Ee=Q("STEk");/* **********************************
|
|
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 Oe=function(de,ee){return(Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ne,oe){ne.__proto__=oe}||function(ne,oe){for(var fe in oe)Object.prototype.hasOwnProperty.call(oe,fe)&&(ne[fe]=oe[fe])})(de,ee)};function Te(de,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function ne(){this.constructor=de}Oe(de,ee),de.prototype=ee===null?Object.create(ee):(ne.prototype=ee.prototype,new ne)}function Le(de,ee,ne,oe){return new(ne||(ne=Promise))(function(fe,re){function ie(xe){try{ge(oe.next(xe))}catch(Ie){re(Ie)}}function pe(xe){try{ge(oe.throw(xe))}catch(Ie){re(Ie)}}function ge(xe){var Ie;xe.done?fe(xe.value):(Ie=xe.value,Ie instanceof ne?Ie:new ne(function(Ne){Ne(Ie)})).then(ie,pe)}ge((oe=oe.apply(de,ee||[])).next())})}function ye(de,ee){var ne,oe,fe,re,ie={label:0,sent:function(){if(1&fe[0])throw fe[1];return fe[1]},trys:[],ops:[]};return re={next:pe(0),throw:pe(1),return:pe(2)},typeof Symbol=="function"&&(re[Symbol.iterator]=function(){return this}),re;function pe(ge){return function(xe){return function(Ie){if(ne)throw new TypeError("Generator is already executing.");for(;ie;)try{if(ne=1,oe&&(fe=2&Ie[0]?oe.return:Ie[0]?oe.throw||((fe=oe.return)&&fe.call(oe),0):oe.next)&&!(fe=fe.call(oe,Ie[1])).done)return fe;switch(oe=0,fe&&(Ie=[2&Ie[0],fe.value]),Ie[0]){case 0:case 1:fe=Ie;break;case 4:return ie.label++,{value:Ie[1],done:!1};case 5:ie.label++,oe=Ie[1],Ie=[0];continue;case 7:Ie=ie.ops.pop(),ie.trys.pop();continue;default:if(!(fe=ie.trys,(fe=fe.length>0&&fe[fe.length-1])||Ie[0]!==6&&Ie[0]!==2)){ie=0;continue}if(Ie[0]===3&&(!fe||Ie[1]>fe[0]&&Ie[1]<fe[3])){ie.label=Ie[1];break}if(Ie[0]===6&&ie.label<fe[1]){ie.label=fe[1],fe=Ie;break}if(fe&&ie.label<fe[2]){ie.label=fe[2],ie.ops.push(Ie);break}fe[2]&&ie.ops.pop(),ie.trys.pop();continue}Ie=ee.call(de,ie)}catch(Ne){Ie=[6,Ne],oe=0}finally{ne=fe=0}if(5&Ie[0])throw Ie[1];return{value:Ie[0]?Ie[1]:void 0,done:!0}}([ge,xe])}}}var Y=function(){function de(){}return de.addKey=function(ee){de.key=ee},Object.defineProperty(de,"isLicensed",{get:function(){return!!de.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(de.key)},enumerable:!1,configurable:!0}),de}(),_=function(){function de(){}return de.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},de.setAttributes=function(ee,ne){for(var oe=0,fe=ne;oe<fe.length;oe++){var re=fe[oe],ie=re[0],pe=re[1];ee.setAttribute(ie,pe)}},de.createRect=function(ee,ne,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","rect");return fe.setAttribute("width",ee.toString()),fe.setAttribute("height",ne.toString()),oe&&de.setAttributes(fe,oe),fe},de.createLine=function(ee,ne,oe,fe,re){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",ee.toString()),ie.setAttribute("y1",ne.toString()),ie.setAttribute("x2",oe.toString()),ie.setAttribute("y2",fe.toString()),re&&de.setAttributes(ie,re),ie},de.createPolygon=function(ee,ne){var oe=document.createElementNS("http://www.w3.org/2000/svg","polygon");return oe.setAttribute("points",ee),ne&&de.setAttributes(oe,ne),oe},de.createCircle=function(ee,ne){var oe=document.createElementNS("http://www.w3.org/2000/svg","circle");return oe.setAttribute("cx",(ee/2).toString()),oe.setAttribute("cy",(ee/2).toString()),oe.setAttribute("r",ee.toString()),ne&&de.setAttributes(oe,ne),oe},de.createEllipse=function(ee,ne,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return fe.setAttribute("cx",(ee/2).toString()),fe.setAttribute("cy",(ne/2).toString()),fe.setAttribute("rx",(ee/2).toString()),fe.setAttribute("ry",(ne/2).toString()),oe&&de.setAttributes(fe,oe),fe},de.createGroup=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","g");return ee&&de.setAttributes(ne,ee),ne},de.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},de.createMarker=function(ee,ne,oe,fe,re,ie,pe){var ge=document.createElementNS("http://www.w3.org/2000/svg","marker");return de.setAttributes(ge,[["id",ee],["orient",ne],["markerWidth",oe.toString()],["markerHeight",fe.toString()],["refX",re.toString()],["refY",ie.toString()]]),ge.appendChild(pe),ge},de.createText=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","text");return ne.setAttribute("x","0"),ne.setAttribute("y","0"),ee&&de.setAttributes(ne,ee),ne},de.createTSpan=function(ee,ne){var oe=document.createElementNS("http://www.w3.org/2000/svg","tspan");return oe.textContent=ee,ne&&de.setAttributes(oe,ne),oe},de.createImage=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","image");return ee&&de.setAttributes(ne,ee),ne},de.createPoint=function(ee,ne){var oe=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return oe.x=ee,oe.y=ne,oe},de.createPath=function(ee,ne){var oe=document.createElementNS("http://www.w3.org/2000/svg","path");return oe.setAttribute("d",ee),ne&&de.setAttributes(oe,ne),oe},de.createElement=function(ee,ne){var oe=document.createElementNS("http://www.w3.org/2000/svg",ee);return ne&&de.setAttributes(oe,ne),oe},de.getHollowRectanglePath=function(ee,ne,oe,fe,re,ie,pe,ge){return"M"+ee+","+ne+"V"+(ne+fe)+"H"+(ee+oe)+"V"+ne+"H"+re+"V"+ie+"H"+(re+pe)+"V"+(ie+ge)+"H"+re+"V"+ne+"Z"},de}(),k=function(){function de(ee){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ee+"_"}return Object.defineProperty(de.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(de.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(de.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),de.prototype.addClass=function(ee){return this.styleSheet===void 0&&this.addStyleSheet(),ee.name=""+this.classNamePrefix+ee.localName,this.classes.push(ee),this.styleSheet.sheet.insertRule("."+ee.name+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length),ee},de.prototype.addRule=function(ee){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ee),this.styleSheet.sheet.insertRule(ee.selector+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length)},de.prototype.addStyleSheet=function(){var ee;this.styleSheet=document.createElement("style"),((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).appendChild(this.styleSheet),this.addRule(new B("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Z("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Z("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},de.prototype.removeStyleSheet=function(){var ee;this.styleSheet&&(((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},de}(),B=function(de,ee){this.selector=de,this.style=ee},Z=function(de,ee){this.localName=de,this.style=ee},z=function(){function de(){this.blocks=[],this.display=""}return de.prototype.addButtonBlock=function(ee){ee.className=this.blockClassName,ee.buttonClassName=this.buttonClassName,ee.buttonColorsClassName=this.buttonColorsClassName,ee.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ee)},de.prototype.addElementBlock=function(ee){ee.className===void 0&&(ee.className=this.blockClassName),this.blocks.push(ee)},de.prototype.getUI=function(){var ee=document.createElement("div");return ee.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ee.style.display=this.display,this.blocks.forEach(function(ne){return ee.appendChild(ne.getUI())}),ee},de}(),he=function(){function de(){}return de.prototype.getUI=function(){var ee=document.createElement("div");if(ee.className=this.className,this.minWidth!==void 0&&(ee.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ee.style.justifyContent="flex-start";break;case"center":ee.style.justifyContent="center";break;case"end":ee.style.justifyContent="flex-end"}return ee.style.whiteSpace="nowrap",ee},de}(),ve=function(de){function ee(){var ne=de!==null&&de.apply(this,arguments)||this;return ne.buttons=[],ne}return Te(ee,de),ee.prototype.addButton=function(ne){ne.className=this.buttonClassName,ne.colorsClassName=this.buttonColorsClassName,ne.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(ne)},ee.prototype.getUI=function(){var ne=de.prototype.getUI.call(this);return this.buttons.forEach(function(oe){return ne.appendChild(oe.getUI())}),ne},ee}(he),Ae=function(){function de(ee,ne){this._isActive=!1,this._isHidden=!1,this._icon=ee,this.title=ne,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(de.prototype,"icon",{get:function(){return this._icon},set:function(ee){this._icon=ee,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isActive",{get:function(){return this._isActive},set:function(ee){this._isActive=ee,this.adjustClassName()},enumerable:!1,configurable:!0}),de.prototype.getUI=function(){var ee=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 ee.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},de.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,"")))},de.prototype.hide=function(){this._isHidden=!0},de}(),ue=function(de){function ee(){var ne=de!==null&&de.apply(this,arguments)||this;return ne.elements=[],ne}return Te(ee,de),ee.prototype.addElement=function(ne){this.elements.push(ne)},ee.prototype.getUI=function(){var ne=de.prototype.getUI.call(this);return this.elements.forEach(function(oe){return ne.appendChild(oe)}),ne},ee}(he),me=function(){function de(ee,ne){this.horizontal=ee,this.vertical=ne}return Object.defineProperty(de.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),de.prototype.getVerticalLength=function(ee){return ee/this.ratio},de.prototype.getHorizontalLength=function(ee){return ee*this.ratio},de}(),be=function(){function de(){}return de.getIcon=function(ee,ne){if(ee>0&&ne>0){var oe=new me(ee,ne),fe=oe.ratio>=1?20:oe.getHorizontalLength(20),re=oe.ratio<1?20:oe.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var pe=_.createDefs();ie.appendChild(pe);var ge=_.createElement("clipPath",[["id","text-bg-clip"]]);pe.appendChild(ge);var xe=_.createPath(_.getHollowRectanglePath((24-fe)/2,(24-re)/2,fe,re,(24-fe)/2+2,(24-re)/2+2,fe-4,re-4));ie.appendChild(xe);var Ie=_.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ie.appendChild(_.createTSpan(ee+":"+ne)),ie.appendChild(Ie);var Ne=Ie.getBBox();_.setAttributes(Ie,[["x",((24-Ne.width)/2).toString()],["y",((24-Ne.height)/2-Ne.y).toString()]]);var ze=_.createPath(_.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ne.width))/2,(24-Math.ceil(Ne.height))/2,Math.ceil(Ne.width),Math.ceil(Ne.height)));return ge.appendChild(ze),_.setAttributes(xe,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},de}(),Ce=function(de){function ee(ne,oe,fe){var re=de.call(this,ne,oe)||this;return re.isDropdownOpen=!1,re.onClick=re.dropdownButtonClicked,re.dropdownButtons=fe,re}return Te(ee,de),ee.prototype.setupDropdown=function(){var ne=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(oe){oe.className=ne.className,oe.colorsClassName=ne.colorsClassName,ne.dropdownBlock.appendChild(oe.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ee.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ee.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ee.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ee.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ee.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ee}(Ae),Pe=function(){function de(ee,ne){this.GRIP_SIZE=10,this.color=ee,this.fillColor=ne,this.visual=_.createGroup(),this.visual.appendChild(_.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return de.prototype.ownsTarget=function(ee){return ee===this.visual||ee===this.visual.childNodes[0]||ee===this.visual.childNodes[1]},de.prototype.setCenter=function(ee,ne){this.visual.childNodes.forEach(function(oe){return _.setAttributes(oe,[["cx",ee.toString()],["cy",ne.toString()]])})},de}(),Ue=function(){function de(ee,ne,oe,fe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ee,this.canvasHeight=ne,this.margin=oe,this.container=fe,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(de.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ee){this._aspectRatio=ee,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.gridContainer&&_.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ee){this._zoomFactor=ee,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),de.prototype.open=function(){var ee=this;this.cropShadeElement=_.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=_.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var ne=0;ne<this.numberOfGridLines;ne++)this.horizontalGridLines.push(_.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(_.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(oe){return ee.gridContainer.appendChild(oe)}),this.verticalGridLines.forEach(function(oe){return ee.gridContainer.appendChild(oe)}),this.cropRectElement=_.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},de.prototype.setCropRectangle=function(ee){this.cropRect=ee;var ne=Object.assign({},this.cropRect);this.zoomFactor!==1&&(ne.width=this.cropRect.width*this.zoomFactor,ne.height=this.cropRect.height*this.zoomFactor,ne.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-ne.width/2,ne.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-ne.height/2),_.setAttributes(this.cropRectElement,[["x",ne.x.toString()],["y",ne.y.toString()],["width",ne.width.toString()],["height",ne.height.toString()]]);var oe=ne.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(re,ie){var pe=ne.y+oe*(ie+1);_.setAttributes(re,[["x1",""+ne.x],["y1",""+pe],["x2",""+(ne.x+ne.width)],["y2",""+pe]])});var fe=ne.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(re,ie){var pe=ne.x+fe*(ie+1);_.setAttributes(re,[["x1",""+pe],["y1",""+ne.y],["x2",""+pe],["y2",""+(ne.y+ne.height)]])}),_.setAttributes(this.cropShadeElement,[["d",_.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,ne.x,ne.y,ne.width,ne.height)]]),this.topLeftGrip.setCenter(ne.x,ne.y),this.topRightGrip.setCenter(ne.x+ne.width,ne.y),this.bottomLeftGrip.setCenter(ne.x,ne.y+ne.height),this.bottomRightGrip.setCenter(ne.x+ne.width,ne.y+ne.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},de.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)},de.prototype.clientToLocalCoordinates=function(ee,ne){var oe=this.container.getBoundingClientRect();return{x:ee-oe.left+this.margin,y:ne-oe.top+this.margin}},de.prototype.onPointerDown=function(ee){this.container.setPointerCapture(ee.pointerId),this.previousPoint=this.clientToLocalCoordinates(ee.clientX,ee.clientY),this.cropRectElement===ee.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ee.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ee.target)&&(this.activeGrip=this.bottomRightGrip)},de.prototype.onPointerMove=function(ee){if(this.isMoving)this.move(this.clientToLocalCoordinates(ee.clientX,ee.clientY));else if(this.activeGrip){var ne=this.clientToLocalCoordinates(ee.clientX,ee.clientY);this.resize(ne)}ee.preventDefault()},de.prototype.onPointerUp=function(ee){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ee.pointerId)},de.prototype.move=function(ee){var ne=ee.x-this.previousPoint.x,oe=ee.y-this.previousPoint.y;this.zoomFactor!==1&&(ne=-ne/this.zoomFactor,oe=-oe/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+ne),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+oe),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ee},de.prototype.resize=function(ee){var ne=Object.assign({},this.cropRect),oe=ee.x-this.previousPoint.x,fe=ee.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:ne.x+oe<this.margin&&(oe=this.margin-ne.x),ne.x+=oe,ne.width=this.cropRect.x+this.cropRect.width-ne.x;break;case this.bottomRightGrip:case this.topRightGrip:ne.width+oe>this.canvasWidth*this.zoomFactor&&(oe=this.canvasWidth*this.zoomFactor-ne.width),ne.width+=oe}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(ne.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(oe),ne.height=this.aspectRatio.getVerticalLength(ne.width)):(ne.y+=fe,ne.height=this.cropRect.y+this.cropRect.height-ne.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?ne.height=this.aspectRatio.getVerticalLength(ne.width):ne.height+=fe}ne.width<10&&(ne.x=this.cropRect.x,ne.width=10),ne.height<10&&(ne.y=this.cropRect.y,ne.height=10),this.previousPoint=ee,ne.x>=this.margin&&ne.y>=this.margin&&ne.x-this.margin+ne.width<=this.canvasWidth&&ne.y-this.margin+ne.height<=this.canvasHeight&&(this.cropRect=ne,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},de.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ee=this.cropRect.x+this.cropRect.width/2,ne=this.cropRect.y+this.cropRect.height/2,oe=this.aspectRatio.getHorizontalLength(this.cropRect.height),fe=this.aspectRatio.getVerticalLength(this.cropRect.width);oe/this.canvasWidth<fe/this.canvasHeight?this.cropRect.width=oe:this.cropRect.height=fe,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=ee-this.cropRect.width/2,this.cropRect.y=ne-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)}},de.prototype.getRescaledRect=function(ee,ne,oe,fe,re,ie){var pe=oe/ee,ge=fe/ne;return{x:(re.x-ie)*pe+ie,y:(re.y-ie)*ge+ie,width:re.width*pe,height:re.height*ge}},de.prototype.scaleCanvas=function(ee,ne){var oe=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ee,ne,this.cropRect,this.margin);this.canvasWidth=ee,this.canvasHeight=ne,this.onCropChange&&this.onCropChange(oe),this.setCropRectangle(oe)},de}(),He=function(){function de(ee){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ee,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(de.prototype,"angle",{get:function(){return this._angle},set:function(ee){this._angle=ee,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),de.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},de.prototype.onPointerDown=function(ee){this.controlContainer.setPointerCapture(ee.pointerId),this.isDragging=!0,this.previousPoint={x:ee.clientX,y:ee.clientY}},de.prototype.onPointerMove=function(ee){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.previousPoint.x=ee.clientX)},de.prototype.onPointerUp=function(ee){this.isDragging&&this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ee.pointerId)},de.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ee=this.angleLabelText.getBBox();_.setAttributes(this.angleLabelElement,[["x",((this.width-ee.width)/2).toString()],["y",(this.height/2).toString()]])}},de.prototype.positionScaleShape=function(){if(this.scaleShape){var ee=this.scaleShape.transform.baseVal.getItem(0);ee.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ee,0)}},de.prototype.getVisual=function(){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg");ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.setAttribute("width",this.width+"px"),ee.setAttribute("height",this.height+"px"),ee.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ee.style.flexShrink="0",document.body.appendChild(ee);for(var ne="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,oe=1;oe<=this.width/5+10;oe++){var fe=oe%5==0?this.height/3:this.height/6;ne+="h4v"+-fe+"h1v"+fe}ne+="v1H0Z",this.scaleShape=_.createPath(ne);var re=_.createTransform();this.scaleShape.transform.baseVal.appendItem(re),ee.appendChild(this.scaleShape),this.angleLabelElement=_.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=_.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=_.createTSpan("");return ie.innerHTML="°",this.angleLabelElement.appendChild(ie),ee.appendChild(this.angleLabelElement),document.body.removeChild(ee),ee},de}(),Be=function(){function de(){this.naturalSize=!1,this.imageType="image/png"}return de.prototype.rasterize=function(ee,ne,oe,fe,re,ie,pe){var ge=this;return new Promise(function(xe){var Ie=document.createElement("canvas");Ie.width=ee.width.baseVal.value-2*fe,Ie.height=ee.height.baseVal.value-2*fe;var Ne=1,ze=1;ge.naturalSize===!0?(Ne=ne.naturalWidth/(ee.width.baseVal.value-2*fe)/ie,ze=ne.naturalHeight/(ee.height.baseVal.value-2*fe)/pe,Ie.width=ne.naturalWidth/ie,Ie.height=ne.naturalHeight/pe):ge.width!==void 0&&ge.height!==void 0&&(Ne=ge.width/oe.width,ze=ge.height/oe.height,Ie.width*=Ne,Ie.height*=ze);var et=Ie.getContext("2d");et.translate(Ie.width/2,Ie.height/2),et.rotate(re*Math.PI/180),et.scale(ie,pe),et.translate(-Ie.width/2,-Ie.height/2),et.drawImage(ne,0,0,Ie.width,Ie.height);var rt=document.createElement("canvas");rt.width=oe.width*Ne,rt.height=oe.height*ze,rt.getContext("2d").putImageData(et.getImageData((oe.x-fe)*Ne,(oe.y-fe)*ze,oe.width*Ne,oe.height*ze),0,0),xe(rt.toDataURL(ge.imageType,ge.imageQuality))})},de}(),Qe=function(){function de(ee){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=de.instanceCounter++,this.styles=new k(this.instanceNo),this.target=ee,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(de.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ee){this._zoomToCropEnabled=ee,ee?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ee){this._gridLines=ee,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ee){this._rotationAngle=ee,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"aspectRatio",{get:function(){var ee;return(ee=this._aspectRatio)!==null&&ee!==void 0?ee:this.aspectRatios[0]},set:function(ee){this._aspectRatio=ee},enumerable:!1,configurable:!0}),de.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},de.prototype.show=function(){this.showUI(),this.open()},de.prototype.close=function(ee){ee===void 0&&(ee=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ee||this.closeEventListeners.forEach(function(ne){return ne()}),this._isOpen=!1)},de.prototype.addRenderEventListener=function(ee){this.renderEventListeners.push(ee)},de.prototype.removeRenderEventListener=function(ee){this.renderEventListeners.indexOf(ee)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ee),1)},de.prototype.addCloseEventListener=function(ee){this.closeEventListeners.push(ee)},de.prototype.removeCloseEventListener=function(ee){this.closeEventListeners.indexOf(ee)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ee),1)},de.prototype.setupResizeObserver=function(){var ee=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ee.resize(ee.target.clientWidth,ee.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))},de.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ee=1*this.target.clientWidth/this.target.clientHeight,ne=this.contentDiv.clientWidth/ee>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ee:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,oe=ne+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ee;this.resize(ne,oe)}},de.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},de.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",_.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},de.prototype.resize=function(ee,ne){this.imageWidth=Math.round(ee),this.imageHeight=Math.round(ne),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()},de.prototype.setEditingTarget=function(){var ee=document.createElement("canvas");ee.width=this.target.naturalWidth,ee.height=this.target.naturalHeight,ee.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var ne=ee.toDataURL();_.setAttributes(this.editingTarget,[["href",ne]]),this.setEditingTargetSize()},de.prototype.setTopLeft=function(){var ee=this.target.getBoundingClientRect(),ne=this.editorCanvas.getBoundingClientRect();this.left=ee.left-ne.left-this.CANVAS_MARGIN,this.top=ee.top-ne.top-this.CANVAS_MARGIN},de.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=_.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=_.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=_.createGroup(),this.editingTargetRotationScaleContainer=_.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ee=_.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ee);var ne=_.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(ne),this.editingTargetContainer=_.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)},de.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},de.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=_.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ue(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()},de.prototype.zoomToCrop=function(){if(this.cropRect){var ee=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,ne=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=ee+"px "+ne+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ee+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-ne+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},de.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)},de.prototype.cropRectChanged=function(ee){this.cropRect=ee,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},de.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},de.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"},de.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},de.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 ee=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,ne=this.target.offsetTop>ee+this.CANVAS_MARGIN?this.target.offsetTop-(ee+this.CANVAS_MARGIN):0;this.coverDiv.style.top=ne+"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},de.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},de.prototype.addTopToolbar=function(){var ee=this;this.topToolbar=new z,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 ne=new ve;ne.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(ne);var oe=[];this.aspectRatios.forEach(function(ze){var et=new Ae(be.getIcon(ze.horizontal,ze.vertical),ze.horizontal===0&&ze.vertical===0?"FREE":ze.horizontal+":"+ze.vertical);et.onClick=function(){return ee.ratioButtonClicked(ze)},oe.push(et)}),this.aspectRatioButton=new Ce(be.getIcon(0,0),"Aspect ratio",oe),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,ne.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var fe=new Ae('<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");fe.isActive=this.isGridVisible,fe.onClick=function(){ee.isGridVisible=!ee.isGridVisible,fe.isActive=ee.isGridVisible},ne.addButton(fe);var re=new Ae('<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(re.isActive=this.zoomToCropEnabled,re.onClick=function(){ee.zoomToCropEnabled=!ee.zoomToCropEnabled,re.isActive=ee.zoomToCropEnabled},ne.addButton(re),!Y.isLicensed){var ie=new ue;this.topToolbar.addElementBlock(ie);var pe=document.createElement("div");pe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ge=document.createElement("a");ge.style.color="currentColor",ge.href="https://markerjs.com/products/cropro",ge.target="_blank",ge.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>',pe.appendChild(ge),ie.addElement(pe)}var xe=new ve;xe.minWidth=3*this.toolbarHeight+"px",xe.contentAlign="end",this.topToolbar.addButtonBlock(xe);var Ie=new Ae('<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");Ie.onClick=this.startRenderAndClose,xe.addButton(Ie),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ie.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ne=new Ae('<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");Ne.onClick=this.close,xe.addButton(Ne),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ne.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},de.prototype.addBottomToolbar=function(){var ee=this;this.bottomToolbar=new z,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 ne=new ve;ne.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(ne);var oe=new Ae('<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");oe.onClick=this.rotateLeftButtonClicked,ne.addButton(oe);var fe=new Ae('<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");fe.onClick=this.rotateRightButtonClicked,ne.addButton(fe);var re=new ue;re.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(re),this.straightener=new He("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(xe){ee.rotateBy(xe),ee.straightener.angle=ee.rotationAngle},re.addElement(this.straightener.getUI());var ie=new ve;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var pe=new Ae('<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");pe.onClick=this.flipHorizontallyButtonClicked,ie.addButton(pe);var ge=new Ae('<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");ge.onClick=this.flipVerticallyButtonClicked,ie.addButton(ge)},de.prototype.ratioButtonClicked=function(ee){this.aspectRatio=ee,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},de.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=be.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},de.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new me(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},de.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},de.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},de.prototype.restoreState=function(ee){if(ee){var ne=this.cropLayer.getRescaledRect(ee.width,ee.height,this.imageWidth,this.imageHeight,ee.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(ne),this.cropRectChanged(ne),this.flippedHorizontally=ee.flippedHorizontally,this.flippedVertically=ee.flippedVertically,this.applyFlip(),this.rotationAngle=ee.rotationAngle,this.applyRotation()}},de.prototype.clientToLocalCoordinates=function(ee,ne){var oe=this.cropImage.getBoundingClientRect();return{x:ee-oe.left,y:ne-oe.top}},de.prototype.onWindowResize=function(){this.positionUI()},de.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ee=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ee+"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()},de.prototype.rotateLeftButtonClicked=function(){var ee=this.rotationAngle-90;this.rotationAngle%90!=0&&(ee+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ee)},de.prototype.rotateRightButtonClicked=function(){var ee=this.rotationAngle+90;this.rotationAngle%90!=0&&(ee-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ee)},de.prototype.rotateTo=function(ee){ee=(ee=ee>180?ee-360:ee)<=-180?ee+360:ee,this.rotationAngle=ee,this.applyRotation()},de.prototype.rotateBy=function(ee){this.rotateTo((this.rotationAngle+ee)%360)},de.prototype.applyRotation=function(){var ee=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var ne=this.editingTargetRotationContainer.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(ne,0);var oe=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/oe.width,this.imageHeight/oe.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ee},de.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},de.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},de.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},de.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var ee,ne;return ye(this,function(oe){switch(oe.label){case 0:return[4,this.render()];case 1:return ee=oe.sent(),ne=this.getState(),this.renderEventListeners.forEach(function(fe){return fe(ee,ne)}),this.close(!0),[2]}})})},de.prototype.render=function(){return Le(this,void 0,void 0,function(){var ee;return ye(this,function(ne){switch(ne.label){case 0:return(ee=new Be).naturalSize=this.renderAtNaturalSize,ee.imageType=this.renderImageType,ee.imageQuality=this.renderImageQuality,ee.width=this.renderWidth,ee.height=this.renderHeight,this.unzoomFromCrop(),_.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ee.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 ne.sent(),[4,ee.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,ne.sent()]}})})},de.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Z("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 Z("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Z("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var ee=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Z("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*ee)+`px;
|
|
height: `+(this.toolbarHeight-2*ee)+`px;
|
|
padding: `+ee+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Z("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Z("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Z("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 Z("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Z("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 Z("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*ee)+`px;
|
|
padding: `+ee+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Z("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},de.instanceCounter=0,de}(),Ge=Q("8hTe"),Xe=Q.n(Ge),Me=/<pre[^>]*>/g;function it(de){var ee=document.createElement("div");return ee.innerHTML=de,ee.childNodes.length===0?"":ee.childNodes[0].nodeValue}var qe=we.a=function(de){var ee=de.value,ne=ee===void 0?"":ee,oe=de.edit,fe=oe===void 0?!1:oe,re=de.className,ie=de.showTextOnly,pe=de.showLines,ge=de.replaces,xe=de.zoomImg,Ie=de.hasMask,Ne=de.style,ze=Ne===void 0?{}:Ne,et=de.stylesPrev,rt=et===void 0?{}:et,yt=String(ne),ot=Object(R.useRef)(),at=Object(R.useRef)(),Lt=Object(R.useState)(""),_t=Object(K.a)(Lt,2),Ut=_t[0],Ft=_t[1],Tt=Object(R.useState)("office"),sr=Object(K.a)(Tt,2),Er=sr[0],Kt=sr[1],dr=function(){var Ct=new Qe(at.current);Ct.displayMode="popup",Ct.addRenderEventListener(function(){var Ot=Object(P.a)(r.a.mark(function ct(pt){var wt;return r.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return ot.current.style.display="none",Bt.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt}});case 3:wt=Bt.sent,wt!=null&&wt.id&&ge(at.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 5:case"end":return Bt.stop()}},ct)}));return function(ct){return Ot.apply(this,arguments)}}()),Ct.show()},dt=function(){var Ct=new Ee.a(at.current);Ct.settings.displayMode="popup",Ct.addEventListener("render",function(){var Ot=Object(P.a)(r.a.mark(function ct(pt){var wt;return r.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(ot.current.style.display="none",!at.current){Bt.next=6;break}return Bt.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt.dataUrl}});case 4:wt=Bt.sent,wt!=null&&wt.id&&ge(at.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 6:case"end":return Bt.stop()}},ct)}));return function(ct){return Ot.apply(this,arguments)}}()),Ct.show(),window.markerArea=Ct},vt=Object(R.useMemo)(function(){ot.current&&(ot.current.style.zIndex=-1);try{var Ze=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ct=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ot=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;yt=yt.replace(Ze,"("+J.a.API_SERVER+"/api/attachments/").replace(Ct,'"'+J.a.API_SERVER+"/api/attachments/").replace(Ot,'"'+J.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(rr){}var ct=M(yt),pt=w();if(yt.match(/\[TOC\]/)&&(ct=ct.replace("<p>[TOC]</p>",D()),O()),ct=ct.replace(/(__special_katext_id_\d+__)/g,function(rr,Bt){var We=pt[Bt],ft=We.type,rn=We.expression;return Object(le.renderToString)(it(rn)||"",{displayMode:ft==="block",throwOnError:!1,output:"html"})}),ct=ct.replace(/▁/g,"\u2581\u2581\u2581"),y(),ie){var wt=document.createElement("div");return wt.innerHTML=ct,wt.innerText}return setTimeout(function(){return or()},500),ct},[yt]),Et=Object(R.useRef)();T.WebkitLineClamp=pe,pe&&(ze=Object(H.a)(Object(H.a)({},ze),T));function Ht(Ze){var Ct=Ze.target;if(Ct.tagName.toUpperCase()==="IMG"){if(xe){var Ot=Ct.getAttribute("src");Ft(Ot),Kt("image")}}else if(Ct.tagName.toUpperCase()==="A"){var ct=Ct.getAttribute("href");if(ct.indexOf("office")>-1)Ze.preventDefault(),Ft(ct),Kt("office");else if(ct.indexOf("application/pdf")>-1)Ze.preventDefault(),Ft(ct),Kt("pdf");else if(ct.indexOf("text/html")>-1)Ze.preventDefault(),Ft(ct),Kt("html");else if(ct.startsWith("#")){Ze.preventDefault();var pt=document.getElementById(ct.replace("#",""));pt&&pt.scrollIntoView(!0)}}}var or=function(){var Ct,Ot=(Ct=Et.current)===null||Ct===void 0?void 0:Ct.querySelectorAll("video");Ot==null||Ot.forEach(function(ct){if(ct.oncontextmenu=function(){return!1},ct.src.indexOf(".m3u8")>-1&&!ct.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var pt=new W.a;pt.loadSource(ct.src),pt.attachMedia(ct)}}})};Object(R.useEffect)(function(){if(Et.current&&vt&&(vt.match(Me)&&window.PR.prettyPrint()),Et.current)return Et.current.addEventListener("click",Ht),function(){Et.current.removeEventListener("click",Ht),y(),O()}},[vt,Et.current,Ht]);var Mt=function(Ct){if(!fe)return;Ct.target.nodeName==="IMG"?(ot.current.style.zIndex=1,ot.current.style.display="flex",ot.current.style.width=Ct.target.clientWidth+"px",ot.current.style.height=Ct.target.clientHeight+"px",ot.current.style.top=Ct.target.offsetTop+"px",ot.current.style.left=Ct.target.offsetLeft+"px",at.current.src=Ct.target.getAttribute("src")):ot.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Et,style:Object(H.a)({},ze),className:"".concat(re||""," markdown-body ").concat(Xe.a.mdBody),onMouseOver:Mt,dangerouslySetInnerHTML:{__html:vt}}),v.a.createElement("div",{ref:ot,className:Xe.a.button},v.a.createElement(X.a,null,v.a.createElement($.a,{onClick:function(){return dr()}},"\u88C1\u526A"),v.a.createElement($.a,{onClick:function(){return dt()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:at,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ce.a,{close:!0,data:Ut,type:Ut!=null&&Ut.length?Er:"",style:Object(H.a)({},rt),onClose:function(){return Ft("")}}))}},"9VGf":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return N});var se=Q("q1tI"),X=Q.n(se);function N($,H){var P=Object(se.useRef)();Object(se.useEffect)(function(){P.current=$}),Object(se.useEffect)(function(){function K(){P.current()}if(H!==null){var G=setInterval(K,H);return function(){return clearInterval(G)}}},[H])}},BU3w:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return P});var se=Q("MNnm"),X="rc-util-key";function N(K){if(K.attachTo)return K.attachTo;var G=document.querySelector("head");return G||document.body}function $(K){var G,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(se.a)())return null;var R=document.createElement("style");if((G=r.csp)===null||G===void 0?void 0:G.nonce){var v;R.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=K;var m=N(r),p=m.firstChild;return r.prepend&&m.prepend?m.prepend(R):r.prepend&&p?m.insertBefore(R,p):m.appendChild(R),R}var H=new Map;function P(K,G){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=N(r);if(!H.has(R)){var v=$("",r),m=v.parentNode;H.set(R,m),m.removeChild(v)}var p=Array.from(H.get(R).children).find(function(u){return u.tagName==="STYLE"&&u[X]===G});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!==K&&(p.innerHTML=K),p}var l=$(K,r);return l[X]=G,l}},Bd2K:function(Ye,we,Q){(function(se){se(Q("VrN/"),Q("osHv"))})(function(se){se.defineOption("autoCloseTags",!1,function(r,R,v){if(v!=se.Init&&v&&r.removeKeyMap("autoCloseTags"),!R)return;var m={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(m["'/'"]=function(p){return P(p)}),(typeof R!="object"||R.whenOpening!==!1)&&(m["'>'"]=function(p){return $(p)}),r.addKeyMap(m)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function $(r){if(r.getOption("disableInput"))return se.Pass;for(var R=r.listSelections(),v=[],m=r.getOption("autoCloseTags"),p=0;p<R.length;p++){if(!R[p].empty())return se.Pass;var h=R[p].head,o=r.getTokenAt(h),f=se.innerMode(r.getMode(),o.state),l=f.state,u=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(l),s=u&&u.name;if(!s)return se.Pass;var a=f.mode.configuration=="html",O=typeof m=="object"&&m.dontCloseTags||a&&X,T=typeof m=="object"&&m.indentTags||a&&N;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&&K(O,S)>-1||G(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(l)||[],s,h,!0))return se.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&K(D,s)>-1){v[p]={text:"/>",newPos:se.Pos(h.line,h.ch+2)};continue}var L=T&&K(T,S)>-1;v[p]={indent:L,text:">"+(L?`
|
|
|
|
`:"")+"</"+s+">",newPos:L?se.Pos(h.line+1,0):se.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 x=r.listSelections().slice(0);x[p]={head:C.newPos,anchor:C.newPos},r.setSelections(x),!A&&C.indent&&(r.indentLine(C.newPos.line,null,!0),r.indentLine(C.newPos.line+1,null,!0))}}function H(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 se.Pass;var l=v[f].head,u=r.getTokenAt(l),s=se.innerMode(r.getMode(),u.state),a=s.state;if(R&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=l.ch-1))return se.Pass;var O,T=s.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(T&&s.mode.name=="javascript")O=p+"script";else if(T&&s.mode.name=="css")O=p+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!S||S.length&&G(r,S,S[S.length-1],l))return se.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 P(r){return r.getOption("disableInput")?se.Pass:H(r,!0)}se.commands.closeTag=function(r){return H(r)};function K(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 G(r,R,v,m,p){if(!se.scanForClosingTag)return!1;var h=Math.min(r.lastLine()+1,m.line+500),o=se.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=se.scanForClosingTag(r,m,null,h);if(!u||u.tag!=v)return!1;m=u.to}return!0}})},BjJ7:function(Ye,we,Q){"use strict";Q.d(we,"d",function(){return X}),Q.d(we,"c",function(){return N}),Q.d(we,"e",function(){return $}),Q.d(we,"b",function(){return H}),Q.d(we,"a",function(){return K});var se=Q("m3rI");function X(G){var r=!0;if(G.length>0){for(var R=0;R<G.length;R++)if(G[R].compile_success==0||!G[R].compile_success){r=!1;break}}else r=!1;return r}function N(G){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;v<G.length;v++){var m=G[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 $(G,r,R){for(var v=0;v<G.length;v++){var m=G[v];if(m.key===r){m.children=R;break}m.children&&$(m.children,r,R)}return G}function H(G,r,R){var v;return function(){var m=this,p=arguments,h=function(){v=null,R||G.apply(m,p)},o=R&&!v;clearTimeout(v),v=setTimeout(h,r),o&&G.apply(m,p)}}var P=!0,K=se.a.API_SERVER},"C+DQ":function(Ye,we,Q){},"C/vA":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return se});function se(X){const N=this;let $=!1,H;return function(){return $||($=!0,H=X.apply(N,arguments)),H}}},"Cg/j":function(Ye,we,Q){"use strict";Q.d(we,"b",function(){return se}),Q.d(we,"a",function(){return X}),Q.d(we,"c",function(){return $}),Q.d(we,"d",function(){return H});var se;(function(P){P.serviceIds=new Map,P.DI_TARGET="$di$target",P.DI_DEPENDENCIES="$di$dependencies";function K(G){return G[P.DI_DEPENDENCIES]||[]}P.getServiceDependencies=K})(se||(se={}));const X=$("instantiationService");function N(P,K,G,r){K[se.DI_TARGET]===K?K[se.DI_DEPENDENCIES].push({id:P,index:G,optional:r}):(K[se.DI_DEPENDENCIES]=[{id:P,index:G,optional:r}],K[se.DI_TARGET]=K)}function $(P){if(se.serviceIds.has(P))return se.serviceIds.get(P);const K=function(G,r,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(K,G,R,!1)};return K.toString=()=>P,se.serviceIds.set(P,K),K}function H(P){return function(K,G,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(P,K,r,!0)}}},DlQD:function(Ye,we,Q){(function(se,X){Ye.exports=X()})(this,function(){"use strict";function se(ne,oe){for(var fe=0;fe<oe.length;fe++){var re=oe[fe];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(ne,re.key,re)}}function X(ne,oe,fe){return oe&&se(ne.prototype,oe),fe&&se(ne,fe),ne}function N(ne,oe){if(!ne)return;if(typeof ne=="string")return $(ne,oe);var fe=Object.prototype.toString.call(ne).slice(8,-1);if(fe==="Object"&&ne.constructor&&(fe=ne.constructor.name),fe==="Map"||fe==="Set")return Array.from(ne);if(fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe))return $(ne,oe)}function $(ne,oe){(oe==null||oe>ne.length)&&(oe=ne.length);for(var fe=0,re=new Array(oe);fe<oe;fe++)re[fe]=ne[fe];return re}function H(ne,oe){var fe;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(fe=N(ne))||oe&&ne&&typeof ne.length=="number"){fe&&(ne=fe);var re=0;return function(){return re>=ne.length?{done:!0}:{done:!1,value:ne[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 fe=ne[Symbol.iterator](),fe.next.bind(fe)}function P(ne,oe){return oe={exports:{}},ne(oe,oe.exports),oe.exports}var K=P(function(ne){function oe(){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 fe(re){ne.exports.defaults=re}ne.exports={defaults:oe(),getDefaults:oe,changeDefaults:fe}}),G=K.defaults,r=K.getDefaults,R=K.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(oe){return o[oe]};function l(ne,oe){if(oe){if(v.test(ne))return ne.replace(m,f)}else if(p.test(ne))return ne.replace(h,f);return ne}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(ne){return ne.replace(u,function(oe,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var a=/(^|[^\[])\^/g;function O(ne,oe){ne=ne.source||ne,oe=oe||"";var fe={replace:function(ie,pe){return pe=pe.source||pe,pe=pe.replace(a,"$1"),ne=ne.replace(ie,pe),fe},getRegex:function(){return new RegExp(ne,oe)}};return fe}var T=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(ne,oe,fe){if(ne){var re;try{re=decodeURIComponent(s(fe)).replace(T,"").toLowerCase()}catch(ie){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}oe&&!S.test(fe)&&(fe=d(oe,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(ie){return null}return fe}var L={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(ne,oe){L[" "+ne]||(A.test(ne)?L[" "+ne]=ne+"/":L[" "+ne]=j(ne,"/",!0)),ne=L[" "+ne];var fe=ne.indexOf(":")===-1;return oe.substring(0,2)==="//"?fe?oe:ne.replace(C,"$1")+oe:oe.charAt(0)==="/"?fe?oe:ne.replace(x,"$1")+oe:ne+oe}var w={exec:function(){}};function y(ne){for(var oe=1,fe,re;oe<arguments.length;oe++){fe=arguments[oe];for(re in fe)Object.prototype.hasOwnProperty.call(fe,re)&&(ne[re]=fe[re])}return ne}function b(ne,oe){var fe=ne.replace(/\|/g,function(pe,ge,xe){for(var Ie=!1,Ne=ge;--Ne>=0&&xe[Ne]==="\\";)Ie=!Ie;return Ie?"|":" |"}),re=fe.split(/ \|/),ie=0;if(re.length>oe)re.splice(oe);else for(;re.length<oe;)re.push("");for(;ie<re.length;ie++)re[ie]=re[ie].trim().replace(/\\\|/g,"|");return re}function j(ne,oe,fe){var re=ne.length;if(re===0)return"";for(var ie=0;ie<re;){var pe=ne.charAt(re-ie-1);if(pe===oe&&!fe)ie++;else if(pe!==oe&&fe)ie++;else break}return ne.substr(0,re-ie)}function U(ne,oe){if(ne.indexOf(oe[1])===-1)return-1;for(var fe=ne.length,re=0,ie=0;ie<fe;ie++)if(ne[ie]==="\\")ie++;else if(ne[ie]===oe[0])re++;else if(ne[ie]===oe[1]&&(re--,re<0))return ie;return-1}function E(ne){ne&&ne.sanitize&&!ne.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:j,findClosingBracket:U,checkSanitizeDeprecation:E},I=K.defaults,g=M.rtrim,W=M.splitCells,J=M.escape,le=M.findClosingBracket;function ce(ne,oe,fe){var re=oe.href,ie=oe.title?J(oe.title):null,pe=ne[1].replace(/\\([\[\]])/g,"$1");return ne[0].charAt(0)!=="!"?{type:"link",raw:fe,href:re,title:ie,text:pe}:{type:"image",raw:fe,href:re,title:ie,text:J(pe)}}function Re(ne,oe){var fe=ne.match(/^(\s+)(?:```)/);if(fe===null)return oe;var re=fe[1];return oe.split(`
|
|
`).map(function(ie){var pe=ie.match(/^\s+/);if(pe===null)return ie;var ge=pe[0];return ge.length>=re.length?ie.slice(re.length):ie}).join(`
|
|
`)}var Ee=function(){function ne(fe){this.options=fe||I}var oe=ne.prototype;return oe.space=function(re){var ie=this.rules.block.newline.exec(re);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},oe.code=function(re,ie){var pe=this.rules.block.code.exec(re);if(pe){var ge=ie[ie.length-1];if(ge&&ge.type==="paragraph")return{raw:pe[0],text:pe[0].trimRight()};var xe=pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:pe[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:g(xe,`
|
|
`)}}},oe.fences=function(re){var ie=this.rules.block.fences.exec(re);if(ie){var pe=ie[0],ge=Re(pe,ie[3]||"");return{type:"code",raw:pe,lang:ie[2]?ie[2].trim():ie[2],text:ge}}},oe.heading=function(re){var ie=this.rules.block.heading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},oe.nptable=function(re){var ie=this.rules.block.nptable.exec(re);if(ie){var pe={type:"table",header:W(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(pe.header.length===pe.align.length){var ge=pe.align.length,xe;for(xe=0;xe<ge;xe++)/^ *-+: *$/.test(pe.align[xe])?pe.align[xe]="right":/^ *:-+: *$/.test(pe.align[xe])?pe.align[xe]="center":/^ *:-+ *$/.test(pe.align[xe])?pe.align[xe]="left":pe.align[xe]=null;for(ge=pe.cells.length,xe=0;xe<ge;xe++)pe.cells[xe]=W(pe.cells[xe],pe.header.length);return pe}}},oe.hr=function(re){var ie=this.rules.block.hr.exec(re);if(ie)return{type:"hr",raw:ie[0]}},oe.blockquote=function(re){var ie=this.rules.block.blockquote.exec(re);if(ie){var pe=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:pe}}},oe.list=function(re){var ie=this.rules.block.list.exec(re);if(ie){for(var pe=ie[0],ge=ie[2],xe=ge.length>1,Ie=ge[ge.length-1]===")",Ne={type:"list",raw:pe,ordered:xe,start:xe?+ge.slice(0,-1):"",loose:!1,items:[]},ze=ie[0].match(this.rules.block.item),et=!1,rt,yt,ot,at,Lt,_t,Ut,Ft=ze.length,Tt=0;Tt<Ft;Tt++)rt=ze[Tt],pe=rt,yt=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
|
|
`)&&(yt-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+yt+"}","gm"),"")),Tt!==Ft-1&&(ot=this.rules.block.bullet.exec(ze[Tt+1])[0],(xe?ot.length===1||!Ie&&ot[ot.length-1]===")":ot.length>1||this.options.smartLists&&ot!==ge)&&(at=ze.slice(Tt+1).join(`
|
|
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-at.length),Tt=Ft-1)),Lt=et||/\n\n(?!\s*$)/.test(rt),Tt!==Ft-1&&(et=rt.charAt(rt.length-1)===`
|
|
`,Lt||(Lt=et)),Lt&&(Ne.loose=!0),_t=/^\[[ xX]\] /.test(rt),Ut=void 0,_t&&(Ut=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:pe,task:_t,checked:Ut,loose:Lt,text:rt});return Ne}},oe.html=function(re){var ie=this.rules.block.html.exec(re);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):J(ie[0]):ie[0]}},oe.def=function(re){var ie=this.rules.block.def.exec(re);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var pe=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:pe,raw:ie[0],href:ie[2],title:ie[3]}}},oe.table=function(re){var ie=this.rules.block.table.exec(re);if(ie){var pe={type:"table",header:W(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(pe.header.length===pe.align.length){pe.raw=ie[0];var ge=pe.align.length,xe;for(xe=0;xe<ge;xe++)/^ *-+: *$/.test(pe.align[xe])?pe.align[xe]="right":/^ *:-+: *$/.test(pe.align[xe])?pe.align[xe]="center":/^ *:-+ *$/.test(pe.align[xe])?pe.align[xe]="left":pe.align[xe]=null;for(ge=pe.cells.length,xe=0;xe<ge;xe++)pe.cells[xe]=W(pe.cells[xe].replace(/^ *\| *| *\| *$/g,""),pe.header.length);return pe}}},oe.lheading=function(re){var ie=this.rules.block.lheading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},oe.paragraph=function(re){var ie=this.rules.block.paragraph.exec(re);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
`?ie[1].slice(0,-1):ie[1]}},oe.text=function(re,ie){var pe=this.rules.block.text.exec(re);if(pe){var ge=ie[ie.length-1];return ge&&ge.type==="text"?{raw:pe[0],text:pe[0]}:{type:"text",raw:pe[0],text:pe[0]}}},oe.escape=function(re){var ie=this.rules.inline.escape.exec(re);if(ie)return{type:"escape",raw:ie[0],text:J(ie[1])}},oe.tag=function(re,ie,pe){var ge=this.rules.inline.tag.exec(re);if(ge)return!ie&&/^<a /i.test(ge[0])?ie=!0:ie&&/^<\/a>/i.test(ge[0])&&(ie=!1),!pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?pe=!0:pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(pe=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:ie,inRawBlock:pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):J(ge[0]):ge[0]}},oe.link=function(re){var ie=this.rules.inline.link.exec(re);if(ie){var pe=le(ie[2],"()");if(pe>-1){var ge=ie[0].indexOf("!")===0?5:4,xe=ge+ie[1].length+pe;ie[2]=ie[2].substring(0,pe),ie[0]=ie[0].substring(0,xe).trim(),ie[3]=""}var Ie=ie[2],Ne="";if(this.options.pedantic){var ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);ze?(Ie=ze[1],Ne=ze[3]):Ne=""}else Ne=ie[3]?ie[3].slice(1,-1):"";Ie=Ie.trim().replace(/^<([\s\S]*)>$/,"$1");var et=ce(ie,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},ie[0]);return et}},oe.reflink=function(re,ie){var pe;if((pe=this.rules.inline.reflink.exec(re))||(pe=this.rules.inline.nolink.exec(re))){var ge=(pe[2]||pe[1]).replace(/\s+/g," ");if(ge=ie[ge.toLowerCase()],!ge||!ge.href){var xe=pe[0].charAt(0);return{type:"text",raw:xe,text:xe}}var Ie=ce(pe,ge,pe[0]);return Ie}},oe.strong=function(re,ie,pe){pe===void 0&&(pe="");var ge=this.rules.inline.strong.start.exec(re);if(ge&&(!ge[1]||ge[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){ie=ie.slice(-1*re.length);var xe=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var Ie;(ge=xe.exec(ie))!=null;)if(Ie=this.rules.inline.strong.middle.exec(ie.slice(0,ge.index+3)),Ie)return{type:"strong",raw:re.slice(0,Ie[0].length),text:re.slice(2,Ie[0].length-2)}}},oe.em=function(re,ie,pe){pe===void 0&&(pe="");var ge=this.rules.inline.em.start.exec(re);if(ge&&(!ge[1]||ge[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){ie=ie.slice(-1*re.length);var xe=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var Ie;(ge=xe.exec(ie))!=null;)if(Ie=this.rules.inline.em.middle.exec(ie.slice(0,ge.index+2)),Ie)return{type:"em",raw:re.slice(0,Ie[0].length),text:re.slice(1,Ie[0].length-1)}}},oe.codespan=function(re){var ie=this.rules.inline.code.exec(re);if(ie){var pe=ie[2].replace(/\n/g," "),ge=/[^ ]/.test(pe),xe=pe.startsWith(" ")&&pe.endsWith(" ");return ge&&xe&&(pe=pe.substring(1,pe.length-1)),pe=J(pe,!0),{type:"codespan",raw:ie[0],text:pe}}},oe.br=function(re){var ie=this.rules.inline.br.exec(re);if(ie)return{type:"br",raw:ie[0]}},oe.del=function(re){var ie=this.rules.inline.del.exec(re);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},oe.autolink=function(re,ie){var pe=this.rules.inline.autolink.exec(re);if(pe){var ge,xe;return pe[2]==="@"?(ge=J(this.options.mangle?ie(pe[1]):pe[1]),xe="mailto:"+ge):(ge=J(pe[1]),xe=ge),{type:"link",raw:pe[0],text:ge,href:xe,tokens:[{type:"text",raw:ge,text:ge}]}}},oe.url=function(re,ie){var pe;if(pe=this.rules.inline.url.exec(re)){var ge,xe;if(pe[2]==="@")ge=J(this.options.mangle?ie(pe[0]):pe[0]),xe="mailto:"+ge;else{var Ie;do Ie=pe[0],pe[0]=this.rules.inline._backpedal.exec(pe[0])[0];while(Ie!==pe[0]);ge=J(pe[0]),pe[1]==="www."?xe="http://"+ge:xe=ge}return{type:"link",raw:pe[0],text:ge,href:xe,tokens:[{type:"text",raw:ge,text:ge}]}}},oe.inlineText=function(re,ie,pe){var ge=this.rules.inline.text.exec(re);if(ge){var xe;return ie?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):J(ge[0]):ge[0]:xe=J(this.options.smartypants?pe(ge[0]):ge[0]),{type:"text",raw:ge[0],text:xe}}},ne}(),Oe=M.noopTest,Te=M.edit,Le=M.merge,ye={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Te(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Te(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Te(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ye._comment=/<!--(?!-?>)[\s\S]*?-->/,ye.html=Te(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Te(ye._paragraph).replace("hr",ye.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ye._tag).getRegex(),ye.blockquote=Te(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Le({},ye),ye.gfm=Le({},ye.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ye.gfm.nptable=Te(ye.gfm.nptable).replace("hr",ye.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ye._tag).getRegex(),ye.gfm.table=Te(ye.gfm.table).replace("hr",ye.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ye._tag).getRegex(),ye.pedantic=Le({},ye.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Oe,paragraph:Te(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,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:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Y._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Y.punctuation=Te(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Y._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Y.em.start=Te(Y.em.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.middle=Te(Y.em.middle).replace(/punctuation/g,Y._punctuation).replace(/overlapSkip/g,Y._overlapSkip).getRegex(),Y.em.endAst=Te(Y.em.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.endUnd=Te(Y.em.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.start=Te(Y.strong.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.middle=Te(Y.strong.middle).replace(/punctuation/g,Y._punctuation).replace(/blockSkip/g,Y._blockSkip).getRegex(),Y.strong.endAst=Te(Y.strong.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.endUnd=Te(Y.strong.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=Te(Y._blockSkip,"g").getRegex(),Y.overlapSkip=Te(Y._overlapSkip,"g").getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._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])?)+(?![-_])/,Y.autolink=Te(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=Te(Y.tag).replace("comment",ye._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=Te(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=Te(Y.reflink).replace("label",Y._label).getRegex(),Y.reflinkSearch=Te(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=Le({},Y),Y.pedantic=Le({},Y.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=Le({},Y.normal,{escape:Te(Y.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Y.gfm.url=Te(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex(),Y.breaks=Le({},Y.gfm,{br:Te(Y.br).replace("{2,}","*").getRegex(),text:Te(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var _={block:ye,inline:Y},k=K.defaults,B=_.block,Z=_.inline;function z(ne){return ne.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 he(ne){var oe="",fe,re,ie=ne.length;for(fe=0;fe<ie;fe++)re=ne.charCodeAt(fe),Math.random()>.5&&(re="x"+re.toString(16)),oe+="&#"+re+";";return oe}var ve=function(){function ne(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||k,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:B.normal,inline:Z.normal};this.options.pedantic?(re.block=B.pedantic,re.inline=Z.pedantic):this.options.gfm&&(re.block=B.gfm,this.options.breaks?re.inline=Z.breaks:re.inline=Z.gfm),this.tokenizer.rules=re}ne.lex=function(re,ie){var pe=new ne(ie);return pe.lex(re)};var oe=ne.prototype;return oe.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},oe.blockTokens=function(re,ie,pe){ie===void 0&&(ie=[]),pe===void 0&&(pe=!0),re=re.replace(/^ +$/gm,"");for(var ge,xe,Ie,Ne;re;){if(ge=this.tokenizer.space(re)){re=re.substring(ge.raw.length),ge.type&&ie.push(ge);continue}if(ge=this.tokenizer.code(re,ie)){re=re.substring(ge.raw.length),ge.type?ie.push(ge):(Ne=ie[ie.length-1],Ne.raw+=`
|
|
`+ge.raw,Ne.text+=`
|
|
`+ge.text);continue}if(ge=this.tokenizer.fences(re)){re=re.substring(ge.raw.length),ie.push(ge);continue}if(ge=this.tokenizer.heading(re)){re=re.substring(ge.raw.length),ie.push(ge);continue}if(ge=this.tokenizer.nptable(re)){re=re.substring(ge.raw.length),ie.push(ge);continue}if(ge=this.tokenizer.hr(re)){re=re.substring(ge.raw.length),ie.push(ge);continue}if(ge=this.tokenizer.blockquote(re)){re=re.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],pe),ie.push(ge);continue}if(ge=this.tokenizer.list(re)){for(re=re.substring(ge.raw.length),Ie=ge.items.length,xe=0;xe<Ie;xe++)ge.items[xe].tokens=this.blockTokens(ge.items[xe].text,[],!1);ie.push(ge);continue}if(ge=this.tokenizer.html(re)){re=re.substring(ge.raw.length),ie.push(ge);continue}if(pe&&(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),ie.push(ge);continue}if(ge=this.tokenizer.lheading(re)){re=re.substring(ge.raw.length),ie.push(ge);continue}if(pe&&(ge=this.tokenizer.paragraph(re))){re=re.substring(ge.raw.length),ie.push(ge);continue}if(ge=this.tokenizer.text(re,ie)){re=re.substring(ge.raw.length),ge.type?ie.push(ge):(Ne=ie[ie.length-1],Ne.raw+=`
|
|
`+ge.raw,Ne.text+=`
|
|
`+ge.text);continue}if(re){var ze="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ze);break}else throw new Error(ze)}}return ie},oe.inline=function(re){var ie,pe,ge,xe,Ie,Ne,ze=re.length;for(ie=0;ie<ze;ie++){Ne=re[ie];switch(Ne.type){case"paragraph":case"text":case"heading":{Ne.tokens=[],this.inlineTokens(Ne.text,Ne.tokens);break}case"table":{for(Ne.tokens={header:[],cells:[]},xe=Ne.header.length,pe=0;pe<xe;pe++)Ne.tokens.header[pe]=[],this.inlineTokens(Ne.header[pe],Ne.tokens.header[pe]);for(xe=Ne.cells.length,pe=0;pe<xe;pe++)for(Ie=Ne.cells[pe],Ne.tokens.cells[pe]=[],ge=0;ge<Ie.length;ge++)Ne.tokens.cells[pe][ge]=[],this.inlineTokens(Ie[ge],Ne.tokens.cells[pe][ge]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(xe=Ne.items.length,pe=0;pe<xe;pe++)this.inline(Ne.items[pe].tokens);break}}}return re},oe.inlineTokens=function(re,ie,pe,ge,xe){ie===void 0&&(ie=[]),pe===void 0&&(pe=!1),ge===void 0&&(ge=!1),xe===void 0&&(xe="");var Ie,Ne=re,ze;if(this.tokens.links){var et=Object.keys(this.tokens.links);if(et.length>0)for(;(ze=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)et.includes(ze[0].slice(ze[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ze=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Ie=this.tokenizer.escape(re)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.tag(re,pe,ge)){re=re.substring(Ie.raw.length),pe=Ie.inLink,ge=Ie.inRawBlock,ie.push(Ie);continue}if(Ie=this.tokenizer.link(re)){re=re.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,ge)),ie.push(Ie);continue}if(Ie=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,ge)),ie.push(Ie);continue}if(Ie=this.tokenizer.strong(re,Ne,xe)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],pe,ge),ie.push(Ie);continue}if(Ie=this.tokenizer.em(re,Ne,xe)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],pe,ge),ie.push(Ie);continue}if(Ie=this.tokenizer.codespan(re)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.br(re)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.del(re)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],pe,ge),ie.push(Ie);continue}if(Ie=this.tokenizer.autolink(re,he)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(!pe&&(Ie=this.tokenizer.url(re,he))){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.inlineText(re,ge,z)){re=re.substring(Ie.raw.length),xe=Ie.raw.slice(-1),ie.push(Ie);continue}if(re){var rt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return ie},X(ne,null,[{key:"rules",get:function(){return{block:B,inline:Z}}}]),ne}(),Ae=K.defaults,ue=M.cleanUrl,me=M.escape,be=function(){function ne(fe){this.options=fe||Ae}var oe=ne.prototype;return oe.code=function(re,ie,pe){var ge=(ie||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(re,ge);xe!=null&&xe!==re&&(pe=!0,re=xe)}return ge?'<pre><code class="'+this.options.langPrefix+me(ge,!0)+'">'+(pe?re:me(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(pe?re:me(re,!0))+`</code></pre>
|
|
`},oe.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},oe.html=function(re){return re},oe.heading=function(re,ie,pe,ge){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+ge.slug(pe)+'">'+re+"</h"+ie+`>
|
|
`:"<h"+ie+">"+re+"</h"+ie+`>
|
|
`},oe.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},oe.list=function(re,ie,pe){var ge=ie?"ol":"ul",xe=ie&&pe!==1?' start="'+pe+'"':"";return"<"+ge+xe+`>
|
|
`+re+"</"+ge+`>
|
|
`},oe.listitem=function(re){return"<li>"+re+`</li>
|
|
`},oe.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},oe.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},oe.table=function(re,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+ie+`</table>
|
|
`},oe.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},oe.tablecell=function(re,ie){var pe=ie.header?"th":"td",ge=ie.align?"<"+pe+' align="'+ie.align+'">':"<"+pe+">";return ge+re+"</"+pe+`>
|
|
`},oe.strong=function(re){return"<strong>"+re+"</strong>"},oe.em=function(re){return"<em>"+re+"</em>"},oe.codespan=function(re){return"<code>"+re+"</code>"},oe.br=function(){return this.options.xhtml?"<br/>":"<br>"},oe.del=function(re){return"<del>"+re+"</del>"},oe.link=function(re,ie,pe){if(re=ue(this.options.sanitize,this.options.baseUrl,re),re===null)return pe;var ge='<a href="'+me(re)+'"';return ie&&(ge+=' title="'+ie+'"'),ge+=">"+pe+"</a>",ge},oe.image=function(re,ie,pe){if(re=ue(this.options.sanitize,this.options.baseUrl,re),re===null)return pe;var ge='<img src="'+re+'" alt="'+pe+'"';return ie&&(ge+=' title="'+ie+'"'),ge+=this.options.xhtml?"/>":">",ge},oe.text=function(re){return re},ne}(),Ce=function(){function ne(){}var oe=ne.prototype;return oe.strong=function(re){return re},oe.em=function(re){return re},oe.codespan=function(re){return re},oe.del=function(re){return re},oe.html=function(re){return re},oe.text=function(re){return re},oe.link=function(re,ie,pe){return""+pe},oe.image=function(re,ie,pe){return""+pe},oe.br=function(){return""},ne}(),Pe=function(){function ne(){this.seen={}}var oe=ne.prototype;return oe.slug=function(re){var ie=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var pe=ie;do this.seen[pe]++,ie=pe+"-"+this.seen[pe];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},ne}(),Ue=K.defaults,He=M.unescape,Be=function(){function ne(fe){this.options=fe||Ue,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ce,this.slugger=new Pe}ne.parse=function(re,ie){var pe=new ne(ie);return pe.parse(re)};var oe=ne.prototype;return oe.parse=function(re,ie){ie===void 0&&(ie=!0);var pe="",ge,xe,Ie,Ne,ze,et,rt,yt,ot,at,Lt,_t,Ut,Ft,Tt,sr,Er,Kt,dr=re.length;for(ge=0;ge<dr;ge++){at=re[ge];switch(at.type){case"space":continue;case"hr":{pe+=this.renderer.hr();continue}case"heading":{pe+=this.renderer.heading(this.parseInline(at.tokens),at.depth,He(this.parseInline(at.tokens,this.textRenderer)),this.slugger);continue}case"code":{pe+=this.renderer.code(at.text,at.lang,at.escaped);continue}case"table":{for(yt="",rt="",Ne=at.header.length,xe=0;xe<Ne;xe++)rt+=this.renderer.tablecell(this.parseInline(at.tokens.header[xe]),{header:!0,align:at.align[xe]});for(yt+=this.renderer.tablerow(rt),ot="",Ne=at.cells.length,xe=0;xe<Ne;xe++){for(et=at.tokens.cells[xe],rt="",ze=et.length,Ie=0;Ie<ze;Ie++)rt+=this.renderer.tablecell(this.parseInline(et[Ie]),{header:!1,align:at.align[Ie]});ot+=this.renderer.tablerow(rt)}pe+=this.renderer.table(yt,ot);continue}case"blockquote":{ot=this.parse(at.tokens),pe+=this.renderer.blockquote(ot);continue}case"list":{for(Lt=at.ordered,_t=at.start,Ut=at.loose,Ne=at.items.length,ot="",xe=0;xe<Ne;xe++)Tt=at.items[xe],sr=Tt.checked,Er=Tt.task,Ft="",Tt.task&&(Kt=this.renderer.checkbox(sr),Ut?Tt.tokens.length>0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=Kt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=Kt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:Kt}):Ft+=Kt),Ft+=this.parse(Tt.tokens,Ut),ot+=this.renderer.listitem(Ft,Er,sr);pe+=this.renderer.list(ot,Lt,_t);continue}case"html":{pe+=this.renderer.html(at.text);continue}case"paragraph":{pe+=this.renderer.paragraph(this.parseInline(at.tokens));continue}case"text":{for(ot=at.tokens?this.parseInline(at.tokens):at.text;ge+1<dr&&re[ge+1].type==="text";)at=re[++ge],ot+=`
|
|
`+(at.tokens?this.parseInline(at.tokens):at.text);pe+=ie?this.renderer.paragraph(ot):ot;continue}default:{var dt='Token with "'+at.type+'" type was not found.';if(this.options.silent){console.error(dt);return}else throw new Error(dt)}}}return pe},oe.parseInline=function(re,ie){ie=ie||this.renderer;var pe="",ge,xe,Ie=re.length;for(ge=0;ge<Ie;ge++){xe=re[ge];switch(xe.type){case"escape":{pe+=ie.text(xe.text);break}case"html":{pe+=ie.html(xe.text);break}case"link":{pe+=ie.link(xe.href,xe.title,this.parseInline(xe.tokens,ie));break}case"image":{pe+=ie.image(xe.href,xe.title,xe.text);break}case"strong":{pe+=ie.strong(this.parseInline(xe.tokens,ie));break}case"em":{pe+=ie.em(this.parseInline(xe.tokens,ie));break}case"codespan":{pe+=ie.codespan(xe.text);break}case"br":{pe+=ie.br();break}case"del":{pe+=ie.del(this.parseInline(xe.tokens,ie));break}case"text":{pe+=ie.text(xe.text);break}default:{var Ne='Token with "'+xe.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return pe},ne}(),Qe=M.merge,Ge=M.checkSanitizeDeprecation,Xe=M.escape,Me=K.getDefaults,it=K.changeDefaults,qe=K.defaults;function de(ne,oe,fe){if(typeof ne=="undefined"||ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ne)+", string expected");if(typeof oe=="function"&&(fe=oe,oe=null),oe=Qe({},de.defaults,oe||{}),Ge(oe),fe){var re=oe.highlight,ie;try{ie=ve.lex(ne,oe)}catch(Ie){return fe(Ie)}var pe=function(Ne){var ze;if(!Ne)try{ze=Be.parse(ie,oe)}catch(et){Ne=et}return oe.highlight=re,Ne?fe(Ne):fe(null,ze)};if(!re||re.length<3)return pe();if(delete oe.highlight,!ie.length)return pe();var ge=0;de.walkTokens(ie,function(Ie){Ie.type==="code"&&(ge++,setTimeout(function(){re(Ie.text,Ie.lang,function(Ne,ze){if(Ne)return pe(Ne);ze!=null&&ze!==Ie.text&&(Ie.text=ze,Ie.escaped=!0),ge--,ge===0&&pe()})},0))}),ge===0&&pe();return}try{var xe=ve.lex(ne,oe);return oe.walkTokens&&de.walkTokens(xe,oe.walkTokens),Be.parse(xe,oe)}catch(Ie){if(Ie.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,oe.silent)return"<p>An error occurred:</p><pre>"+Xe(Ie.message+"",!0)+"</pre>";throw Ie}}de.options=de.setOptions=function(ne){return Qe(de.defaults,ne),it(de.defaults),de},de.getDefaults=Me,de.defaults=qe,de.use=function(ne){var oe=Qe({},ne);if(ne.renderer&&function(){var re=de.defaults.renderer||new be,ie=function(xe){var Ie=re[xe];re[xe]=function(){for(var Ne=arguments.length,ze=new Array(Ne),et=0;et<Ne;et++)ze[et]=arguments[et];var rt=ne.renderer[xe].apply(re,ze);return rt===!1&&(rt=Ie.apply(re,ze)),rt}};for(var pe in ne.renderer)ie(pe);oe.renderer=re}(),ne.tokenizer&&function(){var re=de.defaults.tokenizer||new Ee,ie=function(xe){var Ie=re[xe];re[xe]=function(){for(var Ne=arguments.length,ze=new Array(Ne),et=0;et<Ne;et++)ze[et]=arguments[et];var rt=ne.tokenizer[xe].apply(re,ze);return rt===!1&&(rt=Ie.apply(re,ze)),rt}};for(var pe in ne.tokenizer)ie(pe);oe.tokenizer=re}(),ne.walkTokens){var fe=de.defaults.walkTokens;oe.walkTokens=function(re){ne.walkTokens(re),fe&&fe(re)}}de.setOptions(oe)},de.walkTokens=function(ne,oe){for(var fe=H(ne),re;!(re=fe()).done;){var ie=re.value;oe(ie);switch(ie.type){case"table":{for(var pe=H(ie.tokens.header),ge;!(ge=pe()).done;){var xe=ge.value;de.walkTokens(xe,oe)}for(var Ie=H(ie.tokens.cells),Ne;!(Ne=Ie()).done;)for(var ze=Ne.value,et=H(ze),rt;!(rt=et()).done;){var yt=rt.value;de.walkTokens(yt,oe)}break}case"list":{de.walkTokens(ie.items,oe);break}default:ie.tokens&&de.walkTokens(ie.tokens,oe)}}},de.Parser=Be,de.parser=Be.parse,de.Renderer=be,de.TextRenderer=Ce,de.Lexer=ve,de.lexer=ve.lex,de.Tokenizer=Ee,de.Slugger=Pe,de.parse=de;var ee=de;return ee})},ELLl:function(Ye,we,Q){(function(se){se(Q("VrN/"))})(function(se){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=se.Pos;se.defineOption("autoCloseBrackets",!1,function(o,f,l){l&&l!=se.Init&&(o.removeKeyMap(H),o.state.closeBrackets=null),f&&(P($(f,"pairs")),o.state.closeBrackets=f,o.addKeyMap(H))});function $(o,f){return f=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[f]!=null?o[f]:X[f]}var H={Backspace:r,Enter:R};function P(o){for(var f=0;f<o.length;f++){var l=o.charAt(f),u="'"+l+"'";H[u]||(H[u]=K(l))}}P(X.pairs+"`");function K(o){return function(f){return m(f,o)}}function G(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=G(o);if(!f||o.getOption("disableInput"))return se.Pass;for(var l=$(f,"pairs"),u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return se.Pass;var a=p(o,u[s].head);if(!a||l.indexOf(a)%2!=0)return se.Pass}for(var s=u.length-1;s>=0;s--){var O=u[s].head;o.replaceRange("",N(O.line,O.ch-1),N(O.line,O.ch+1),"+delete")}}function R(o){var f=G(o),l=f&&$(f,"explode");if(!l||o.getOption("disableInput"))return se.Pass;for(var u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return se.Pass;var a=p(o,u[s].head);if(!a||l.indexOf(a)%2!=0)return se.Pass}o.operation(function(){var O=o.lineSeparator()||`
|
|
`;o.replaceSelection(O+O,null),o.execCommand("goCharLeft"),u=o.listSelections();for(var T=0;T<u.length;T++){var S=u[T].head.line;o.indentLine(S,null,!0),o.indentLine(S+1,null,!0)}})}function v(o){var f=se.cmpPos(o.anchor,o.head)>0;return{anchor:new N(o.anchor.line,o.anchor.ch+(f?-1:1)),head:new N(o.head.line,o.head.ch+(f?1:-1))}}function m(o,f){var l=G(o);if(!l||o.getOption("disableInput"))return se.Pass;var u=$(l,"pairs"),s=u.indexOf(f);if(s==-1)return se.Pass;for(var a=$(l,"closeBefore"),O=$(l,"triples"),T=u.charAt(s+1)==f,S=o.listSelections(),D=s%2==0,L,A=0;A<S.length;A++){var C=S[A],x=C.head,d,w=o.getRange(x,N(x.line,x.ch+1));if(D&&!C.empty())d="surround";else if((T||!D)&&w==f)T&&h(o,x)?d="both":O.indexOf(f)>=0&&o.getRange(x,N(x.line,x.ch+3))==f+f+f?d="skipThree":d="skip";else if(T&&x.ch>1&&O.indexOf(f)>=0&&o.getRange(N(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(o.getTokenTypeAt(N(x.line,x.ch-2))))return se.Pass;d="addFour"}else if(T){var y=x.ch==0?" ":o.getRange(N(x.line,x.ch-1),x);if(!se.isWordChar(w)&&y!=f&&!se.isWordChar(y))d="both";else return se.Pass}else if(D&&(w.length===0||/\s/.test(w)||a.indexOf(w)>-1))d="both";else return se.Pass;if(!L)L=d;else if(L!=d)return se.Pass}var b=s%2?u.charAt(s-1):f,j=s%2?f:u.charAt(s+1);o.operation(function(){if(L=="skip")o.execCommand("goCharRight");else if(L=="skipThree")for(var U=0;U<3;U++)o.execCommand("goCharRight");else if(L=="surround"){for(var E=o.getSelections(),U=0;U<E.length;U++)E[U]=b+E[U]+j;o.replaceSelections(E,"around"),E=o.listSelections().slice();for(var U=0;U<E.length;U++)E[U]=v(E[U]);o.setSelections(E)}else L=="both"?(o.replaceSelection(b+j,null),o.triggerElectric(b+j),o.execCommand("goCharLeft")):L=="addFour"&&(o.replaceSelection(b+b+b+b,"before"),o.execCommand("goCharRight"))})}function p(o,f){var l=o.getRange(N(f.line,f.ch-1),N(f.line,f.ch+1));return l.length==2?l:null}function h(o,f){var l=o.getTokenAt(N(f.line,f.ch+1));return/\bstring/.test(l.type)&&l.start==f.ch&&(f.ch==0||!/\bstring/.test(o.getTokenTypeAt(f)))}})},FWmy:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return se});function se(X,N){if(!X)throw new Error(N?`Assertion failed (${N})`:"Assertion Failed")}},GfqC:function(Ye,we,Q){"use strict";var se=Q("q1tI"),X=Q.n(se),N=Q("TSYQ"),$=Q.n(N);function H(M,I){var g="cannot "+M.method+" "+M.action+" "+I.status+"'",W=new Error(g);return W.status=I.status,W.method=M.method,W.url=M.action,W}function P(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(g){return I}}function K(M){var I=new XMLHttpRequest;M.onProgress&&I.upload&&(I.upload.onprogress=function(le){le.total>0&&(le.percent=le.loaded/le.total*100),M.onProgress(le)});var g=new FormData;M.data&&Object.keys(M.data).forEach(function(J){var le=M.data[J];if(Array.isArray(le)){le.forEach(function(ce){g.append(J+"[]",ce)});return}g.append(J,M.data[J])}),M.file instanceof Blob?g.append(M.filename,M.file,M.file.name):g.append(M.filename,M.file),I.onerror=function(le){M.onError(le)},I.onload=function(){return I.status<200||I.status>=300?M.onError(H(M,I),P(I)):M.onSuccess(P(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var W=M.headers||{};return W["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(J){W[J]!==null&&I.setRequestHeader(J,W[J])}),I.send(g),{abort:function(){I.abort()}}}var G=+new Date,r=0;function R(){return"rc-upload-"+G+"-"+ ++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(","),W=M.name||"",J=M.type||"",le=J.replace(/\/.*$/,"");return g.some(function(ce){var Re=ce.trim();return Re.charAt(0)==="."?v(W.toLowerCase(),Re.toLowerCase()):/\/\*$/.test(Re)?le===Re.replace(/\/.*$/,""):J===Re})}return!0};function p(M,I){var g=M.createReader(),W=[];function J(){g.readEntries(function(le){var ce=Array.prototype.slice.apply(le);W=W.concat(ce);var Re=!ce.length;Re?I(W):J()})}J()}var h=function(I,g,W){var J=function le(ce,Re){Re=Re||"",ce.isFile?ce.file(function(Ee){W(Ee)&&(ce.fullPath&&!Ee.webkitRelativePath&&(Object.defineProperties(Ee,{webkitRelativePath:{writable:!0}}),Ee.webkitRelativePath=ce.fullPath.replace(/^\//,""),Object.defineProperties(Ee,{webkitRelativePath:{writable:!1}})),g([Ee]))}):ce.isDirectory&&p(ce,function(Ee){Ee.forEach(function(Oe){le(Oe,""+Re+ce.name+"/")})})};I.forEach(function(le){J(le.webkitGetAsEntry())})},o=h,f=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(M[W]=g[W])}return M},l=function(){function M(I,g){var W=[],J=!0,le=!1,ce=void 0;try{for(var Re=I[Symbol.iterator](),Ee;!(J=(Ee=Re.next()).done)&&!(W.push(Ee.value),g&&W.length===g);J=!0);}catch(Oe){le=!0,ce=Oe}finally{try{!J&&Re.return&&Re.return()}finally{if(le)throw ce}}return W}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 W=0;W<g.length;W++){var J=g[W];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(I,J.key,J)}}return function(I,g,W){return g&&M(I.prototype,g),W&&M(I,W),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 W in M){if(I.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(M,W))continue;g[W]=M[W]}return g}function O(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function T(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,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(g[W]=I[W]),g},{})},L=function(M){S(I,M);function I(){var g,W,J,le;O(this,I);for(var ce=arguments.length,Re=Array(ce),Ee=0;Ee<ce;Ee++)Re[Ee]=arguments[Ee];return le=(W=(J=T(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Re))),J),J.state={uid:R()},J.reqs={},J.onChange=function(Oe){var Te=Oe.target.files;J.uploadFiles(Te),J.reset()},J.onClick=function(Oe){var Te=J.fileInput;if(!Te)return;var Le=J.props,ye=Le.children,Y=Le.onClick;ye&&ye.type==="button"&&(Te.parentNode.focus(),Te.parentNode.querySelector("button").blur()),Te.click(),Y&&Y(Oe)},J.onKeyDown=function(Oe){Oe.key==="Enter"&&J.onClick()},J.onFileDrop=function(Oe){var Te=J.props.multiple;if(Oe.preventDefault(),Oe.type==="dragover")return;if(J.props.directory)o(Array.prototype.slice.call(Oe.dataTransfer.items),J.uploadFiles,function(ye){return m(ye,J.props.accept)});else{var Le=Array.prototype.slice.call(Oe.dataTransfer.files).filter(function(ye){return m(ye,J.props.accept)});Te===!1&&(Le=Le.slice(0,1)),J.uploadFiles(Le)}},J.uploadFiles=function(Oe){var Te=Array.prototype.slice.call(Oe);Te.map(function(Le){return Le.uid=R(),Le}).forEach(function(Le){J.upload(Le,Te)})},J.saveFileInput=function(Oe){J.fileInput=Oe},W),T(J,le)}return u(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,J){var le=this,ce=this.props;if(!ce.beforeUpload)return setTimeout(function(){return le.post(W)},0);var Re=ce.beforeUpload(W,J);Re&&Re.then?Re.then(function(Ee){var Oe=Object.prototype.toString.call(Ee);return Oe==="[object File]"||Oe==="[object Blob]"?le.post(Ee):le.post(W)}).catch(function(Ee){console.log(Ee)}):Re!==!1&&setTimeout(function(){return le.post(W)},0);return}},{key:"post",value:function(W){var J=this;if(!this._isMounted)return;var le=this.props,ce=le.onStart,Re=le.onProgress,Ee=le.transformFile,Oe=Ee===void 0?function(Te){return Te}:Ee;new Promise(function(Te){var Le=le.action;return typeof Le=="function"&&(Le=Le(W)),Te(Le)}).then(function(Te){var Le=W.uid,ye=le.customRequest||K,Y=Promise.resolve(Oe(W)).then(function(_){var k=le.data;return typeof k=="function"&&(k=k(_)),Promise.all([_,k])}).catch(function(_){console.error(_)});Y.then(function(_){var k=l(_,2),B=k[0],Z=k[1],z={action:Te,filename:le.name,data:Z,file:B,headers:le.headers,withCredentials:le.withCredentials,method:le.method||"post",onProgress:Re?function(he){Re(he,W)}:null,onSuccess:function(ve,Ae){delete J.reqs[Le],le.onSuccess(ve,W,Ae)},onError:function(ve,Ae){delete J.reqs[Le],le.onError(ve,Ae,W)}};ce(W),J.reqs[Le]=ye(z)})})}},{key:"reset",value:function(){this.setState({uid:R()})}},{key:"abort",value:function(W){var J=this.reqs;if(W){var le=W;W&&W.uid&&(le=W.uid),J[le]&&J[le].abort&&J[le].abort(),delete J[le]}else Object.keys(J).forEach(function(ce){J[ce]&&J[ce].abort&&J[ce].abort(),delete J[ce]})}},{key:"render",value:function(){var W,J=this.props,le=J.component,ce=J.prefixCls,Re=J.className,Ee=J.disabled,Oe=J.id,Te=J.style,Le=J.multiple,ye=J.accept,Y=J.children,_=J.directory,k=J.openFileDialogOnClick,B=J.onMouseEnter,Z=J.onMouseLeave,z=a(J,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),he=$()((W={},s(W,ce,!0),s(W,ce+"-disabled",Ee),s(W,Re,Re),W)),ve=Ee?{}:{onClick:k?this.onClick:function(){},onKeyDown:k?this.onKeyDown:function(){},onMouseEnter:B,onMouseLeave:Z,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return X.a.createElement(le,f({},ve,{className:he,role:"button",style:Te}),X.a.createElement("input",f({},D(z),{id:Oe,type:"file",ref:this.saveFileInput,onClick:function(ue){return ue.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ye,directory:_?"directory":null,webkitdirectory:_?"webkitdirectory":null,multiple:Le,onChange:this.onChange})),Y)}}]),I}(se.Component),A=L,C=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(M[W]=g[W])}return M},x=function(){function M(I,g){for(var W=0;W<g.length;W++){var J=g[W];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(I,J.key,J)}}return function(I,g,W){return g&&M(I.prototype,g),W&&M(I,W),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 j=function(M){y(I,M);function I(){var g,W,J,le;d(this,I);for(var ce=arguments.length,Re=Array(ce),Ee=0;Ee<ce;Ee++)Re[Ee]=arguments[Ee];return le=(W=(J=w(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Re))),J),J.saveUploader=function(Oe){J.uploader=Oe},W),w(J,le)}return x(I,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return X.a.createElement(A,C({},this.props,{ref:this.saveUploader}))}}]),I}(se.Component);j.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 U=j,E=we.a=U},HmJG:function(Ye,we,Q){},JYp7:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return se});var se;(function(X){function N(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}X.is=N;const $=Object.freeze([]);function H(){return $}X.empty=H;function*P(a){yield a}X.single=P;function K(a){return a||$}X.from=K;function G(a){return!a||a[Symbol.iterator]().next().done===!0}X.isEmpty=G;function r(a){return a[Symbol.iterator]().next().value}X.first=r;function R(a,O){for(const T of a)if(O(T))return!0;return!1}X.some=R;function v(a,O){for(const T of a)if(O(T))return T;return}X.find=v;function*m(a,O){for(const T of a)O(T)&&(yield T)}X.filter=m;function*p(a,O){let T=0;for(const S of a)yield O(S,T++)}X.map=p;function*h(...a){for(const O of a)for(const T of O)yield T}X.concat=h;function*o(a){for(const O of a)for(const T of O)yield T}X.concatNested=o;function f(a,O,T){let S=T;for(const D of a)S=O(S,D);return S}X.reduce=f;function*l(a,O,T=a.length){for(O<0&&(O+=a.length),T<0?T+=a.length:T>a.length&&(T=a.length);O<T;O++)yield a[O]}X.slice=l;function u(a,O=Number.POSITIVE_INFINITY){const T=[];if(O===0)return[T,a];const S=a[Symbol.iterator]();for(let D=0;D<O;D++){const L=S.next();if(L.done)return[T,X.empty()];T.push(L.value)}return[T,{[Symbol.iterator](){return S}}]}X.consume=u;function s(a,O,T=(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(!T(L.value,A.value))return!1}}X.equals=s})(se||(se={}))},LdHM:function(Ye,we,Q){"use strict";Q.d(we,"b",function(){return a}),Q.d(we,"a",function(){return T});var se=Q("1OyB"),X=Q("vuIU"),N=Q("Ji7U"),$=Q("LK+K"),H=Q("q1tI"),P=Q("rePB"),K=Q("Ff2n"),G=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(W,J){var le=W.prefixCls,ce=W.id,Re=W.flattenOptions,Ee=W.childrenAsData,Oe=W.values,Te=W.searchValue,Le=W.multiple,ye=W.defaultActiveFirstOption,Y=W.height,_=W.itemHeight,k=W.notFoundContent,B=W.open,Z=W.menuItemSelectedIcon,z=W.virtual,he=W.onSelect,ve=W.onToggleOpen,Ae=W.onActiveValue,ue=W.onScroll,me=W.onMouseEnter,be="".concat(le,"-item"),Ce=Object(v.a)(function(){return Re},[B,Re],function(ee,ne){return ne[0]&&ee[1]!==ne[1]}),Pe=H.useRef(null),Ue=function(ne){ne.preventDefault()},He=function(ne){Pe.current&&Pe.current.scrollTo({index:ne})},Be=function(ne){for(var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=Ce.length,re=0;re<fe;re+=1){var ie=(ne+re*oe+fe)%fe,pe=Ce[ie],ge=pe.group,xe=pe.data;if(!ge&&!xe.disabled)return ie}return-1},Qe=H.useState(function(){return Be(0)}),Ge=Object(G.a)(Qe,2),Xe=Ge[0],Me=Ge[1],it=function(ne){Me(ne);var oe=Ce[ne];if(!oe){Ae(null,-1);return}Ae(oe.data.value,ne)};H.useEffect(function(){it(ye!==!1?Be(0):-1)},[Ce.length,Te]),H.useEffect(function(){var ee=setTimeout(function(){if(!Le&&B&&Oe.size===1){var ne=Array.from(Oe)[0],oe=Ce.findIndex(function(fe){var re=fe.data;return re.value===ne});it(oe),He(oe)}});return function(){return clearTimeout(ee)}},[B]);var qe=function(ne){ne!==void 0&&he(ne,{selected:!Oe.has(ne)}),Le||ve(!1)};if(H.useImperativeHandle(J,function(){return{onKeyDown:function(ne){var oe=ne.which;switch(oe){case r.a.UP:case r.a.DOWN:{var fe=0;if(oe===r.a.UP?fe=-1:oe===r.a.DOWN&&(fe=1),fe!==0){var re=Be(Xe+fe,fe);He(re),it(re)}break}case r.a.ENTER:{var ie=Ce[Xe];ie&&!ie.data.disabled?qe(ie.data.value):qe(void 0),B&&ne.preventDefault();break}case r.a.ESC:ve(!1)}},onKeyUp:function(){},scrollTo:function(ne){He(ne)}}}),Ce.length===0)return H.createElement("div",{role:"listbox",id:"".concat(ce,"_list"),className:"".concat(be,"-empty"),onMouseDown:Ue},k);function de(ee){var ne=Ce[ee];if(!ne)return null;var oe=ne.data||{},fe=oe.value,re=oe.label,ie=oe.children,pe=Object(R.a)(oe,!0),ge=Ee?ie:re;return ne?H.createElement("div",Object.assign({"aria-label":typeof ge=="string"?ge:null},pe,{key:ee,role:"option",id:"".concat(ce,"_list_").concat(ee),"aria-selected":Oe.has(fe)}),fe):null}return H.createElement(H.Fragment,null,H.createElement("div",{role:"listbox",id:"".concat(ce,"_list"),style:{height:0,width:0,overflow:"hidden"}},de(Xe-1),de(Xe),de(Xe+1)),H.createElement(h.a,{itemKey:"key",ref:Pe,data:Ce,height:Y,itemHeight:_,fullHeight:!1,onMouseDown:Ue,onScroll:ue,virtual:z,onMouseEnter:me},function(ee,ne){var oe,fe=ee.group,re=ee.groupOption,ie=ee.data,pe=ie.label,ge=ie.key;if(fe)return H.createElement("div",{className:p()(be,"".concat(be,"-group"))},pe!==void 0?pe:ge);var xe=ie.disabled,Ie=ie.value,Ne=ie.title,ze=ie.children,et=ie.style,rt=ie.className,yt=Object(K.a)(ie,["disabled","value","title","children","style","className"]),ot=Oe.has(Ie),at="".concat(be,"-option"),Lt=p()(be,at,rt,(oe={},Object(P.a)(oe,"".concat(at,"-grouped"),re),Object(P.a)(oe,"".concat(at,"-active"),Xe===ne&&!xe),Object(P.a)(oe,"".concat(at,"-disabled"),xe),Object(P.a)(oe,"".concat(at,"-selected"),ot),oe)),_t=Ee?ze:pe,Ut=!Z||typeof Z=="function"||ot;return H.createElement("div",Object.assign({},yt,{"aria-selected":ot,className:Lt,title:Ne,onMouseMove:function(){if(Xe===ne||xe)return;it(ne)},onClick:function(){xe||qe(Ie)},style:et}),H.createElement("div",{className:"".concat(at,"-content")},_t||Ie),H.isValidElement(Z)||ot,Ut&&H.createElement(o.a,{className:"".concat(be,"-option-state"),customizeIcon:Z,customizeIconProps:{isSelected:ot}},ot?"\u2713":null))}))},l=H.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 T=O,S=Q("VTBJ"),D=Q("Zm9Q");function L(g){var W=g.key,J=g.props,le=J.children,ce=J.value,Re=Object(K.a)(J,["children","value"]);return Object(S.a)({key:W,value:ce!==void 0?ce:W,children:le},Re)}function A(g){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function(J,le){if(!H.isValidElement(J)||!J.type)return null;var ce=J.type.isSelectOptGroup,Re=J.key,Ee=J.props,Oe=Ee.children,Te=Object(K.a)(Ee,["children"]);return W||!ce?L(J):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Re===null?le:Re,"__"),label:Re},Te),{},{options:A(Oe)})}).filter(function(J){return J})}var C=Q("2Qr1"),x=Q("qNPg"),d=Q("U8pU"),w=Q("Kwbf"),y=Q("WKfj");function b(g){var W=g.mode,J=g.options,le=g.children,ce=g.backfill,Re=g.allowClear,Ee=g.placeholder,Oe=g.getInputElement,Te=g.showSearch,Le=g.onSearch,ye=g.defaultOpen,Y=g.autoFocus,_=g.labelInValue,k=g.value,B=g.inputValue,Z=g.optionLabelProp,z=W==="multiple"||W==="tags",he=Te!==void 0?Te:z||W==="combobox",ve=J||A(le);if(Object(w.a)(W!=="tags"||ve.every(function(be){return!be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Ae=ve.some(function(be){return be.options?be.options.some(function(Ce){return typeof("value"in Ce?Ce.value:Ce.key)=="number"}):typeof("value"in be?be.value:be.key)=="number"});Object(w.a)(!Ae,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(W!=="combobox"||!Z,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(W==="combobox"||!ce,"`backfill` only works with `combobox` mode."),Object(w.a)(W==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(w.b)(W!=="combobox"||!Oe||!Re||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!he&&W!=="combobox"&&W!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!ye||Y,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),k!=null){var ue=Object(y.d)(k);Object(w.a)(!_||ue.every(function(be){return Object(d.a)(be)==="object"&&("key"in be||"value"in be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!z||Array.isArray(k),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var me=null;Object(D.a)(le).some(function(be){if(!H.isValidElement(be)||!be.type)return!1;var Ce=be.type;if(Ce.isSelectOption)return!1;if(Ce.isSelectOptGroup){var Pe=Object(D.a)(be.props.children).every(function(Ue){return!H.isValidElement(Ue)||!be.type||Ue.type.isSelectOption?!0:(me=Ue.type,!1)});return!Pe}return me=Ce,!0}),me&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(me.displayName||me.name||me,"`.")),Object(w.a)(B===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=b,U=Object(x.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:j,fillOptionsWithMissingValue:C.a}),E=function(g){Object(N.a)(J,g);var W=Object($.a)(J);function J(){var le;return Object(se.a)(this,J),le=W.apply(this,arguments),le.selectRef=H.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object(X.a)(J,[{key:"render",value:function(){return H.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),J}(H.Component);E.Option=a,E.OptGroup=T;var M=E,I=we.c=M},M8RZ:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return r});var se=Q("fWQN"),X=Q("mtLc"),N=Q("yKVA"),$=Q("879j"),H=Q("q1tI"),P=Q.n(H),K=Q("i8i4"),G=Q.n(K),r=function(R){Object(N.a)(m,R);var v=Object($.a)(m);function m(p){var h;Object(se.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(X.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(P.a.Component)},MI8n:function(Ye,we,Q){"use strict";Q.d(we,"c",function(){return H}),Q.d(we,"b",function(){return r}),Q.d(we,"e",function(){return R}),Q.d(we,"a",function(){return v}),Q.d(we,"d",function(){return m}),Q.d(we,"f",function(){return p});var se=Q("/cxE"),X=Q("pmY6"),N=Q("24hK"),$=Q("5Y4S"),H;(function(h){h.None=()=>X.a.None;function o(b){return(j,U=null,E)=>{let M=!1,I;return I=b(g=>M?void 0:(I?I.dispose():M=!0,j.call(U,g)),null,E),M&&I.dispose(),I}}h.once=o;function f(b,j){return T((U,E=null,M)=>b(I=>U.call(E,j(I)),null,M))}h.map=f;function l(b,j){return T((U,E=null,M)=>b(I=>{j(I),U.call(E,I)},null,M))}h.forEach=l;function u(b,j){return T((U,E=null,M)=>b(I=>j(I)&&U.call(E,I),null,M))}h.filter=u;function s(b){return b}h.signal=s;function a(...b){return(j,U=null,E)=>Object(X.e)(...b.map(M=>M(I=>j.call(U,I),null,E)))}h.any=a;function O(b,j,U){let E=U;return f(b,M=>(E=j(E,M),E))}h.reduce=O;function T(b){let j;const U=new r({onFirstListenerAdd(){j=b(U.fire,U)},onLastListenerRemove(){j.dispose()}});return U.event}function S(b,j,U=100,E=!1,M){let I,g,W,J=0;const le=new r({leakWarningThreshold:M,onFirstListenerAdd(){I=b(ce=>{J++,g=j(g,ce),E&&!W&&(le.fire(g),g=void 0),clearTimeout(W),W=setTimeout(()=>{const Re=g;g=void 0,W=void 0,(!E||J>1)&&le.fire(Re),J=0},U)})},onLastListenerRemove(){I.dispose()}});return le.event}h.debounce=S;function D(b,j=(U,E)=>U===E){let U=!0,E;return u(b,M=>{const I=U||!j(M,E);return U=!1,E=M,I})}h.latch=D;function L(b,j){return[h.filter(b,j),h.filter(b,U=>!j(U))]}h.split=L;function A(b,j=!1,U=[]){let E=U.slice(),M=b(W=>{E?E.push(W):g.fire(W)});const I=()=>{E&&E.forEach(W=>g.fire(W)),E=null},g=new r({onFirstListenerAdd(){M||(M=b(W=>g.fire(W)))},onFirstListenerDidAdd(){E&&(j?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,j){return new C(O(this.event,b,j))}latch(){return new C(D(this.event))}debounce(b,j=100,U=!1,E){return new C(S(this.event,b,j,U,E))}on(b,j,U){return this.event(b,j,U)}once(b,j,U){return o(this.event)(b,j,U)}}function x(b){return new C(b)}h.chain=x;function d(b,j,U=E=>E){const E=(...W)=>g.fire(U(...W)),M=()=>b.on(j,E),I=()=>b.removeListener(j,E),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromNodeEventEmitter=d;function w(b,j,U=E=>E){const E=(...W)=>g.fire(U(...W)),M=()=>b.addEventListener(j,E),I=()=>b.removeEventListener(j,E),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromDOMEventEmitter=w;function y(b){return new Promise(j=>o(b)(j))}h.toPromise=y})(H||(H={}));class P{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${P._idPool++}`}start(h){this._stopWatch=new $.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}}}P._idPool=0;let K=-1;class G{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=K;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=K>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new P(this._options._profName):void 0}get event(){return this._event||(this._event=(h,o,f)=>{var l;this._listeners||(this._listeners=new N.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(X.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return f instanceof X.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 N.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(se.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 N.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=H.None,this.inputEventListener=X.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(Ye,we,Q){"use strict";(function(se,X){Q.d(we,"b",function(){return f}),Q.d(we,"i",function(){return a}),Q.d(we,"f",function(){return O}),Q.d(we,"d",function(){return T}),Q.d(we,"g",function(){return S}),Q.d(we,"h",function(){return D}),Q.d(we,"c",function(){return L}),Q.d(we,"k",function(){return A}),Q.d(we,"j",function(){return C}),Q.d(we,"a",function(){return x}),Q.d(we,"e",function(){return y});var N;const $="en";let H=!1,P=!1,K=!1,G=!1,r=!1,R=!1,v=!1,m,p=$,h,o;const f=typeof self=="object"?self:typeof se=="object"?se:{};let l;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?l=f.vscode.process:typeof X!="undefined"&&(l=X);const u=typeof((N=l==null?void 0:l.versions)===null||N===void 0?void 0:N.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)o=navigator.userAgent,H=o.indexOf("Windows")>=0,P=o.indexOf("Macintosh")>=0,v=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=o.indexOf("Linux")>=0,R=!0,m=navigator.language,p=m;else if(typeof l=="object"){H=l.platform==="win32",P=l.platform==="darwin",K=l.platform==="linux",G=K&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,m=$,p=$;const b=l.env.VSCODE_NLS_CONFIG;if(b)try{const j=JSON.parse(b),U=j.availableLanguages["*"];m=j.locale,p=U||$,h=j._translationsConfigFile}catch(j){}r=!0}else console.error("Unable to resolve platform.");let s=0;P?s=1:H?s=3:K&&(s=2);const a=H,O=P,T=K,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 U=[];f.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,g=U.length;I<g;I++){const W=U[I];if(W.id===M.data.vscodeSetImmediateId){U.splice(I,1),W.callback();return}}});let E=0;return M=>{const I=++E;U.push({id:I,callback:M}),f.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const j=Promise.resolve();return U=>j.then(U)}(),x=P||v?2:H?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 j=new Uint16Array(b.buffer);d=j[0]===(2<<8)+1}return d}}).call(this,Q("IyRk"),Q("Q2Ig"))},N0LK:function(Ye,we,Q){"use strict";Q.d(we,"C",function(){return se}),Q.d(we,"v",function(){return N}),Q.d(we,"s",function(){return $}),Q.d(we,"t",function(){return H}),Q.d(we,"U",function(){return P}),Q.d(we,"J",function(){return K}),Q.d(we,"O",function(){return G}),Q.d(we,"p",function(){return r}),Q.d(we,"T",function(){return R}),Q.d(we,"q",function(){return v}),Q.d(we,"N",function(){return m}),Q.d(we,"M",function(){return p}),Q.d(we,"Q",function(){return h}),Q.d(we,"u",function(){return o}),Q.d(we,"x",function(){return f}),Q.d(we,"I",function(){return l}),Q.d(we,"f",function(){return u}),Q.d(we,"h",function(){return s}),Q.d(we,"g",function(){return a}),Q.d(we,"i",function(){return O}),Q.d(we,"G",function(){return T}),Q.d(we,"H",function(){return S}),Q.d(we,"r",function(){return D}),Q.d(we,"R",function(){return L}),Q.d(we,"d",function(){return A}),Q.d(we,"e",function(){return C}),Q.d(we,"E",function(){return x}),Q.d(we,"F",function(){return d}),Q.d(we,"j",function(){return w}),Q.d(we,"z",function(){return y}),Q.d(we,"K",function(){return j}),Q.d(we,"L",function(){return U}),Q.d(we,"m",function(){return M}),Q.d(we,"k",function(){return g}),Q.d(we,"A",function(){return J}),Q.d(we,"a",function(){return le}),Q.d(we,"n",function(){return ce}),Q.d(we,"l",function(){return Re}),Q.d(we,"D",function(){return Ee}),Q.d(we,"B",function(){return Oe}),Q.d(we,"b",function(){return Te}),Q.d(we,"S",function(){return Le}),Q.d(we,"o",function(){return ye}),Q.d(we,"P",function(){return Y}),Q.d(we,"w",function(){return _}),Q.d(we,"c",function(){return k}),Q.d(we,"y",function(){return z});function se(ue){return!ue||typeof ue!="string"?!0:ue.trim().length===0}const X=/{(\d+)}/g;function N(ue,...me){return me.length===0?ue:ue.replace(X,function(be,Ce){const Pe=parseInt(Ce,10);return isNaN(Pe)||Pe<0||Pe>=me.length?be:me[Pe]})}function $(ue){return ue.replace(/[<>&]/g,function(me){switch(me){case"<":return"<";case">":return">";case"&":return"&";default:return me}})}function H(ue){return ue.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function P(ue,me=" "){const be=K(ue,me);return G(be,me)}function K(ue,me){if(!ue||!me)return ue;const be=me.length;if(be===0||ue.length===0)return ue;let Ce=0;for(;ue.indexOf(me,Ce)===Ce;)Ce=Ce+be;return ue.substring(Ce)}function G(ue,me){if(!ue||!me)return ue;const be=me.length,Ce=ue.length;if(be===0||Ce===0)return ue;let Pe=Ce,Ue=-1;for(;!(Ue=ue.lastIndexOf(me,Pe-1),Ue===-1||Ue+be!==Pe);){if(Ue===0)return"";Pe=Ue}return ue.substring(0,Pe)}function r(ue){return ue.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function R(ue){return ue.replace(/\*/g,"")}function v(ue,me,be={}){if(!ue)throw new Error("Cannot create regex from empty string");me||(ue=H(ue)),be.wholeWord&&(/\B/.test(ue.charAt(0))||(ue="\\b"+ue),/\B/.test(ue.charAt(ue.length-1))||(ue=ue+"\\b"));let Ce="";return be.global&&(Ce+="g"),be.matchCase||(Ce+="i"),be.multiline&&(Ce+="m"),be.unicode&&(Ce+="u"),new RegExp(ue,Ce)}function m(ue){if(ue.source==="^"||ue.source==="^$"||ue.source==="$"||ue.source==="^\\s*$")return!1;const me=ue.exec("");return!!(me&&ue.lastIndex===0)}function p(ue){return(ue.global?"g":"")+(ue.ignoreCase?"i":"")+(ue.multiline?"m":"")+(ue.unicode?"u":"")}function h(ue){return ue.split(/\r\n|\r|\n/)}function o(ue){for(let me=0,be=ue.length;me<be;me++){const Ce=ue.charCodeAt(me);if(Ce!==32&&Ce!==9)return me}return-1}function f(ue,me=0,be=ue.length){for(let Ce=me;Ce<be;Ce++){const Pe=ue.charCodeAt(Ce);if(Pe!==32&&Pe!==9)return ue.substring(me,Ce)}return ue.substring(me,be)}function l(ue,me=ue.length-1){for(let be=me;be>=0;be--){const Ce=ue.charCodeAt(be);if(Ce!==32&&Ce!==9)return be}return-1}function u(ue,me){return ue<me?-1:ue>me?1:0}function s(ue,me,be=0,Ce=ue.length,Pe=0,Ue=me.length){for(;be<Ce&&Pe<Ue;be++,Pe++){let Qe=ue.charCodeAt(be),Ge=me.charCodeAt(Pe);if(Qe<Ge)return-1;if(Qe>Ge)return 1}const He=Ce-be,Be=Ue-Pe;return He<Be?-1:He>Be?1:0}function a(ue,me){return O(ue,me,0,ue.length,0,me.length)}function O(ue,me,be=0,Ce=ue.length,Pe=0,Ue=me.length){for(;be<Ce&&Pe<Ue;be++,Pe++){let Qe=ue.charCodeAt(be),Ge=me.charCodeAt(Pe);if(Qe===Ge)continue;if(Qe>=128||Ge>=128)return s(ue.toLowerCase(),me.toLowerCase(),be,Ce,Pe,Ue);T(Qe)&&(Qe-=32),T(Ge)&&(Ge-=32);const Xe=Qe-Ge;if(Xe===0)continue;return Xe}const He=Ce-be,Be=Ue-Pe;return He<Be?-1:He>Be?1:0}function T(ue){return ue>=97&&ue<=122}function S(ue){return ue>=65&&ue<=90}function D(ue,me){return ue.length===me.length&&O(ue,me)===0}function L(ue,me){const be=me.length;return me.length>ue.length?!1:O(ue,me,0,be)===0}function A(ue,me){let be,Ce=Math.min(ue.length,me.length);for(be=0;be<Ce;be++)if(ue.charCodeAt(be)!==me.charCodeAt(be))return be;return Ce}function C(ue,me){let be,Ce=Math.min(ue.length,me.length);const Pe=ue.length-1,Ue=me.length-1;for(be=0;be<Ce;be++)if(ue.charCodeAt(Pe-be)!==me.charCodeAt(Ue-be))return be;return Ce}function x(ue){return 55296<=ue&&ue<=56319}function d(ue){return 56320<=ue&&ue<=57343}function w(ue,me){return(ue-55296<<10)+(me-56320)+65536}function y(ue,me,be){const Ce=ue.charCodeAt(be);if(x(Ce)&&be+1<me){const Pe=ue.charCodeAt(be+1);if(d(Pe))return w(Ce,Pe)}return Ce}function b(ue,me){const be=ue.charCodeAt(me-1);if(d(be)&&me>1){const Ce=ue.charCodeAt(me-2);if(x(Ce))return w(Ce,be)}return be}function j(ue,me){const be=B.getInstance(),Ce=me,Pe=ue.length,Ue=y(ue,Pe,me);me+=Ue>=65536?2:1;let He=be.getGraphemeBreakType(Ue);for(;me<Pe;){const Be=y(ue,Pe,me),Qe=be.getGraphemeBreakType(Be);if(k(He,Qe))break;me+=Be>=65536?2:1,He=Qe}return me-Ce}function U(ue,me){const be=B.getInstance(),Ce=me,Pe=b(ue,me);me-=Pe>=65536?2:1;let Ue=be.getGraphemeBreakType(Pe);for(;me>0;){const He=b(ue,me),Be=be.getGraphemeBreakType(He);if(k(Be,Ue))break;me-=He>=65536?2:1,Ue=Be}return Ce-me}const E=/(?:[\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(ue){return E.test(ue)}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(ue){return I.test(ue)}const W=/^[\t\n\r\x20-\x7E]*$/;function J(ue){return W.test(ue)}const le=/[\u2028\u2029]/;function ce(ue){return le.test(ue)}function Re(ue){for(let me=0,be=ue.length;me<be;me++)if(Ee(ue.charCodeAt(me)))return!0;return!1}function Ee(ue){return ue=+ue,ue>=11904&&ue<=55215||ue>=63744&&ue<=64255||ue>=65281&&ue<=65374}function Oe(ue){return ue>=127462&&ue<=127487||ue===8986||ue===8987||ue===9200||ue===9203||ue>=9728&&ue<=10175||ue===11088||ue===11093||ue>=127744&&ue<=128591||ue>=128640&&ue<=128764||ue>=128992&&ue<=129003||ue>=129280&&ue<=129535||ue>=129648&&ue<=129750}const Te=String.fromCharCode(65279);function Le(ue){return!!(ue&&ue.length>0&&ue.charCodeAt(0)===65279)}function ye(ue,me=!1){return ue?(me&&(ue=ue.replace(/\\./g,"")),ue.toLowerCase()!==ue):!1}function Y(ue){const me=90-65+1;return ue=ue%(2*me),ue<me?String.fromCharCode(97+ue):String.fromCharCode(65+ue-me)}function _(ue){const me=B.getInstance();return me.getGraphemeBreakType(ue)}function k(ue,me){return ue===0?me!==5&&me!==7:ue===2&&me===3?!1:ue===4||ue===2||ue===3||(me===4||me===2||me===3)?!0:ue===8&&(me===8||me===9||me===11||me===12)||((ue===11||ue===9)&&(me===9||me===10)||((ue===12||ue===10)&&me===10||(me===5||me===13||(me===7||(ue===1||ue===13&&me===14)))))?!1:!(ue===6&&me===6)}class B{constructor(){this._data=Z()}static getInstance(){return B._INSTANCE||(B._INSTANCE=new B),B._INSTANCE}getGraphemeBreakType(ue){if(ue<32)return ue===10?3:ue===13?2:4;if(ue<127)return 0;const me=this._data,be=me.length/3;let Ce=1;for(;Ce<=be;)if(ue<me[3*Ce])Ce=2*Ce;else if(ue>me[3*Ce+1])Ce=2*Ce+1;else return me[3*Ce+2];return 0}}B._INSTANCE=null;function Z(){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 z(ue,me){if(ue===0)return 0;const be=he(ue,me);if(be!==void 0)return be;const Ce=b(me,ue);return ue-=ve(Ce),ue}function he(ue,me){let be=b(me,ue);for(ue-=ve(be);Ae(be)||be===65039||be===8419;){if(ue===0)return;be=b(me,ue),ue-=ve(be)}if(!Oe(be))return;if(ue>=0){const Ce=b(me,ue);Ce===8205&&(ue-=ve(Ce))}return ue}function ve(ue){return ue>=65536?2:1}function Ae(ue){return 127995<=ue&&ue<=127999}},Ot1p:function(Ye,we,Q){"use strict";var se=Q("2qtc"),X=Q("kLXV"),N=Q("rAM+"),$=Q("miYZ"),H=Q("tsqr"),P=Q("9og8"),K=Q("tJVT"),G=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"),T=Q("kSUc"),S=Q("9Bee"),D=function(xe){var Ie=xe.value,Ne=Ie===void 0?"":Ie,ze=xe.className,et=xe.showTextOnly,rt=xe.showLines,yt=xe.style,ot=yt===void 0?{}:yt,at=Object(v.useMemo)(function(){return""},[Ne]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:at}}))},L=Q("0Owb"),A=Q("dejd"),C=Q("C+DQ"),x=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(xe){var Ie=xe.onActionCallback,Ne=xe.title,ze=xe.icon,et=xe.actionName,rt=xe.className,yt=rt===void 0?"":rt,ot=xe.children;function at(){Ie(et)}return m.a.createElement("a",{title:Ne,className:yt,onClick:at},m.a.createElement("i",{className:"md-iconfont ".concat(ze)}),ot)}var b=function(xe){var Ie=xe.watch,Ne=xe.showNullButton,ze=xe.onActionCallback,et=xe.fullScreen,rt=xe.insertTemp,yt=xe.hidetoolBar,ot=xe.uuid,at=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(ot,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var Lt=[].concat(w,[{title:"".concat(Ie?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ie?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!yt&&Lt.map(function(_t,Ut){return m.a.createElement("li",{key:Ut},_t.actionName?m.a.createElement(y,Object(L.a)({},_t,{onActionCallback:ze})):m.a.createElement("span",{className:"v-line"}))}),Ne?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:ze},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:ze},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(et?"icon-shrink":"icon-enlarge"),title:et?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ze})))},j=Q("M8RZ"),U=Q("+L6B"),E=Q("2/Rp"),M=Q("y8nQ"),I=Q("Vl3Y"),g=Q("5NDa"),W=Q("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},le=function(xe){var Ie=xe.callback,Ne=xe.onCancel;function ze(et){Ie(et)}return m.a.createElement(I.a,Object(L.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ze}),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(W.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(W.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},ce=Q("7ahc"),Re=Q("HmJG"),Ee=Q("BjJ7"),Oe=I.a.useForm,Te={width:280,marginRight:10},Le={labelCol:{span:5},wrapperCol:{span:19}},ye=function(xe){var Ie=xe.callback,Ne=xe.onCancel,ze=Oe(),et=Object(K.a)(ze,1),rt=et[0];function yt(Lt){Ie(Lt)}function ot(Lt,_t){if(Lt.status===-1){H.b.error(Lt.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(Lt.id),type:_t.type})}function at(Lt){var _t=Lt.target.files[0];_(_t,ot)}return m.a.createElement(I.a,Object(L.a)({form:rt},Le,{className:"upload-image-panel",onFinish:yt}),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(W.a,{style:Te})),m.a.createElement(Y,{onFileChange:at}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(W.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))};function Y(xe){var Ie=xe.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ie}))}function _(xe,Ie){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ne=new FormData;Ne.append("editormd-image-file",xe),Ne.append("file_param_name","editormd-image-file"),Ne.append("byxhr","true");var ze=new window.XMLHttpRequest;ze.withCredentials=!0,ze.addEventListener("load",function(et){Ie(JSON.parse(et.target.responseText),xe)},!1),ze.addEventListener("error",function(et){console.error(et)},!1),ze.open("POST","".concat(Ee.a,"/api/attachments.json")),ze.send(Ne)}var k=Q("giR+"),B=Q("fyUT"),Z=Q("7Kak"),z=Q("9yH6"),he=z.a.Group,ve={margin:"0 8px"},Ae=function(xe){var Ie=xe.callback,Ne=xe.onCancel;function ze(et){Ie(et)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ze},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:ve},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:ve},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(B.a,null)),m.a.createElement("span",{style:ve},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(B.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:ve},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(he,null,m.a.createElement(z.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(z.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(z.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(z.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},ue=Q("ErOA"),me=Q("7Cbv"),be="link",Ce="upload-image",Pe="code-block",Ue="add-table",He="------------",Be={default:He,left:":".concat(He),center:":".concat(He,":"),right:"".concat(He,":")},Qe=Q("9VGf"),Ge,Xe;function Me(){}var it=0,qe=1e4,de="\u2581",ee=`
|
|
**\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 ne(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var oe=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=oe?"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"],ie=(Ge={},Object(G.a)(Ge,fe+"-B","bold"),Object(G.a)(Ge,fe+"-I","italic"),Ge),pe=(Xe={},Object(G.a)(Xe,be,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(Xe,Pe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(Xe,Ce,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(Xe,Ue,"\u6DFB\u52A0\u8868\u683C"),Xe),ge=we.a=function(xe){var Ie=xe.defaultValue,Ne=Ie===void 0?"":Ie,ze=xe.onChange,et=xe.width,rt=et===void 0?"100%":et,yt=xe.height,ot=yt===void 0?400:yt,at=xe.miniToolbar,Lt=at===void 0?!1:at,_t=xe.isFocus,Ut=_t===void 0?!1:_t,Ft=xe.watch,Tt=xe.insertTemp,sr=xe.mode,Er=sr===void 0?"markdown":sr,Kt=xe.id,dr=Kt===void 0?"markdown-editor-id":Kt,dt=xe.showResizeBar,vt=dt===void 0?!1:dt,Et=xe.noStorage,Ht=Et===void 0?!1:Et,or=xe.showNullButton,Mt=or===void 0?!1:or,Ze=xe.hidetoolBar,Ct=Ze===void 0?!1:Ze,Ot=xe.fullScreen,ct=Ot===void 0?!1:Ot,pt=xe.onBlur,wt=xe.onCMBeforeChange,rr=xe.onFullScreen,Bt=xe.className,We=Bt===void 0?"":Bt,ft=xe.disablePaste,rn=ft===void 0?!1:ft,_n=xe.placeholder,En=_n===void 0?"":_n,nn=xe.values,xn=nn===void 0?"":nn,gt=Object(v.useState)(null),Ai=Object(K.a)(gt,2),Ke=Ai[0],Tn=Ai[1],Sr=Object(v.useState)(Ne),Vn=Object(K.a)(Sr,2),an=Vn[0],Ar=Vn[1],Xn=Object(v.useState)(Ft),Yn=Object(K.a)(Xn,2),Or=Yn[0],$n=Yn[1],Oi=Object(v.useState)(ct),Jn=Object(K.a)(Oi,2),Rr=Jn[0],Ri=Jn[1],aa=Object(v.useState)(""),Qn=Object(K.a)(aa,2),lr=Qn[0],Vr=Qn[1],sa=Object(v.useState)(0),sn=Object(K.a)(sa,2),Lr=sn[0],Zn=sn[1],oa=Object(v.useState)(ot),Li=Object(K.a)(oa,2),Ii=Li[0],wn=Li[1],Di=Object(v.useState)(!1),ki=Object(K.a)(Di,2),la=ki[0],Sn=ki[1],on=Object(v.useRef)(Object(me.a)()),ln=Object(v.useRef)(!1),Cn=Object(v.useRef)(),Br=Object(v.useRef)(),jr=Object(v.useRef)(),Hr=Object(v.useRef)(),An=Object(v.useRef)(),Mi=function(){var st=Object(P.a)(R.a.mark(function mt(){var ut,xt;return R.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:on.current}});case 2:xt=Pt.sent,xt!=null&&(ut=xt.attachments)!==null&&ut!==void 0&&ut.length&&(console.log("cm:",Ke,Br),xt.attachments.map(function(At){At.content_type.indexOf("image")>-1?Ke.replaceSelection(".concat(At.content_type,")")):At.content_type.indexOf("video")>-1?Ke.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):At.content_type.indexOf("pdf")>-1?Ke.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(At.id,"?type=").concat(At.content_type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):Ke.replaceSelection("[".concat(At.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(At.id,"?type=").concat(At.content_type,")"))}));case 4:case"end":return Pt.stop()}},mt)}));return function(){return st.apply(this,arguments)}}();Object(v.useEffect)(function(){Ar(xn),Ke==null||Ke.setValue(xn)},[xn]),Object(v.useEffect)(function(){rr==null||rr(Rr)},[Rr]),Object(v.useEffect)(function(){if(Br.current){var st=h.a.fromTextArea(Br.current,{mode:Er,lineNumbers:!Lt,lineWrapping:!0,value:Ne,autoCloseTags:!0,autoCloseBrackets:!0});Ut&&st.focus();function mt(ut,xt){if(rn){xt.preventDefault();return}var Rt=xt.clipboardData;if(Rt){var Pt=Rt.types.toString(),At=Rt.items;if(Pt==="Files"||Rt.types.indexOf("Files")>-1){if(xt.preventDefault(),Er=="stex")return;try{var Yt,cr=At[1];((Yt=At[0])===null||Yt===void 0?void 0:Yt.kind)==="file"&&(cr=At[0]);var St=cr.getAsFile(),Wr=St.name.split(".").pop();_(St,function(It){if(It.id){var fr,nr,Cr;(St==null||((fr=St.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?st.replaceSelection(".concat(It.content_type,")")):(St==null||((nr=St.type)===null||nr===void 0)?void 0:nr.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(St==null||((Cr=St.type)===null||Cr===void 0)?void 0:Cr.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):re.includes(Wr)?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):st.replaceSelection("[".concat(St.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}else(It==null?void 0:It.status)===401&&(document.location.href="/user/login")})}catch(It){H.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return st.on("paste",mt),st.on("dragleave",function(ut,xt){jr.current.classList.remove("mouse-hover-md")}),st.on("dragover",function(ut,xt){jr.current.classList.add("mouse-hover-md")}),st.on("drop",function(ut,xt){jr.current.classList.add("mouse-hover-md");var Rt;if(Rt=xt.dataTransfer.files,Rt.length>0){xt.preventDefault(),xt.stopPropagation();for(var Pt=function(cr){var St=Rt[cr],Wr=St.name.split(".").pop();_(St,function(It){if(It.id){var fr,nr,Cr;(St==null||((fr=St.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?st.replaceSelection(".concat(It.content_type,")")):(St==null||((nr=St.type)===null||nr===void 0)?void 0:nr.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(St==null||((Cr=St.type)===null||Cr===void 0)?void 0:Cr.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):re.includes(Wr)?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):st.replaceSelection("[".concat(St.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}else(It==null?void 0:It.status)===401&&(document.location.href="/user/login")})},At=0;At<Rt.length;At++)Pt(At)}}),Tn(st),function(){st.off("paste",mt)}}},[]);var xr=Object(v.useCallback)(function(){if(jr.current)try{}catch(st){console.log(st,"---- to set md editor body height")}},[Ii,jr,Rr]);Object(v.useEffect)(function(){function st(){var ut=new o.default(function(xt){var Rt=Object(N.a)(xt),Pt;try{for(Rt.s();!(Pt=Rt.n()).done;){var At=Pt.value;(At.target.offsetHeight>0||At.target.offsetWidth>0)&&(xr(),Ke.setSize("100%","100%"),Ke.refresh())}}catch(Yt){Rt.e(Yt)}finally{Rt.f()}});return ut.observe(Br.current.parentElement),ut}if(Ke){var mt=st();return function(){mt.unobserve(Br.current.parentElement)}}},[Ke,xr]),Object(v.useEffect)(function(){if(Ke){for(var st=[],mt=function(){var At=xt[ut];Rt=Object(K.a)(At,2);var Yt=Rt[0],cr=Rt[1],St=Object(G.a)({},Yt,function(){Pi(cr)});st.push(St),Ke.addKeyMap(St)},ut=0,xt=Object.entries(ie);ut<xt.length;ut++){var Rt;mt()}return Cn.current=setInterval(function(){ln.current&&Mi()},4e3),function(){clearInterval(Cn.current);var Pt=Object(N.a)(st),At;try{for(Pt.s();!(At=Pt.n()).done;){var Yt=At.value;Ke.removeKeyMap(Yt)}}catch(cr){Pt.e(cr)}finally{Pt.f()}}}},[Ke]),Object(v.useEffect)(function(){ct!==Rr&&Ri(ct)},[ct]),Object(Qe.a)(function(){if(!Ht&&Lr>0){var st=new Date().getTime(),mt=window.sessionStorage.getItem(dr);st>=Lr+qe&&(!mt||mt!==an)&&(window.sessionStorage.setItem(dr,an),Sn(!0))}},qe),Object(v.useEffect)(function(){$n(Ft)},[Ke,Ft]),Object(v.useEffect)(function(){Ke&&(Ut&&Ke.focus())},[Ke,Ut]),Object(v.useEffect)(function(){if(Or&&Ke){var st=Ke.getScrollerElement();function mt(ut){var xt=ut.target;if(An.current){var Rt=xt.scrollTop/xt.scrollHeight;An.current.scrollTop=An.current.scrollHeight*Rt}}return st.addEventListener("scroll",mt),function(){st.removeEventListener("scroll",mt)}}},[Ke,Or]),Object(v.useEffect)(function(){if(Ke&&wt){function st(mt,ut){wt(mt,ut)}return Ke.on("beforeChange",st),function(){Ke.off("beforeChange",st)}}},[Ke,wt]),Object(v.useEffect)(function(){if(Ke&&pt){function st(){pt(Ke.getValue())}return Ke.on("blur",st),function(){Ke.off("blur",st)}}},[Ke,pt]),Object(v.useEffect)(function(){if(Ke){function st(mt){var ut=mt.getValue();Ar(ut),Zn(new Date().getTime()),mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ze&&ze(ut)}return Ke.on("change",st),function(){Ke.off("change",st)}}},[Ke,ze]),Object(v.useEffect)(function(){Ke&&(Ne==null?(Ke.setValue(""),Ar("")):Ne!==Ke.getValue()&&(Ke.setValue(Ne),Ar(Ne),Ke.setCursor(Ke.lineCount(),0)))},[Ke,Ne]);var Pi=Object(v.useCallback)(function(st){var mt=Ke.getCursor(),ut=Ke.getSelection(),xt=ut.split(`
|
|
`);switch(st){case"bold":return Ke.replaceSelection("**"+ut+"**"),ut===""&&Ke.setCursor(mt.line,mt.ch+2),Ke.focus();case"italic":return Ke.replaceSelection("*"+ut+"*"),ut===""&&Ke.setCursor(mt.line,mt.ch+1),Ke.focus();case"code":return Ke.replaceSelection("`"+ut+"`"),ut===""&&Ke.setCursor(mt.line,mt.ch+1),Ke.focus();case"inline-latex":return Ke.replaceSelection("`$$"+ut+"$$`"),ut===""&&Ke.setCursor(mt.line,mt.ch+3),Ke.focus();case"latex":return Ke.replaceSelection("```latex\n"+ut+"\n```"),Ke.setCursor(mt.line+1,ut.length+1),Ke.focus();case"line-break":return Ke.replaceSelection(`<br/>
|
|
`),Ke.focus();case"list-ul":return ut===""?Ke.replaceSelection("- "+ut):Ke.replaceSelection(xt.map(function(Rt){return Rt===""?"":"- ".concat(Rt)}).join(`
|
|
`)),Ke.focus();case"list-ol":return ut===""?Ke.replaceSelection("1. "+ut):Ke.replaceSelection(xt.map(function(Rt,Pt){return Rt===""?"":"".concat(Pt+1,". ").concat(Rt)}).join(`
|
|
`)),Ke.focus();case"add-null-ch":return ut===""&&Ke.setCursor(mt.line,mt.ch+1),Ke.replaceSelection(de),Ke.focus();case"inster-template-1":return ut===""&&Ke.setCursor(mt.line,mt.ch),Ke.replaceSelection(ee),Ke.focus();case"eraser":return Ke.setValue(""),Ke.focus();case"trigger-watch":return $n(!Or),Ke.focus();case"trigger-full-screen":return Ri(!Rr),Ke.focus();case be:Vr(be);return;case Pe:Vr(Pe);return;case Ce:Vr(Ce);return;case Ue:Vr(Ue);return;default:throw new Error}},[Ke,Or,Rr]),On=Object(v.useCallback)(function(st){Vr("");switch(lr){case be:var mt=st.title,ut=st.link;return Ke.replaceSelection("[".concat(mt,"](").concat(ut,")")),Ke.focus();case Pe:var xt=st.language,Rt=st.content;return Ke.replaceSelection(["```"+xt,Rt,"```"].join(`
|
|
`)),Ke.focus();case Ce:var Pt=st.src,At=st.alt;return At?Ke.replaceSelection(".concat(Pt,' "').concat(At,'" )')):Ke.replaceSelection("")),Ke.focus();case Ue:for(var Yt=st.row,cr=st.col,St=st.align,Wr=`
|
|
`,It=0;It<Yt;It++){for(var fr=[],nr=[],Cr=0;Cr<cr;Cr++)It===1&&nr.push(Be[St]),fr.push(" ");It===1&&(Wr+="| ".concat(nr.join(" | "),` |
|
|
`)),Wr+="| ".concat(fr.join(cr===1?"":" | "),` |
|
|
`)}return Ke.replaceSelection(Wr+`
|
|
`),Ke.focus();default:throw new Error}},[Ke,lr]),qn=Object(v.useMemo)(function(){switch(lr){case be:return m.a.createElement(le,{callback:On,onCancel:Xr});case Pe:return m.a.createElement(ce.b,{callback:On,onCancel:Xr});case Ce:return m.a.createElement(ye,{callback:On,onCancel:Xr});case Ue:return m.a.createElement(Ae,{callback:On,onCancel:Xr});default:return null}},[lr]);function Xr(){Vr("")}Object(v.useEffect)(function(){if(Hr.current){var st=Hr.current,mt=!1,ut=0;function xt(At){mt=!0,ut=At.pageY}function Rt(){mt=!1}function Pt(At){if(mt){var Yt=At.pageY-ut;Yt<0&&(Yt=0),Yt>300&&(Yt=300);var cr=ot+Yt+"px";wn(cr)}}return st.addEventListener("mousedown",xt),document.addEventListener("mousemove",Pt),document.addEventListener("mouseup",Rt),function(){st.removeEventListener("mousedown",xt),document.removeEventListener("mousemove",Pt),document.removeEventListener("mouseup",Rt)}}},[Ke,Hr]),Object(v.useEffect)(function(){wn(ot)},[ot]);var Pr=ne(rt),ei=ne(Ii),Ir={width:Pr,height:ei},ti=Object(v.useMemo)(function(){if(Lr){var st=new Date(Lr),mt=st.getHours(),ut=st.getMinutes(),xt=st.getSeconds();return mt=mt<10?"0"+mt:mt,ut=ut<10?"0"+ut:ut,xt=xt<10?"0"+xt:xt,"".concat(mt,":").concat(ut,":").concat(xt)}return 0},[Lr]);function Ni(){window.sessionStorage.removeItem(dr),Sn(!1),Zn(0)}function un(){Sn(!1),Zn(0),Ke.setValue(window.sessionStorage.getItem(dr))}function ua(st,mt){var ut=Ke.getValue();ut=ut.replace(st,mt),Ar(ut),Ke==null||Ke.setValue(ut)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:jr},m.a.createElement("div",{className:"markdown-editor-container ".concat(We," ").concat(Or?"on-preview":""," ").concat(Lt?"mini":""," ").concat(Rr?"full-screen":""),style:Ir},m.a.createElement(b,{insertTemp:Tt,watch:Or,fullScreen:Rr,showNullButton:Mt,onActionCallback:Pi,hidetoolBar:Ct,uuid:on.current,setOpenPhones:function(){ln.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Br,placeholder:En})),Or?m.a.createElement("div",{ref:An,className:"preview-container"},Er==="stex"&&m.a.createElement(D,{value:an}),Er!=="stex"&&m.a.createElement(S.a,{edit:!0,value:an,replaces:ua})):null))),vt?m.a.createElement("a",{ref:Hr,className:"editor-resize"}):null,m.a.createElement(j.a,null,pe[lr]?m.a.createElement(X.a,{centered:!0,title:pe[lr],visible:!0,onCancel:Xr,footer:null,className:"markdown-popup-form"},qn):null))}},SJMd:function(Ye,we){/**
|
|
* @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,se,X,N=!1,$,H;window.PR_SHOULD_USE_CONTINUATION=!0;var P,K;(function(){var G=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],T=/^(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",x="pun",d="pln",w="tag",y="dec",b="src",j="atn",U="atv",E="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(he){for(var ve=0,Ae=!1,ue=!1,me=0,be=he.length;me<be;++me){var Ce=he[me];if(Ce.ignoreCase)ue=!0;else if(/[a-z]/i.test(Ce.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ae=!0,ue=!1;break}}var Pe={b:8,t:9,n:10,v:11,f:12,r:13};function Ue(Xe){var Me=Xe.charCodeAt(0);if(Me!==92)return Me;var it=Xe.charAt(1);return Me=Pe[it],Me||("0"<=it&&it<="7"?parseInt(Xe.substring(1),8):it==="u"||it==="x"?parseInt(Xe.substring(2),16):Xe.charCodeAt(1))}function He(Xe){if(Xe<32)return(Xe<16?"\\x0":"\\x")+Xe.toString(16);var Me=String.fromCharCode(Xe);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function Be(Xe){var Me=Xe.substring(1,Xe.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")),it=[],qe=Me[0]==="^",de=["["];qe&&de.push("^");for(var ee=qe?1:0,ne=Me.length;ee<ne;++ee){var oe=Me[ee];if(/\\[bdsw]/i.test(oe))de.push(oe);else{var fe=Ue(oe),re;ee+2<ne&&Me[ee+1]==="-"?(re=Ue(Me[ee+2]),ee+=2):re=fe,it.push([fe,re]),re<65||fe>122||(re<65||fe>90||it.push([Math.max(65,fe)|32,Math.min(re,90)|32]),re<97||fe>122||it.push([Math.max(97,fe)&~32,Math.min(re,122)&~32]))}}it.sort(function(xe,Ie){return xe[0]-Ie[0]||Ie[1]-xe[1]});for(var ie=[],pe=[],ee=0;ee<it.length;++ee){var ge=it[ee];ge[0]<=pe[1]+1?pe[1]=Math.max(pe[1],ge[1]):ie.push(pe=ge)}for(var ee=0;ee<ie.length;++ee){var ge=ie[ee];de.push(He(ge[0])),ge[1]>ge[0]&&(ge[1]+1>ge[0]&&de.push("-"),de.push(He(ge[1])))}return de.push("]"),de.join("")}function Qe(Xe){for(var Me=Xe.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")),it=Me.length,qe=[],de=0,ee=0;de<it;++de){var ne=Me[de];if(ne==="(")++ee;else if(ne.charAt(0)==="\\"){var oe=+ne.substring(1);oe&&(oe<=ee?qe[oe]=-1:Me[de]=He(oe))}}for(var de=1;de<qe.length;++de)qe[de]===-1&&(qe[de]=++ve);for(var de=0,ee=0;de<it;++de){var ne=Me[de];if(ne==="(")++ee,qe[ee]||(Me[de]="(?:");else if(ne.charAt(0)==="\\"){var oe=+ne.substring(1);oe&&oe<=ee&&(Me[de]="\\"+qe[oe])}}for(var de=0;de<it;++de)Me[de]==="^"&&Me[de+1]!=="^"&&(Me[de]="");if(Xe.ignoreCase&&Ae)for(var de=0;de<it;++de){var ne=Me[de],fe=ne.charAt(0);ne.length>=2&&fe==="["?Me[de]=Be(ne):fe!=="\\"&&(Me[de]=ne.replace(/[a-zA-Z]/g,function(pe){var ge=pe.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Me.join("")}for(var Ge=[],me=0,be=he.length;me<be;++me){var Ce=he[me];if(Ce.global||Ce.multiline)throw new Error(""+Ce);Ge.push("(?:"+Qe(Ce)+")")}return new RegExp(Ge.join("|"),ue?"gi":"g")}function g(he,ve){var Ae=/(?:^|\s)nocode(?:\s|$)/,ue=[],me=0,be=[],Ce=0;function Pe(Ue){var He=Ue.nodeType;if(He==1){if(Ae.test(Ue.className))return;for(var Be=Ue.firstChild;Be;Be=Be.nextSibling)Pe(Be);var Qe=Ue.nodeName.toLowerCase();(Qe==="br"||Qe==="li")&&(ue[Ce]=`
|
|
`,be[Ce<<1]=me++,be[Ce++<<1|1]=Ue)}else if(He==3||He==4){var Ge=Ue.nodeValue;Ge.length&&(ve?Ge=Ge.replace(/\r\n?/g,`
|
|
`):Ge=Ge.replace(/[ \t\r\n]+/g," "),ue[Ce]=Ge,be[Ce<<1]=me,me+=Ge.length,be[Ce++<<1|1]=Ue)}}return Pe(he),{sourceCode:ue.join("").replace(/\n$/,""),spans:be}}function W(he,ve,Ae,ue,me){if(!Ae)return;var be={sourceNode:he,pre:1,langExtension:null,numberLines:null,sourceCode:Ae,spans:null,basePos:ve,decorations:null};ue(be),me.push.apply(me,be.decorations)}var J=/\S/;function le(he){for(var ve=void 0,Ae=he.firstChild;Ae;Ae=Ae.nextSibling){var ue=Ae.nodeType;ve=ue===1?ve?he:Ae:ue===3&&J.test(Ae.nodeValue)?he:ve}return ve===he?void 0:ve}function ce(he,ve){var Ae={},ue;(function(){for(var Ce=he.concat(ve),Pe=[],Ue={},He=0,Be=Ce.length;He<Be;++He){var Qe=Ce[He],Ge=Qe[3];if(Ge)for(var Xe=Ge.length;--Xe>=0;)Ae[Ge.charAt(Xe)]=Qe;var Me=Qe[1],it=""+Me;Ue.hasOwnProperty(it)||(Pe.push(Me),Ue[it]=null)}Pe.push(/[\0-\uffff]/),ue=I(Pe)})();var me=ve.length,be=function(Ce){for(var Pe=Ce.sourceCode,Ue=Ce.basePos,He=Ce.sourceNode,Be=[Ue,d],Qe=0,Ge=Pe.match(ue)||[],Xe={},Me=0,it=Ge.length;Me<it;++Me){var qe=Ge[Me],de=Xe[qe],ee=void 0,ne;if(typeof de=="string")ne=!1;else{var oe=Ae[qe.charAt(0)];if(oe)ee=qe.match(oe[1]),de=oe[0];else{for(var fe=0;fe<me;++fe)if(oe=ve[fe],ee=qe.match(oe[1]),ee){de=oe[0];break}ee||(de=d)}ne=de.length>=5&&de.substring(0,5)==="lang-",ne&&!(ee&&typeof ee[1]=="string")&&(ne=!1,de=b),ne||(Xe[qe]=de)}var re=Qe;if(Qe+=qe.length,!ne)Be.push(Ue+re,de);else{var ie=ee[1],pe=qe.indexOf(ie),ge=pe+ie.length;ee[2]&&(ge=qe.length-ee[2].length,pe=ge-ie.length);var xe=de.substring(5);W(He,Ue+re,qe.substring(0,pe),be,Be),W(He,Ue+re+pe,ie,Y(xe,ie),Be),W(He,Ue+re+ge,qe.substring(ge),be,Be)}}Ce.decorations=Be};return be}function Re(he){var ve=[],Ae=[];he.tripleQuotedStrings?ve.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):he.multiLineStrings?ve.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ve.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),he.verbatimStrings&&Ae.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ue=he.hashComments;ue&&(he.cStyleComments?(ue>1?ve.push([L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ve.push([L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ae.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ve.push([L,/^#[^\r\n]*/,null,"#"])),he.cStyleComments&&(Ae.push([L,/^\/\/[^\r\n]*/,null]),Ae.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var me=he.regexLiterals;if(me){var be=me>1?"":`
|
|
\r`,Ce=be?".":"[\\S\\s]",Pe="/(?=[^/*"+be+"])(?:[^/\\x5B\\x5C"+be+"]|\\x5C"+Ce+"|\\x5B(?:[^\\x5C\\x5D"+be+"]|\\x5C"+Ce+")*(?:\\x5D|$))+/";Ae.push(["lang-regex",RegExp("^"+M+"("+Pe+")")])}var Ue=he.types;Ue&&Ae.push([A,Ue]);var He=(""+he.keywords).replace(/^ | $/g,"");He.length&&Ae.push([D,new RegExp("^(?:"+He.replace(/[\s,]+/g,"|")+")\\b"),null]),ve.push([d,/^\s+/,null,` \r
|
|
\xA0`]);var Be="^.[^\\s\\w.$@'\"`/\\\\]*";return he.regexLiterals&&(Be+="(?!s*/)"),Ae.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],[x,new RegExp(Be),null]),ce(ve,Ae)}var Ee=Re({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(he,ve,Ae){for(var ue=/(?:^|\s)nocode(?:\s|$)/,me=/\r\n?|\n/,be=he.ownerDocument,Ce=be.createElement("li");he.firstChild;)Ce.appendChild(he.firstChild);var Pe=[Ce];function Ue(Me){var it=Me.nodeType;if(it==1&&!ue.test(Me.className))if(Me.nodeName==="br")He(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var qe=Me.firstChild;qe;qe=qe.nextSibling)Ue(qe);else if((it==3||it==4)&&Ae){var de=Me.nodeValue,ee=de.match(me);if(ee){var ne=de.substring(0,ee.index);Me.nodeValue=ne;var oe=de.substring(ee.index+ee[0].length);if(oe){var fe=Me.parentNode;fe.insertBefore(be.createTextNode(oe),Me.nextSibling)}He(Me),ne||Me.parentNode.removeChild(Me)}}}function He(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function it(ee,ne){var oe=ne?ee.cloneNode(!1):ee,fe=ee.parentNode;if(fe){var re=it(fe,1),ie=ee.nextSibling;re.appendChild(oe);for(var pe=ie;pe;pe=ie)ie=pe.nextSibling,re.appendChild(pe)}return oe}for(var qe=it(Me.nextSibling,0),de;(de=qe.parentNode)&&de.nodeType===1;)qe=de;Pe.push(qe)}for(var Be=0;Be<Pe.length;++Be)Ue(Pe[Be]);ve===(ve|0)&&Pe[0].setAttribute("value",ve);var Qe=be.createElement("ol");Qe.className="linenums";for(var Ge=Math.max(0,ve-1|0)||0,Be=0,Xe=Pe.length;Be<Xe;++Be)Ce=Pe[Be],Ce.className="L"+(Be+Ge)%10,Ce.firstChild||Ce.appendChild(be.createTextNode("\xA0")),Qe.appendChild(Ce);he.appendChild(Qe)}function Te(he){var ve=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ve=ve&&+ve[1]<=8;var Ae=/\n/g,ue=he.sourceCode,me=ue.length,be=0,Ce=he.spans,Pe=Ce.length,Ue=0,He=he.decorations,Be=He.length,Qe=0;He[Be]=me;var Ge,Xe;for(Xe=Ge=0;Xe<Be;)He[Xe]!==He[Xe+2]?(He[Ge++]=He[Xe++],He[Ge++]=He[Xe++]):Xe+=2;for(Be=Ge,Xe=Ge=0;Xe<Be;){for(var Me=He[Xe],it=He[Xe+1],qe=Xe+2;qe+2<=Be&&He[qe+1]===it;)qe+=2;He[Ge++]=Me,He[Ge++]=it,Xe=qe}Be=He.length=Ge;var de=he.sourceNode,ee="";de&&(ee=de.style.display,de.style.display="none");try{for(var ne=null;Ue<Pe;){var oe=Ce[Ue],fe=Ce[Ue+2]||me,re=He[Qe+2]||me,qe=Math.min(fe,re),ie=Ce[Ue+1],pe;if(ie.nodeType!==1&&(pe=ue.substring(be,qe))){ve&&(pe=pe.replace(Ae,"\r")),ie.nodeValue=pe;var ge=ie.ownerDocument,xe=ge.createElement("span");xe.className=He[Qe+1];var Ie=ie.parentNode;Ie.replaceChild(xe,ie),xe.appendChild(ie),be<fe&&(Ce[Ue+1]=ie=ge.createTextNode(ue.substring(qe,fe)),Ie.insertBefore(ie,xe.nextSibling))}be=qe,be>=fe&&(Ue+=2),be>=re&&(Qe+=2)}}finally{de&&(de.style.display=ee)}}var Le={};function ye(he,ve){for(var Ae=ve.length;--Ae>=0;){var ue=ve[Ae];Le.hasOwnProperty(ue)?G.console&&console.warn("cannot override language handler %s",ue):Le[ue]=he}}function Y(he,ve){return he&&Le.hasOwnProperty(he)||(he=/^\s*</.test(ve)?"default-markup":"default-code"),Le[he]}ye(Ee,["default-code"]),ye(ce([],[[d,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ye(ce([[d,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ye(ce([],[[U,/^[\s\S]+/]]),["uq.val"]),ye(Re({keywords:m,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),ye(Re({keywords:"null,true,false"}),["json"]),ye(Re({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),ye(Re({keywords:p,cStyleComments:!0}),["java"]),ye(Re({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(Re({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(Re({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(Re({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(Re({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(Re({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(ce([],[[S,/^[\s\S]+/]]),["regex"]);function _(he){var ve=he.langExtension;try{var Ae=g(he.sourceNode,he.pre),ue=Ae.sourceCode;he.sourceCode=ue,he.spans=Ae.spans,he.basePos=0,Y(ve,ue)(he),Te(he)}catch(me){G.console&&console.log(me&&me.stack||me)}}function k(he,ve,Ae){var ue=Ae||!1,me=ve||null,be=document.createElement("div");be.innerHTML="<pre>"+he+"</pre>",be=be.firstChild,ue&&Oe(be,ue,!0);var Ce={langExtension:me,numberLines:ue,sourceNode:be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return _(Ce),be.innerHTML}function B(he,ve){var Ae=ve||document.body,ue=Ae.ownerDocument||document;function me(oe){return Ae.getElementsByTagName(oe)}for(var be=[me("pre"),me("code"),me("xmp")],Ce=[],Pe=0;Pe<be.length;++Pe)for(var Ue=0,He=be[Pe].length;Ue<He;++Ue)Ce.push(be[Pe][Ue]);be=null;var Be=Date;Be.now||(Be={now:function(){return+new Date}});var Qe=0,Ge=/\blang(?:uage)?-([\w.]+)(?!\S)/,Xe=/\bprettyprint\b/,Me=/\bprettyprinted\b/,it=/pre|xmp/i,qe=/^code$/i,de=/^(?:pre|code|xmp)$/i,ee={};function ne(){for(var oe=G.PR_SHOULD_USE_CONTINUATION?Be.now()+250:Infinity;Qe<Ce.length&&Be.now()<oe;Qe++){for(var fe=Ce[Qe],re=ee,ie=fe;ie=ie.previousSibling;){var pe=ie.nodeType,ge=(pe===7||pe===8)&&ie.nodeValue;if(ge?!/^\??prettify\b/.test(ge):pe!==3||/\S/.test(ie.nodeValue))break;if(ge){re={},ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ft,Tt,sr){re[Tt]=sr});break}}var xe=fe.className;if((re!==ee||Xe.test(xe))&&!Me.test(xe)){for(var Ie=!1,Ne=fe.parentNode;Ne;Ne=Ne.parentNode){var ze=Ne.tagName;if(de.test(ze)&&Ne.className&&Xe.test(Ne.className)){Ie=!0;break}}if(!Ie){fe.className+=" prettyprinted";var et=re.lang;if(!et){et=xe.match(Ge);var rt;!et&&(rt=le(fe))&&qe.test(rt.tagName)&&(et=rt.className.match(Ge)),et&&(et=et[1])}var yt;if(it.test(fe.tagName))yt=1;else{var ot=fe.currentStyle,at=ue.defaultView,Lt=ot?ot.whiteSpace:at&&at.getComputedStyle?at.getComputedStyle(fe,null).getPropertyValue("white-space"):0;yt=Lt&&Lt.substring(0,3)==="pre"}var _t=re.linenums;(_t=_t==="true"||+_t)||(_t=xe.match(/\blinenums\b(?::(\d+))?/),_t=_t?_t[1]&&_t[1].length?+_t[1]:!0:!1),_t&&Oe(fe,_t,yt);var Ut={langExtension:et,sourceNode:fe,numberLines:_t,pre:yt,sourceCode:null,basePos:null,spans:null,decorations:null};_(Ut)}}}Qe<Ce.length?G.setTimeout(ne,250):typeof he=="function"&&he()}ne()}var Z=G.PR={createSimpleLexer:ce,registerLangHandler:ye,sourceDecorator:Re,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:U,PR_COMMENT:L,PR_DECLARATION:y,PR_KEYWORD:D,PR_LITERAL:C,PR_NOCODE:E,PR_PLAIN:d,PR_PUNCTUATION:x,PR_SOURCE:b,PR_STRING:S,PR_TAG:w,PR_TYPE:A,prettyPrintOne:N?G.prettyPrintOne=k:P=k,prettyPrint:K=N?G.prettyPrint=B:K=B},z=G.define;typeof z=="function"&&z.amd&&z("google-code-prettify",[],function(){return Z})})()},STEk:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return ye});/*! *****************************************************************************
|
|
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 se=function(Y,_){return(se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,B){k.__proto__=B}||function(k,B){for(var Z in B)Object.prototype.hasOwnProperty.call(B,Z)&&(k[Z]=B[Z])})(Y,_)};function X(Y,_){function k(){this.constructor=Y}se(Y,_),Y.prototype=_===null?Object.create(_):(k.prototype=_.prototype,new k)}function N(Y,_,k,B){return new(k||(k=Promise))(function(Z,z){function he(ue){try{Ae(B.next(ue))}catch(me){z(me)}}function ve(ue){try{Ae(B.throw(ue))}catch(me){z(me)}}function Ae(ue){var me;ue.done?Z(ue.value):(me=ue.value,me instanceof k?me:new k(function(be){be(me)})).then(he,ve)}Ae((B=B.apply(Y,_||[])).next())})}function $(Y,_){var k,B,Z,z,he={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return z={next:ve(0),throw:ve(1),return:ve(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function ve(Ae){return function(ue){return function(me){if(k)throw new TypeError("Generator is already executing.");for(;he;)try{if(k=1,B&&(Z=2&me[0]?B.return:me[0]?B.throw||((Z=B.return)&&Z.call(B),0):B.next)&&!(Z=Z.call(B,me[1])).done)return Z;switch(B=0,Z&&(me=[2&me[0],Z.value]),me[0]){case 0:case 1:Z=me;break;case 4:return he.label++,{value:me[1],done:!1};case 5:he.label++,B=me[1],me=[0];continue;case 7:me=he.ops.pop(),he.trys.pop();continue;default:if(!(Z=he.trys,(Z=Z.length>0&&Z[Z.length-1])||me[0]!==6&&me[0]!==2)){he=0;continue}if(me[0]===3&&(!Z||me[1]>Z[0]&&me[1]<Z[3])){he.label=me[1];break}if(me[0]===6&&he.label<Z[1]){he.label=Z[1],Z=me;break}if(Z&&he.label<Z[2]){he.label=Z[2],he.ops.push(me);break}Z[2]&&he.ops.pop(),he.trys.pop();continue}me=_.call(Y,he)}catch(be){me=[6,be],B=0}finally{k=Z=0}if(5&me[0])throw me[1];return{value:me[0]?me[1]:void 0,done:!0}}([Ae,ue])}}}function H(){for(var Y=0,_=0,k=arguments.length;_<k;_++)Y+=arguments[_].length;var B=Array(Y),Z=0;for(_=0;_<k;_++)for(var z=arguments[_],he=0,ve=z.length;he<ve;he++,Z++)B[Z]=z[he];return B}var P=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(_,k){for(var B=0,Z=k;B<Z.length;B++){var z=Z[B],he=z[0],ve=z[1];_.setAttribute(he,ve)}},Y.createRect=function(_,k,B){var Z=document.createElementNS("http://www.w3.org/2000/svg","rect");return Z.setAttribute("width",_.toString()),Z.setAttribute("height",k.toString()),B&&Y.setAttributes(Z,B),Z},Y.createLine=function(_,k,B,Z,z){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",_.toString()),he.setAttribute("y1",k.toString()),he.setAttribute("x2",B.toString()),he.setAttribute("y2",Z.toString()),z&&Y.setAttributes(he,z),he},Y.createPolygon=function(_,k){var B=document.createElementNS("http://www.w3.org/2000/svg","polygon");return B.setAttribute("points",_),k&&Y.setAttributes(B,k),B},Y.createCircle=function(_,k){var B=document.createElementNS("http://www.w3.org/2000/svg","circle");return B.setAttribute("cx",(_/2).toString()),B.setAttribute("cy",(_/2).toString()),B.setAttribute("r",_.toString()),k&&Y.setAttributes(B,k),B},Y.createEllipse=function(_,k,B){var Z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Z.setAttribute("cx",(_/2).toString()),Z.setAttribute("cy",(k/2).toString()),Z.setAttribute("rx",(_/2).toString()),Z.setAttribute("ry",(k/2).toString()),B&&Y.setAttributes(Z,B),Z},Y.createGroup=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return _&&Y.setAttributes(k,_),k},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(_,k,B,Z,z,he,ve){var Ae=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(Ae,[["id",_],["orient",k],["markerWidth",B.toString()],["markerHeight",Z.toString()],["refX",z.toString()],["refY",he.toString()]]),Ae.appendChild(ve),Ae},Y.createText=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),_&&Y.setAttributes(k,_),k},Y.createTSpan=function(_,k){var B=document.createElementNS("http://www.w3.org/2000/svg","tspan");return B.textContent=_,k&&Y.setAttributes(B,k),B},Y.createImage=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&Y.setAttributes(k,_),k},Y.createPoint=function(_,k){var B=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return B.x=_,B.y=k,B},Y.createPath=function(_,k){var B=document.createElementNS("http://www.w3.org/2000/svg","path");return B.setAttribute("d",_),k&&Y.setAttributes(B,k),B},Y}(),K=function(){function Y(){}return Y.addKey=function(_){Y.key=_},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),G=function(){function Y(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Y.prototype.rasterize=function(_,k,B){var Z=this;return new Promise(function(z){var he=B!==void 0?B:document.createElement("canvas");_===null&&(Z.markersOnly=!0,Z.naturalSize=!1);var ve=document.createElementNS("http://www.w3.org/2000/svg","svg");ve.setAttribute("xmlns","http://www.w3.org/2000/svg"),ve.setAttribute("width",k.width.baseVal.valueAsString),ve.setAttribute("height",k.height.baseVal.valueAsString),ve.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),ve.innerHTML=k.innerHTML,Z.naturalSize===!0?(ve.width.baseVal.value=_.naturalWidth,ve.height.baseVal.value=_.naturalHeight):Z.width!==void 0&&Z.height!==void 0&&(ve.width.baseVal.value=Z.width,ve.height.baseVal.value=Z.height),he.width=ve.width.baseVal.value,he.height=ve.height.baseVal.value;var Ae=ve.outerHTML,ue=he.getContext("2d");Z.markersOnly!==!0&&ue.drawImage(_,0,0,he.width,he.height);var me=window.URL,be=new Image(he.width,he.height);be.setAttribute("crossOrigin","anonymous");var Ce=new Blob([Ae],{type:"image/svg+xml"}),Pe=me.createObjectURL(Ce);be.onload=function(){ue.drawImage(be,0,0),me.revokeObjectURL(Pe);var Ue=he.toDataURL(Z.imageType,Z.imageQuality);z(Ue)},be.src=Pe})},Y}(),r=function(){},R=function(){function Y(_){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+_+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(_){return this.styleSheet===void 0&&this.addStyleSheet(),_.name=""+this.classNamePrefix+_.localName,this.classes.push(_),this.styleSheet.sheet.insertRule("."+_.name+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length),_},Y.prototype.addRule=function(_){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(_),this.styleSheet.sheet.insertRule(_.selector+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var _;this.styleSheet=document.createElement("style"),((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).appendChild(this.styleSheet),this.addRule(new v("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new m("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new m("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Y.prototype.removeStyleSheet=function(){var _;this.styleSheet&&(((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),v=function(Y,_){this.selector=Y,this.style=_},m=function(Y,_){this.localName=Y,this.style=_},p=function(){function Y(_,k,B,Z,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=_,this.displayMode=k,this.markerItems=B,this.uiStyleSettings=Z,this.styles=z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Y.prototype.show=function(_){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var B=document.createElement("div");B.className=this.toolbarBlockStyleClass.name,B.style.whiteSpace="nowrap",this.uiContainer.appendChild(B),this.addActionButton(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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(z){var he=document.createElement("div");he.className=""+k.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",z.typeName),he.innerHTML=z.icon,he.addEventListener("click",function(){k.markerToolbarButtonClicked(he,z)}),k.buttons.push(he),k.markerButtons.push(he)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Z=document.createElement("div");Z.className=this.toolbarBlockStyleClass.name,Z.style.whiteSpace="nowrap",Z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Z),this.addActionButton(Z,'<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(Z,'<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()},Y.prototype.addButtonClickListener=function(_){this.buttonClickListeners.push(_)},Y.prototype.removeButtonClickListener=function(_){this.buttonClickListeners.indexOf(_)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(_),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var _=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<_||k===_&&this.markerButtons.length-1===_?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===_&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},Y.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")},Y.prototype.resetButtonStyles=function(){var _=this;this.buttons.forEach(function(k){k.className=k.className.replace(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:_.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name)})},Y.prototype.addActionButton=function(_,k,B){var Z=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=k,z.setAttribute("data-action",B),z.addEventListener("click",function(){Z.actionToolbarButtonClicked(z,B)}),B){case"select":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":z.style.fill=this.uiStyleSettings.closeButtonColor}_.appendChild(z),this.buttons.push(z)},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new m("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 m("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new m("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new m("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 m("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new m("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
padding: `+_+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new m("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new m("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Y.prototype.markerToolbarButtonClicked=function(_,k){this.setActiveButton(_),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(_,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(_){this.resetButtonStyles(),_.className=_.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),_.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(_){var k=this.markerButtons.find(function(B){return B.getAttribute("data-type-name")===_});k&&this.setActiveButton(k)},Y.prototype.setCurrentMarker=function(_){var k=this;this.currentMarker=_,this.buttons.filter(function(B){return/delete|notes/.test(B.getAttribute("data-action"))}).forEach(function(B){k.currentMarker===void 0?(B.style.fillOpacity="0.4",B.style.pointerEvents="none"):(B.style.fillOpacity="1",B.style.pointerEvents="all")})},Y}(),h=function(){function Y(_,k,B,Z){this.panels=[],this.panelButtons=[],this.markerjsContainer=_,this.displayMode=k,this.uiStyleSettings=B,this.styles=Z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var _;this.toolboxStyleClass=this.styles.addClass(new m("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 m("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new m("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new m("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new m("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 m("toolbox-panel-row_colors",`
|
|
background-color: `+((_=this.uiStyleSettings.toolboxBackgroundColor)!==null&&_!==void 0?_:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new m("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 m("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new m("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Y.prototype.show=function(_){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(_){var k,B,Z=this;this.panels=_,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+" "+((B=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var he;z.uiStyleSettings=Z.uiStyleSettings;var ve=document.createElement("div");ve.className=Z.toolboxButtonStyleClass.name+" "+((he=Z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:Z.toolboxButtonStyleColorsClass.name),ve.innerHTML=z.icon,ve.title=z.title,ve.addEventListener("click",function(){Z.panelButtonClick(z)}),Z.panelButtons.push(ve),Z.buttonRow.appendChild(ve)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(_){var k=this,B=-1;if(_!==this.activePanel){B=this.panels.indexOf(_),this.panelRow.innerHTML="";var Z=_.getUi();Z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Z),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=_}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(z,he){var ve,Ae;z.className=k.toolboxButtonStyleClass.name+" "+(he===B?""+((ve=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ve!==void 0?ve:k.toolboxActiveButtonStyleColorsClass.name):""+((Ae=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:k.toolboxButtonStyleColorsClass.name))})},Y}(),o=function(Y,_){this.title=Y,this.icon=_},f=function(Y){function _(k,B,Z,z){var he=Y.call(this,k,z||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=B,he.currentColor=Z,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return X(_,Y),_.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.whiteSpace="nowrap",this.colors.forEach(function(Z){var z=k.getColorBox(Z);B.appendChild(z),k.colorBoxes.push(z)}),B},_.prototype.getColorBox=function(k){var B=this,Z=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-Z,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=z-2+"px",he.style.height=z-2+"px",he.style.padding="1px",he.style.marginRight="2px",he.style.marginBottom="2px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderRadius=(z+2)/2+"px",he.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){B.setCurrentColor(k,he)});var ve=document.createElement("div");return ve.style.display="inline-block",ve.style.width=z-2+"px",ve.style.height=z-2+"px",ve.style.backgroundColor=k,ve.style.borderRadius=z/2+"px",k==="transparent"&&(ve.style.fill=this.uiStyleSettings.toolboxAccentColor,ve.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),he.appendChild(ve),he},_.prototype.setCurrentColor=function(k,B){var Z=this;this.currentColor=k,this.colorBoxes.forEach(function(z){z.style.borderColor=z===B?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},_}(o),l=function(){function Y(_,k,B){this._state="new",this._isSelected=!1,this._container=_,this._overlayContainer=k,this.globalSettings=B,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(_){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(_,k){},Y.prototype.dblClick=function(_,k){},Y.prototype.manipulate=function(_){},Y.prototype.pointerUp=function(_){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(_){this.container.childNodes.length>0?this.container.insertBefore(_,this.container.childNodes[0]):this.container.appendChild(_)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(_){this._state=_.state,this.notes=_.notes},Y.prototype.scale=function(_,k){},Y.prototype.colorChanged=function(_){this.onColorChanged&&this.onColorChanged(_),this.stateChanged()},Y.prototype.fillColorChanged=function(_){this.onFillColorChanged&&this.onFillColorChanged(_),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var _=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),_.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(_)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),u=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(_){return this.topLeft.ownsTarget(_)?this.topLeft:this.topCenter.ownsTarget(_)?this.topCenter:this.topRight.ownsTarget(_)?this.topRight:this.centerLeft.ownsTarget(_)?this.centerLeft:this.centerRight.ownsTarget(_)?this.centerRight:this.bottomLeft.ownsTarget(_)?this.bottomLeft:this.bottomCenter.ownsTarget(_)?this.bottomCenter:this.bottomRight.ownsTarget(_)?this.bottomRight:void 0},Y}(),s=function(){function Y(){this.GRIP_SIZE=10,this.visual=P.createGroup(),this.visual.appendChild(P.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(P.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},Y}(),a=function(){function Y(){}return Y.toITransformMatrix=function(_){return{a:_.a,b:_.b,c:_.c,d:_.d,e:_.e,f:_.f}},Y.toSVGMatrix=function(_,k){return _.a=k.a,_.b=k.b,_.c=k.c,_.d=k.d,_.e=k.e,_.f=k.f,_},Y}(),O=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(P.createTransform()),z.setupControlBox(),z}return X(_,Y),Object.defineProperty(_.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var B=P.createTransform();this._visual.transform.baseVal.appendItem(B)},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),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 Z=this.unrotatePoint(k);if(this.manipulationStartX=Z.x,this.manipulationStartY=Z.y,this.offsetX=Z.x-this.left,this.offsetY=Z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(B),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var he=this.container.transform.baseVal.getItem(0);he.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(he,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},_.prototype.pointerUp=function(k){var B=this.state;Y.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",B==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},_.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},_.prototype.manipulate=function(k){var B=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(B.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(B.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(B):this.state==="rotate"&&this.rotate(k)},_.prototype.resize=function(k){var B=this.manipulationStartLeft,Z=this.manipulationStartWidth,z=this.manipulationStartTop,he=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:B=this.manipulationStartLeft+k.x-this.manipulationStartX,Z=this.manipulationStartWidth+this.manipulationStartLeft-B;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Z=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+k.y-this.manipulationStartY,he=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+k.y-this.manipulationStartY}Z>=0?(this.left=B,this.width=Z):(this.left=B+Z,this.width=-Z),he>=0?(this.top=z,this.height=he):(this.top=z+he,this.height=-he),this.setSize()},_.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},_.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var B=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*B,this.applyRotation()}},_.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)},_.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var B=this.container.getCTM(),Z=P.createPoint(k.x,k.y);return{x:(Z=Z.matrixTransform(B)).x,y:Z.y}},_.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var B=this.container.getCTM();B=B.inverse();var Z=P.createPoint(k.x,k.y);return{x:(Z=Z.matrixTransform(B)).x,y:Z.y}},_.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=P.createGroup();var k=P.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=P.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=P.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 u,this.addControlGrips(),this.controlBox.style.display="none"},_.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()},_.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()},_.prototype.createGrip=function(){var k=new s;return k.visual.transform.baseVal.appendItem(P.createTransform()),this.controlBox.appendChild(k.visual),k},_.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,B=-k/2,Z=B,z=(this.width+this.CB_DISTANCE)/2-k/2,he=(this.height+this.CB_DISTANCE)/2-k/2,ve=this.height+this.CB_DISTANCE-k/2,Ae=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,B,Z),this.positionGrip(this.controlGrips.topCenter.visual,z,Z),this.positionGrip(this.controlGrips.topRight.visual,Ae,Z),this.positionGrip(this.controlGrips.centerLeft.visual,B,he),this.positionGrip(this.controlGrips.centerRight.visual,Ae,he),this.positionGrip(this.controlGrips.bottomLeft.visual,B,ve),this.positionGrip(this.controlGrips.bottomCenter.visual,z,ve),this.positionGrip(this.controlGrips.bottomRight.visual,Ae,ve),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,Z-3*this.CB_DISTANCE)},_.prototype.positionGrip=function(k,B,Z){var z=k.transform.baseVal.getItem(0);z.setTranslate(B,Z),k.transform.baseVal.replaceItem(z,0)},_.prototype.hideControlBox=function(){this.controlBox.style.display="none"},_.prototype.showControlBox=function(){this.controlBox.style.display=""},_.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:a.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:a.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},_.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var B=k;this.left=B.left,this.top=B.top,this.width=B.width,this.height=B.height,this.rotationAngle=B.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,B.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,B.containerTransformMatrix))},_.prototype.scale=function(k,B){Y.prototype.scale.call(this,k,B);var Z=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:Z.x*k,y:Z.y*B});this.left=z.x,this.top=z.y,this.width=this.width*k,this.height=this.height*B,this.adjustControlBox()},_}(l),T=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return X(_,Y),_.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},_.prototype.createVisual=function(){this.visual=P.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)},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},_.prototype.setSize=function(){Y.prototype.setSize.call(this),P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&P.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},_.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&P.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&P.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&P.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},_.prototype.restoreState=function(k){var B=k;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,B){Y.prototype.scale.call(this,k,B),this.setSize()},_.title="Rectangle marker",_}(O),S=function(Y){function _(k,B,Z,z){var he=Y.call(this,k,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return he.widths=[],he.widthBoxes=[],he.widths=B,he.currentWidth=Z,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return X(_,Y),_.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.widths.forEach(function(Z){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=Z===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){k.setCurrentWidth(Z,z)}),B.appendChild(z);var he=document.createElement("div");he.innerText=Z.toString(),he.style.marginRight="5px",z.appendChild(he);var ve=document.createElement("div");ve.style.minHeight="20px",ve.style.flexGrow="2",ve.style.display="flex",ve.style.alignItems="center";var Ae=document.createElement("hr");Ae.style.minWidth="20px",Ae.style.border="0px",Ae.style.borderTop=Z+"px solid "+k.uiStyleSettings.toolboxColor,Ae.style.flexGrow="2",ve.appendChild(Ae),z.appendChild(ve),k.widthBoxes.push(z)}),B},_.prototype.setCurrentWidth=function(k,B){var Z=this;this.currentWidth=k,this.widthBoxes.forEach(function(z){z.style.borderColor=z===B?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},_}(o),D=function(Y){function _(k,B,Z,z){var he=Y.call(this,k,z||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return he.styles=[],he.styleBoxes=[],he.styles=B,he.currentStyle=Z,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return X(_,Y),_.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.styles.forEach(function(Z){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/k.styles.length-5+"%",z.style.borderColor=Z===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){k.setCurrentStyle(Z,z)}),B.appendChild(z);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var ve=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Z!==""?'stroke-dasharray="'+Z+'"':"")+` />
|
|
</svg>`;he.innerHTML=ve,z.appendChild(he),k.styleBoxes.push(z)}),B},_.prototype.setCurrentStyle=function(k,B){var Z=this;this.currentStyle=k,this.styleBoxes.forEach(function(z){z.style.borderColor=z===B?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},_}(o),L=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.strokeColor=Z.defaultColor,z.strokeWidth=Z.defaultStrokeWidth,z.strokeDasharray=Z.defaultStrokeDasharray,z.strokePanel=new f("Line color",Z.defaultColorSet,Z.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new S("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new D("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return X(_,Y),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="FrameMarker",_.title="Frame marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',_}(T),A=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},C=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return X(_,Y),_.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),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(B)?this.activeGrip=this.grip1:this.grip2.ownsTarget(B)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},_.prototype.pointerUp=function(k){var B=this.state;Y.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",B==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},_.prototype.adjustVisual=function(){},_.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)},_.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()},_.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=P.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){this.positionGrips()},_.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},_.prototype.createGrip=function(){var k=new s;return k.visual.transform.baseVal.appendItem(P.createTransform()),this.controlBox.appendChild(k.visual),k},_.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)},_.prototype.positionGrip=function(k,B,Z){var z=k.transform.baseVal.getItem(0);z.setTranslate(B,Z),k.transform.baseVal.replaceItem(z,0)},_.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},_.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var B=k;this.x1=B.x1,this.y1=B.y1,this.x2=B.x2,this.y2=B.y2},_.prototype.scale=function(k,B){Y.prototype.scale.call(this,k,B),this.x1=this.x1*k,this.y1=this.y1*B,this.x2=this.x2*k,this.y2=this.y2*B,this.adjustVisual(),this.adjustControlBox()},_}(l),x=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=Z.defaultColor,z.strokeWidth=Z.defaultStrokeWidth,z.strokeDasharray=Z.defaultStrokeDasharray,z.strokePanel=new f("Line color",Z.defaultColorSet,Z.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new S("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new D("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return X(_,Y),_.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},_.prototype.createVisual=function(){this.visual=P.createGroup(),this.selectorLine=P.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=P.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)},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},_.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()),P.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),P.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),P.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var B=k;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.createVisual(),this.adjustVisual()},_.typeName="LineMarker",_.title="Line marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',_}(C),d=function(Y){function _(k,B,Z,z){var he=Y.call(this,k,z||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return he.fonts=[],he.fontBoxes=[],he.fonts=B,he.currentFont=Z,he.setCurrentFont=he.setCurrentFont.bind(he),he}return X(_,Y),_.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.flexGrow="2",this.fonts.forEach(function(Z){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/k.fonts.length-5+"%",z.style.borderColor=Z===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){k.setCurrentFont(Z,z)}),B.appendChild(z);var he=document.createElement("div");he.style.display="flex",he.style.minHeight="20px",he.style.flexGrow="2",he.style.fontFamily=Z,he.style.overflow="hidden";var ve=document.createElement("div");ve.style.whiteSpace="nowrap",ve.style.overflow="hidden",ve.style.textOverflow="ellipsis",ve.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(ve),z.appendChild(he),k.fontBoxes.push(z)}),B},_.prototype.setCurrentFont=function(k,B){var Z=this;this.currentFont=k,this.fontBoxes.forEach(function(z){z.style.borderColor=z===B?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},_}(o),w=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=Z.defaultColor,z.fontFamily=Z.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new f("Color",Z.defaultColorSet,Z.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new d("Font",Z.defaultFontFamilies,Z.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return X(_,Y),_.prototype.ownsTarget=function(k){if(Y.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var B=!1;return this.textElement.childNodes.forEach(function(Z){Z===k&&(B=!0)}),B},_.prototype.createVisual=function(){this.visual=P.createGroup(),this.bgRectangle=P.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=P.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(P.createTransform()),this.textElement.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.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(B){k.textElement.appendChild(P.createTSpan(B.trim()===""?" ":B.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},_.prototype.getTextScale=function(){var k=this.textElement.getBBox(),B=1;if(k.width>0&&k.height>0){var Z=(1*this.width-this.width*this.padding*2/100)/k.width,z=(1*this.height-this.height*this.padding*2/100)/k.height;B=Math.min(Z,z)}return B},_.prototype.getTextPosition=function(k){var B=this.textElement.getBBox(),Z=0,z=0;return B.width>0&&B.height>0&&(Z=(this.width-B.width*k)/2,z=this.height/2-B.height*k/2),{x:Z,y:z}},_.prototype.sizeText=function(){var k=this.textElement.getBBox(),B=this.getTextScale(),Z=this.getTextPosition(B);Z.y-=k.y*B,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Z.x+"px, "+Z.y+"px) scale("+B+", "+B+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Z.x,Z.y),this.textElement.transform.baseVal.getItem(1).setScale(B,B))},_.prototype.manipulate=function(k){Y.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)},_.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},_.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},_.prototype.pointerUp=function(k){var B=this.state;B==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,k),this.setSize(),(B==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},_.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(B){B.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var B=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&B>.9;)B-=.1,k.textEditor.style.fontSize=Math.max(B,.9)+"em"}),this.textEditor.addEventListener("keyup",function(B){B.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(B){if(B.clipboardData){var Z=B.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(Z)),B.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")},_.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),B=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Z=this.textElement.getBBox(),z={x:Z.width*k,y:Z.height*k};B.x-=z.x/2,B.y-=z.y/2,this.textEditor.style.top=B.y+"px",this.textEditor.style.left=B.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-B.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},_.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()},_.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},_.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},_.prototype.dblClick=function(k,B){Y.prototype.dblClick.call(this,k,B),this.showTextEditor()},_.prototype.setColor=function(k){this.textElement&&P.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},_.prototype.setFont=function(k){this.textElement&&P.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},_.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},_.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var B=k;this.color=B.color,this.fontFamily=B.fontFamily,this.padding=B.padding,this.text=B.text,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,B){Y.prototype.scale.call(this,k,B),this.setSize(),this.sizeText(),this.positionTextEditor()},_.typeName="TextMarker",_.title="Text marker",_.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',_}(O),y=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=Z.defaultColor,z.lineWidth=Z.defaultStrokeWidth,z.pixelRatio=Z.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new f("Color",Z.defaultColorSet,Z.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new S("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return X(_,Y),_.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},_.prototype.createVisual=function(){this.visual=P.createGroup(),this.drawingImage=P.createImage(),this.visual.appendChild(this.drawingImage);var k=P.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(k,B){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):Y.prototype.pointerDown.call(this,k,B)},_.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){Y.prototype.resize.call(this,k),P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,k)},_.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)},_.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},_.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},_.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),B=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Z=B[0],z=B[1],he=B[2],ve=B[3],Ae=!1,ue=0;ue<this.canvasElement.height;ue++)for(var me=0;me<this.canvasElement.width;me++)k.data[ue*this.canvasElement.width*4+4*me+3]>0&&(Ae=!0,ue<z&&(z=ue),me<Z&&(Z=me),ue>ve&&(ve=ue),me>he&&(he=me));if(Ae){this.left=Z/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(he-Z)/this.pixelRatio,this.height=(ve-z)/this.pixelRatio;var be=document.createElement("canvas");be.width=he-Z,be.height=ve-z,be.getContext("2d").putImageData(this.canvasContext.getImageData(Z,z,he-Z,ve-z),0,0),this.drawingImgUrl=be.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},_.prototype.setDrawingImage=function(){P.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},_.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},_.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){this.createVisual(),Y.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},_.prototype.scale=function(k,B){Y.prototype.scale.call(this,k,B),this.setDrawingImage()},_.typeName="FreehandMarker",_.title="Freehand marker",_.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',_}(O),b=function(Y){function _(k,B,Z){var z=Y.call(this,k,Z||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return z.typeBoxes=[],z.currentType=B,z.setCurrentType=z.setCurrentType.bind(z),z}return X(_,Y),_.prototype.getUi=function(){var k=this,B=document.createElement("div");B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2";for(var Z=function(ve){var Ae="both";switch(ve){case 0:Ae="both";break;case 1:Ae="start";break;case 2:Ae="end";break;case 3:Ae="none"}var ue=document.createElement("div");if(ue.style.display="flex",ue.style.flexGrow="2",ue.style.alignItems="center",ue.style.justifyContent="space-between",ue.style.padding="5px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderColor=Ae===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){k.setCurrentType(Ae,ue)}),B.appendChild(ue),Ae==="both"||Ae==="start"){var me=document.createElement("div");me.style.display="flex",me.style.alignItems="center",me.style.minHeight="20px",me.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,me.style.marginLeft="5px",ue.appendChild(me)}var be=document.createElement("div");be.style.display="flex",be.style.alignItems="center",be.style.minHeight="20px",be.style.flexGrow="2";var Ce=document.createElement("hr");if(Ce.style.minWidth="20px",Ce.style.border="0px",Ce.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),Ce.style.flexGrow="2",be.appendChild(Ce),ue.appendChild(be),Ae==="both"||Ae==="end"){var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.alignItems="center",Pe.style.minHeight="20px",Pe.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Pe.style.marginRight="5px",ue.appendChild(Pe)}z.typeBoxes.push(ue)},z=this,he=0;he<4;he++)Z(he);return B},_.prototype.setCurrentType=function(k,B){var Z=this;this.currentType=k,this.typeBoxes.forEach(function(z){z.style.borderColor=z===B?Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},_}(o),j=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new b("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return X(_,Y),_.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},_.prototype.getArrowPoints=function(k,B){var Z=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return k-Z/2+","+(B+z/2)+" "+k+","+(B-z/2)+" "+(k+Z/2)+","+(B+z/2)},_.prototype.createTips=function(){this.arrow1=P.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=P.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.arrow2)},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(Y.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",P.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),P.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),B=this.arrow1.transform.baseVal.getItem(0);B.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(B,0);var Z=this.arrow2.transform.baseVal.getItem(0);Z.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Z,0)}},_.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var B=k;this.arrowType=B.arrowType,this.createTips(),this.adjustVisual()},_.typeName="ArrowMarker",_.title="Arrow marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',_}(x),U=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.fillColor=Z.defaultFillColor,z.strokeWidth=0,z.fillPanel=new f("Color",Z.defaultColorSet,Z.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return X(_,Y),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="CoverMarker",_.title="Cover marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',_}(T),E=function(Y){function _(k,B,Z,z){var he=Y.call(this,k,z||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return he.opacities=[],he.opacityBoxes=[],he.opacities=B,he.currentOpacity=Z,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return X(_,Y),_.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",B.style.justifyContent="space-between",this.opacities.forEach(function(Z){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=Z===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){k.setCurrentOpacity(Z,z)}),B.appendChild(z);var he=document.createElement("div");he.innerText=100*Z+"%",z.appendChild(he),k.opacityBoxes.push(z)}),B},_.prototype.setCurrentOpacity=function(k,B){var Z=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===B?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},_}(o),M=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=Z.defaultHighlightColor,z.strokeWidth=0,z.opacity=Z.defaultHighlightOpacity,z.fillPanel=new f("Color",Z.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new E("Opacity",Z.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return X(_,Y),_.prototype.setOpacity=function(k){this.opacity=k,this.visual&&P.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="HighlightMarker",_.title="Highlight marker",_.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>',_}(U),I='<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>',g=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=Z.defaultStrokeColor,z.bgColor=Z.defaultFillColor,z.fontFamily=Z.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new f("Text color",Z.defaultColorSet,z.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>'),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new f("Fill color",Z.defaultColorSet,z.bgColor,I),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new d("Font",Z.defaultFontFamilies,Z.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new s,z.tipGrip.visual.transform.baseVal.appendItem(P.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return X(_,Y),_.prototype.ownsTarget=function(k){return Y.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},_.prototype.createTip=function(){P.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=P.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},_.prototype.pointerDown=function(k,B){this.state==="new"&&Y.prototype.pointerDown.call(this,k,B),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(B)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,k,B)},_.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,k);else{var B=this.state==="creating";Y.prototype.pointerUp.call(this,k),this.setTipPoints(B),this.positionTip()}},_.prototype.manipulate=function(k){if(this.tipMoving){var B=this.unrotatePoint(k);this.tipPosition={x:B.x-this.manipulationStartLeft,y:B.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,k)},_.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(P.setAttributes(this.bgRectangle,[["fill",k]]),P.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},_.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},_.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var B=Math.min(this.height/2,15),Z=this.height/5;k&&(this.tipPosition={x:B+Z/2,y:this.height+20});var z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Z=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:0},this.tipBase2Position={x:B+Z,y:0}):(this.tipBase1Position={x:0,y:B},this.tipBase2Position={x:0,y:B+Z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Z=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-Z,y:0},this.tipBase2Position={x:this.width-B,y:0}):(this.tipBase1Position={x:this.width,y:B},this.tipBase2Position={x:this.width,y:B+Z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Z=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-Z,y:this.height},this.tipBase2Position={x:this.width-B,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-B-Z},this.tipBase2Position={x:this.width,y:this.height-B}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Z=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:this.height},this.tipBase2Position={x:B+Z,y:this.height}):(this.tipBase1Position={x:0,y:this.height-B},this.tipBase2Position={x:0,y:this.height-B-Z})},_.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.positionTip()},_.prototype.positionTip=function(){P.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(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.select=function(){this.positionTip(),Y.prototype.select.call(this)},_.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Y.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var B=k;this.bgColor=B.bgColor,this.tipPosition=B.tipPosition,Y.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},_.prototype.scale=function(k,B){Y.prototype.scale.call(this,k,B),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*B},this.positionTip()},_.typeName="CalloutMarker",_.title="Callout marker",_.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>',_}(w),W=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=Z.defaultColor,z.strokeWidth=Z.defaultStrokeWidth,z.strokeDasharray=Z.defaultStrokeDasharray,z.fillColor=Z.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new f("Line color",H(Z.defaultColorSet,["transparent"]),Z.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new f("Fill color",H(Z.defaultColorSet,["transparent"]),z.fillColor,I),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new S("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new D("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new E("Opacity",Z.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return X(_,Y),_.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},_.prototype.createVisual=function(){this.visual=P.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)},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},_.prototype.setSize=function(){Y.prototype.setSize.call(this),P.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},_.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&P.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},_.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&P.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&P.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&P.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.setOpacity=function(k){this.opacity=k,this.visual&&P.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var B=k;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,B){Y.prototype.scale.call(this,k,B),this.setSize()},_.typeName="EllipseMarker",_.title="Ellipse marker",_.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',_}(O),J=function(Y){function _(k,B,Z){return Y.call(this,k,B,Z)||this}return X(_,Y),Object.defineProperty(_.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},_.prototype.createTips=function(){this.tip1=P.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(P.createTransform()),this.visual.appendChild(this.tip1),this.tip2=P.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(P.createTransform()),this.visual.appendChild(this.tip2)},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(P.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()]]),P.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),B=this.tip1.transform.baseVal.getItem(0);B.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(B,0);var Z=this.tip2.transform.baseVal.getItem(0);Z.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Z,0)}},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},_.typeName="MeasurementMarker",_.title="Measurement marker",_.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>',_}(x),le=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.strokePanel.colors=Z.defaultColorSet,z.fillColor="transparent",z}return X(_,Y),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="EllipseFrameMarker",_.title="Ellipse frame marker",_.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>',_}(W),ce=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(_){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(_)||(this.undoStack.push(_),JSON.stringify(this.lastRedoStep)!==JSON.stringify(_)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(_){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=_)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var _=this.undoStack.pop();return _!==void 0&&this.redoStack.push(_),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),Re=function(Y){function _(k,B,Z){var z=Y.call(this,k,B,Z)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=Z.defaultColor,z.strokeWidth=Z.defaultStrokeWidth,z.strokeDasharray=Z.defaultStrokeDasharray,z.strokePanel=new f("Line color",Z.defaultColorSet,Z.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new S("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new D("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return X(_,Y),_.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},_.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},_.prototype.createVisual=function(){this.visual=P.createGroup(),this.selectorCurve=P.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=P.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)},_.prototype.pointerDown=function(k,B){Y.prototype.pointerDown.call(this,k,B),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(B)&&(this.activeGrip=this.curveGrip,this._state="resize")},_.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),P.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),P.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),P.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=P.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=P.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)},_.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},_.prototype.positionGrips=function(){Y.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()))},_.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Y.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Y.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)},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},_.prototype.scale=function(k,B){this.curveX=this.curveX*k,this.curveY=this.curveY*B,Y.prototype.scale.call(this,k,B)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var B=k;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.curveX=B.curveX,this.curveY=B.curveY,this.createVisual(),this.adjustVisual()},_.typeName="CurveMarker",_.title="Curve marker",_.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>',_}(C),Ee=function(){function Y(_,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=_,this.cancelable=k}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),Oe=function(Y){function _(k,B,Z){var z=Y.call(this,k,!1)||this;return z.dataUrl=B,z.state=Z,z}return X(_,Y),_}(Ee),Te=function(Y){function _(k,B,Z){Z===void 0&&(Z=!1);var z=Y.call(this,k,Z)||this;return z.marker=B,z}return X(_,Y),_}(Ee),Le=function(){function Y(){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 Y.prototype.addEventListener=function(_,k){this[_].push(k)},Y.prototype.removeEventListener=function(_,k){var B=this[_].indexOf(k);B>-1&&this[_].splice(B,1)},Y}(),ye=function(){function Y(_){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new A,this._isOpen=!1,this.undoRedoManager=new ce,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 Le,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new R(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=_,this.targetRoot=document.body,this.width=_.clientWidth,this.height=_.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(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[L,y,j,w,le,W,M,g,J,U,x,Re]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[L,y,j,w,W,M,g]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[L,y,j,w,M]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(_){var k=this;this._availableMarkerTypes.splice(0),_.forEach(function(B){if(typeof B=="string"){var Z=k.ALL_MARKER_TYPES.find(function(z){return z.typeName===B});Z!==void 0&&k._availableMarkerTypes.push(Z)}else k._availableMarkerTypes.push(B)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(_){this._zoomLevel=_,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var _=this;this.styles.styleSheetRoot===void 0&&r.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=r.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new Ee(_))})},Y.prototype.render=function(){return N(this,void 0,void 0,function(){var _;return $(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(_=new G).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.markersOnly=this.renderMarkersOnly,_.width=this.renderWidth,_.height=this.renderHeight,[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Y.prototype.close=function(_){var k=this;if(_===void 0&&(_=!1),this.isOpen){var B=!1;_||this.eventListeners.beforeclose.forEach(function(Z){var z=new Ee(k,!0);Z(z),z.defaultPrevented&&(B=!0)}),B||(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(Z){return Z(new Ee(k))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var _,k=[],B=0;B<arguments.length;B++)k[B]=arguments[B];(_=this._availableMarkerTypes).push.apply(_,k)},Y.prototype.addRenderEventListener=function(_){this.addEventListener("render",function(k){_(k.dataUrl,k.state)})},Y.prototype.removeRenderEventListener=function(_){},Y.prototype.addCloseEventListener=function(_){this.addEventListener("close",function(){_()})},Y.prototype.removeCloseEventListener=function(_){},Y.prototype.setupResizeObserver=function(){var _=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return _.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupTargetResize=function(){var _=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/_>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*_:this.editorCanvas.clientWidth,B=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/_;this.resize(k,B)},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.prototype.resize=function(_,k){this._isResizing=!0;var B=_/this.imageWidth,Z=k/this.imageHeight;this.imageWidth=Math.round(_),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(B,Z),this._isResizing=!1},Y.prototype.scaleMarkers=function(_,k){var B,Z=this;this._currentMarker&&this._currentMarker instanceof w?this._currentMarker.scale(_,k):(B=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==Z._currentMarker&&z.scale(_,k)}),B!==void 0&&this.setCurrentMarker(B)},Y.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"},Y.prototype.setTopLeft=function(){var _=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=_.left-k.left,this.top=_.top-k.top},Y.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)},Y.prototype.addDefs=function(){for(var _,k=[],B=0;B<arguments.length;B++)k[B]=arguments[B];this.defs=P.createDefs(),this.addDefsToImage(),(_=this.defs).append.apply(_,k)},Y.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Y.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)},Y.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Y.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Y.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)},Y.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Y.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)},Y.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 _=document.createElement("a");_.href="https://markerjs.com/",_.target="_blank",_.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>',_.title="Powered by marker.js",_.style.display="grid",_.style.alignItems="center",_.style.justifyItems="center",_.style.padding="3px",_.style.width="20px",_.style.height="20px",this.logoUI.appendChild(_),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.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")},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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 p(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 h(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Y.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.removeMarker=function(_){this.markerImage.removeChild(_.container),this.markers.indexOf(_)>-1&&this.markers.splice(this.markers.indexOf(_),1),_.dispose()},Y.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())},Y.prototype.toolbarButtonClicked=function(_,k){if(_==="marker"&&k!==void 0)this.createNewMarker(k);else if(_==="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()}},Y.prototype.deleteSelectedMarker=function(){var _=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Z){var z=new Te(_,_._currentMarker,!0);Z(z),z.defaultPrevented&&(k=!0)}),!k){var B=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(Z){return Z(new Te(_,B))})}}},Y.prototype.clear=function(){var _=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var ve=new Te(_,void 0,!0);he(ve),ve.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var B=function(he){var ve=Z.markers[he];Z.setCurrentMarker(Z.markers[he]),Z._currentMarker.dispose(),Z.markerImage.removeChild(Z._currentMarker.container),Z.markers.splice(Z.markers.indexOf(Z._currentMarker),1),Z.eventListeners.markerdelete.forEach(function(Ae){return Ae(new Te(_,ve))})},Z=this,z=this.markers.length-1;z>=0;z--)B(z);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var _;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=(_=this._currentMarker.notes)!==null&&_!==void 0?_:"",this.overlayContainer.appendChild(this.notesArea))},Y.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)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var _=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),B=this.undoRedoManager.getLastUndoStep();if(!B||B.width===k.width&&B.height===k.height){var Z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),Z<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(z){return z(new Ee(_))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(z){return z(new Ee(_))})}},Y.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Y.prototype.undoStep=function(){var _=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new Ee(_))}))},Y.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Y.prototype.redoStep=function(){var _=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new Ee(_))}))},Y.prototype.stepZoom=function(){var _=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=_<this.zoomSteps.length-1?this.zoomSteps[_+1]:this.zoomSteps[0]},Y.prototype.panTo=function(_){this.contentDiv.scrollBy({left:this.prevPanPoint.x-_.x,top:this.prevPanPoint.y-_.y}),this.prevPanPoint=_},Y.prototype.startRenderAndClose=function(){return N(this,void 0,void 0,function(){var _,k,B=this;return $(this,function(Z){switch(Z.label){case 0:return[4,this.render()];case 1:return _=Z.sent(),k=this.getState(),this.eventListeners.render.forEach(function(z){return z(new Oe(B,_,k))}),this.close(!0),[2]}})})},Y.prototype.getState=function(_){_===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(B){return k.markers.push(B.getState())}),k},Y.prototype.restoreState=function(_){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);_.markers.forEach(function(B){var Z=k._availableMarkerTypes.find(function(he){return he.typeName===B.typeName});if(Z!==void 0){var z=k.addNewMarker(Z);z.restoreState(B),k.markers.push(z)}}),_.width&&_.height&&(_.width!==this.imageWidth||_.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/_.width,this.imageHeight/_.height),this.eventListeners.restorestate.forEach(function(B){return B(new Ee(k))})},Y.prototype.addNewMarker=function(_){var k=P.createGroup();return this.markerImage.appendChild(k),new _(k,this.overlayContainer,this.settings)},Y.prototype.createNewMarker=function(_){var k,B=this;(k=typeof _=="string"?this._availableMarkerTypes.find(function(Z){return Z.typeName===_}):_)&&(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(Z){return Z(new Te(B,B._currentMarker))}))},Y.prototype.markerCreated=function(_){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(_),this.setCurrentMarker(_),_ instanceof y&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(y):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(B){return B(new Te(k,k._currentMarker))})},Y.prototype.colorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=_,this.settings.defaultStrokeColor=_)},Y.prototype.fillColorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=_)},Y.prototype.markerStateChanged=function(_){var k=this;this.eventListeners.markerchange.forEach(function(B){return B(new Te(k,_))})},Y.prototype.setCurrentMarker=function(_){var k=this;this._currentMarker!==_&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(B){return B(new Te(k,k._currentMarker))})),this._currentMarker=_,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(B){return B(new Te(k,k._currentMarker))}))},Y.prototype.onPointerDown=function(_){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||_.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(B){return B.ownsTarget(_.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:_.clientX,y:_.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY))},Y.prototype.onDblClick=function(_){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(B){return B.ownsTarget(_.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target):this.setCurrentMarker()}},Y.prototype.onPointerMove=function(_){this.touchPoints!==1&&_.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||_.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(_.clientX,_.clientY)):this.zoomLevel>1&&this.panTo({x:_.clientX,y:_.clientY}))},Y.prototype.onPointerUp=function(_){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(_.clientX,_.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(_){this._currentMarker===void 0||this.notesArea!==void 0||_.key!=="Delete"&&_.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(_,k){var B=this.markerImage.getBoundingClientRect();return{x:(_-B.left)/this.zoomLevel,y:(k-B.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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()},Y.prototype.addLicenseKey=function(_){K.addKey(_)},Y.prototype.addEventListener=function(_,k){this.eventListeners.addEventListener(_,k)},Y.prototype.removeEventListener=function(_,k){this.eventListeners.removeEventListener(_,k)},Y.prototype.renderState=function(_){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(_),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var _=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 Ee(_))}))},Y.prototype.blur=function(){var _=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new Ee(_))}))},Y.instanceCounter=0,Y}()},T8No:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return K}),Q.d(we,"e",function(){return G}),Q.d(we,"c",function(){return x}),Q.d(we,"b",function(){return d}),Q.d(we,"d",function(){return w}),Q.d(we,"f",function(){return j});var se=Q("MNsG"),X=Q("N0LK"),N=Q("Cg/j");let $=se.k||"";const H=new Map;H.set("false",!1),H.set("true",!0),H.set("isMac",se.f),H.set("isLinux",se.d),H.set("isWindows",se.i),H.set("isWeb",se.h),H.set("isMacNative",se.f&&!se.h),H.set("isEdge",$.indexOf("Edg/")>=0),H.set("isFirefox",$.indexOf("Firefox")>=0),H.set("isChrome",$.indexOf("Chrome")>=0),H.set("isSafari",$.indexOf("Safari")>=0);const P=Object.prototype.hasOwnProperty;class K{static has(E){return m.create(E)}static equals(E,M){return p.create(E,M)}static regex(E,M){return S.create(E,M)}static not(E){return l.create(E)}static and(...E){return A.create(E,null)}static or(...E){return C.create(E,null,!0)}static deserialize(E,M=!1){return E?this._deserializeOrExpression(E,M):void 0}static _deserializeOrExpression(E,M){let I=E.split("||");return C.create(I.map(g=>this._deserializeAndExpression(g,M)),null,!0)}static _deserializeAndExpression(E,M){let I=E.split("&&");return A.create(I.map(g=>this._deserializeOne(g,M)),null)}static _deserializeOne(E,M){if(E=E.trim(),E.indexOf("!=")>=0){let I=E.split("!=");return f.create(I[0].trim(),this._deserializeValue(I[1],M))}if(E.indexOf("==")>=0){let I=E.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],M))}if(E.indexOf("=~")>=0){let I=E.split("=~");return S.create(I[0].trim(),this._deserializeRegexValue(I[1],M))}if(E.indexOf(" in ")>=0){let I=E.split(" in ");return h.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(E)){const I=E.split(">=");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(E)){const I=E.split(">");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(E)){const I=E.split("<=");return T.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(E)){const I=E.split("<");return O.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(E)?l.create(E.substr(1).trim()):m.create(E)}static _deserializeValue(E,M){if(E=E.trim(),E==="true")return!0;if(E==="false")return!1;let I=/^'([^']*)'$/.exec(E);return I?I[1].trim():E}static _deserializeRegexValue(E,M){if(Object(X.C)(E)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=E.indexOf("/"),g=E.lastIndexOf("/");if(I===g||I<0){if(M)throw new Error(`bad regexp-value '${E}', missing /-enclosure`);return console.warn(`bad regexp-value '${E}', missing /-enclosure`),null}let W=E.slice(I+1,g),J=E[g+1]==="i"?"i":"";try{return new RegExp(W,J)}catch(le){if(M)throw new Error(`bad regexp-value '${E}', parse error: ${le}`);return console.warn(`bad regexp-value '${E}', parse error: ${le}`),null}}}function G(E,M){const I=E?E.substituteConstants():void 0,g=M?M.substituteConstants():void 0;return!I&&!g?!0:!I||!g?!1:I.equals(g)}function r(E,M){return E.cmp(M)}class R{constructor(){this.type=0}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}R.INSTANCE=new R;class v{constructor(){this.type=1}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!0}serialize(){return"true"}keys(){return[]}negate(){return R.INSTANCE}}v.INSTANCE=new v;class m{constructor(E,M){this.key=E,this.negated=M,this.type=2}static create(E,M=null){const I=H.get(E);return typeof I=="boolean"?I?v.INSTANCE:R.INSTANCE:new m(E,M)}cmp(E){return E.type!==this.type?this.type-E.type:y(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=H.get(this.key);return typeof E=="boolean"?E?v.INSTANCE:R.INSTANCE:this}evaluate(E){return!!E.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(E,M,I){this.key=E,this.value=M,this.negated=I,this.type=4}static create(E,M,I=null){if(typeof M=="boolean")return M?m.create(E,I):l.create(E,I);const g=H.get(E);if(typeof g=="boolean"){const W=g?"true":"false";return M===W?v.INSTANCE:R.INSTANCE}return new p(E,M,I)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=H.get(this.key);if(typeof E=="boolean"){const M=E?"true":"false";return this.value===M?v.INSTANCE:R.INSTANCE}return this}evaluate(E){return E.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(E,M){this.key=E,this.valueKey=M,this.type=10,this.negated=null}static create(E,M){return new h(E,M)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.valueKey,E.key,E.valueKey)}equals(E){return E.type===this.type?this.key===E.key&&this.valueKey===E.valueKey:!1}substituteConstants(){return this}evaluate(E){const M=E.getValue(this.valueKey),I=E.getValue(this.key);return Array.isArray(M)?M.indexOf(I)>=0:typeof I=="string"&&typeof M=="object"&&M!==null?P.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(E){this._actual=E,this.type=11}static create(E){return new o(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(E,M,I){this.key=E,this.value=M,this.negated=I,this.type=5}static create(E,M,I=null){if(typeof M=="boolean")return M?l.create(E,I):m.create(E,I);const g=H.get(E);if(typeof g=="boolean"){const W=g?"true":"false";return M===W?R.INSTANCE:v.INSTANCE}return new f(E,M,I)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=H.get(this.key);if(typeof E=="boolean"){const M=E?"true":"false";return this.value===M?R.INSTANCE:v.INSTANCE}return this}evaluate(E){return E.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(E,M){this.key=E,this.negated=M,this.type=3}static create(E,M=null){const I=H.get(E);return typeof I=="boolean"?I?R.INSTANCE:v.INSTANCE:new l(E,M)}cmp(E){return E.type!==this.type?this.type-E.type:y(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=H.get(this.key);return typeof E=="boolean"?E?R.INSTANCE:v.INSTANCE:this}evaluate(E){return!E.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(E,M){if(typeof E=="string"){const I=parseFloat(E);isNaN(I)||(E=I)}return typeof E=="string"||typeof E=="number"?M(E):R.INSTANCE}class s{constructor(E,M,I){this.key=E,this.value=M,this.negated=I,this.type=12}static create(E,M,I=null){return u(M,g=>new s(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class a{constructor(E,M,I){this.key=E,this.value=M,this.negated=I,this.type=13}static create(E,M,I=null){return u(M,g=>new a(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.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(E,M,I){this.key=E,this.value=M,this.negated=I,this.type=14}static create(E,M,I=null){return u(M,g=>new O(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class T{constructor(E,M,I){this.key=E,this.value=M,this.negated=I,this.type=15}static create(E,M,I=null){return u(M,g=>new T(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.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(E,M){this.key=E,this.regexp=M,this.type=7,this.negated=null}static create(E,M){return new S(E,M)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.key<E.key)return-1;if(this.key>E.key)return 1;const M=this.regexp?this.regexp.source:"",I=E.regexp?E.regexp.source:"";return M<I?-1:M>I?1:0}equals(E){if(E.type===this.type){const M=this.regexp?this.regexp.source:"",I=E.regexp?E.regexp.source:"";return this.key===E.key&&M===I}return!1}substituteConstants(){return this}evaluate(E){let M=E.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const E=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${E}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(E){this._actual=E,this.type=8}static create(E){return new D(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function L(E){let M=null;for(let I=0,g=E.length;I<g;I++){const W=E[I].substituteConstants();if(E[I]!==W&&M===null){M=[];for(let J=0;J<I;J++)M[J]=E[J]}M!==null&&(M[I]=W)}return M===null?E:M}class A{constructor(E,M){this.expr=E,this.negated=M,this.type=6}static create(E,M){return A._normalizeArr(E,M)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.expr.length<E.expr.length)return-1;if(this.expr.length>E.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const g=r(this.expr[M],E.expr[M]);if(g!==0)return g}return 0}equals(E){if(E.type===this.type){if(this.expr.length!==E.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(E.expr[M]))return!1;return!0}return!1}substituteConstants(){const E=L(this.expr);return E===this.expr?this:A.create(E,this.negated)}evaluate(E){for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].evaluate(E))return!1;return!0}static _normalizeArr(E,M){const I=[];let g=!1;for(const W of E){if(!W)continue;if(W.type===1){g=!0;continue}if(W.type===0)return R.INSTANCE;if(W.type===6){I.push(...W.expr);continue}I.push(W)}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 W=1;W<I.length;W++)I[W-1].equals(I[W])&&(I.splice(W,1),W--);if(I.length===1)return I[0];for(;I.length>1;){const W=I[I.length-1];if(W.type!==9)break;I.pop();const J=I.pop(),le=I.length===0,ce=C.create(W.expr.map(Re=>A.create([Re,J],null)),null,le);ce&&(I.push(ce),I.sort(r))}return I.length===1?I[0]:new A(I,M)}serialize(){return this.expr.map(E=>E.serialize()).join(" && ")}keys(){const E=[];for(let M of this.expr)E.push(...M.keys());return E}negate(){if(!this.negated){const E=[];for(let M of this.expr)E.push(M.negate());this.negated=C.create(E,this,!0)}return this.negated}}class C{constructor(E,M){this.expr=E,this.negated=M,this.type=9}static create(E,M,I){return C._normalizeArr(E,M,I)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.expr.length<E.expr.length)return-1;if(this.expr.length>E.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const g=r(this.expr[M],E.expr[M]);if(g!==0)return g}return 0}equals(E){if(E.type===this.type){if(this.expr.length!==E.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(E.expr[M]))return!1;return!0}return!1}substituteConstants(){const E=L(this.expr);return E===this.expr?this:C.create(E,this.negated,!1)}evaluate(E){for(let M=0,I=this.expr.length;M<I;M++)if(this.expr[M].evaluate(E))return!0;return!1}static _normalizeArr(E,M,I){let g=[],W=!1;if(E){for(let J=0,le=E.length;J<le;J++){const ce=E[J];if(!ce)continue;if(ce.type===0){W=!0;continue}if(ce.type===1)return v.INSTANCE;if(ce.type===9){g=g.concat(ce.expr);continue}g.push(ce)}if(g.length===0&&W)return R.INSTANCE;g.sort(r)}if(g.length===0)return;if(g.length===1)return g[0];for(let J=1;J<g.length;J++)g[J-1].equals(g[J])&&(g.splice(J,1),J--);if(g.length===1)return g[0];if(I){for(let J=0;J<g.length;J++)for(let le=J+1;le<g.length;le++)j(g[J],g[le])&&(g.splice(le,1),le--);if(g.length===1)return g[0]}return new C(g,M)}serialize(){return this.expr.map(E=>E.serialize()).join(" || ")}keys(){const E=[];for(let M of this.expr)E.push(...M.keys());return E}negate(){if(!this.negated){let E=[];for(let M of this.expr)E.push(M.negate());for(;E.length>1;){const M=E.shift(),I=E.shift(),g=[];for(const J of U(M))for(const le of U(I))g.push(A.create([J,le],null));const W=E.length===0;E.unshift(C.create(g,null,W))}this.negated=E[0]}return this.negated}}class x extends m{constructor(E,M,I){super(E,null);this._defaultValue=M,typeof I=="object"?x._info.push(Object.assign(Object.assign({},I),{key:E})):I!==!0&&x._info.push({key:E,description:I,type:M!=null?typeof M:void 0})}static all(){return x._info.values()}bindTo(E){return E.createKey(this.key,this._defaultValue)}getValue(E){return E.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(E){return p.create(this.key,E)}}x._info=[];const d=Object(N.c)("contextKeyService"),w="setContext";function y(E,M){return E<M?-1:E>M?1:0}function b(E,M,I,g){return E<I?-1:E>I?1:M<g?-1:M>g?1:0}function j(E,M){if(M.type===6&&E.type!==9&&E.type!==6){for(const W of M.expr)if(E.equals(W))return!0}const I=E.negate(),g=U(I).concat(U(M));g.sort(r);for(let W=0;W<g.length;W++){const J=g[W],le=J.negate();for(let ce=W+1;ce<g.length;ce++){const Re=g[ce];if(le.equals(Re))return!0}}return!1}function U(E){return E.type===9?E.expr:[E]}},TXwP:function(Ye,we,Q){var se,X;(function(){var N;(function(){"use strict";var H=[,,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,T=/\/\/(?:[^\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,x=!1,d=!1,w=!1,y=!1,b=!1,j=!1,U=this._ch,E=!1,M,I,g;M=this._input.read(a),I=M!=="",g=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(O),J=f.get_directives(W);J&&J.ignore==="start"&&(W+=f.readIgnored(this._input)),this.print_string(W),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),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 le=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);le.match(/[ :]$/)&&(le=this.eatString(": ").replace(/\s$/,""),this.print_string(le),this._output.space_before_token=!0),le=le.replace(/\s$/,""),le==="extend"?y=!0:le==="import"&&(b=!0),le in this.NESTED_AT_RULE?(this._nestedLevel+=1,le in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!x&&C===0&&le.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,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&(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),x=!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 ce=0;ce<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ce++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ce])){E=!0;break}(x||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 Re=g==='"'||g==="'";this.preserveSingleSpace(Re||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")E=!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 Ee=!1;this._input.lookBack("with")&&(Ee=!0),this.preserveSingleSpace(I||Ee),this.print_string(this._ch),d&&g==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),C++,this.indent())}else if(this._ch===")")C&&(C--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!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||j)&&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 Oe=g==='"'||g==="'";this.preserveSingleSpace(Oe||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&E&&this._output.add_new_line()}var Te=this._output.get_code(L);return Te},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}],P={};function K(r){var R=P[r];if(R!==void 0)return R.exports;var v=P[r]={exports:{}};return H[r](v,v.exports,K),v.exports}var G=K(15);N=G})();var $=N;!(se=[],X=function(){return{css_beautify:$}}.apply(we,se),X!==void 0&&(Ye.exports=X))})()},Vhoy:function(Ye,we,Q){"use strict";Q.d(we,"d",function(){return $}),Q.d(we,"e",function(){return H}),Q.d(we,"c",function(){return P}),Q.d(we,"b",function(){return K}),Q.d(we,"a",function(){return G});var se=Q("MI8n");class X{constructor(){this._icons=new Map,this._onDidRegister=new se.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 N=new X,$=N;function H(r,R){return new K(r,R)}function P(r){return r?r.replace(/\$\((.*?)\)/g,(R,v)=>` ${v} `).trim():""}class K{constructor(r,R,v){this.id=r,this.definition=R,this.description=v,N.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var G;(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 K)return["codicon","codicon-"+h.id];const o=R.exec(h.id);if(!o)return v(K.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})(G||(G={})),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"})}(K||(K={}))},"VrN/":function(Ye,we,Q){(function(se,X){Ye.exports=X()})(this,function(){"use strict";var se=navigator.userAgent,X=navigator.platform,N=/gecko\/\d/i.test(se),$=/MSIE \d/.test(se),H=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(se),P=/Edge\/(\d+)/.exec(se),K=$||H||P,G=K&&($?document.documentMode||6:+(P||H)[1]),r=!P&&/WebKit\//.test(se),R=r&&/Qt\/\d+\.\d+/.test(se),v=!P&&/Chrome\//.test(se),m=/Opera\//.test(se),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(se),o=/PhantomJS/.test(se),f=!P&&/AppleWebKit/.test(se)&&/Mobile\/\w+/.test(se),l=/Android/.test(se),u=f||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(se),s=f||/Mac/.test(X),a=/\bCrOS\b/.test(se),O=/win/i.test(X),T=m&&se.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(m=!1,r=!0);var S=s&&(R||m&&(T==null||T<12.11)),D=N||K&&G>=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 x(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 F=0;F<t.length;++F)c.appendChild(t[F]);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 j(){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 U(e,t){var i=e.className;L(t).test(i)||(e.className+=(i?" ":"")+t)}function E(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}:K&&(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 W(e,t,i,n,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var F=n||0,V=c||0;;){var q=e.indexOf(" ",F);if(q<0||q>=t)return V+(t-F);V+=q-F,V+=i-V%i,F=q+1}}var J=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.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 le(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ce=50,Re={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},Oe={origin:"*mouse"},Te={origin:"+move"};function Le(e,t,i){for(var n=0,c=0;;){var F=e.indexOf(" ",n);F==-1&&(F=e.length);var V=F-n;if(F==e.length||c+V>=t)return n+Math.min(V,t-c);if(c+=F-n,c+=i-c%i,n=F+1,c>=t)return n}}var ye=[""];function Y(e){for(;ye.length<=e;)ye.push(_(ye)+" ");return ye[e]}function _(e){return e[e.length-1]}function k(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function B(e,t,i){for(var n=0,c=i(t);n<e.length&&i(e[n])<=c;)n++;e.splice(n,0,t)}function Z(){}function z(e,t){var i;return Object.create?i=Object.create(e):(Z.prototype=e,i=new Z),t&&g(t,i),i}var he=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ve(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||he.test(e))}function Ae(e,t){return t?t.source.indexOf("\\w")>-1&&ve(e)?!0:t.test(e):ve(e)}function ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var me=/[\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 be(e){return e.charCodeAt(0)>=768&&me.test(e)}function Ce(e,t,i){for(;(i<0?t>0:t<e.length)&&be(e.charAt(t));)t+=i;return t}function Pe(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var c=(t+i)/2,F=n<0?Math.ceil(c):Math.floor(c);if(F==t)return e(F)?t:i;e(F)?i=F:t=F+n}}function Ue(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var c=!1,F=0;F<e.length;++F){var V=e[F];(V.from<i&&V.to>t||t==i&&V.to==t)&&(n(Math.max(V.from,t),Math.min(V.to,i),V.level==1?"rtl":"ltr",F),c=!0)}c||n(t,i,"ltr")}var He=null;function Be(e,t,i){var n;He=null;for(var c=0;c<e.length;++c){var F=e[c];if(F.from<t&&F.to>t)return c;F.to==t&&(F.from!=F.to&&i=="before"?n=c:He=c),F.from==t&&(F.from!=F.to&&i!="before"?n=c:He=c)}return n!=null?n:He}var Qe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ae){return ae<=247?e.charAt(ae):1424<=ae&&ae<=1524?"R":1536<=ae&&ae<=1785?t.charAt(ae-1536):1774<=ae&&ae<=2220?"r":8192<=ae&&ae<=8203?"w":ae==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,F=/[LRr]/,V=/[Lb1n]/,q=/[1n]/;function te(ae,_e,Se){this.level=ae,this.from=_e,this.to=Se}return function(ae,_e){var Se=_e=="ltr"?"L":"R";if(ae.length==0||_e=="ltr"&&!n.test(ae))return!1;for(var ke=ae.length,De=[],Fe=0;Fe<ke;++Fe)De.push(i(ae.charCodeAt(Fe)));for(var je=0,Ve=Se;je<ke;++je){var $e=De[je];$e=="m"?De[je]=Ve:Ve=$e}for(var tt=0,Je=Se;tt<ke;++tt){var nt=De[tt];nt=="1"&&Je=="r"?De[tt]="n":F.test(nt)&&(Je=nt,nt=="r"&&(De[tt]="R"))}for(var ht=1,lt=De[0];ht<ke-1;++ht){var bt=De[ht];bt=="+"&<=="1"&&De[ht+1]=="1"?De[ht]="1":bt==","&<==De[ht+1]&&(lt=="1"||lt=="n")&&(De[ht]=lt),lt=bt}for(var Nt=0;Nt<ke;++Nt){var Zt=De[Nt];if(Zt==",")De[Nt]="N";else if(Zt=="%"){var Wt=void 0;for(Wt=Nt+1;Wt<ke&&De[Wt]=="%";++Wt);for(var _r=Nt&&De[Nt-1]=="!"||Wt<ke&&De[Wt]=="1"?"1":"N",gr=Nt;gr<Wt;++gr)De[gr]=_r;Nt=Wt-1}}for(var Vt=0,vr=Se;Vt<ke;++Vt){var tr=De[Vt];vr=="L"&&tr=="1"?De[Vt]="L":F.test(tr)&&(vr=tr)}for(var $t=0;$t<ke;++$t)if(c.test(De[$t])){var Xt=void 0;for(Xt=$t+1;Xt<ke&&c.test(De[Xt]);++Xt);for(var Gt=($t?De[$t-1]:Se)=="L",yr=(Xt<ke?De[Xt]:Se)=="L",zn=Gt==yr?Gt?"L":"R":Se,tn=$t;tn<Xt;++tn)De[tn]=zn;$t=Xt-1}for(var ar=[],Ur,qt=0;qt<ke;)if(V.test(De[qt])){var Va=qt;for(++qt;qt<ke&&V.test(De[qt]);++qt);ar.push(new te(0,Va,qt))}else{var Kr=qt,yn=ar.length,bn=_e=="rtl"?1:0;for(++qt;qt<ke&&De[qt]!="L";++qt);for(var hr=Kr;hr<qt;)if(q.test(De[hr])){Kr<hr&&(ar.splice(yn,0,new te(1,Kr,hr)),yn+=bn);var Kn=hr;for(++hr;hr<qt&&q.test(De[hr]);++hr);ar.splice(yn,0,new te(2,Kn,hr)),yn+=bn,Kr=hr}else++hr;Kr<qt&&ar.splice(yn,0,new te(1,Kr,qt))}return _e=="ltr"&&(ar[0].level==1&&(Ur=ae.match(/^\s+/))&&(ar[0].from=Ur[0].length,ar.unshift(new te(0,0,Ur[0].length))),_(ar).level==1&&(Ur=ae.match(/\s+$/))&&(_(ar).to-=Ur[0].length,ar.push(new te(0,ke-Ur[0].length,ke)))),_e=="rtl"?ar.reverse():ar}}();function Ge(e,t){var i=e.order;return i==null&&(i=e.order=Qe(e.text,t)),i}var Xe=[],Me=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]||Xe).concat(i)}};function it(e,t){return e._handlers&&e._handlers[t]||Xe}function qe(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 F=le(c,i);F>-1&&(n[t]=c.slice(0,F).concat(c.slice(F+1)))}}}function de(e,t){var i=it(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 ee(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),de(e,i||t.type,e,t),pe(t)||t.codemirrorIgnore}function ne(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)le(i,t[n])==-1&&i.push(t[n])}function oe(e,t){return it(e,t).length>0}function fe(e){e.prototype.on=function(t,i){Me(this,t,i)},e.prototype.off=function(t,i){qe(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){re(e),ie(e)}function xe(e){return e.target||e.srcElement}function Ie(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 Ne=function(){if(K&&G<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),ze;function et(e){if(ze==null){var t=d("span","\u200B");x(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ze=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&G<8))}var i=ze?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var rt;function yt(e){if(rt!=null)return rt;var t=x(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:rt=n.right-i.right<3}var ot=`
|
|
|
|
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 F=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),V=F.indexOf("\r");V!=-1?(i.push(F.slice(0,V)),t+=V+1):(i.push(F),t=c+1)}return i}:function(e){return e.split(/\r\n?|\n/)},at=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},Lt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_t=null;function Ut(e){if(_t!=null)return _t;var t=x(e,d("span","x")),i=t.getBoundingClientRect(),n=y(t,0,1).getBoundingClientRect();return _t=Math.abs(i.left-n.left)>1}var Ft={},Tt={};function sr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ft[e]=t}function Er(e,t){Tt[e]=t}function Kt(e){if(typeof e=="string"&&Tt.hasOwnProperty(e))e=Tt[e];else if(e&&typeof e.name=="string"&&Tt.hasOwnProperty(e.name)){var t=Tt[e.name];typeof t=="string"&&(t={name:t}),e=z(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Kt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Kt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function dr(e,t){t=Kt(t);var i=Ft[t.name];if(!i)return dr(e,"text/plain");var n=i(e,t);if(dt.hasOwnProperty(t.name)){var c=dt[t.name];for(var F in c){if(!c.hasOwnProperty(F))continue;n.hasOwnProperty(F)&&(n["_"+F]=n[F]),n[F]=c[F]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var V in t.modeProps)n[V]=t.modeProps[V];return n}var dt={};function vt(e,t){var i=dt.hasOwnProperty(e)?dt[e]:dt[e]={};g(t,i)}function Et(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 Ht(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 or(e,t,i){return e.startState?e.startState(t,i):!0}var Mt=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};Mt.prototype.eol=function(){return this.pos>=this.string.length},Mt.prototype.sol=function(){return this.pos==this.lineStart},Mt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Mt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Mt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Mt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Mt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Mt.prototype.skipToEnd=function(){this.pos=this.string.length},Mt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Mt.prototype.backUp=function(e){this.pos-=e},Mt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Mt.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Mt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(V){return i?V.toLowerCase():V},c=this.string.substr(this.pos,e.length);if(n(c)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var F=this.string.slice(this.pos).match(e);return F&&F.index>0?null:(F&&t!==!1&&(this.pos+=F[0].length),F)}},Mt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Mt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Mt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Mt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ze(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],F=c.chunkSize();if(t<F){i=c;break}t-=F}return i.lines[t]}function Ct(e,t,i){var n=[],c=t.line;return e.iter(t.line,i.line+1,function(F){var V=F.text;c==i.line&&(V=V.slice(0,i.ch)),c==t.line&&(V=V.slice(t.ch)),n.push(V),++c}),n}function Ot(e,t,i){var n=[];return e.iter(t,i,function(c){n.push(c.text)}),n}function ct(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function pt(e){if(e.parent==null)return null;for(var t=e.parent,i=le(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 wt(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var c=e.children[n],F=c.height;if(t<F){e=c;continue e}t-=F,i+=c.chunkSize()}return i}while(!e.lines);for(var V=0;V<e.lines.length;++V){var q=e.lines[V],te=q.height;if(t<te)break;t-=te}return i+V}function rr(e,t){return t>=e.first&&t<e.first+e.size}function Bt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function We(e,t,i){if(i===void 0&&(i=null),!(this instanceof We))return new We(e,t,i);this.line=e,this.ch=t,this.sticky=i}function ft(e,t){return e.line-t.line||e.ch-t.ch}function rn(e,t){return e.sticky==t.sticky&&ft(e,t)==0}function _n(e){return We(e.line,e.ch)}function En(e,t){return ft(e,t)<0?t:e}function nn(e,t){return ft(e,t)<0?e:t}function xn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function gt(e,t){if(t.line<e.first)return We(e.first,0);var i=e.first+e.size-1;return t.line>i?We(i,Ze(e,i).text.length):Ai(t,Ze(e,t.line).text.length)}function Ai(e,t){var i=e.ch;return i==null||i>t?We(e.line,t):i<0?We(e.line,0):e}function Ke(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=gt(e,t[n]);return i}var Tn=function(e,t){this.state=e,this.lookAhead=t},Sr=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Sr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Sr.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}},Sr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Sr.fromSaved=function(e,t,i){return t instanceof Tn?new Sr(e,Et(e.mode,t.state),i,t.lookAhead):new Sr(e,Et(e.mode,t),i)},Sr.prototype.save=function(e){var t=e!==!1?Et(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Tn(t,this.maxLookAhead):t};function Vn(e,t,i,n){var c=[e.state.modeGen],F={};Rr(e,t.text,e.doc.mode,i,function(ae,_e){return c.push(ae,_e)},F,n);for(var V=i.state,q=function(ae){i.baseTokens=c;var _e=e.state.overlays[ae],Se=1,ke=0;i.state=!0,Rr(e,t.text,_e.mode,i,function(De,Fe){for(var je=Se;ke<De;){var Ve=c[Se];Ve>De&&c.splice(Se,1,De,c[Se+1],Ve),Se+=2,ke=Math.min(De,Ve)}if(!Fe)return;if(_e.opaque)c.splice(je,Se-je,De,"overlay "+Fe),Se=je+2;else for(;je<Se;je+=2){var $e=c[je+1];c[je+1]=($e?$e+" ":"")+"overlay "+Fe}},F),i.state=V,i.baseTokens=null,i.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)q(te);return{styles:c,classes:F.bgClass||F.textClass?F:null}}function an(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ar(e,pt(t)),c=t.text.length>e.options.maxHighlightLength&&Et(e.doc.mode,n.state),F=Vn(e,t,n);c&&(n.state=c),t.stateAfter=n.save(!c),t.styles=F.styles,F.classes?t.styleClasses=F.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ar(e,t,i){var n=e.doc,c=e.display;if(!n.mode.startState)return new Sr(n,!0,t);var F=Ri(e,t,i),V=F>n.first&&Ze(n,F-1).stateAfter,q=V?Sr.fromSaved(n,V,F):new Sr(n,or(n.mode),F);return n.iter(F,t,function(te){Xn(e,te.text,q);var ae=q.line;te.stateAfter=ae==t-1||ae%5==0||ae>=c.viewFrom&&ae<c.viewTo?q.save():null,q.nextLine()}),i&&(n.modeFrontier=q.line),q}function Xn(e,t,i,n){var c=e.doc.mode,F=new Mt(t,e.options.tabSize,i);for(F.start=F.pos=n||0,t==""&&Yn(c,i.state);!F.eol();)Or(c,F,i.state),F.start=F.pos}function Yn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Ht(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Or(e,t,i,n){for(var c=0;c<10;c++){n&&(n[0]=Ht(e,i).mode);var F=e.token(t,i);if(t.pos>t.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var $n=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Oi(e,t,i,n){var c=e.doc,F=c.mode,V;t=gt(c,t);var q=Ze(c,t.line),te=Ar(e,t.line,i),ae=new Mt(q.text,e.options.tabSize,te),_e;for(n&&(_e=[]);(n||ae.pos<t.ch)&&!ae.eol();)ae.start=ae.pos,V=Or(F,ae,te.state),n&&_e.push(new $n(ae,V,Et(c.mode,te.state)));return n?_e:new $n(ae,V,te.state)}function Jn(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 Rr(e,t,i,n,c,F,V){var q=i.flattenSpans;q==null&&(q=e.options.flattenSpans);var te=0,ae=null,_e=new Mt(t,e.options.tabSize,n),Se,ke=e.options.addModeClass&&[null];for(t==""&&Jn(Yn(i,n.state),F);!_e.eol();){if(_e.pos>e.options.maxHighlightLength?(q=!1,V&&Xn(e,t,n,_e.pos),_e.pos=t.length,Se=null):Se=Jn(Or(i,_e,n.state,ke),F),ke){var De=ke[0].name;De&&(Se="m-"+(Se?De+" "+Se:De))}if(!q||ae!=Se){for(;te<_e.start;)te=Math.min(_e.start,te+5e3),c(te,ae);ae=Se}_e.start=_e.pos}for(;te<_e.pos;){var Fe=Math.min(_e.pos,te+5e3);c(Fe,ae),te=Fe}}function Ri(e,t,i){for(var n,c,F=e.doc,V=i?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>V;--q){if(q<=F.first)return F.first;var te=Ze(F,q-1),ae=te.stateAfter;if(ae&&(!i||q+(ae instanceof Tn?ae.lookAhead:0)<=F.modeFrontier))return q;var _e=W(te.text,null,e.options.tabSize);(c==null||n>_e)&&(c=q-1,n=_e)}return c}function aa(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=Ze(e,n).stateAfter;if(c&&(!(c instanceof Tn)||n+c.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Qn=!1,lr=!1;function Vr(){Qn=!0}function sa(){lr=!0}function sn(e,t,i){this.marker=e,this.from=t,this.to=i}function Lr(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function Zn(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function oa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Li(e,t,i){var n;if(e)for(var c=0;c<e.length;++c){var F=e[c],V=F.marker,q=F.from==null||(V.inclusiveLeft?F.from<=t:F.from<t);if(q||F.from==t&&V.type=="bookmark"&&(!i||!F.marker.insertLeft)){var te=F.to==null||(V.inclusiveRight?F.to>=t:F.to>t);(n||(n=[])).push(new sn(V,F.from,te?null:F.to))}}return n}function Ii(e,t,i){var n;if(e)for(var c=0;c<e.length;++c){var F=e[c],V=F.marker,q=F.to==null||(V.inclusiveRight?F.to>=t:F.to>t);if(q||F.from==t&&V.type=="bookmark"&&(!i||F.marker.insertLeft)){var te=F.from==null||(V.inclusiveLeft?F.from<=t:F.from<t);(n||(n=[])).push(new sn(V,te?null:F.from-t,F.to==null?null:F.to-t))}}return n}function wn(e,t){if(t.full)return null;var i=rr(e,t.from.line)&&Ze(e,t.from.line).markedSpans,n=rr(e,t.to.line)&&Ze(e,t.to.line).markedSpans;if(!i&&!n)return null;var c=t.from.ch,F=t.to.ch,V=ft(t.from,t.to)==0,q=Li(i,c,V),te=Ii(n,F,V),ae=t.text.length==1,_e=_(t.text).length+(ae?c:0);if(q)for(var Se=0;Se<q.length;++Se){var ke=q[Se];if(ke.to==null){var De=Lr(te,ke.marker);De?ae&&(ke.to=De.to==null?null:De.to+_e):ke.to=c}}if(te)for(var Fe=0;Fe<te.length;++Fe){var je=te[Fe];if(je.to!=null&&(je.to+=_e),je.from==null){var Ve=Lr(q,je.marker);Ve||(je.from=_e,ae&&(q||(q=[])).push(je))}else je.from+=_e,ae&&(q||(q=[])).push(je)}q&&(q=Di(q)),te&&te!=q&&(te=Di(te));var $e=[q];if(!ae){var tt=t.text.length-2,Je;if(tt>0&&q)for(var nt=0;nt<q.length;++nt)q[nt].to==null&&(Je||(Je=[])).push(new sn(q[nt].marker,null,null));for(var ht=0;ht<tt;++ht)$e.push(Je);$e.push(te)}return $e}function Di(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 ki(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(De){if(De.markedSpans)for(var Fe=0;Fe<De.markedSpans.length;++Fe){var je=De.markedSpans[Fe].marker;je.readOnly&&(!n||le(n,je)==-1)&&(n||(n=[])).push(je)}}),!n)return null;for(var c=[{from:t,to:i}],F=0;F<n.length;++F)for(var V=n[F],q=V.find(0),te=0;te<c.length;++te){var ae=c[te];if(ft(ae.to,q.from)<0||ft(ae.from,q.to)>0)continue;var _e=[te,1],Se=ft(ae.from,q.from),ke=ft(ae.to,q.to);(Se<0||!V.inclusiveLeft&&!Se)&&_e.push({from:ae.from,to:q.from}),(ke>0||!V.inclusiveRight&&!ke)&&_e.push({from:q.to,to:ae.to}),c.splice.apply(c,_e),te+=_e.length-3}return c}function la(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 Sn(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function on(e){return e.inclusiveLeft?-1:0}function ln(e){return e.inclusiveRight?1:0}function Cn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),c=t.find(),F=ft(n.from,c.from)||on(e)-on(t);if(F)return-F;var V=ft(n.to,c.to)||ln(e)-ln(t);return V||t.id-e.id}function Br(e,t){var i=lr&&e.markedSpans,n;if(i)for(var c=void 0,F=0;F<i.length;++F)c=i[F],c.marker.collapsed&&(t?c.from:c.to)==null&&(!n||Cn(n,c.marker)<0)&&(n=c.marker);return n}function jr(e){return Br(e,!0)}function Hr(e){return Br(e,!1)}function An(e,t){var i=lr&&e.markedSpans,n;if(i)for(var c=0;c<i.length;++c){var F=i[c];F.marker.collapsed&&(F.from==null||F.from<t)&&(F.to==null||F.to>t)&&(!n||Cn(n,F.marker)<0)&&(n=F.marker)}return n}function Mi(e,t,i,n,c){var F=Ze(e,t),V=lr&&F.markedSpans;if(V)for(var q=0;q<V.length;++q){var te=V[q];if(!te.marker.collapsed)continue;var ae=te.marker.find(0),_e=ft(ae.from,i)||on(te.marker)-on(c),Se=ft(ae.to,n)||ln(te.marker)-ln(c);if(_e>=0&&Se<=0||_e<=0&&Se>=0)continue;if(_e<=0&&(te.marker.inclusiveRight&&c.inclusiveLeft?ft(ae.to,i)>=0:ft(ae.to,i)>0)||_e>=0&&(te.marker.inclusiveRight&&c.inclusiveLeft?ft(ae.from,n)<=0:ft(ae.from,n)<0))return!0}}function xr(e){for(var t;t=jr(e);)e=t.find(-1,!0).line;return e}function Pi(e){for(var t;t=Hr(e);)e=t.find(1,!0).line;return e}function On(e){for(var t,i;t=Hr(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qn(e,t){var i=Ze(e,t),n=xr(i);return i==n?t:pt(n)}function Xr(e,t){if(t>e.lastLine())return t;var i=Ze(e,t),n;if(!Pr(e,i))return t;for(;n=Hr(i);)i=n.find(1,!0).line;return pt(i)+1}function Pr(e,t){var i=lr&&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&&ei(e,t,n))return!0}}function ei(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return ei(e,n.line,Lr(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var c=void 0,F=0;F<t.markedSpans.length;++F)if(c=t.markedSpans[F],c.marker.collapsed&&!c.marker.widgetNode&&c.from==i.to&&(c.to==null||c.to!=i.from)&&(c.marker.inclusiveLeft||i.marker.inclusiveRight)&&ei(e,t,c))return!0}function Ir(e){e=xr(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 F=i.parent;F;i=F,F=i.parent)for(var V=0;V<F.children.length;++V){var q=F.children[V];if(q==i)break;t+=q.height}return t}function ti(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=jr(n);){var c=i.find(0,!0);n=c.from.line,t+=c.from.ch-c.to.ch}for(n=e;i=Hr(n);){var F=i.find(0,!0);t-=n.text.length-F.from.ch,n=F.to.line,t+=n.text.length-F.to.ch}return t}function Ni(e){var t=e.display,i=e.doc;t.maxLine=Ze(i,i.first),t.maxLineLength=ti(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var c=ti(n);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=n)})}var un=function(e,t,i){this.text=e,Sn(this,t),this.height=i?i(this):1};un.prototype.lineNo=function(){return pt(this)},fe(un);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),la(e),Sn(e,i);var c=n?n(e):1;c!=e.height&&ct(e,c)}function st(e){e.parent=null,la(e)}var mt={},ut={};function xt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ut:mt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Rt(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 F=c?t.rest[c-1]:t.line,V=void 0;n.pos=0,n.addToken=At,yt(e.display.measure)&&(V=Ge(F,e.doc.direction))&&(n.addToken=cr(n.addToken,V)),n.map=[];var q=t!=e.display.externalMeasured&&pt(F);Wr(F,n,an(e,F,q)),F.styleClasses&&(F.styleClasses.bgClass&&(n.bgClass=E(F.styleClasses.bgClass,n.bgClass||"")),F.styleClasses.textClass&&(n.textClass=E(F.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(et(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 te=n.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return de(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=E(n.pre.className,n.textClass||"")),n}function Pt(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 At(e,t,i,n,c,F,V){if(!t)return;var q=e.splitSpaces?Yt(t,e.trailingSpace):t,te=e.cm.state.specialChars,ae=!1,_e;if(!te.test(t))e.col+=t.length,_e=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,_e),K&&G<9&&(ae=!0),e.pos+=t.length;else{_e=document.createDocumentFragment();for(var Se=0;;){te.lastIndex=Se;var ke=te.exec(t),De=ke?ke.index-Se:t.length-Se;if(De){var Fe=document.createTextNode(q.slice(Se,Se+De));K&&G<9?_e.appendChild(d("span",[Fe])):_e.appendChild(Fe),e.map.push(e.pos,e.pos+De,Fe),e.col+=De,e.pos+=De}if(!ke)break;Se+=De+1;var je=void 0;if(ke[0]==" "){var Ve=e.cm.options.tabSize,$e=Ve-e.col%Ve;je=_e.appendChild(d("span",Y($e),"cm-tab")),je.setAttribute("role","presentation"),je.setAttribute("cm-text"," "),e.col+=$e}else ke[0]=="\r"||ke[0]==`
|
|
`?(je=_e.appendChild(d("span",ke[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),je.setAttribute("cm-text",ke[0]),e.col+=1):(je=e.cm.options.specialCharPlaceholder(ke[0]),je.setAttribute("cm-text",ke[0]),K&&G<9?_e.appendChild(d("span",[je])):_e.appendChild(je),e.col+=1);e.map.push(e.pos,e.pos+1,je),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,i||n||c||ae||F||V){var tt=i||"";n&&(tt+=n),c&&(tt+=c);var Je=d("span",[_e],tt,F);if(V)for(var nt in V)V.hasOwnProperty(nt)&&nt!="style"&&nt!="class"&&Je.setAttribute(nt,V[nt]);return e.content.appendChild(Je)}e.content.appendChild(_e)}function Yt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",c=0;c<e.length;c++){var F=e.charAt(c);F==" "&&i&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(F="\xA0"),n+=F,i=F==" "}return n}function cr(e,t){return function(i,n,c,F,V,q,te){c=c?c+" cm-force-border":"cm-force-border";for(var ae=i.pos,_e=ae+n.length;;){for(var Se=void 0,ke=0;ke<t.length&&!(Se=t[ke],Se.to>ae&&Se.from<=ae);ke++);if(Se.to>=_e)return e(i,n,c,F,V,q,te);e(i,n.slice(0,Se.to-ae),c,F,null,q,te),F=null,n=n.slice(Se.to-ae),ae=Se.to}}}function St(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 Wr(e,t,i){var n=e.markedSpans,c=e.text,F=0;if(!n){for(var V=1;V<i.length;V+=2)t.addToken(t,c.slice(F,F=i[V]),xt(i[V+1],t.cm.options));return}for(var q=c.length,te=0,ae=1,_e="",Se,ke,De=0,Fe,je,Ve,$e,tt;;){if(De==te){Fe=je=Ve=ke="",tt=null,$e=null,De=Infinity;for(var Je=[],nt=void 0,ht=0;ht<n.length;++ht){var lt=n[ht],bt=lt.marker;if(bt.type=="bookmark"&<.from==te&&bt.widgetNode)Je.push(bt);else if(lt.from<=te&&(lt.to==null||lt.to>te||bt.collapsed&<.to==te&<.from==te)){if(lt.to!=null&<.to!=te&&De>lt.to&&(De=lt.to,je=""),bt.className&&(Fe+=" "+bt.className),bt.css&&(ke=(ke?ke+";":"")+bt.css),bt.startStyle&<.from==te&&(Ve+=" "+bt.startStyle),bt.endStyle&<.to==De&&(nt||(nt=[])).push(bt.endStyle,lt.to),bt.title&&((tt||(tt={})).title=bt.title),bt.attributes)for(var Nt in bt.attributes)(tt||(tt={}))[Nt]=bt.attributes[Nt];bt.collapsed&&(!$e||Cn($e.marker,bt)<0)&&($e=lt)}else lt.from>te&&De>lt.from&&(De=lt.from)}if(nt)for(var Zt=0;Zt<nt.length;Zt+=2)nt[Zt+1]==De&&(je+=" "+nt[Zt]);if(!$e||$e.from==te)for(var Wt=0;Wt<Je.length;++Wt)St(t,0,Je[Wt]);if($e&&($e.from||0)==te){if(St(t,($e.to==null?q+1:$e.to)-te,$e.marker,$e.from==null),$e.to==null)return;$e.to==te&&($e=!1)}}if(te>=q)break;for(var _r=Math.min(q,De);;){if(_e){var gr=te+_e.length;if(!$e){var Vt=gr>_r?_e.slice(0,_r-te):_e;t.addToken(t,Vt,Se?Se+Fe:Fe,Ve,te+Vt.length==De?je:"",ke,tt)}if(gr>=_r){_e=_e.slice(_r-te),te=_r;break}te=gr,Ve=""}_e=c.slice(F,F=i[ae++]),Se=xt(i[ae++],t.cm.options)}}}function It(e,t,i){this.line=t,this.rest=On(t),this.size=this.rest?pt(_(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Pr(e,t)}function fr(e,t,i){for(var n=[],c,F=t;F<i;F=c){var V=new It(e.doc,Ze(e.doc,F),F);c=F+V.size,n.push(V)}return n}var nr=null;function Cr(e){nr?nr.ops.push(e):e.ownsGroup=nr={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{nr=null,t(i)}}var ri=null;function er(e,t){var i=it(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),c;nr?c=nr.delayedCallbacks:ri?c=ri:(c=ri=[],setTimeout(Do,0));for(var F=function(q){c.push(function(){return i[q].apply(null,n)})},V=0;V<i.length;++V)F(V)}function Do(){var e=ri;ri=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 F=t.changes[c];F=="text"?Mo(e,t):F=="gutter"?Ja(e,t,i,n):F=="class"?ha(e,t):F=="widget"&&Po(e,t,n)}t.changes=null}function ni(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),K&&G<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=ni(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):Rt(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?ni(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=ni(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 F=t.line.gutterMarkers;if(e.options.lineNumbers||F){var V=ni(t),q=t.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),V.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!F||!F["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(d("div",Bt(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),F)for(var te=0;te<e.display.gutterSpecs.length;++te){var ae=e.display.gutterSpecs[te].className,_e=F.hasOwnProperty(ae)&&F[ae];_e&&q.appendChild(d("div",[_e],"CodeMirror-gutter-elt","left: "+n.gutterLeft[ae]+"px; width: "+n.gutterWidth[ae]+"px"))}}}function Po(e,t,i){t.alignable&&(t.alignable=null);for(var n=L("CodeMirror-linewidget"),c=t.node.firstChild,F=void 0;c;c=F)F=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 F=ni(i),V=0,q=t.widgets;V<q.length;++V){var te=q[V],ae=d("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||ae.setAttribute("cm-ignore-events","true"),Fo(te,ae,i,n),e.display.input.setUneditable(ae),c&&te.above?F.insertBefore(ae,i.gutter||i.text):F.appendChild(ae),er(te,"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 ii(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;"),x(t.display.measure,d("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Gr(e,t){for(var i=xe(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 Fi(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=x(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 Nr(e){return ce-e.display.nativeBarWidth}function hn(e){return e.display.scroller.clientWidth-Nr(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-Nr(e)-e.display.barHeight}function Uo(e,t,i){var n=e.options.lineWrapping,c=n&&hn(e);if(!t.measure.heights||n&&t.measure.width!=c){var F=t.measure.heights=[];if(n){t.measure.width=c;for(var V=t.text.firstChild.getClientRects(),q=0;q<V.length-1;q++){var te=V[q],ae=V[q+1];Math.abs(te.bottom-ae.bottom)>2&&F.push((te.bottom+ae.top)/2-i.top)}}F.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(pt(e.rest[c])>i)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=xr(t);var i=pt(t),n=e.display.externalMeasured=new It(e.doc,t,i);n.lineN=i;var c=n.built=Rt(e,n);return n.text=c.pre,x(e.display.lineMeasure,c.pre),n}function ts(e,t,i,n){return Fr(e,Rn(e,t),i,n)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[fn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Rn(e,t){var i=pt(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 Fr(e,t,i,n,c){t.before&&(i=-1);var F=i+(n||""),V;return t.cache.hasOwnProperty(F)?V=t.cache[F]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),V=Ho(e,t,i,n),V.bogus||(t.cache[F]=V)),{left:V.left,right:V.right,top:c?V.rtop:V.top,bottom:c?V.rbottom:V.bottom}}var rs={left:0,right:0,top:0,bottom:0};function ns(e,t,i){for(var n,c,F,V,q,te,ae=0;ae<e.length;ae+=3)if(q=e[ae],te=e[ae+1],t<q?(c=0,F=1,V="left"):t<te?(c=t-q,F=c+1):(ae==e.length-3||t==te&&e[ae+3]>t)&&(F=te-q,c=F-1,t>=te&&(V="right")),c!=null){if(n=e[ae+2],q==te&&i==(n.insertLeft?"left":"right")&&(V=i),i=="left"&&c==0)for(;ae&&e[ae-2]==e[ae-3]&&e[ae-1].insertLeft;)n=e[(ae-=3)+2],V="left";if(i=="right"&&c==te-q)for(;ae<e.length-3&&e[ae+3]==e[ae+4]&&!e[ae+5].insertLeft;)n=e[(ae+=3)+2],V="right";break}return{node:n,start:c,end:F,collapse:V,coverStart:q,coverEnd:te}}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),F=c.node,V=c.start,q=c.end,te=c.collapse,ae;if(F.nodeType==3){for(var _e=0;_e<4;_e++){for(;V&&be(t.line.text.charAt(c.coverStart+V));)--V;for(;c.coverStart+q<c.coverEnd&&be(t.line.text.charAt(c.coverStart+q));)++q;if(K&&G<9&&V==0&&q==c.coverEnd-c.coverStart?ae=F.parentNode.getBoundingClientRect():ae=jo(y(F,V,q).getClientRects(),n),ae.left||ae.right||V==0)break;q=V,V=V-1,te="right"}K&&G<11&&(ae=Wo(e.display.measure,ae))}else{V>0&&(te=n="right");var Se;e.options.lineWrapping&&(Se=F.getClientRects()).length>1?ae=Se[n=="right"?Se.length-1:0]:ae=F.getBoundingClientRect()}if(K&&G<9&&!V&&(!ae||!ae.left&&!ae.right)){var ke=F.parentNode.getClientRects()[0];ke?ae={left:ke.left,right:ke.left+In(e.display),top:ke.top,bottom:ke.bottom}:ae=rs}for(var De=ae.top-t.rect.top,Fe=ae.bottom-t.rect.top,je=(De+Fe)/2,Ve=t.view.measure.heights,$e=0;$e<Ve.length-1&&!(je<Ve[$e]);$e++);var tt=$e?Ve[$e-1]:0,Je=Ve[$e],nt={left:(te=="right"?ae.right:ae.left)-t.rect.left,right:(te=="left"?ae.left:ae.right)-t.rect.left,top:tt,bottom:Je};return!ae.left&&!ae.right&&(nt.bogus=!0),e.options.singleCursorHeightPerLine||(nt.rtop=De,nt.rbottom=Fe),nt}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ut(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 ai(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+=ii(e.widgets[i]));return t}function Ui(e,t,i,n,c){if(!c){var F=pa(t);i.top+=F,i.bottom+=F}if(n=="line")return i;n||(n="local");var V=Ir(t);if(n=="local"?V+=Fi(e.display):V-=e.display.viewOffset,n=="page"||n=="window"){var q=e.display.lineSpace.getBoundingClientRect();V+=q.top+(n=="window"?0:os());var te=q.left+(n=="window"?0:ss());i.left+=te,i.right+=te}return i.top+=V,i.bottom+=V,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 F=e.display.sizer.getBoundingClientRect();n+=F.left,c+=F.top}var V=e.display.lineSpace.getBoundingClientRect();return{left:n-V.left,top:c-V.top}}function ma(e,t,i,n,c){return n||(n=Ze(e.doc,t.line)),Ui(e,n,ts(e,n,t.ch,c),i)}function Dr(e,t,i,n,c,F){n=n||Ze(e.doc,t.line),c||(c=Rn(e,n));function V(Fe,je){var Ve=Fr(e,c,Fe,je?"right":"left",F);return je?Ve.left=Ve.right:Ve.right=Ve.left,Ui(e,n,Ve,i)}var q=Ge(n,e.doc.direction),te=t.ch,ae=t.sticky;if(te>=n.text.length?(te=n.text.length,ae="before"):te<=0&&(te=0,ae="after"),!q)return V(ae=="before"?te-1:te,ae=="before");function _e(Fe,je,Ve){var $e=q[je],tt=$e.level==1;return V(Ve?Fe-1:Fe,tt!=Ve)}var Se=Be(q,te,ae),ke=He,De=_e(te,Se,ae=="before");return ke!=null&&(De.other=_e(te,ke,ae!="before")),De}function us(e,t){var i=0;t=gt(e.doc,t),e.options.lineWrapping||(i=In(e.display)*t.ch);var n=Ze(e.doc,t.line),c=Ir(n)+Fi(e.display);return{left:i,right:i,top:c,bottom:c+n.height}}function ga(e,t,i,n,c){var F=We(e,t,i);return F.xRel=c,n&&(F.outside=n),F}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=wt(n,i),F=n.first+n.size-1;if(c>F)return ga(n.first+n.size-1,Ze(n,F).text.length,null,1,1);t<0&&(t=0);for(var V=Ze(n,c);;){var q=Go(e,V,c,t,i),te=An(V,q.ch+(q.xRel>0||q.outside>0?1:0));if(!te)return q;var ae=te.find(1);if(ae.line==c)return ae;V=Ze(n,c=ae.line)}}function hs(e,t,i,n){n-=pa(t);var c=t.text.length,F=Pe(function(V){return Fr(e,i,V-1).bottom<=n},c,0);return c=Pe(function(V){return Fr(e,i,V).top>n},F,c),{begin:F,end:c}}function ds(e,t,i,n){i||(i=Rn(e,t));var c=Ui(e,t,Fr(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-=Ir(t);var F=Rn(e,t),V=pa(t),q=0,te=t.text.length,ae=!0,_e=Ge(t,e.doc.direction);if(_e){var Se=(e.options.lineWrapping?Ko:zo)(e,t,i,F,_e,n,c);ae=Se.level!=1,q=ae?Se.from:Se.to-1,te=ae?Se.to:Se.from-1}var ke=null,De=null,Fe=Pe(function(ht){var lt=Fr(e,F,ht);return lt.top+=V,lt.bottom+=V,ya(lt,n,c,!1)?(lt.top<=c&<.left<=n&&(ke=ht,De=lt),!0):!1},q,te),je,Ve,$e=!1;if(De){var tt=n-De.left<De.right-n,Je=tt==ae;Fe=ke+(Je?0:1),Ve=Je?"after":"before",je=tt?De.left:De.right}else{!ae&&(Fe==te||Fe==q)&&Fe++,Ve=Fe==0?"after":Fe==t.text.length?"before":Fr(e,F,Fe-(ae?1:0)).bottom+V<=c==ae?"after":"before";var nt=Dr(e,We(i,Fe,Ve),"line",t,F);je=nt.left,$e=c<nt.top?-1:c>=nt.bottom?1:0}return Fe=Ce(t.text,Fe,1),ga(i,Fe,Ve,$e,n-je)}function zo(e,t,i,n,c,F,V){var q=Pe(function(Se){var ke=c[Se],De=ke.level!=1;return ya(Dr(e,We(i,De?ke.to:ke.from,De?"before":"after"),"line",t,n),F,V,!0)},0,c.length-1),te=c[q];if(q>0){var ae=te.level!=1,_e=Dr(e,We(i,ae?te.from:te.to,ae?"after":"before"),"line",t,n);ya(_e,F,V,!0)&&_e.top>V&&(te=c[q-1])}return te}function Ko(e,t,i,n,c,F,V){var q=hs(e,t,n,V),te=q.begin,ae=q.end;/\s/.test(t.text.charAt(ae-1))&&ae--;for(var _e=null,Se=null,ke=0;ke<c.length;ke++){var De=c[ke];if(De.from>=ae||De.to<=te)continue;var Fe=De.level!=1,je=Fr(e,n,Fe?Math.min(ae,De.to)-1:Math.max(te,De.from)).right,Ve=je<F?F-je+1e9:je-F;(!_e||Se>Ve)&&(_e=De,Se=Ve)}return _e||(_e=c[c.length-1]),_e.from<te&&(_e={from:te,to:_e.to,level:_e.level}),_e.to>ae&&(_e={from:_e.from,to:ae,level:_e.level}),_e}var dn;function Ln(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(dn==null){dn=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)dn.appendChild(document.createTextNode("x")),dn.appendChild(d("br"));dn.appendChild(document.createTextNode("x"))}x(e.measure,dn);var i=dn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),C(e.measure),i||1}function In(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),i=d("pre",[t],"CodeMirror-line-like");x(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,F=t.gutters.firstChild,V=0;F;F=F.nextSibling,++V){var q=e.display.gutterSpecs[V].className;i[q]=F.offsetLeft+F.clientLeft+c,n[q]=F.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=Ln(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/In(e.display)-3);return function(c){if(Pr(e.doc,c))return 0;var F=0;if(c.widgets)for(var V=0;V<c.widgets.length;V++)c.widgets[V].height&&(F+=c.widgets[V].height);return i?F+(Math.ceil(c.text.length/n)||1)*t:F+t}}function Ea(e){var t=e.doc,i=cs(e);t.iter(function(n){var c=i(n);c!=n.height&&ct(n,c)})}function cn(e,t,i,n){var c=e.display;if(!i&&xe(t).getAttribute("cm-not-content")=="true")return null;var F,V,q=c.lineSpace.getBoundingClientRect();try{F=t.clientX-q.left,V=t.clientY-q.top}catch(Se){return null}var te=va(e,F,V),ae;if(n&&te.xRel>0&&(ae=Ze(e.doc,te.line).text).length==te.ch){var _e=W(ae,ae.length,e.options.tabSize)-ae.length;te=We(te.line,Math.max(0,Math.round((F-qa(e.display).left)/In(e.display))-_e))}return te}function fn(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 pr(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)lr&&qn(e.doc,t)<c.viewTo&&$r(e);else if(i<=c.viewFrom)lr&&Xr(e.doc,i+n)>c.viewFrom?$r(e):(c.viewFrom+=n,c.viewTo+=n);else if(t<=c.viewFrom&&i>=c.viewTo)$r(e);else if(t<=c.viewFrom){var F=Bi(e,i,i+n,1);F?(c.view=c.view.slice(F.index),c.viewFrom=F.lineN,c.viewTo+=n):$r(e)}else if(i>=c.viewTo){var V=Bi(e,t,t,-1);V?(c.view=c.view.slice(0,V.index),c.viewTo=V.lineN):$r(e)}else{var q=Bi(e,t,t,-1),te=Bi(e,i,i+n,1);q&&te?(c.view=c.view.slice(0,q.index).concat(fr(e,q.lineN,te.lineN)).concat(c.view.slice(te.index)),c.viewTo+=n):$r(e)}var ae=c.externalMeasured;ae&&(i<ae.lineN?ae.lineN+=n:t<ae.lineN+ae.size&&(c.externalMeasured=null))}function Yr(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 F=n.view[fn(e,t)];if(F.node==null)return;var V=F.changes||(F.changes=[]);le(V,i)==-1&&V.push(i)}function $r(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bi(e,t,i,n){var c=fn(e,t),F,V=e.display.view;if(!lr||i==e.doc.first+e.doc.size)return{index:c,lineN:i};for(var q=e.display.viewFrom,te=0;te<c;te++)q+=V[te].size;if(q!=t){if(n>0){if(c==V.length-1)return null;F=q+V[c].size-t,c++}else F=q-t;t+=F,i+=F}for(;qn(e.doc,i)!=i;){if(c==(n<0?0:V.length-1))return null;i+=n*V[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=fr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=fr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(fn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(fr(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,fn(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 si(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(),F=n.selection=document.createDocumentFragment(),V=0;V<i.sel.ranges.length;V++){if(!t&&V==i.sel.primIndex)continue;var q=i.sel.ranges[V];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var te=q.empty();(te||e.options.showCursorWhenSelecting)&&ms(e,q.head,c),te||Xo(e,q,F)}return n}function ms(e,t,i){var n=Dr(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 F=i.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));F.style.display="",F.style.left=n.other.left+"px",F.style.top=n.other.top+"px",F.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function ji(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,i){var n=e.display,c=e.doc,F=document.createDocumentFragment(),V=qa(e.display),q=V.left,te=Math.max(n.sizerWidth,hn(e)-n.sizer.offsetLeft)-V.right,ae=c.direction=="ltr";function _e(Je,nt,ht,lt){nt<0&&(nt=0),nt=Math.round(nt),lt=Math.round(lt),F.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Je+`px;
|
|
top: `+nt+"px; width: "+(ht==null?te-Je:ht)+`px;
|
|
height: `+(lt-nt)+"px"))}function Se(Je,nt,ht){var lt=Ze(c,Je),bt=lt.text.length,Nt,Zt;function Wt(Vt,vr){return ma(e,We(Je,Vt),"div",lt,vr)}function _r(Vt,vr,tr){var $t=ds(e,lt,null,Vt),Xt=vr=="ltr"==(tr=="after")?"left":"right",Gt=tr=="after"?$t.begin:$t.end-(/\s/.test(lt.text.charAt($t.end-1))?2:1);return Wt(Gt,Xt)[Xt]}var gr=Ge(lt,c.direction);return Ue(gr,nt||0,ht==null?bt:ht,function(Vt,vr,tr,$t){var Xt=tr=="ltr",Gt=Wt(Vt,Xt?"left":"right"),yr=Wt(vr-1,Xt?"right":"left"),zn=nt==null&&Vt==0,tn=ht==null&&vr==bt,ar=$t==0,Ur=!gr||$t==gr.length-1;if(yr.top-Gt.top<=3){var qt=(ae?zn:tn)&&ar,Va=(ae?tn:zn)&&Ur,Kr=qt?q:(Xt?Gt:yr).left,yn=Va?te:(Xt?yr:Gt).right;_e(Kr,Gt.top,yn-Kr,Gt.bottom)}else{var bn,hr,Kn,Xa;Xt?(bn=ae&&zn&&ar?q:Gt.left,hr=ae?te:_r(Vt,tr,"before"),Kn=ae?q:_r(vr,tr,"after"),Xa=ae&&tn&&Ur?te:yr.right):(bn=ae?_r(Vt,tr,"before"):q,hr=!ae&&zn&&ar?te:Gt.right,Kn=!ae&&tn&&Ur?q:yr.left,Xa=ae?_r(vr,tr,"after"):te),_e(bn,Gt.top,hr-bn,Gt.bottom),Gt.bottom<yr.top&&_e(q,Gt.bottom,null,yr.top),_e(Kn,yr.top,Xa-Kn,yr.bottom)}(!Nt||ji(Gt,Nt)<0)&&(Nt=Gt),ji(yr,Nt)<0&&(Nt=yr),(!Zt||ji(Gt,Zt)<0)&&(Zt=Gt),ji(yr,Zt)<0&&(Zt=yr)}),{start:Nt,end:Zt}}var ke=t.from(),De=t.to();if(ke.line==De.line)Se(ke.line,ke.ch,De.ch);else{var Fe=Ze(c,ke.line),je=Ze(c,De.line),Ve=xr(Fe)==xr(je),$e=Se(ke.line,ke.ch,Ve?Fe.text.length+1:null).end,tt=Se(De.line,Ve?0:null,De.ch).start;Ve&&($e.top<tt.top-2?(_e($e.right,$e.top,null,$e.bottom),_e(q,tt.top,tt.left,tt.bottom)):_e($e.right,$e.top,tt.left-$e.right,$e.bottom)),$e.bottom<tt.top&&_e(q,$e.bottom,null,tt.top)}i.appendChild(F)}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()||Dn(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,Dn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(de(e,"focus",e,t),e.state.focused=!0,U(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 Dn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(de(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 Hi(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var c=t.view[n],F=e.options.lineWrapping,V=void 0,q=0;if(c.hidden)continue;if(K&&G<8){var te=c.node.offsetTop+c.node.offsetHeight;V=te-i,i=te}else{var ae=c.node.getBoundingClientRect();V=ae.bottom-ae.top,!F&&c.text.firstChild&&(q=c.text.firstChild.getBoundingClientRect().right-ae.left-1)}var _e=c.line.height-V;if((_e>.005||_e<-.005)&&(ct(c.line,V),ys(c.line),c.rest))for(var Se=0;Se<c.rest.length;Se++)ys(c.rest[Se]);if(q>e.display.sizerWidth){var ke=Math.ceil(q/In(e.display));ke>e.display.maxLineLength&&(e.display.maxLineLength=ke,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 Wi(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Fi(e));var c=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,F=wt(t,n),V=wt(t,c);if(i&&i.ensure){var q=i.ensure.from.line,te=i.ensure.to.line;q<F?(F=q,V=wt(t,Ir(Ze(t,q))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=V&&(F=wt(t,Ir(Ze(t,te))-e.wrapper.clientHeight),V=te)}return{from:F,to:Math.max(V,F+1)}}function Yo(e,t){if(ee(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 F=d("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Fi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Nr(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(c),e.display.lineSpace.removeChild(F)}}function $o(e,t,i,n){n==null&&(n=0);var c;!e.options.lineWrapping&&t==i&&(t=t.ch?We(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?We(t.line,t.ch+1,"before"):t);for(var F=0;F<5;F++){var V=!1,q=Dr(e,t),te=!i||i==t?q:Dr(e,i);c={left:Math.min(q.left,te.left),top:Math.min(q.top,te.top)-n,right:Math.max(q.left,te.left),bottom:Math.max(q.bottom,te.bottom)+n};var ae=wa(e,c),_e=e.doc.scrollTop,Se=e.doc.scrollLeft;if(ae.scrollTop!=null&&(li(e,ae.scrollTop),Math.abs(e.doc.scrollTop-_e)>1&&(V=!0)),ae.scrollLeft!=null&&(pn(e,ae.scrollLeft),Math.abs(e.doc.scrollLeft-Se)>1&&(V=!0)),!V)break}return c}function Jo(e,t){var i=wa(e,t);i.scrollTop!=null&&li(e,i.scrollTop),i.scrollLeft!=null&&pn(e,i.scrollLeft)}function wa(e,t){var i=e.display,n=Ln(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,F=ca(e),V={};t.bottom-t.top>F&&(t.bottom=t.top+F);var q=e.doc.height+da(i),te=t.top<n,ae=t.bottom>q-n;if(t.top<c)V.scrollTop=te?0:t.top;else if(t.bottom>c+F){var _e=Math.min(t.top,(ae?q:t.bottom)-F);_e!=c&&(V.scrollTop=_e)}var Se=e.options.fixedGutter?0:i.gutters.offsetWidth,ke=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Se,De=hn(e)-i.gutters.offsetWidth,Fe=t.right-t.left>De;return Fe&&(t.right=t.left+De),t.left<10?V.scrollLeft=0:t.left<ke?V.scrollLeft=Math.max(0,t.left+Se-(Fe?0:10)):t.right>De+ke-3&&(V.scrollLeft=t.right+(Fe?0:10)-De),V}function Sa(e,t){if(t==null)return;Gi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function kn(e){Gi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function oi(e,t,i){(t!=null||i!=null)&&Gi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Qo(e,t){Gi(e),e.curOp.scrollToPos=t}function Gi(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});oi(e,c.scrollLeft,c.scrollTop)}function li(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Aa(e,{top:t}),_s(e,t,!0),N&&Aa(e),di(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 pn(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 ui(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+Nr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var mn=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),Me(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Me(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mn.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 F=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+F)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},mn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mn.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 J,this.disableVert=new J},mn.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var c=e.getBoundingClientRect(),F=i=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);F!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},mn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hi=function(){};hi.prototype.update=function(){return{bottom:0,right:0}},hi.prototype.setScrollLeft=function(){},hi.prototype.setScrollTop=function(){},hi.prototype.clear=function(){};function Mn(e,t){t||(t=ui(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&&Hi(e),Es(e,ui(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:mn,null:hi};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),Me(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"?pn(e,t):li(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function gn(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},Cr(e.curOp)}function vn(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 F=0;F<t.length;F++)nl(t[F]);for(var V=0;V<t.length;V++)il(t[V])}function el(e){var t=e.cm,i=t.display;sl(t),e.updateMaxLine&&Ni(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 zi(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&&Hi(t),e.barMeasure=ui(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+Nr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-hn(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&&pn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Mn(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&&pn(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,gt(n,e.scrollToPos.from),gt(n,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,c)}var F=e.maybeHiddenMarkers,V=e.maybeUnhiddenMarkers;if(F)for(var q=0;q<F.length;++q)F[q].lines.length||de(F[q],"hide");if(V)for(var te=0;te<V.length;++te)V[te].lines.length&&de(V[te],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&de(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function br(e,t){if(e.curOp)return t();gn(e);try{return t()}finally{vn(e)}}function Jt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);gn(e);try{return t.apply(e,arguments)}finally{vn(e)}}}function ur(e){return function(){if(this.curOp)return e.apply(this,arguments);gn(this);try{return e.apply(this,arguments)}finally{vn(this)}}}function Qt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);gn(t);try{return e.apply(this,arguments)}finally{vn(t)}}}function di(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=Ar(e,t.highlightFrontier),c=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(F){if(n.line>=e.display.viewFrom){var V=F.styles,q=F.text.length>e.options.maxHighlightLength?Et(t.mode,n.state):null,te=Vn(e,F,n,!0);q&&(n.state=q),F.styles=te.styles;var ae=F.styleClasses,_e=te.classes;_e?F.styleClasses=_e:ae&&(F.styleClasses=null);for(var Se=!V||V.length!=F.styles.length||ae!=_e&&(!ae||!_e||ae.bgClass!=_e.bgClass||ae.textClass!=_e.textClass),ke=0;!Se&&ke<V.length;++ke)Se=V[ke]!=F.styles[ke];Se&&c.push(n.line),F.stateAfter=n.save(),n.nextLine()}else F.text.length<=e.options.maxHighlightLength&&Xn(e,F.text,n),F.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return di(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),c.length&&br(e,function(){for(var F=0;F<c.length;F++)Yr(e,c[F],"text")})}var zi=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Wi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=hn(e),this.force=i,this.dims=ba(e),this.events=[]};zi.prototype.signal=function(e,t){oe(e,t)&&this.events.push(arguments)},zi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)de.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=Nr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Nr(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=j();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==j())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 $r(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)&&($r(e),t.dims=ba(e));var c=n.first+n.size,F=Math.max(t.visible.from-e.options.viewportMargin,n.first),V=Math.min(c,t.visible.to+e.options.viewportMargin);i.viewFrom<F&&F-i.viewFrom<20&&(F=Math.max(n.first,i.viewFrom)),i.viewTo>V&&i.viewTo-V<20&&(V=Math.min(c,i.viewTo)),lr&&(F=qn(e.doc,F),V=Xr(e.doc,V));var q=F!=i.viewFrom||V!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vo(e,F,V),i.viewOffset=Ir(Ze(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var te=fs(e);if(!q&&te==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ae=ol(e);return te>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),te>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(ae),C(i.cursorDiv),C(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,q&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,di(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==hn(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+da(e.display)-ca(e),i.top)}),t.visible=Wi(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Wi(e.display,e.doc,i));if(!Ca(e,t))break;Hi(e);var c=ui(e);si(e),Mn(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 zi(e,t);if(Ca(e,i)){Hi(e),ws(e,i);var n=ui(e);si(e),Mn(e,n),Ra(e,n),i.finish()}}function ul(e,t,i){var n=e.display,c=e.options.lineNumbers,F=n.lineDiv,V=F.firstChild;function q(Fe){var je=Fe.nextSibling;return r&&s&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),je}for(var te=n.view,ae=n.viewFrom,_e=0;_e<te.length;_e++){var Se=te[_e];if(!Se.hidden)if(!Se.node||Se.node.parentNode!=F){var ke=No(e,Se,ae,i);F.insertBefore(ke,V)}else{for(;V!=Se.node;)V=q(V);var De=c&&t!=null&&t<=ae&&Se.lineNumber;Se.changes&&(le(Se.changes,"gutter")>-1&&(De=!1),Ya(e,Se,ae,i)),De&&(C(Se.lineNumber),Se.lineNumber.appendChild(document.createTextNode(Bt(e.options,ae)))),V=Se.node.nextSibling}ae+=Se.size}for(;V;)V=q(V)}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+Nr(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,F=n+"px",V=0;V<i.length;V++)if(!i[V].hidden){e.options.fixedGutter&&(i[V].gutter&&(i[V].gutter.style.left=F),i[V].gutterBackground&&(i[V].gutterBackground.style.left=F));var q=i[V].alignable;if(q)for(var te=0;te<q.length;te++)q[te].style.left=F}e.options.fixedGutter&&(t.gutters.style.left=n+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Bt(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")),F=c.firstChild.offsetWidth,V=c.offsetWidth-F;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(F,n.lineGutter.offsetWidth-V)+1,n.lineNumWidth=n.lineNumInnerWidth+V,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 F=e[c],V=null;if(typeof F!="string"&&(V=F.style,F=F.className),F=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:F,style:V})}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],F=c.className,V=c.style,q=t.appendChild(d("div",null,"CodeMirror-gutter "+F));V&&(q.style.cssText=V),F=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oa(e)}function ci(e){As(e.display),pr(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 F=w("div",[c.lineSpace],"CodeMirror-lines");c.mover=d("div",[F],null,"position: relative"),c.sizer=d("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=d("div",null,null,"position: absolute; height: "+ce+"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"),K&&G<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!r&&!(N&&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 Ki=0,Tr=null;K?Tr=-.53:N?Tr=15:v?Tr=-.7:p&&(Tr=-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*=Tr,t.y*=Tr,t}function Rs(e,t){var i=Os(t),n=i.x,c=i.y,F=e.display,V=F.scroller,q=V.scrollWidth>V.clientWidth,te=V.scrollHeight>V.clientHeight;if(!(n&&q||c&&te))return;if(c&&s&&r){e:for(var ae=t.target,_e=F.view;ae!=V;ae=ae.parentNode)for(var Se=0;Se<_e.length;Se++)if(_e[Se].node==ae){e.display.currentWheelTarget=ae;break e}}if(n&&!N&&!m&&Tr!=null){c&&te&&li(e,Math.max(0,V.scrollTop+c*Tr)),pn(e,Math.max(0,V.scrollLeft+n*Tr)),(!c||c&&te)&&re(t),F.wheelStartX=null;return}if(c&&Tr!=null){var ke=c*Tr,De=e.doc.scrollTop,Fe=De+F.wrapper.clientHeight;ke<0?De=Math.max(0,De+ke-50):Fe=Math.min(e.doc.height,Fe+ke+50),Aa(e,{top:De,bottom:Fe})}Ki<20&&(F.wheelStartX==null?(F.wheelStartX=V.scrollLeft,F.wheelStartY=V.scrollTop,F.wheelDX=n,F.wheelDY=c,setTimeout(function(){if(F.wheelStartX==null)return;var je=V.scrollLeft-F.wheelStartX,Ve=V.scrollTop-F.wheelStartY,$e=Ve&&F.wheelDY&&Ve/F.wheelDY||je&&F.wheelDX&&je/F.wheelDX;if(F.wheelStartX=F.wheelStartY=null,!$e)return;Tr=(Tr*Ki+$e)/(Ki+1),++Ki},200)):(F.wheelDX+=n,F.wheelDY+=c))}var wr=function(e,t){this.ranges=e,this.primIndex=t};wr.prototype.primary=function(){return this.ranges[this.primIndex]},wr.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(!rn(i.anchor,n.anchor)||!rn(i.head,n.head))return!1}return!0},wr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Dt(_n(this.ranges[t].anchor),_n(this.ranges[t].head));return new wr(e,this.primIndex)},wr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},wr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(ft(t,n.from())>=0&&ft(e,n.to())<=0)return i}return-1};var Dt=function(e,t){this.anchor=e,this.head=t};Dt.prototype.from=function(){return nn(this.anchor,this.head)},Dt.prototype.to=function(){return En(this.anchor,this.head)},Dt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function kr(e,t,i){var n=e&&e.options.selectionsMayTouch,c=t[i];t.sort(function(ke,De){return ft(ke.from(),De.from())}),i=le(t,c);for(var F=1;F<t.length;F++){var V=t[F],q=t[F-1],te=ft(q.to(),V.from());if(n&&!V.empty()?te>0:te>=0){var ae=nn(q.from(),V.from()),_e=En(q.to(),V.to()),Se=q.empty()?V.from()==V.head:q.from()==q.head;F<=i&&--i,t.splice(--F,2,new Dt(Se?_e:ae,Se?ae:_e))}}return new wr(t,i)}function Jr(e,t){return new wr([new Dt(e,t||e)],0)}function Qr(e){return e.text?We(e.from.line+e.text.length-1,_(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(ft(e,t.from)<0)return e;if(ft(e,t.to)<=0)return Qr(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+=Qr(t).ch-t.to.ch),We(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 Dt(Ls(c.anchor,t),Ls(c.head,t)))}return kr(e.cm,i,e.sel.primIndex)}function Is(e,t,i){return e.line==t.line?We(i.line,e.ch-t.ch+i.ch):We(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var n=[],c=We(e.first,0),F=c,V=0;V<t.length;V++){var q=t[V],te=Is(q.from,c,F),ae=Is(Qr(q),c,F);if(c=q.to,F=ae,i=="around"){var _e=e.sel.ranges[V],Se=ft(_e.head,_e.anchor)<0;n[V]=new Dt(Se?ae:te,Se?te:ae)}else n[V]=new Dt(te,te)}return new wr(n,e.sel.primIndex)}function Da(e){e.doc.mode=dr(e.options,e.doc.modeOption),fi(e)}function fi(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,di(e,100),e.state.modeGen++,e.curOp&&pr(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&_(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,i,n){function c(tt){return i?i[tt]:null}function F(tt,Je,nt){ua(tt,Je,nt,n),er(tt,"change",tt,t)}function V(tt,Je){for(var nt=[],ht=tt;ht<Je;++ht)nt.push(new un(ae[ht],c(ht),n));return nt}var q=t.from,te=t.to,ae=t.text,_e=Ze(e,q.line),Se=Ze(e,te.line),ke=_(ae),De=c(ae.length-1),Fe=te.line-q.line;if(t.full)e.insert(0,V(0,ae.length)),e.remove(ae.length,e.size-ae.length);else if(Ds(e,t)){var je=V(0,ae.length-1);F(Se,Se.text,De),Fe&&e.remove(q.line,Fe),je.length&&e.insert(q.line,je)}else if(_e==Se)if(ae.length==1)F(_e,_e.text.slice(0,q.ch)+ke+_e.text.slice(te.ch),De);else{var Ve=V(1,ae.length-1);Ve.push(new un(ke+_e.text.slice(te.ch),De,n)),F(_e,_e.text.slice(0,q.ch)+ae[0],c(0)),e.insert(q.line+1,Ve)}else if(ae.length==1)F(_e,_e.text.slice(0,q.ch)+ae[0]+Se.text.slice(te.ch),c(0)),e.remove(q.line+1,Fe);else{F(_e,_e.text.slice(0,q.ch)+ae[0],c(0)),F(Se,ke+Se.text.slice(te.ch),De);var $e=V(1,ae.length-1);Fe>1&&e.remove(q.line+1,Fe-1),e.insert(q.line+1,$e)}er(e,"change",e,t)}function Zr(e,t,i){function n(c,F,V){if(c.linked)for(var q=0;q<c.linked.length;++q){var te=c.linked[q];if(te.doc==F)continue;var ae=V&&te.sharedHist;if(i&&!ae)continue;t(te.doc,ae),n(te.doc,c,ae)}}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||Ni(e),e.options.mode=t.modeOption,pr(e)}function Ms(e){(e.doc.direction=="rtl"?U:A)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){br(e,function(){Ms(e),pr(e)})}function Vi(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:_n(t.from),to:Qr(t),text:Ct(e,t.from,t.to)};return Fs(e,i,t.from.line,t.to.line+1),Zr(e,function(n){return Fs(n,i,t.from.line,t.to.line+1)},!0),i}function Ps(e){for(;e.length;){var t=_(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),_(e.done);if(e.done.length&&!_(e.done).ranges)return _(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),_(e.done)}function Ns(e,t,i,n){var c=e.history;c.undone.length=0;var F=+new Date,V,q;if((c.lastOp==n||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(V=pl(c,c.lastOp==n)))q=_(V.changes),ft(t.from,t.to)==0&&ft(t.from,q.to)==0?q.to=Qr(t):V.changes.push(Ma(e,t));else{var te=_(c.done);for((!te||!te.ranges)&&Xi(e.sel,c.done),V={changes:[Ma(e,t)],generation:c.generation},c.done.push(V);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=F,c.lastOp=c.lastSelOp=n,c.lastOrigin=c.lastSelOrigin=t.origin,q||de(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,F=n&&n.origin;i==c.lastSelOp||F&&c.lastSelOrigin==F&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==F||ml(e,F,_(c.done),t))?c.done[c.done.length-1]=t:Xi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=F,c.lastSelOp=i,n&&n.clearRedo!==!1&&Ps(c.undone)}function Xi(e,t){var i=_(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fs(e,t,i,n){var c=t["spans_"+e.id],F=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(V){V.markedSpans&&((c||(c=t["spans_"+e.id]={}))[F]=V.markedSpans),++F})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var 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=wn(e,t);if(!i)return n;if(!n)return i;for(var c=0;c<i.length;++c){var F=i[c],V=n[c];if(F&&V){e:for(var q=0;q<V.length;++q){for(var te=V[q],ae=0;ae<F.length;++ae)if(F[ae].marker==te.marker)continue e;F.push(te)}}else V&&(i[c]=V)}return i}function Pn(e,t,i){for(var n=[],c=0;c<e.length;++c){var F=e[c];if(F.ranges){n.push(i?wr.prototype.deepCopy.call(F):F);continue}var V=F.changes,q=[];n.push({changes:q});for(var te=0;te<V.length;++te){var ae=V[te],_e=void 0;if(q.push({from:ae.from,to:ae.to,text:ae.text}),t)for(var Se in ae)(_e=Se.match(/^spans_(\d+)$/))&&(le(t,Number(_e[1]))>-1&&(_(q)[Se]=ae[Se],delete ae[Se]))}}return n}function Pa(e,t,i,n){if(n){var c=e.anchor;if(i){var F=ft(t,c)<0;F!=ft(i,c)<0?(c=t,t=i):F!=ft(t,i)<0&&(t=i)}return new Dt(c,t)}else return new Dt(i||t,t)}function Yi(e,t,i,n,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),ir(e,new wr([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),F=0;F<e.sel.ranges.length;F++)n[F]=Pa(e.sel.ranges[F],t[F],null,c);var V=kr(e.cm,n,e.sel.primIndex);ir(e,V,i)}function Na(e,t,i,n){var c=e.sel.ranges.slice(0);c[t]=i,ir(e,kr(e.cm,c,e.sel.primIndex),n)}function js(e,t,i,n){ir(e,Jr(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(c){this.ranges=[];for(var F=0;F<c.length;F++)this.ranges[F]=new Dt(gt(e,c[F].anchor),gt(e,c[F].head))},origin:i&&i.origin};return de(e,"beforeSelectionChange",e,n),e.cm&&de(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?kr(e.cm,n.ranges,n.ranges.length-1):t}function Hs(e,t,i){var n=e.history.done,c=_(n);c&&c.ranges?(n[n.length-1]=t,$i(e,t,i)):ir(e,t,i)}function ir(e,t,i){$i(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function $i(e,t,i){(oe(e,"beforeSelectionChange")||e.cm&&oe(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(ft(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,zs(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&kn(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,ne(e.cm)),er(e,"cursorActivity",e)}function Gs(e){Ws(e,zs(e,e.sel,null,!1))}function zs(e,t,i,n){for(var c,F=0;F<t.ranges.length;F++){var V=t.ranges[F],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[F],te=Ji(e,V.anchor,q&&q.anchor,i,n),ae=Ji(e,V.head,q&&q.head,i,n);(c||te!=V.anchor||ae!=V.head)&&(c||(c=t.ranges.slice(0,F)),c[F]=new Dt(te,ae))}return c?kr(e.cm,c,t.primIndex):t}function Nn(e,t,i,n,c){var F=Ze(e,t.line);if(F.markedSpans)for(var V=0;V<F.markedSpans.length;++V){var q=F.markedSpans[V],te=q.marker,ae="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,_e="selectRight"in te?!te.selectRight:te.inclusiveRight;if((q.from==null||(ae?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(_e?q.to>=t.ch:q.to>t.ch))){if(c&&(de(te,"beforeCursorEnter"),te.explicitlyCleared))if(F.markedSpans){--V;continue}else break;if(!te.atomic)continue;if(i){var Se=te.find(n<0?1:-1),ke=void 0;if((n<0?_e:ae)&&(Se=Ks(e,Se,-n,Se&&Se.line==t.line?F:null)),Se&&Se.line==t.line&&(ke=ft(Se,i))&&(n<0?ke<0:ke>0))return Nn(e,Se,t,n,c)}var De=te.find(n<0?-1:1);return(n<0?ae:_e)&&(De=Ks(e,De,n,De.line==t.line?F:null)),De?Nn(e,De,t,n,c):null}}return t}function Ji(e,t,i,n,c){var F=n||1,V=Nn(e,t,i,F,c)||!c&&Nn(e,t,i,F,!0)||Nn(e,t,i,-F,c)||!c&&Nn(e,t,i,-F,!0);return V||(e.cantEdit=!0,We(e.first,0))}function Ks(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?gt(e,We(t.line-1)):null:i>0&&t.ch==(n||Ze(e,t.line)).text.length?t.line<e.first+e.size-1?We(t.line+1,0):null:new We(t.line,t.ch+i)}function Vs(e){e.setSelection(We(e.firstLine(),0),We(e.lastLine()),Ee)}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,F,V,q){c&&(n.from=gt(e,c)),F&&(n.to=gt(e,F)),V&&(n.text=V),q!==void 0&&(n.origin=q)}),de(e,"beforeChange",e,n),e.cm&&de(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 Fn(e,t,i){if(e.cm){if(!e.cm.curOp)return Jt(e.cm,Fn)(e,t,i);if(e.cm.state.suppressEdits)return}if((oe(e,"beforeChange")||e.cm&&oe(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var n=Qn&&!i&&ki(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]==""&&ft(t.from,t.to)==0)return;var i=Ia(e,t);Ns(e,t,i,e.cm?e.cm.curOp.id:NaN),pi(e,t,i,wn(e,t));var n=[];Zr(e,function(c,F){!F&&le(n,c.history)==-1&&(Zs(c.history,t),n.push(c.history)),pi(c,t,null,wn(c,t))})}function Qi(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var c=e.history,F,V=e.sel,q=t=="undo"?c.done:c.undone,te=t=="undo"?c.undone:c.done,ae=0;ae<q.length&&!(F=q[ae],i?F.ranges&&!F.equals(e.sel):!F.ranges);ae++);if(ae==q.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(F=q.pop(),F.ranges){if(Xi(F,te),i&&!F.equals(e.sel)){ir(e,F,{clearRedo:!1});return}V=F}else if(n){q.push(F);return}else break;var _e=[];Xi(V,te),te.push({changes:_e,generation:c.generation}),c.generation=F.generation||++c.maxGeneration;for(var Se=oe(e,"beforeChange")||e.cm&&oe(e.cm,"beforeChange"),ke=function(je){var Ve=F.changes[je];if(Ve.origin=t,Se&&!Xs(e,Ve,!1))return q.length=0,{};_e.push(Ma(e,Ve));var $e=je?Ia(e,Ve):_(q);pi(e,Ve,$e,Us(e,Ve)),!je&&e.cm&&e.cm.scrollIntoView({from:Ve.from,to:Qr(Ve)});var tt=[];Zr(e,function(Je,nt){!nt&&le(tt,Je.history)==-1&&(Zs(Je.history,Ve),tt.push(Je.history)),pi(Je,Ve,null,Us(Je,Ve))})},De=F.changes.length-1;De>=0;--De){var Fe=ke(De);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new wr(k(e.sel.ranges,function(c){return new Dt(We(c.anchor.line+t,c.anchor.ch),We(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){pr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Yr(e.cm,n,"gutter")}}function pi(e,t,i,n){if(e.cm&&!e.cm.curOp)return Jt(e.cm,pi)(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:We(e.first,0),to:We(t.to.line+c,t.to.ch),text:[_(t.text)],origin:t.origin}}var F=e.lastLine();t.to.line>F&&(t={from:t.from,to:We(F,Ze(e,F).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ct(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),$i(e,i,Ee),e.cantEdit&&Ji(e,We(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,c=e.display,F=t.from,V=t.to,q=!1,te=F.line;e.options.lineWrapping||(te=pt(xr(Ze(n,F.line))),n.iter(te,V.line+1,function(De){if(De==c.maxLine)return q=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ne(e),ka(n,t,i,cs(e)),e.options.lineWrapping||(n.iter(te,F.line+t.text.length,function(De){var Fe=ti(De);Fe>c.maxLineLength&&(c.maxLine=De,c.maxLineLength=Fe,c.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),aa(n,F.line),di(e,400);var ae=t.text.length-(V.line-F.line)-1;t.full?pr(e):F.line==V.line&&t.text.length==1&&!Ds(e.doc,t)?Yr(e,F.line,"text"):pr(e,F.line,V.line+1,ae);var _e=oe(e,"changes"),Se=oe(e,"change");if(Se||_e){var ke={from:F,to:V,text:t.text,removed:t.removed,origin:t.origin};Se&&er(e,"change",e,ke),_e&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ke)}e.display.selForContextMenu=null}function Un(e,t,i,n,c){var F;n||(n=i),ft(n,i)<0&&(F=[n,i],i=F[0],n=F[1]),typeof t=="string"&&(t=e.splitLines(t)),Fn(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 F=e[c],V=!0;if(F.ranges){F.copied||(F=e[c]=F.deepCopy(),F.copied=!0);for(var q=0;q<F.ranges.length;q++)Js(F.ranges[q].anchor,t,i,n),Js(F.ranges[q].head,t,i,n);continue}for(var te=0;te<F.changes.length;++te){var ae=F.changes[te];if(i<ae.from.line)ae.from=We(ae.from.line+n,ae.from.ch),ae.to=We(ae.to.line+n,ae.to.ch);else if(t<=ae.to.line){V=!1;break}}V||(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 mi(e,t,i,n){var c=t,F=t;return typeof t=="number"?F=Ze(e,xn(e,t)):c=pt(t),c==null?null:(n(F,c)&&e.cm&&Yr(e.cm,c,i),F)}function gi(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}gi.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,st(c),er(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 vi(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}vi.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 F=Math.min(t,c-e),V=n.height;if(n.removeInner(e,F),this.height-=V-n.height,c==F&&(this.children.splice(i--,1),n.parent=null),(t-=F)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof gi))){var q=[];this.collapse(q),this.children=[new gi(q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var c=this.children[n],F=c.chunkSize();if(e<=F){if(c.insertInner(e,t,i),c.lines&&c.lines.length>50){for(var V=c.lines.length%25+25,q=V;q<c.lines.length;){var te=new gi(c.lines.slice(q,q+=25));c.height-=te.height,this.children.splice(++n,0,te),te.parent=this}c.lines=c.lines.slice(0,V),this.maybeSpill()}break}e-=F}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new vi(t);if(e.parent){e.size-=i.size,e.height-=i.height;var c=le(e.parent.children,e);e.parent.children.splice(c+1,0,i)}else{var n=new vi(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],F=c.chunkSize();if(e<F){var V=Math.min(t,F-e);if(c.iterN(e,V,i))return!0;if((t-=V)==0)break;e=0}else e-=F}}};var yi=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};yi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=pt(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 F=ii(this);ct(i,Math.max(0,i.height-F)),e&&(br(e,function(){qs(e,i,-F),Yr(e,n,"widget")}),er(e,"lineWidgetCleared",e,this,n))},yi.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var c=ii(this)-t;if(!c)return;Pr(this.doc,n)||ct(n,n.height+c),i&&br(i,function(){i.curOp.forceUpdate=!0,qs(i,n,c),er(i,"lineWidgetChanged",i,e,pt(n))})},fe(yi);function qs(e,t,i){Ir(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,i)}function El(e,t,i,n){var c=new yi(e,i,n),F=e.cm;return F&&c.noHScroll&&(F.display.alignWidgets=!0),mi(e,t,"widget",function(V){var q=V.widgets||(V.widgets=[]);if(c.insertAt==null?q.push(c):q.splice(Math.min(q.length-1,Math.max(0,c.insertAt)),0,c),c.line=V,F&&!Pr(e,V)){var te=Ir(V)<e.scrollTop;ct(V,V.height+ii(c)),te&&Sa(F,c.height),F.curOp.forceUpdate=!0}return!0}),F&&er(F,"lineWidgetAdded",F,c,typeof t=="number"?t:pt(t)),c}var eo=0,qr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};qr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&gn(e),oe(this,"clear")){var i=this.find();i&&er(this,"clear",i.from,i.to)}for(var n=null,c=null,F=0;F<this.lines.length;++F){var V=this.lines[F],q=Lr(V.markedSpans,this);e&&!this.collapsed?Yr(e,pt(V),"text"):e&&(q.to!=null&&(c=pt(V)),q.from!=null&&(n=pt(V))),V.markedSpans=Zn(V.markedSpans,q),q.from==null&&this.collapsed&&!Pr(this.doc,V)&&e&&ct(V,Ln(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var ae=xr(this.lines[te]),_e=ti(ae);_e>e.display.maxLineLength&&(e.display.maxLine=ae,e.display.maxLineLength=_e,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&pr(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&&er(e,"markerCleared",e,this,n,c),t&&vn(e),this.parent&&this.parent.clear()},qr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,c=0;c<this.lines.length;++c){var F=this.lines[c],V=Lr(F.markedSpans,this);if(V.from!=null&&(i=We(t?F:pt(F),V.from),e==-1))return i;if(V.to!=null&&(n=We(t?F:pt(F),V.to),e==1))return n}return i&&{from:i,to:n}},qr.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;br(n,function(){var c=t.line,F=pt(t.line),V=fa(n,F);if(V&&(is(V),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Pr(i.doc,c)&&i.height!=null){var q=i.height;i.height=null;var te=ii(i)-q;te&&ct(c,c.height+te)}er(n,"markerChanged",n,e)})},qr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||le(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qr.prototype.detachLine=function(e){if(this.lines.splice(le(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},fe(qr);function Bn(e,t,i,n,c){if(n&&n.shared)return xl(e,t,i,n,c);if(e.cm&&!e.cm.curOp)return Jt(e.cm,Bn)(e,t,i,n,c);var F=new qr(e,c),V=ft(t,i);if(n&&g(n,F,!1),V>0||V==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=w("span",[F.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(Mi(e,t.line,t,i,F)||t.line!=i.line&&Mi(e,i.line,t,i,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");sa()}F.addToHistory&&Ns(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var q=t.line,te=e.cm,ae;if(e.iter(q,i.line+1,function(Se){te&&F.collapsed&&!te.options.lineWrapping&&xr(Se)==te.display.maxLine&&(ae=!0),F.collapsed&&q!=t.line&&ct(Se,0),oa(Se,new sn(F,q==t.line?t.ch:null,q==i.line?i.ch:null)),++q}),F.collapsed&&e.iter(t.line,i.line+1,function(Se){Pr(e,Se)&&ct(Se,0)}),F.clearOnEnter&&Me(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(Vr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++eo,F.atomic=!0),te){if(ae&&(te.curOp.updateMaxLine=!0),F.collapsed)pr(te,t.line,i.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var _e=t.line;_e<=i.line;_e++)Yr(te,_e,"text");F.atomic&&Gs(te.doc),er(te,"markerAdded",te,F)}return F}var bi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};bi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();er(this,"clear")},bi.prototype.find=function(e,t){return this.primary.find(e,t)},fe(bi);function xl(e,t,i,n,c){n=g(n),n.shared=!1;var F=[Bn(e,t,i,n,c)],V=F[0],q=n.widgetNode;return Zr(e,function(te){q&&(n.widgetNode=q.cloneNode(!0)),F.push(Bn(te,gt(te,t),gt(te,i),n,c));for(var ae=0;ae<te.linked.length;++ae)if(te.linked[ae].isParent)return;V=_(F)}),new bi(F,V)}function to(e){return e.findMarks(We(e.first,0),e.clipPos(We(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(),F=e.clipPos(c.from),V=e.clipPos(c.to);if(ft(F,V)){var q=Bn(e,F,V,n.primary,n.primary.type);n.markers.push(q),q.parent=n}}}function wl(e){for(var t=function(n){var c=e[n],F=[c.primary.doc];Zr(c.primary.doc,function(te){return F.push(te)});for(var V=0;V<c.markers.length;V++){var q=c.markers[V];le(F,q.doc)==-1&&(q.parent=null,c.markers.splice(V--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,mr=function(e,t,i,n,c){if(!(this instanceof mr))return new mr(e,t,i,n,c);i==null&&(i=0),vi.call(this,[new gi([new un("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var F=We(i,0);this.sel=Jr(F),this.history=new Vi(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:F,to:F,text:e}),ir(this,Jr(F),Ee)};mr.prototype=z(vi.prototype,{constructor:mr,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=Ot(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Qt(function(e){var t=We(this.first,0),i=this.first+this.size-1;Fn(this,{from:t,to:We(i,Ze(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&oi(this.cm,0,0),ir(this,Jr(t),Ee)}),replaceRange:function(e,t,i,n){t=gt(this,t),i=i?gt(this,i):t,Un(this,e,t,i,n)},getRange:function(e,t,i){var n=Ct(this,gt(this,e),gt(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(rr(this,e))return Ze(this,e)},getLineNumber:function(e){return pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ze(this,e)),xr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return gt(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:Qt(function(e,t,i){js(this,gt(this,typeof e=="number"?We(e,t||0):e),null,i)}),setSelection:Qt(function(e,t,i){js(this,gt(this,e),gt(this,t||e),i)}),extendSelection:Qt(function(e,t,i){Yi(this,gt(this,e),t&>(this,t),i)}),extendSelections:Qt(function(e,t){Bs(this,Ke(this,e),t)}),extendSelectionsBy:Qt(function(e,t){var i=k(this.sel.ranges,e);Bs(this,Ke(this,i),t)}),setSelections:Qt(function(e,t,i){if(!e.length)return;for(var n=[],c=0;c<e.length;c++)n[c]=new Dt(gt(this,e[c].anchor),gt(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ir(this,kr(this.cm,n,t),i)}),addSelection:Qt(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Dt(gt(this,e),gt(this,t||e))),ir(this,kr(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=Ct(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=Ct(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:Qt(function(e,t,i){for(var n=[],c=this.sel,F=0;F<c.ranges.length;F++){var V=c.ranges[F];n[F]={from:V.from(),to:V.to(),text:this.splitLines(e[F]),origin:i}}for(var q=t&&t!="end"&&cl(this,n,t),te=n.length-1;te>=0;te--)Fn(this,n[te]);q?Hs(this,q):this.cm&&kn(this.cm)}),undo:Qt(function(){Qi(this,"undo")}),redo:Qt(function(){Qi(this,"redo")}),undoSelection:Qt(function(){Qi(this,"undo",!0)}),redoSelection:Qt(function(){Qi(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 Vi(this.history.maxGeneration),Zr(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:Pn(this.history.done),undone:Pn(this.history.undone)}},setHistory:function(e){var t=this.history=new Vi(this.history.maxGeneration);t.done=Pn(e.done.slice(0),null,!0),t.undone=Pn(e.undone.slice(0),null,!0)},setGutterMarker:Qt(function(e,t,i){return mi(this,e,"gutter",function(n){var c=n.gutterMarkers||(n.gutterMarkers={});return c[t]=i,!i&&ue(c)&&(n.gutterMarkers=null),!0})}),clearGutter:Qt(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&mi(t,i,"gutter",function(){return i.gutterMarkers[e]=null,ue(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!rr(this,e))return null;if(t=e,e=Ze(this,e),!e)return null}else if(t=pt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Qt(function(e,t,i){return mi(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:Qt(function(e,t,i){return mi(this,e,t=="gutter"?"gutter":"class",function(n){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",F=n[c];if(F)if(i==null)n[c]=null;else{var V=F.match(L(i));if(!V)return!1;var q=V.index+V[0].length;n[c]=F.slice(0,V.index)+(!V.index||q==F.length?"":" ")+F.slice(q)||null}else return!1;return!0})}),addLineWidget:Qt(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Bn(this,gt(this,e),gt(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=gt(this,e),Bn(this,e,e,i,"bookmark")},findMarksAt:function(e){e=gt(this,e);var t=[],i=Ze(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=gt(this,e),t=gt(this,t);var n=[],c=e.line;return this.iter(e.line,t.line+1,function(F){var V=F.markedSpans;if(V)for(var q=0;q<V.length;q++){var te=V[q];!(te.to!=null&&c==e.line&&e.ch>=te.to||te.from==null&&c!=e.line||te.from!=null&&c==t.line&&te.from>=t.ch)&&(!i||i(te.marker))&&n.push(te.marker.parent||te.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 F=c.text.length+n;if(F>e)return t=e,!0;e-=F,++i}),gt(this,We(i,t))},indexFromPos:function(e){e=gt(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 mr(Ot(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 mr(Ot(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 jt&&(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];Zr(e,function(c){return n.push(c.id)},!0),e.history=new Vi(null),e.history.done=Pn(this.history.done,n),e.history.undone=Pn(this.history.undone,n)}},iterLinkedDocs:function(e){Zr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ot(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Qt(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)})}),mr.prototype.eachLine=mr.prototype.iter;var ro=0;function Cl(e){var t=this;if(no(t),ee(t,e)||Gr(t.display,e))return;re(e),K&&(ro=+new Date);var i=cn(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,F=Array(c),V=0,q=function(){++V==c&&Jt(t,function(){i=gt(t.doc,i);var De={from:i,to:i,text:t.doc.splitLines(F.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Fn(t.doc,De),Hs(t.doc,Jr(gt(t.doc,i),gt(t.doc,Qr(De))))})()},te=function(De,Fe){if(t.options.allowDropFileTypes&&le(t.options.allowDropFileTypes,De.type)==-1){q();return}var je=new FileReader;je.onerror=function(){return q()},je.onload=function(){var Ve=je.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ve)){q();return}F[Fe]=Ve,q()},je.readAsText(De)},ae=0;ae<n.length;ae++)te(n[ae],ae);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 _e=e.dataTransfer.getData("Text");if(_e){var Se;if(t.state.draggingText&&!t.state.draggingText.copy&&(Se=t.listSelections()),$i(t.doc,Jr(i,i)),Se)for(var ke=0;ke<Se.length;++ke)Un(t.doc,"",Se[ke].anchor,Se[ke].head,"drag");t.replaceSelection(_e,"around","paste"),t.display.input.focus()}}catch(De){}}}function Al(e,t){if(K&&(!e.state.draggingText||+new Date-ro<100)){ge(t);return}if(ee(e,t)||Gr(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=cn(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)),x(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 F=0;F<i.length;F++)e(i[F])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,io(Il)},100))}),Me(window,"blur",function(){return io(Dn)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var en={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"},_i=0;_i<10;_i++)en[_i+48]=en[_i+96]=String(_i);for(var Zi=65;Zi<=90;Zi++)en[Zi]=String.fromCharCode(Zi);for(var Ei=1;Ei<=12;Ei++)en[Ei+111]=en[Ei+63235]="F"+Ei;var zr={};zr.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"},zr.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"},zr.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"},zr.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"]},zr.default=s?zr.macDefault:zr.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,c,F,V=0;V<t.length-1;V++){var q=t[V];if(/^(cmd|meta|m)$/i.test(q))F=!0;else if(/^a(lt)?$/i.test(q))i=!0;else if(/^(c|ctrl|control)$/i.test(q))n=!0;else if(/^s(hift)?$/i.test(q))c=!0;else throw new Error("Unrecognized modifier name: "+q)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),F&&(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=k(i.split(" "),Dl),F=0;F<c.length;F++){var V=void 0,q=void 0;F==c.length-1?(q=c.join(" "),V=n):(q=c.slice(0,F+1).join(" "),V="...");var te=t[q];if(!te)t[q]=V;else if(te!=V)throw new Error("Inconsistent bindings for "+q)}delete e[i]}for(var ae in t)e[ae]=t[ae];return e}function jn(e,t,i,n){t=qi(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 jn(e,t.fallthrough,i,n);for(var F=0;F<t.fallthrough.length;F++){var V=jn(e,t.fallthrough[F],i,n);if(V)return V}}}function so(e){var t=typeof e=="string"?e:en[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=en[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),oo(i,e,t))}function qi(e){return typeof e=="string"?zr[e]:e}function Hn(e,t){for(var i=e.doc.sel.ranges,n=[],c=0;c<i.length;c++){for(var F=t(i[c]);n.length&&ft(F.from,_(n).to)<=0;){var V=n.pop();if(ft(V.from,F.from)<0){F.from=V.from;break}}n.push(F)}br(e,function(){for(var q=n.length-1;q>=0;q--)Un(e.doc,"",n[q].from,n[q].to,"+delete");kn(e)})}function Fa(e,t,i){var n=Ce(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 We(t.line,n,i<0?"after":"before")}function Ba(e,t,i,n,c){if(e){t.doc.direction=="rtl"&&(c=-c);var F=Ge(i,t.doc.direction);if(F){var V=c<0?_(F):F[0],q=c<0==(V.level==1),te=q?"after":"before",ae;if(V.level>0||t.doc.direction=="rtl"){var _e=Rn(t,i);ae=c<0?i.text.length-1:0;var Se=Fr(t,_e,ae).top;ae=Pe(function(ke){return Fr(t,_e,ke).top==Se},c<0==(V.level==1)?V.from:V.to-1,ae),te=="before"&&(ae=Fa(i,ae,1))}else ae=c<0?V.to:V.from;return new We(n,ae,te)}}return new We(n,c<0?i.text.length:0,c<0?"before":"after")}function Ml(e,t,i,n){var c=Ge(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 F=Be(c,i.ch,i.sticky),V=c[F];if(e.doc.direction=="ltr"&&V.level%2==0&&(n>0?V.to>i.ch:V.from<i.ch))return Ua(t,i,n);var q=function($e,tt){return Fa(t,$e instanceof We?$e.ch:$e,tt)},te,ae=function($e){return e.options.lineWrapping?(te=te||Rn(e,t),ds(e,t,te,$e)):{begin:0,end:t.text.length}},_e=ae(i.sticky=="before"?q(i,-1):i.ch);if(e.doc.direction=="rtl"||V.level==1){var Se=V.level==1==n<0,ke=q(i,Se?1:-1);if(ke!=null&&(Se?ke<=V.to&&ke<=_e.end:ke>=V.from&&ke>=_e.begin)){var De=Se?"before":"after";return new We(i.line,ke,De)}}var Fe=function($e,tt,Je){for(var nt=function(Nt,Zt){return Zt?new We(i.line,q(Nt,1),"before"):new We(i.line,Nt,"after")};$e>=0&&$e<c.length;$e+=tt){var ht=c[$e],lt=tt>0==(ht.level!=1),bt=lt?Je.begin:q(Je.end,-1);if(ht.from<=bt&&bt<ht.to)return nt(bt,lt);if(bt=lt?ht.from:q(ht.to,-1),Je.begin<=bt&&bt<Je.end)return nt(bt,lt)}},je=Fe(F+n,n,_e);if(je)return je;var Ve=n>0?_e.end:q(_e.begin,-1);return Ve!=null&&!(n>0&&Ve==t.text.length)&&(je=Fe(n>0?0:c.length-1,n,ae(Ve)),je)?je:null}var xi={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return Hn(e,function(t){if(t.empty()){var i=Ze(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:We(t.head.line+1,0)}:{from:t.head,to:We(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Hn(e,function(t){return{from:We(t.from().line,0),to:gt(e.doc,We(t.to().line+1,0))}})},delLineLeft:function(e){return Hn(e,function(t){return{from:We(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Hn(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 Hn(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(We(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(We(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")},Te)},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")},Te)},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},Te)},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 F=i[c].from(),V=W(e.getLine(F.line),F.ch,n);t.push(Y(n-V%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return br(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var c=t[n].head,F=Ze(e.doc,c.line).text;if(F){if(c.ch==F.length&&(c=new We(c.line,c.ch-1)),c.ch>0)c=new We(c.line,c.ch+1),e.replaceRange(F.charAt(c.ch-1)+F.charAt(c.ch-2),We(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var V=Ze(e.doc,c.line-1).text;V&&(c=new We(c.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+V.charAt(V.length-1),We(c.line-1,V.length-1),c,"+transpose"))}}i.push(new Dt(c,c))}e.setSelections(i)})},newlineAndIndent:function(e){return br(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);kn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var i=Ze(e.doc,t),n=xr(i);return n!=i&&(t=pt(n)),Ba(!0,e,n,t,1)}function Pl(e,t){var i=Ze(e.doc,t),n=Pi(i);return n!=i&&(t=pt(n)),Ba(!0,e,i,t,-1)}function ho(e,t){var i=uo(e,t.line),n=Ze(e.doc,i.line),c=Ge(n,e.doc.direction);if(!c||c[0].level==0){var F=Math.max(i.ch,n.text.search(/\S/)),V=t.line==i.line&&t.ch<=F&&t.ch;return We(i.line,V?0:F,i.sticky)}return i}function ea(e,t,i){if(typeof t=="string"&&(t=xi[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)!=Re}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=jn(t,e.state.keyMaps[n],i,e);if(c)return c}return e.options.extraKeys&&jn(t,e.options.extraKeys,i,e)||jn(t,e.options.keyMap,i,e)}var Fl=new J;function Ti(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"&&er(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?Ti(e,"Shift-"+i,t,function(n){return ea(e,n,!0)})||Ti(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ea(e,n)}):Ti(e,i,t,function(n){return ea(e,n)}):!1}function Ul(e,t,i){return Ti(e,"'"+i+"'",t,function(n){return ea(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=j(),ee(t,e))return;K&&G<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&&!Lt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!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;U(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(A(t,"CodeMirror-crosshair"),qe(document,"keyup",i),qe(document,"mouseover",i))}Me(document,"keyup",i),Me(document,"mouseover",i)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),ee(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Gr(t.display,e)||ee(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&&ft(t,this.pos)==0&&i==this.button};var wi,Si;function Hl(e,t){var i=+new Date;return Si&&Si.compare(i,e,t)?(wi=Si=null,"triple"):wi&&wi.compare(i,e,t)?(Si=new Ha(i,e,t),wi=null,"double"):(wi=new Ha(i,e,t),Si=null,"single")}function vo(e){var t=this,i=t.display;if(ee(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Gr(i,e)){r||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=cn(t,e),c=Ie(e),F=n?Hl(n,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,c,n,F,e))return;c==1?n?zl(t,n,F,e):xe(e)==i.scroller&&re(e):c==2?(n&&Yi(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 F="Click";return n=="double"?F="Double"+F:n=="triple"&&(F="Triple"+F),F=(t==1?"Left":t==2?"Middle":"Right")+F,Ti(e,oo(F,c),c,function(V){if(typeof V=="string"&&(V=xi[V]),!V)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=V(e,i)!=Re}finally{e.state.suppressEdits=!1}return q})}function Gl(e,t,i){var n=e.getOption("configureMouse"),c=n?n(e,t,i):{};if(c.unit==null){var F=a?i.shiftKey&&i.metaKey:i.altKey;c.unit=F?"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){K?setTimeout(I(gs,e),0):e.curOp.focus=j();var c=Gl(e,i,n),F=e.doc.sel,V;e.options.dragDrop&&Ne&&!e.isReadOnly()&&i=="single"&&(V=F.contains(t))>-1&&(ft((V=F.ranges[V]).from(),t)<0||t.xRel>0)&&(ft(V.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,F=!1,V=Jt(e,function(ae){r&&(c.scroller.draggable=!1),e.state.draggingText=!1,qe(c.wrapper.ownerDocument,"mouseup",V),qe(c.wrapper.ownerDocument,"mousemove",q),qe(c.scroller,"dragstart",te),qe(c.scroller,"drop",V),F||(re(ae),n.addNew||Yi(e.doc,i,null,null,n.extend),r&&!p||K&&G==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),q=function(ae){F=F||Math.abs(t.clientX-ae.clientX)+Math.abs(t.clientY-ae.clientY)>=10},te=function(){return F=!0};r&&(c.scroller.draggable=!0),e.state.draggingText=V,V.copy=!n.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),Me(c.wrapper.ownerDocument,"mouseup",V),Me(c.wrapper.ownerDocument,"mousemove",q),Me(c.scroller,"dragstart",te),Me(c.scroller,"drop",V),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,i){if(i=="char")return new Dt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Dt(We(t.line,0),gt(e.doc,We(t.line+1,0)));var n=i(e,t);return new Dt(n.from,n.to)}function Vl(e,t,i,n){var c=e.display,F=e.doc;re(t);var V,q,te=F.sel,ae=te.ranges;if(n.addNew&&!n.extend?(q=F.sel.contains(i),q>-1?V=ae[q]:V=new Dt(i,i)):(V=F.sel.primary(),q=F.sel.primIndex),n.unit=="rectangle")n.addNew||(V=new Dt(i,i)),i=cn(e,t,!0,!0),q=-1;else{var _e=yo(e,i,n.unit);n.extend?V=Pa(V,_e.anchor,_e.head,n.extend):V=_e}n.addNew?q==-1?(q=ae.length,ir(F,kr(e,ae.concat([V]),q),{scroll:!1,origin:"*mouse"})):ae.length>1&&ae[q].empty()&&n.unit=="char"&&!n.extend?(ir(F,kr(e,ae.slice(0,q).concat(ae.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),te=F.sel):Na(F,q,V,Oe):(q=0,ir(F,new wr([V],0),Oe),te=F.sel);var Se=i;function ke(Je){if(ft(Se,Je)==0)return;if(Se=Je,n.unit=="rectangle"){for(var nt=[],ht=e.options.tabSize,lt=W(Ze(F,i.line).text,i.ch,ht),bt=W(Ze(F,Je.line).text,Je.ch,ht),Nt=Math.min(lt,bt),Zt=Math.max(lt,bt),Wt=Math.min(i.line,Je.line),_r=Math.min(e.lastLine(),Math.max(i.line,Je.line));Wt<=_r;Wt++){var gr=Ze(F,Wt).text,Vt=Le(gr,Nt,ht);Nt==Zt?nt.push(new Dt(We(Wt,Vt),We(Wt,Vt))):gr.length>Vt&&nt.push(new Dt(We(Wt,Vt),We(Wt,Le(gr,Zt,ht))))}nt.length||nt.push(new Dt(i,i)),ir(F,kr(e,te.ranges.slice(0,q).concat(nt),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Je)}else{var vr=V,tr=yo(e,Je,n.unit),$t=vr.anchor,Xt;ft(tr.anchor,$t)>0?(Xt=tr.head,$t=nn(vr.from(),tr.anchor)):(Xt=tr.anchor,$t=En(vr.to(),tr.head));var Gt=te.ranges.slice(0);Gt[q]=Xl(e,new Dt(gt(F,$t),Xt)),ir(F,kr(e,Gt,q),Oe)}}var De=c.wrapper.getBoundingClientRect(),Fe=0;function je(Je){var nt=++Fe,ht=cn(e,Je,!0,n.unit=="rectangle");if(!ht)return;if(ft(ht,Se)!=0){e.curOp.focus=j(),ke(ht);var lt=Wi(c,F);(ht.line>=lt.to||ht.line<lt.from)&&setTimeout(Jt(e,function(){Fe==nt&&je(Je)}),150)}else{var bt=Je.clientY<De.top?-20:Je.clientY>De.bottom?20:0;bt&&setTimeout(Jt(e,function(){if(Fe!=nt)return;c.scroller.scrollTop+=bt,je(Je)}),50)}}function Ve(Je){e.state.selectingText=!1,Fe=Infinity,Je&&(re(Je),c.input.focus()),qe(c.wrapper.ownerDocument,"mousemove",$e),qe(c.wrapper.ownerDocument,"mouseup",tt),F.history.lastSelOrigin=null}var $e=Jt(e,function(Je){Je.buttons===0||!Ie(Je)?Ve(Je):je(Je)}),tt=Jt(e,Ve);e.state.selectingText=tt,Me(c.wrapper.ownerDocument,"mousemove",$e),Me(c.wrapper.ownerDocument,"mouseup",tt)}function Xl(e,t){var i=t.anchor,n=t.head,c=Ze(e.doc,i.line);if(ft(i,n)==0&&i.sticky==n.sticky)return t;var F=Ge(c);if(!F)return t;var V=Be(F,i.ch,i.sticky),q=F[V];if(q.from!=i.ch&&q.to!=i.ch)return t;var te=V+(q.from==i.ch==(q.level!=1)?0:1);if(te==0||te==F.length)return t;var ae;if(n.line!=i.line)ae=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var _e=Be(F,n.ch,n.sticky),Se=_e-V||(n.ch-i.ch)*(q.level==1?-1:1);_e==te-1||_e==te?ae=Se<0:ae=Se>0}var ke=F[te+(ae?-1:0)],De=ae==(ke.level==1),Fe=De?ke.from:ke.to,je=De?"after":"before";return i.ch==Fe&&i.sticky==je?t:new Dt(new We(i.line,Fe,je),n)}function bo(e,t,i,n){var c,F;if(t.touches)c=t.touches[0].clientX,F=t.touches[0].clientY;else try{c=t.clientX,F=t.clientY}catch(ke){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&re(t);var V=e.display,q=V.lineDiv.getBoundingClientRect();if(F>q.bottom||!oe(e,i))return pe(t);F-=q.top-V.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var ae=V.gutters.childNodes[te];if(ae&&ae.getBoundingClientRect().right>=c){var _e=wt(e.doc,F),Se=e.display.gutterSpecs[te];return de(e,i,e,_e,Se.className,t),pe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(Gr(e.display,t)||Yl(e,t))return;if(ee(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return oe(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-"),ai(e)}var Wn={toString:function(){return"CodeMirror.Init"}},xo={},ta={};function $l(e){var t=e.optionHandlers;function i(n,c,F,V){e.defaults[n]=c,F&&(t[n]=V?function(q,te,ae){ae!=Wn&&F(q,te,ae)}:F)}e.defineOption=i,e.Init=Wn,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){fi(n),ai(n),pr(n)},!0),i("lineSeparator",null,function(n,c){if(n.doc.lineSep=c,!c)return;var F=[],V=n.doc.first;n.doc.iter(function(te){for(var ae=0;;){var _e=te.text.indexOf(c,ae);if(_e==-1)break;ae=_e+c.length,F.push(We(V,_e))}V++});for(var q=F.length-1;q>=0;q--)Un(n.doc,c,F[q],We(F[q].line,F[q].ch+c.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,c,F){n.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),F!=Wn&&n.refresh()}),i("specialCharPlaceholder",Pt,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),ci(n)},!0),i("keyMap","default",function(n,c,F){var V=qi(c),q=F!=Wn&&qi(F);q&&q.detach&&q.detach(n,V),V.attach&&V.attach(n,q||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),ci(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 Mn(n)},!0),i("scrollbarStyle","native",function(n){Ts(n),Mn(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),ci(n)},!0),i("firstLineNumber",1,ci,!0),i("lineNumberFormatter",function(n){return n},ci,!0),i("showCursorWhenSelecting",!1,si,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,c){c=="nocursor"&&(Dn(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,si,!0),i("singleCursorHeightPerLine",!0,si,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,fi,!0),i("addModeClass",!1,fi,!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,fi,!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!=Wn;if(!t!=!n){var c=e.display.dragFunctions,F=t?Me:qe;F(e.display.scroller,"dragstart",c.start),F(e.display.scroller,"dragenter",c.enter),F(e.display.scroller,"dragover",c.over),F(e.display.scroller,"dragleave",c.leave),F(e.display.scroller,"drop",c.drop)}}function Ql(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),Ni(e)),Ea(e),pr(e),ai(e),setTimeout(function(){return Mn(e)},100)}function jt(e,t){var i=this;if(!(this instanceof jt))return new jt(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var n=t.value;typeof n=="string"?n=new mr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var c=new jt.inputStyles[t.inputStyle](this),F=this.display=new hl(e,n,c,t);F.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 J,keySeq:null,specialChars:null},t.autofocus&&!u&&F.input.focus(),K&&G<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Rl(),gn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ta(i)},20):Dn(this);for(var V in ta)ta.hasOwnProperty(V)&&ta[V](this,t[V],Wn);Cs(this),t.finishInit&&t.finishInit(this);for(var q=0;q<Ga.length;++q)Ga[q](this);vn(this),r&&t.lineWrapping&&getComputedStyle(F.lineDiv).textRendering=="optimizelegibility"&&(F.lineDiv.style.textRendering="auto")}jt.defaults=xo,jt.optionHandlers=ta;function Zl(e){var t=e.display;Me(t.scroller,"mousedown",Jt(e,vo)),K&&G<11?Me(t.scroller,"dblclick",Jt(e,function(te){if(ee(e,te))return;var ae=cn(e,te);if(!ae||Wa(e,te)||Gr(e.display,te))return;re(te);var _e=e.findWordAt(ae);Yi(e.doc,_e.anchor,_e.head)})):Me(t.scroller,"dblclick",function(te){return ee(e,te)||re(te)}),Me(t.scroller,"contextmenu",function(te){return _o(e,te)}),Me(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||_o(e,te)});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 F(te){if(te.touches.length!=1)return!1;var ae=te.touches[0];return ae.radiusX<=1&&ae.radiusY<=1}function V(te,ae){if(ae.left==null)return!0;var _e=ae.left-te.left,Se=ae.top-te.top;return _e*_e+Se*Se>20*20}Me(t.scroller,"touchstart",function(te){if(!ee(e,te)&&!F(te)&&!Wa(e,te)){t.input.ensurePolled(),clearTimeout(i);var ae=+new Date;t.activeTouch={start:ae,moved:!1,prev:ae-n.end<=300?n:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Me(t.scroller,"touchend",function(te){var ae=t.activeTouch;if(ae&&!Gr(t,te)&&ae.left!=null&&!ae.moved&&new Date-ae.start<300){var _e=e.coordsChar(t.activeTouch,"page"),Se;!ae.prev||V(ae,ae.prev)?Se=new Dt(_e,_e):!ae.prev.prev||V(ae,ae.prev.prev)?Se=e.findWordAt(_e):Se=new Dt(We(_e.line,0),gt(e.doc,We(_e.line+1,0))),e.setSelection(Se.anchor,Se.head),e.focus(),re(te)}c()}),Me(t.scroller,"touchcancel",c),Me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(li(e,t.scroller.scrollTop),pn(e,t.scroller.scrollLeft,!0),de(e,"scroll",e))}),Me(t.scroller,"mousewheel",function(te){return Rs(e,te)}),Me(t.scroller,"DOMMouseScroll",function(te){return Rs(e,te)}),Me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){ee(e,te)||ge(te)},over:function(te){ee(e,te)||(Ol(e,te),ge(te))},start:function(te){return Al(e,te)},drop:Jt(e,Cl),leave:function(te){ee(e,te)||no(e)}};var q=t.input.getField();Me(q,"keyup",function(te){return mo.call(e,te)}),Me(q,"keydown",Jt(e,po)),Me(q,"keypress",Jt(e,go)),Me(q,"focus",function(te){return Ta(e,te)}),Me(q,"blur",function(te){return Dn(e,te)})}var Ga=[];jt.defineInitHook=function(e){return Ga.push(e)};function Ci(e,t,i,n){var c=e.doc,F;i==null&&(i="add"),i=="smart"&&(c.mode.indent?F=Ar(e,t).state:i="prev");var V=e.options.tabSize,q=Ze(c,t),te=W(q.text,null,V);q.stateAfter&&(q.stateAfter=null);var ae=q.text.match(/^\s*/)[0],_e;if(!n&&!/\S/.test(q.text))_e=0,i="not";else if(i=="smart"&&(_e=c.mode.indent(F,q.text.slice(ae.length),q.text),_e==Re||_e>150)){if(!n)return;i="prev"}i=="prev"?t>c.first?_e=W(Ze(c,t-1).text,null,V):_e=0:i=="add"?_e=te+e.options.indentUnit:i=="subtract"?_e=te-e.options.indentUnit:typeof i=="number"&&(_e=te+i),_e=Math.max(0,_e);var Se="",ke=0;if(e.options.indentWithTabs)for(var De=Math.floor(_e/V);De;--De)ke+=V,Se+=" ";if(ke<_e&&(Se+=Y(_e-ke)),Se!=ae)return Un(c,Se,We(t,0),We(t,ae.length),"+input"),q.stateAfter=null,!0;for(var Fe=0;Fe<c.sel.ranges.length;Fe++){var je=c.sel.ranges[Fe];if(je.head.line==t&&je.head.ch<ae.length){var Ve=We(t,ae.length);Na(c,Fe,new Dt(Ve,Ve));break}}}var Mr=null;function ra(e){Mr=e}function za(e,t,i,n,c){var F=e.doc;e.display.shift=!1,n||(n=F.sel);var V=+new Date-200,q=c=="paste"||e.state.pasteIncoming>V,te=ot(t),ae=null;if(q&&n.ranges.length>1)if(Mr&&Mr.text.join(`
|
|
`)==t){if(n.ranges.length%Mr.text.length==0){ae=[];for(var _e=0;_e<Mr.text.length;_e++)ae.push(F.splitLines(Mr.text[_e]))}}else te.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(ae=k(te,function($e){return[$e]}));for(var Se=e.curOp.updateInput,ke=n.ranges.length-1;ke>=0;ke--){var De=n.ranges[ke],Fe=De.from(),je=De.to();De.empty()&&(i&&i>0?Fe=We(Fe.line,Fe.ch-i):e.state.overwrite&&!q?je=We(je.line,Math.min(Ze(F,je.line).text.length,je.ch+_(te).length)):q&&Mr&&Mr.lineWise&&Mr.text.join(`
|
|
`)==te.join(`
|
|
`)&&(Fe=je=We(Fe.line,0)));var Ve={from:Fe,to:je,text:ae?ae[ke%ae.length]:te,origin:c||(q?"paste":e.state.cutIncoming>V?"cut":"+input")};Fn(e.doc,Ve),er(e,"inputRead",e,Ve)}t&&!q&&wo(e,t),kn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Se),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&&br(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 F=e.getModeAt(c.head),V=!1;if(F.electricChars){for(var q=0;q<F.electricChars.length;q++)if(t.indexOf(F.electricChars.charAt(q))>-1){V=Ci(e,c.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(Ze(e.doc,c.head.line).text.slice(0,c.head.ch))&&(V=Ci(e,c.head.line,"smart")));V&&er(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,F={anchor:We(c,0),head:We(c+1,0)};i.push(F),t.push(e.getRange(F.anchor,F.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 F=this.options,V=F[n];if(F[n]==c&&n!="mode")return;F[n]=c,t.hasOwnProperty(n)&&Jt(this,t[n])(this,c,V),de(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"](qi(n))},removeKeyMap:function(n){for(var c=this.state.keyMaps,F=0;F<c.length;++F)if(c[F]==n||c[F].name==n)return c.splice(F,1),!0},addOverlay:ur(function(n,c){var F=n.token?n:e.getMode(this.options,n);if(F.startState)throw new Error("Overlays may not be stateful.");B(this.state.overlays,{mode:F,modeSpec:n,opaque:c&&c.opaque,priority:c&&c.priority||0},function(V){return V.priority}),this.state.modeGen++,pr(this)}),removeOverlay:ur(function(n){for(var c=this.state.overlays,F=0;F<c.length;++F){var V=c[F].modeSpec;if(V==n||typeof n=="string"&&V.name==n){c.splice(F,1),this.state.modeGen++,pr(this);return}}}),indentLine:ur(function(n,c,F){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),rr(this.doc,n)&&Ci(this,n,c,F)}),indentSelection:ur(function(n){for(var c=this.doc.sel.ranges,F=-1,V=0;V<c.length;V++){var q=c[V];if(q.empty())q.head.line>F&&(Ci(this,q.head.line,n,!0),F=q.head.line,V==this.doc.sel.primIndex&&kn(this));else{var te=q.from(),ae=q.to(),_e=Math.max(F,te.line);F=Math.min(this.lastLine(),ae.line-(ae.ch?0:1))+1;for(var Se=_e;Se<F;++Se)Ci(this,Se,n);var ke=this.doc.sel.ranges;te.ch==0&&c.length==ke.length&&ke[V].from().ch>0&&Na(this.doc,V,new Dt(te,ke[V].to()),Ee)}}}),getTokenAt:function(n,c){return Oi(this,n,c)},getLineTokens:function(n,c){return Oi(this,We(n),c,!0)},getTokenTypeAt:function(n){n=gt(this.doc,n);var c=an(this,Ze(this.doc,n.line)),F=0,V=(c.length-1)/2,q=n.ch,te;if(q==0)te=c[2];else for(;;){var ae=F+V>>1;if((ae?c[ae*2-1]:0)>=q)V=ae;else if(c[ae*2+1]<q)F=ae+1;else{te=c[ae*2+2];break}}var _e=te?te.indexOf("overlay "):-1;return _e<0?te:_e==0?null:te.slice(0,_e-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 F=[];if(!i.hasOwnProperty(c))return F;var V=i[c],q=this.getModeAt(n);if(typeof q[c]=="string")V[q[c]]&&F.push(V[q[c]]);else if(q[c])for(var te=0;te<q[c].length;te++){var ae=V[q[c][te]];ae&&F.push(ae)}else q.helperType&&V[q.helperType]?F.push(V[q.helperType]):V[q.name]&&F.push(V[q.name]);for(var _e=0;_e<V._global.length;_e++){var Se=V._global[_e];Se.pred(q,this)&&le(F,Se.val)==-1&&F.push(Se.val)}return F},getStateAfter:function(n,c){var F=this.doc;return n=xn(F,n==null?F.first+F.size-1:n),Ar(this,n+1,c).state},cursorCoords:function(n,c){var F,V=this.doc.sel.primary();return n==null?F=V.head:typeof n=="object"?F=gt(this.doc,n):F=n?V.from():V.to(),Dr(this,F,c||"page")},charCoords:function(n,c){return ma(this,gt(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,wt(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,c,F){var V=!1,q;if(typeof n=="number"){var te=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>te&&(n=te,V=!0),q=Ze(this.doc,n)}else q=n;return Ui(this,q,{top:0,left:0},c||"page",F||V).top+(V?this.doc.height-Ir(q):0)},defaultTextHeight:function(){return Ln(this.display)},defaultCharWidth:function(){return In(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,c,F,V,q){var te=this.display;n=Dr(this,gt(this.doc,n));var ae=n.bottom,_e=n.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),te.sizer.appendChild(c),V=="over")ae=n.top;else if(V=="above"||V=="near"){var Se=Math.max(te.wrapper.clientHeight,this.doc.height),ke=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);(V=="above"||n.bottom+c.offsetHeight>Se)&&n.top>c.offsetHeight?ae=n.top-c.offsetHeight:n.bottom+c.offsetHeight<=Se&&(ae=n.bottom),_e+c.offsetWidth>ke&&(_e=ke-c.offsetWidth)}c.style.top=ae+"px",c.style.left=c.style.right="",q=="right"?(_e=te.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(q=="left"?_e=0:q=="middle"&&(_e=(te.sizer.clientWidth-c.offsetWidth)/2),c.style.left=_e+"px"),F&&Jo(this,{left:_e,top:ae,right:_e+c.offsetWidth,bottom:ae+c.offsetHeight})},triggerOnKeyDown:ur(po),triggerOnKeyPress:ur(go),triggerOnKeyUp:mo,triggerOnMouseDown:ur(vo),execCommand:function(n){if(xi.hasOwnProperty(n))return xi[n].call(null,this)},triggerElectric:ur(function(n){wo(this,n)}),findPosH:function(n,c,F,V){var q=1;c<0&&(q=-1,c=-c);for(var te=gt(this.doc,n),ae=0;ae<c&&!(te=Ka(this.doc,te,q,F,V),te.hitSide);++ae);return te},moveH:ur(function(n,c){var F=this;this.extendSelectionsBy(function(V){return F.display.shift||F.doc.extend||V.empty()?Ka(F.doc,V.head,n,c,F.options.rtlMoveVisually):n<0?V.from():V.to()},Te)}),deleteH:ur(function(n,c){var F=this.doc.sel,V=this.doc;F.somethingSelected()?V.replaceSelection("",null,"+delete"):Hn(this,function(q){var te=Ka(V,q.head,n,c,!1);return n<0?{from:te,to:q.head}:{from:q.head,to:te}})}),findPosV:function(n,c,F,V){var q=1,te=V;c<0&&(q=-1,c=-c);for(var ae=gt(this.doc,n),_e=0;_e<c;++_e){var Se=Dr(this,ae,"div");if(te==null?te=Se.left:Se.left=te,ae=Oo(this,Se,q,F),ae.hitSide)break}return ae},moveV:ur(function(n,c){var F=this,V=this.doc,q=[],te=!this.display.shift&&!V.extend&&V.sel.somethingSelected();if(V.extendSelectionsBy(function(_e){if(te)return n<0?_e.from():_e.to();var Se=Dr(F,_e.head,"div");_e.goalColumn!=null&&(Se.left=_e.goalColumn),q.push(Se.left);var ke=Oo(F,Se,n,c);return c=="page"&&_e==V.sel.primary()&&Sa(F,ma(F,ke,"div").top-Se.top),ke},Te),q.length)for(var ae=0;ae<V.sel.ranges.length;ae++)V.sel.ranges[ae].goalColumn=q[ae]}),findWordAt:function(n){var c=this.doc,F=Ze(c,n.line).text,V=n.ch,q=n.ch;if(F){var te=this.getHelper(n,"wordChars");(n.sticky=="before"||q==F.length)&&V?--V:++q;for(var ae=F.charAt(V),_e=Ae(ae,te)?function(Se){return Ae(Se,te)}:/\s/.test(ae)?function(Se){return/\s/.test(Se)}:function(Se){return!/\s/.test(Se)&&!Ae(Se)};V>0&&_e(F.charAt(V-1));)--V;for(;q<F.length&&_e(F.charAt(q));)++q}return new Dt(We(n.line,V),We(n.line,q))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):A(this.display.cursorDiv,"CodeMirror-overwrite"),de(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ur(function(n,c){oi(this,n,c)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Nr(this)-this.display.barHeight,width:n.scrollWidth-Nr(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:hn(this)}},scrollIntoView:ur(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:We(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:ur(function(n,c){var F=this,V=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};n!=null&&(this.display.wrapper.style.width=V(n)),c!=null&&(this.display.wrapper.style.height=V(c)),this.options.lineWrapping&&as(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(te){if(te.widgets){for(var ae=0;ae<te.widgets.length;ae++)if(te.widgets[ae].noHScroll){Yr(F,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,de(this,"refresh",this)}),operation:function(n){return br(this,n)},startOperation:function(){return gn(this)},endOperation:function(){return vn(this)},refresh:ur(function(){var n=this.display.cachedTextHeight;pr(this),this.curOp.forceUpdate=!0,ai(this),oi(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(n==null||Math.abs(n-Ln(this.display))>.5||this.options.lineWrapping)&&Ea(this),de(this,"refresh",this)}),swapDoc:ur(function(n){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),ai(this),this.display.input.reset(),oi(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,er(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}},fe(e),e.registerHelper=function(n,c,F){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][c]=F},e.registerGlobalHelper=function(n,c,F,V){e.registerHelper(n,c,V),i[n]._global.push({pred:F,val:V})}}function Ka(e,t,i,n,c){var F=t,V=i,q=Ze(e,t.line),te=c&&e.direction=="rtl"?-i:i;function ae(){var tt=t.line+te;return tt<e.first||tt>=e.first+e.size?!1:(t=new We(tt,t.ch,t.sticky),q=Ze(e,tt))}function _e(tt){var Je;if(n=="codepoint"){var nt=q.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(nt)?Je=null:Je=new We(t.line,Math.max(0,Math.min(q.text.length,t.ch+i*(nt>=55296&&nt<56320?2:1))),-i)}else c?Je=Ml(e.cm,q,t,i):Je=Ua(q,t,i);if(Je==null)if(!tt&&ae())t=Ba(c,e.cm,q,t.line,te);else return!1;else t=Je;return!0}if(n=="char"||n=="codepoint")_e();else if(n=="column")_e(!0);else if(n=="word"||n=="group")for(var Se=null,ke=n=="group",De=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(i<0&&!_e(!Fe));Fe=!1){var je=q.text.charAt(t.ch)||`
|
|
`,Ve=Ae(je,De)?"w":ke&&je==`
|
|
`?"n":!ke||/\s/.test(je)?null:"p";if(ke&&!Fe&&!Ve&&(Ve="s"),Se&&Se!=Ve){i<0&&(i=1,_e(),t.sticky="after");break}if(Ve&&(Se=Ve),i>0&&!_e(!Fe))break}var $e=Ji(e,t,F,V,!0);return rn(F,$e)&&($e.hitSide=!0),$e}function Oo(e,t,i,n){var c=e.doc,F=t.left,V;if(n=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(q-.5*Ln(e.display),3);V=(i>0?t.bottom:t.top)+i*te}else n=="line"&&(V=i>0?t.bottom+3:t.top-3);for(var ae;!(ae=va(e,F,V),!ae.outside);){if(i<0?V<=0:V>=c.height){ae.hitSide=!0;break}V+=i*5}return ae}var kt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,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 F(q){for(var te=q.target;te;te=te.parentNode){if(te==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Me(c,"paste",function(q){if(!F(q)||ee(n,q)||To(q,n))return;G<=11&&setTimeout(Jt(n,function(){return t.updateFromDOM()}),20)}),Me(c,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Me(c,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Me(c,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Me(c,"touchstart",function(){return i.forceCompositionEnd()}),Me(c,"input",function(){t.composing||t.readFromDOMSoon()});function V(q){if(!F(q)||ee(n,q))return;if(n.somethingSelected())ra({lineWise:!1,text:n.getSelections()}),q.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var te=So(n);ra({lineWise:!0,text:te.text}),q.type=="cut"&&n.operation(function(){n.setSelections(te.ranges,0,Ee),n.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var ae=Mr.text.join(`
|
|
`);if(q.clipboardData.setData("Text",ae),q.clipboardData.getData("Text")==ae){q.preventDefault();return}}var _e=Ao(),Se=_e.firstChild;n.display.lineSpace.insertBefore(_e,n.display.lineSpace.firstChild),Se.value=Mr.text.join(`
|
|
`);var ke=document.activeElement;M(Se),setTimeout(function(){n.display.lineSpace.removeChild(_e),ke.focus(),ke==c&&i.showPrimarySelection()},50)}Me(c,"copy",V),Me(c,"cut",V)},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 F=na(t,e.anchorNode,e.anchorOffset),V=na(t,e.focusNode,e.focusOffset);if(F&&!F.bad&&V&&!V.bad&&ft(nn(F,V),n)==0&&ft(En(F,V),c)==0)return;var q=t.display.view,te=n.line>=t.display.viewFrom&&Ro(t,n)||{node:q[0].measure.map[2],offset:0},ae=c.line<t.display.viewTo&&Ro(t,c);if(!ae){var _e=q[q.length-1].measure,Se=_e.maps?_e.maps[_e.maps.length-1]:_e.map;ae={node:Se[Se.length-1],offset:Se[Se.length-2]-Se[Se.length-3]}}if(!te||!ae){e.removeAllRanges();return}var ke=e.rangeCount&&e.getRangeAt(0),De;try{De=y(te.node,te.offset,ae.offset,ae.node)}catch(Fe){}De&&(!N&&t.state.focused?(e.collapse(te.node,te.offset),De.collapsed||(e.removeAllRanges(),e.addRange(De))):(e.removeAllRanges(),e.addRange(De)),ke&&e.anchorNode==null?e.addRange(ke):N&&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){x(this.cm.display.cursorDiv,e.cursors),x(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():br(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=na(t,e.anchorNode,e.anchorOffset),n=na(t,e.focusNode,e.focusOffset);i&&n&&br(t,function(){ir(t.doc,Jr(i,n),Ee),(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=We(n.line-1,Ze(e.doc,n.line-1).length)),c.ch==Ze(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=We(c.line+1,0)),n.line<t.viewFrom||c.line>t.viewTo-1)return!1;var F,V,q;n.line==t.viewFrom||(F=fn(e,n.line))==0?(V=pt(t.view[0].line),q=t.view[0].node):(V=pt(t.view[F].line),q=t.view[F-1].node.nextSibling);var te=fn(e,c.line),ae,_e;if(te==t.view.length-1?(ae=t.viewTo-1,_e=t.lineDiv.lastChild):(ae=pt(t.view[te+1].line)-1,_e=t.view[te+1].node.previousSibling),!q)return!1;for(var Se=e.doc.splitLines(tu(e,q,_e,V,ae)),ke=Ct(e.doc,We(V,0),We(ae,Ze(e.doc,ae).text.length));Se.length>1&&ke.length>1;)if(_(Se)==_(ke))Se.pop(),ke.pop(),ae--;else if(Se[0]==ke[0])Se.shift(),ke.shift(),V++;else break;for(var De=0,Fe=0,je=Se[0],Ve=ke[0],$e=Math.min(je.length,Ve.length);De<$e&&je.charCodeAt(De)==Ve.charCodeAt(De);)++De;for(var tt=_(Se),Je=_(ke),nt=Math.min(tt.length-(Se.length==1?De:0),Je.length-(ke.length==1?De:0));Fe<nt&&tt.charCodeAt(tt.length-Fe-1)==Je.charCodeAt(Je.length-Fe-1);)++Fe;if(Se.length==1&&ke.length==1&&V==n.line)for(;De&&De>n.ch&&tt.charCodeAt(tt.length-Fe-1)==Je.charCodeAt(Je.length-Fe-1);)De--,Fe++;Se[Se.length-1]=tt.slice(0,tt.length-Fe).replace(/^\u200b+/,""),Se[0]=Se[0].slice(De).replace(/\u200b+$/,"");var ht=We(V,De),lt=We(ae,ke.length?_(ke).length-Fe:0);if(Se.length>1||Se[0]||ft(ht,lt))return Un(e.doc,Se,ht,lt,"+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())&&br(this.cm,function(){return pr(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()||Jt(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=Ze(e.doc,t.line),c=es(i,n,t.line),F=Ge(n,e.doc.direction),V="left";if(F){var q=Be(F,t.ch);V=q%2?"right":"left"}var te=ns(c.map,t.ch,V);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Gn(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,c){var F="",V=!1,q=e.doc.lineSeparator(),te=!1;function ae(De){return function(Fe){return Fe.id==De}}function _e(){V&&(F+=q,te&&(F+=q),V=te=!1)}function Se(De){De&&(_e(),F+=De)}function ke(De){if(De.nodeType==1){var Fe=De.getAttribute("cm-text");if(Fe){Se(Fe);return}var je=De.getAttribute("cm-marker"),Ve;if(je){var $e=e.findMarks(We(n,0),We(c+1,0),ae(+je));$e.length&&(Ve=$e[0].find(0))&&Se(Ct(e.doc,Ve.from,Ve.to).join(q));return}if(De.getAttribute("contenteditable")=="false")return;var tt=/^(pre|div|p|li|table|br)$/i.test(De.nodeName);if(!/^br$/i.test(De.nodeName)&&De.textContent.length==0)return;tt&&_e();for(var Je=0;Je<De.childNodes.length;Je++)ke(De.childNodes[Je]);/^(pre|p)$/i.test(De.nodeName)&&(te=!0),tt&&(V=!0)}else De.nodeType==3&&Se(De.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ke(t),t==i);)t=t.nextSibling,te=!1;return F}function na(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Gn(e.clipPos(We(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 F=e.display.view[c];if(F.node==n)return ru(F,t,i)}}function ru(e,t,i){var n=e.text.firstChild,c=!1;if(!t||!b(n,t))return Gn(We(pt(e.line),0),!0);if(t==n&&(c=!0,t=n.childNodes[i],i=0,!t)){var F=e.rest?_(e.rest):e.line;return Gn(We(pt(F),F.text.length),c)}var V=t.nodeType==3?t:null,q=t;for(!V&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(V=t.firstChild,i&&(i=V.nodeValue.length));q.parentNode!=n;)q=q.parentNode;var te=e.measure,ae=te.maps;function _e(Ve,$e,tt){for(var Je=-1;Je<(ae?ae.length:0);Je++)for(var nt=Je<0?te.map:ae[Je],ht=0;ht<nt.length;ht+=3){var lt=nt[ht+2];if(lt==Ve||lt==$e){var bt=pt(Je<0?e.line:e.rest[Je]),Nt=nt[ht]+tt;return(tt<0||lt!=Ve)&&(Nt=nt[ht+(tt?1:0)]),We(bt,Nt)}}}var Se=_e(V,q,i);if(Se)return Gn(Se,c);for(var ke=q.nextSibling,De=V?V.nodeValue.length-i:0;ke;ke=ke.nextSibling){if(Se=_e(ke,ke.firstChild,0),Se)return Gn(We(Se.line,Se.ch-De),c);De+=ke.textContent.length}for(var Fe=q.previousSibling,je=i;Fe;Fe=Fe.previousSibling){if(Se=_e(Fe,Fe.firstChild,-1),Se)return Gn(We(Se.line,Se.ch+je),c);je+=Fe.textContent.length}}var zt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new J,this.hasSelection=!1,this.composing=null};zt.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"),Me(c,"input",function(){K&&G>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Me(c,"paste",function(V){if(ee(n,V)||To(V,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function F(V){if(ee(n,V))return;if(n.somethingSelected())ra({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var q=So(n);ra({lineWise:!0,text:q.text}),V.type=="cut"?n.setSelections(q.ranges,null,Ee):(i.prevInput="",c.value=q.text.join(`
|
|
`),M(c))}else return;V.type=="cut"&&(n.state.cutIncoming=+new Date)}Me(c,"cut",F),Me(c,"copy",F),Me(e.scroller,"paste",function(V){if(Gr(e,V)||ee(n,V))return;if(!c.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var q=new Event("paste");q.clipboardData=V.clipboardData,c.dispatchEvent(q)}),Me(e.lineSpace,"selectstart",function(V){Gr(e,V)||re(V)}),Me(c,"compositionstart",function(){var V=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:V,range:n.markText(V,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Me(c,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},zt.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},zt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},zt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var c=Dr(e,i.sel.primary().head,"div"),F=t.wrapper.getBoundingClientRect(),V=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+V.top-F.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+V.left-F.left))}return n},zt.prototype.showSelection=function(e){var t=this.cm,i=t.display;x(i.cursorDiv,e.cursors),x(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},zt.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),K&&G>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&G>=9&&(this.hasSelection=null))},zt.prototype.getField=function(){return this.textarea},zt.prototype.supportsTouch=function(){return!1},zt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},zt.prototype.blur=function(){this.textarea.blur()},zt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},zt.prototype.receivedFocus=function(){this.slowPoll()},zt.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()})},zt.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)},zt.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||at(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(K&&G>=9&&this.hasSelection===c||s&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var F=c.charCodeAt(0);if(F==8203&&!n&&(n="\u200B"),F==8666)return this.reset(),this.cm.execCommand("undo")}for(var V=0,q=Math.min(n.length,c.length);V<q&&n.charCodeAt(V)==c.charCodeAt(V);)++V;return br(t,function(){za(t,c.slice(V),n.length-V,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},zt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zt.prototype.onKeyPress=function(){K&&G>=9&&(this.hasSelection=null),this.fastPoll()},zt.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var F=cn(i,e),V=n.scroller.scrollTop;if(!F||m)return;var q=i.options.resetSelectionOnContextMenu;q&&i.doc.sel.contains(F)==-1&&Jt(i,ir)(i.doc,Jr(F),Ee);var te=c.style.cssText,ae=t.wrapper.style.cssText,_e=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-_e.top-5)+"px; left: "+(e.clientX-_e.left-5)+`px;
|
|
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Se;r&&(Se=window.scrollY),n.input.focus(),r&&window.scrollTo(null,Se),n.input.reset(),i.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=De,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ke(){if(c.selectionStart!=null){var je=i.somethingSelected(),Ve="\u200B"+(je?c.value:"");c.value="\u21DA",c.value=Ve,t.prevInput=je?"":"\u200B",c.selectionStart=1,c.selectionEnd=Ve.length,n.selForContextMenu=i.doc.sel}}function De(){if(t.contextMenuPending!=De)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ae,c.style.cssText=te,K&&G<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=V),c.selectionStart!=null){(!K||K&&G<9)&&ke();var je=0,Ve=function(){n.selForContextMenu==i.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?Jt(i,Vs)(i):je++<10?n.detectingSelectAll=setTimeout(Ve,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ve,200)}}if(K&&G>=9&&ke(),D){ge(e);var Fe=function(){qe(window,"mouseup",Fe),setTimeout(De,20)};Me(window,"mouseup",Fe)}else setTimeout(De,50)},zt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},zt.prototype.setUneditable=function(){},zt.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=j();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=q.getValue()}var c;if(e.form&&(Me(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var F=e.form;c=F.submit;try{var V=F.submit=function(){n(),F.submit=c,F.submit(),F.submit=V}}catch(te){}}t.finishInit=function(te){te.save=n,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,n(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(qe(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var q=jt(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return q}function iu(e){e.off=qe,e.on=Me,e.wheelEventPixels=dl,e.Doc=mr,e.splitLines=ot,e.countColumn=W,e.findColumn=Le,e.isWordChar=ve,e.Pass=Re,e.signal=de,e.Line=un,e.changeEnd=Qr,e.scrollbarModel=xs,e.Pos=We,e.cmpPos=ft,e.modes=Ft,e.mimeModes=Tt,e.resolveMode=Kt,e.getMode=dr,e.modeExtensions=dt,e.extendMode=vt,e.copyState=Et,e.startState=or,e.innerMode=Ht,e.commands=xi,e.keyMap=zr,e.keyName=lo,e.isModifierKey=so,e.lookupKey=jn,e.normalizeKeyMap=kl,e.StringStream=Mt,e.SharedTextMarker=bi,e.TextMarker=qr,e.LineWidget=yi,e.e_preventDefault=re,e.e_stopPropagation=ie,e.e_stop=ge,e.addClass=U,e.contains=b,e.rmClass=A,e.keyNames=en}$l(jt),ql(jt);var au="iter insert remove copy getEditor constructor".split(" ");for(var ia in mr.prototype)mr.prototype.hasOwnProperty(ia)&&le(au,ia)<0&&(jt.prototype[ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(mr.prototype[ia]));return fe(mr),jt.inputStyles={textarea:zt,contenteditable:kt},jt.defineMode=function(e){!jt.defaults.mode&&e!="null"&&(jt.defaults.mode=e),sr.apply(this,arguments)},jt.defineMIME=Er,jt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jt.defineMIME("text/plain","null"),jt.defineExtension=function(e,t){jt.prototype[e]=t},jt.defineDocExtension=function(e,t){mr.prototype[e]=t},jt.fromTextArea=nu,iu(jt),jt.version="5.58.2",jt})},Y1PL:function(Ye,we,Q){"use strict";Q.r(we),Q.d(we,"ResizableTextArea",function(){return le});var se=Q("wx14"),X=Q("1OyB"),N=Q("vuIU"),$=Q("Ji7U"),H=Q("LK+K"),P=Q("q1tI"),K=Q("VTBJ"),G=Q("rePB"),r=Q("Zm9Q"),R=Q("Kwbf"),v=Q("c+Xe"),m=Q("m+aA"),p=Q("bdgK"),h=new Map;function o(Ee){Ee.forEach(function(Oe){var Te,Le=Oe.target;(Te=h.get(Le))===null||Te===void 0||Te.forEach(function(ye){return ye(Le)})})}var f=new p.default(o),l=null,u=null;function s(Ee,Oe){h.has(Ee)||(h.set(Ee,new Set),f.observe(Ee)),h.get(Ee).add(Oe)}function a(Ee,Oe){h.has(Ee)&&(h.get(Ee).delete(Oe),h.get(Ee).size||(f.unobserve(Ee),h.delete(Ee)))}var O=function(Ee){Object($.a)(Te,Ee);var Oe=Object(H.a)(Te);function Te(){return Object(X.a)(this,Te),Oe.apply(this,arguments)}return Object(N.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(P.Component),T=P.createContext(null);function S(Ee){var Oe=Ee.children,Te=Ee.onBatchResize,Le=P.useRef(0),ye=P.useRef([]),Y=P.useContext(T),_=P.useCallback(function(k,B,Z){Le.current+=1;var z=Le.current;ye.current.push({size:k,element:B,data:Z}),Promise.resolve().then(function(){z===Le.current&&(Te==null||Te(ye.current),ye.current=[])}),Y==null||Y(k,B,Z)},[Te,Y]);return P.createElement(T.Provider,{value:_},Oe)}function D(Ee){var Oe=Ee.children,Te=Ee.disabled,Le=P.useRef(null),ye=P.useRef(null),Y=P.useContext(T),_=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),k=P.isValidElement(Oe)&&Object(v.c)(Oe),B=k?Oe.ref:null,Z=P.useMemo(function(){return Object(v.a)(B,Le)},[B,Le]),z=P.useRef(Ee);z.current=Ee;var he=P.useCallback(function(ve){var Ae=z.current,ue=Ae.onResize,me=Ae.data,be=ve.getBoundingClientRect(),Ce=be.width,Pe=be.height,Ue=ve.offsetWidth,He=ve.offsetHeight,Be=Math.floor(Ce),Qe=Math.floor(Pe);if(_.current.width!==Be||_.current.height!==Qe||_.current.offsetWidth!==Ue||_.current.offsetHeight!==He){var Ge={width:Be,height:Qe,offsetWidth:Ue,offsetHeight:He};_.current=Ge;var Xe=Ue===Math.round(Ce)?Ce:Ue,Me=He===Math.round(Pe)?Pe:He,it=Object(K.a)(Object(K.a)({},Ge),{},{offsetWidth:Xe,offsetHeight:Me});Y==null||Y(it,ve,me),ue&&Promise.resolve().then(function(){ue(it,ve)})}},[]);return P.useEffect(function(){var ve=Object(m.a)(Le.current)||Object(m.a)(ye.current);return ve&&!Te&&s(ve,he),function(){return a(ve,he)}},[Le.current,Te]),P.createElement(O,{ref:ye},k?P.cloneElement(Oe,{ref:Z}):Oe)}var L="rc-observer-key";function A(Ee){var Oe=Ee.children,Te=Object(r.a)(Oe);return Te.map(function(Le,ye){var Y=(Le==null?void 0:Le.key)||"".concat(L,"-").concat(ye);return P.createElement(D,Object(se.a)({},Ee,{key:Y}),Le)})}A.Collection=S;var C=A,x=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"],j={},U;function E(Ee){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(Oe&&j[Te])return j[Te];var Le=window.getComputedStyle(Ee),ye=Le.getPropertyValue("box-sizing")||Le.getPropertyValue("-moz-box-sizing")||Le.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(Le.getPropertyValue("padding-bottom"))+parseFloat(Le.getPropertyValue("padding-top")),_=parseFloat(Le.getPropertyValue("border-bottom-width"))+parseFloat(Le.getPropertyValue("border-top-width")),k=b.map(function(Z){return"".concat(Z,":").concat(Le.getPropertyValue(Z))}).join(";"),B={sizingStyle:k,paddingSize:Y,borderSize:_,boxSizing:ye};return Oe&&Te&&(j[Te]=B),B}function M(Ee){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),Ee.getAttribute("wrap")?U.setAttribute("wrap",Ee.getAttribute("wrap")):U.removeAttribute("wrap");var ye=E(Ee,Oe),Y=ye.paddingSize,_=ye.borderSize,k=ye.boxSizing,B=ye.sizingStyle;U.setAttribute("style","".concat(B,";").concat(y)),U.value=Ee.value||Ee.placeholder||"";var Z=Number.MIN_SAFE_INTEGER,z=Number.MAX_SAFE_INTEGER,he=U.scrollHeight,ve;if(k==="border-box"?he+=_:k==="content-box"&&(he-=Y),Te!==null||Le!==null){U.value=" ";var Ae=U.scrollHeight-Y;Te!==null&&(Z=Ae*Te,k==="border-box"&&(Z=Z+Y+_),he=Math.max(Z,he)),Le!==null&&(z=Ae*Le,k==="border-box"&&(z=z+Y+_),ve=he>z?"":"hidden",he=Math.min(z,he))}return{height:he,minHeight:Z,maxHeight:z,overflowY:ve,resize:"none"}}var I=Q("Gytx"),g=Q.n(I),W;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(W||(W={}));var J=function(Ee){Object($.a)(Te,Ee);var Oe=Object(H.a)(Te);function Te(Le){var ye;return Object(X.a)(this,Te),ye=Oe.call(this,Le),ye.nextFrameActionId=void 0,ye.resizeFrameId=void 0,ye.textArea=void 0,ye.saveTextArea=function(Y){ye.textArea=Y},ye.handleResize=function(Y){var _=ye.state.resizeStatus,k=ye.props,B=k.autoSize,Z=k.onResize;if(_!==W.NONE)return;typeof Z=="function"&&Z(Y),B&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var Y=ye.props.autoSize;if(!Y||!ye.textArea)return;var _=Y.minRows,k=Y.maxRows,B=M(ye.textArea,!1,_,k);ye.setState({textareaStyles:B,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(ye.resizeFrameId),ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:W.RESIZED},function(){ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:W.NONE}),ye.fixFirefoxAutoScroll()})})})})},ye.renderTextArea=function(){var Y=ye.props,_=Y.prefixCls,k=_===void 0?"rc-textarea":_,B=Y.autoSize,Z=Y.onResize,z=Y.className,he=Y.disabled,ve=ye.state,Ae=ve.textareaStyles,ue=ve.resizeStatus,me=Object(x.a)(ye.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),be=w()(k,z,Object(G.a)({},"".concat(k,"-disabled"),he));"value"in me&&(me.value=me.value||"");var Ce=Object(K.a)(Object(K.a)(Object(K.a)({},ye.props.style),Ae),ue===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(C,{onResize:ye.handleResize,disabled:!(B||Z)},P.createElement("textarea",Object(se.a)({},me,{className:be,style:Ce,ref:ye.saveTextArea})))},ye.state={textareaStyles:{},resizeStatus:W.NONE},ye}return Object(N.a)(Te,[{key:"componentDidUpdate",value:function(ye){(ye.value!==this.props.value||!g()(ye.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ye=this.textArea.selectionStart,Y=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,Y)}}catch(_){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(P.Component),le=J,ce=function(Ee){Object($.a)(Te,Ee);var Oe=Object(H.a)(Te);function Te(Le){var ye;Object(X.a)(this,Te),ye=Oe.call(this,Le),ye.resizableTextArea=void 0,ye.focus=function(){ye.resizableTextArea.textArea.focus()},ye.saveTextArea=function(_){ye.resizableTextArea=_},ye.handleChange=function(_){var k=ye.props.onChange;ye.setValue(_.target.value,function(){ye.resizableTextArea.resizeTextarea()}),k&&k(_)},ye.handleKeyDown=function(_){var k=ye.props,B=k.onPressEnter,Z=k.onKeyDown;_.keyCode===13&&B&&B(_),Z&&Z(_)};var Y=typeof Le.value=="undefined"||Le.value===null?Le.defaultValue:Le.value;return ye.state={value:Y},ye}return Object(N.a)(Te,[{key:"setValue",value:function(ye,Y){"value"in this.props||this.setState({value:ye},Y)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(le,Object(se.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ye){return"value"in ye?{value:ye.value}:null}}]),Te}(P.Component),Re=we.default=ce},ZW9T:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return I});var se=Q("k1fw"),X=Q("oBTY"),N=Q("miYZ"),$=Q("tsqr"),H=Q("rAM+"),P=Q("tJVT"),K=Q("PpiC"),G=Q("q1tI"),r=Q.n(G),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(W,J){return J.map(function(le){return{label:le,kind:W.languages.CompletionItemKind.Keyword,insertText:le}})},T=function(W){return Object.keys(a.tables).map(function(J){return{label:J,kind:W.languages.CompletionItemKind.Variable,insertText:J}})},S=function(W,J){var le=a.tables[W];return le?le.map(function(ce){return{label:ce,kind:J.languages.CompletionItemKind.Field,insertText:ce}}):[]};function D(g,W,J,le,ce){var Re=W.getWordUntilPosition(J),Ee={startLineNumber:J.lineNumber,endLineNumber:J.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Oe=le.map(function(Te){return{label:Te,kind:g.languages.CompletionItemKind.Keyword,insertText:Te,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return ce.map(function(Te){Oe.push(Object(se.a)(Object(se.a)({},Te),{},{range:Ee}))}),Oe}var L=function(g){a.languages.map(function(ce){return g.languages.registerDocumentFormattingEditProvider(ce,{provideDocumentFormattingEdits:function(Ee,Oe,Te){return Object(v.a)(p.a.mark(function Le(){var ye;return p.a.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return ye=s()(Ee.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}),_.abrupt("return",[{range:Ee.getFullModelRange(),text:ye}]);case 2:case"end":return _.stop()}},Le)}))()}}),ce});var W=f.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=l.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),le=o.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Re,Ee){var Oe=Re.getWordUntilPosition(Ee),Te={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},Le=Re.getLineContent(Ee.lineNumber).substring(Oe.startColumn-2,Oe.endColumn);return{suggestions:[].concat(Object(X.a)(f.keywords.map(function(ye){return{label:ye,kind:g.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(X.a)(f.quickKey.map(function(ye){return{label:ye.label,kind:g.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Le.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Re,Ee){var Oe=Re.getWordUntilPosition(Ee),Te={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn};return{suggestions:Object(X.a)(h.keywords.map(function(Le){return{label:Le,kind:g.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Re,Ee){var Oe=Re.getWordUntilPosition(Ee),Te={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},Le=Re.getLineContent(Ee.lineNumber).substring(Oe.startColumn-2,Oe.endColumn);return{suggestions:[].concat(Object(X.a)(o.keywords.map(function(ye){return{label:ye,kind:g.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(X.a)(o.quickKey.map(function(ye){return{label:ye.label,kind:g.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Le.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Re,Ee){var Oe=Re.getWordUntilPosition(Ee),Te={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},Le=Re.getLineContent(Ee.lineNumber).substring(Oe.startColumn-2,Oe.endColumn);return{suggestions:[].concat(Object(X.a)(l.keywords.map(function(ye){return{label:ye,kind:g.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(X.a)(l.quickKey.map(function(ye){return{label:ye.label,kind:g.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Le.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}})},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"),x=Q("LvDl"),d=Q("+ua5");function w(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var b=!1,j={"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 U(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=g;if(Array.isArray(g)){for(var J=0;J<g.length;J++){var le=j[g[J]];if(le)return le}return W[0]}return j[W]||W}var E=null,M=we.b=function(g){var W=g.width,J=W===void 0?"100%":W,le=g.height,ce=le===void 0?"100%":le,Re=g.value,Ee=g.language,Oe=Ee===void 0?"javascript":Ee,Te=g.style,Le=Te===void 0?{}:Te,ye=g.options,Y=ye===void 0?{}:ye,_=g.overrideServices,k=_===void 0?{}:_,B=g.theme,Z=B===void 0?"vs-dark":B,z=g.onEditBlur,he=g.onSave,ve=g.autoHeight,Ae=ve===void 0?!1:ve,ue=g.forbidCopy,me=ue===void 0?!1:ue,be=g.onChange,Ce=be===void 0?y:be,Pe=g.editorDidMount,Ue=Pe===void 0?y:Pe,He=g.onFocus,Be=He===void 0?y:He,Qe=g.filename,Ge=Qe===void 0?"educoder.txt":Qe,Xe=g.errorLine,Me=g.errorContent,it=Me===void 0?"":Me,qe=Object(K.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),de=Object(G.useRef)(),ee=Object(G.useRef)({}),ne=Object(G.useRef)(),oe=Object(G.useRef)(),fe=Object(G.useRef)(!1),re=Object(G.useRef)(),ie=Object(G.useState)(!1),pe=Object(P.a)(ie,2),ge=pe[0],xe=pe[1];function Ie(){var dt;return de.current&&(dt=new R.default(function(vt){var Et=Object(H.a)(vt),Ht;try{for(Et.s();!(Ht=Et.n()).done;){var or=Ht.value;(or.target.offsetHeight>0||or.target.offsetWidth>0)&&ee.current.instance.layout()}}catch(Mt){Et.e(Mt)}finally{Et.f()}}),dt.observe(de.current)),dt}function Ne(){$.b.warn(decodeURIComponent(A))}var ze=function(){var vt=ee.current.instance;if(Re!=null&&vt&&ge){var Et=vt.getModel();Et&&Re!==Et.getValue()&&(b=!0,Et.setValue(Re),vt.layout(),b=!1)}};Object(G.useEffect)(function(){oe.current&&clearTimeout(oe.current),oe.current=setTimeout(function(){ze()},500)},[Re,ge,ee.current]),Object(G.useEffect)(function(){if(Xe&&ee.current&&ee.current.instance){var dt=ee.current.instance;dt.changeViewZones(function(Et){var Ht=document.createElement("div");Ht.style.padding="10px 20px",Ht.style.width="calc(100% - 20px)",Ht.className="my-error-line-wrp",Ht.innerHTML=it,Et.addZone({afterLineNumber:Xe||11,heightInLines:3,domNode:Ht})});var vt={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}};dt.addOverlayWidget(vt),dt.revealPositionInCenter({lineNumber:20,column:1})}},[Xe,ee.current,ge]);function et(){var dt=ee.current.instance;if(dt){var vt=dt.getSelection(),Et=ee.current.pastePos||{},Ht=new E.Range(Et.startLineNumber||vt.endLineNumber,Et.startColumn||vt.endColumn,Et.endLineNumber||vt.endLineNumber,Et.endColumn||vt.endColumn);setTimeout(function(){dt.executeEdits("",[{range:Ht,text:""}])},300)}}function rt(dt){(window.navigator.platform.match("Mac")?dt.metaKey:dt.ctrlKey)&&dt.keyCode==83&&(dt.preventDefault(),he())}var yt=function(){if(Ae&&ee.current.instance){var vt=ee.current.instance.getContentHeight();Kt(vt<ce?ce:vt)}else Kt(ce)};function ot(dt){var vt=document.createEvent("MouseEvents");vt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),dt.dispatchEvent(vt)}function at(dt,vt){var Et=window.URL||window.webkitURL||window,Ht=new Blob([vt]),or=document.createElementNS("http://www.w3.org/1999/xhtml","a");or.href=Et.createObjectURL(Ht),or.download=dt,ot(or)}Object(G.useEffect)(function(){yt()},[yt]),Object(G.useEffect)(function(){de.current&&!ge&&Promise.all([Q.e(18),Q.e(29)]).then(Q.t.bind(null,"M/lh",7)).then(function(dt){try{E=dt,ee.current.instance=E.editor.create(de.current,{value:Re,language:U(Oe),theme:Z,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},k);var vt=ee.current.instance,Et=C.d._menuItems,Ht=Object(X.a)(Et).find(function(Ot){return Ot[0]._debugName=="EditorContext"}),or=Ht[1],Mt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ze=function(ct,pt){var wt=ct._first;do{var rr,Bt,We=pt.includes((rr=wt.element)===null||rr===void 0||((Bt=rr.command)===null||Bt===void 0)?void 0:Bt.id);We&&ct._remove(wt)}while(wt=wt.next)};if(Ue(vt,E),setTimeout(function(){yt(),ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){at(Ge||"educoder.txt",vt.getValue())}}),vt.getDomNode().addEventListener("input",function(){ne.current.autoFormat&&vt.getAction("editor.action.formatDocument").run()})},500),ee.current.subscription=vt.onDidChangeModelContent(function(Ot){fe.current?clearTimeout(re.current):(yt(),Ce(vt.getValue(),Ot)),re.current=setTimeout(function(){fe.current=!1},500)}),window.Monaco||L(E,U(Oe)),me&&(Ze(or,Mt),de.current.classList.add("noCopyPaste"),vt.onKeyDown(function(Ot){var ct=Ot.keyCode,pt=Ot.ctrlKey,wt=Ot.metaKey;(ct===33||ct===52)&&(wt||pt)&&(Ne(),Ot.preventDefault())})),window.Monaco=E,z&&vt.onDidBlurEditorWidget(function(){z(vt.getValue())}),Be&&vt.onDidFocusEditorText(function(){Be(vt.getValue())}),me){vt.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KEY_V,function(){return Ne(),null}),vt.onDidPaste(function(Ot){ee.current.pastePos=Ot});try{window.addEventListener("paste",et)}catch(Ot){}}var Ct=Ie();return xe(!0),function(){var Ot=ee.current.instance;Ot.dispose();var ct=Ot.getModel();ct&&ct.dispose(),ee.current.subscription&&ee.current.subscription.dispose(),me&&window.removeEventListener("paste",et),Ct.unobserve(de.current)}}catch(Ot){}})},[]),Object(G.useEffect)(function(){var dt=ee.current.instance;if(dt&&ge)return document.addEventListener("keydown",rt,!1),function(){document.removeEventListener("keydown",rt)}},[he,ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;if(dt&&ge){var vt=U(Oe);E.editor.setModelLanguage(dt.getModel(),vt),console.log("language:",Oe,dt.getModel(),vt)}},[Oe,ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;dt&&ge&&E.editor.setTheme(Z)},[Z,ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;ne.current=Y,dt&&ge&&(dt.updateOptions(Object(se.a)({},Y)),setTimeout(function(){dt.getModel().updateOptions(Object(se.a)({},Y))},200))},[JSON.stringify(Y),ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;dt&&ge&&dt.layout()},[J,ce,ge]);var Lt=Object(G.useState)(w(J)),_t=Object(P.a)(Lt,2),Ut=_t[0],Ft=_t[1],Tt=Object(G.useState)(w(ce)),sr=Object(P.a)(Tt,2),Er=sr[0],Kt=sr[1],dr=Object(se.a)(Object(se.a)({},Le),{},{width:Ut,height:Er});return r.a.createElement("div",{className:"my-monaco-editor",ref:de,style:dr})};function I(g){var W=g.width,J=W===void 0?"100%":W,le=g.height,ce=le===void 0?"100%":le,Re=g.original,Ee=g.modified,Oe=g.language,Te=g.options,Le=Te===void 0?{}:Te,ye=Object(G.useRef)(),Y=Object(G.useState)(null),_=Object(P.a)(Y,2),k=_[0],B=_[1];function Z(Ae){var ue;return ye.current&&(ue=new R.default(function(me){var be=Object(H.a)(me),Ce;try{for(be.s();!(Ce=be.n()).done;){var Pe=Ce.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&Ae.layout()}}catch(Ue){be.e(Ue)}finally{be.f()}}),ue.observe(ye.current)),ue}Object(G.useEffect)(function(){ye.current&&Promise.all([Q.e(18),Q.e(29)]).then(Q.t.bind(null,"M/lh",7)).then(function(Ae){E=Ae;var ue=E.editor.createDiffEditor(ye.current,Object(se.a)(Object(se.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},Le),{},{wordWrap:!0}));B(ue);var me=Z(ue);return function(){ue.dispose();var be=ue.getModel();be&&be.dispose(),me.unobserve(ye.current)}})},[]),Object(G.useEffect)(function(){k&&k.setModel({original:E.editor.createModel(Re,Oe),modified:E.editor.createModel(Ee,Oe)})},[Re,Ee,Oe,k]);var z=w(J),he=w(ce),ve={width:z,height:he};return r.a.createElement("div",{className:"my-diff-editor",ref:ye,style:ve})}},Zss7:function(Ye,we,Q){var se;(function(X){var N=/^\s+/,$=/\s+$/,H=0,P=X.round,K=X.min,G=X.max,r=X.random;function R(_,k){if(_=_||"",k=k||{},_ instanceof R)return _;if(!(this instanceof R))return new R(_,k);var B=v(_);this._originalInput=_,this._r=B.r,this._g=B.g,this._b=B.b,this._a=B.a,this._roundA=P(100*this._a)/100,this._format=k.format||B.format,this._gradientType=k.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=B.ok,this._tc_id=H++}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 _=this.toRgb();return(_.r*299+_.g*587+_.b*114)/1e3},getLuminance:function(){var _=this.toRgb(),k,B,Z,z,he,ve;return k=_.r/255,B=_.g/255,Z=_.b/255,k<=.03928?z=k/12.92:z=X.pow((k+.055)/1.055,2.4),B<=.03928?he=B/12.92:he=X.pow((B+.055)/1.055,2.4),Z<=.03928?ve=Z/12.92:ve=X.pow((Z+.055)/1.055,2.4),.2126*z+.7152*he+.0722*ve},setAlpha:function(_){return this._a=M(_),this._roundA=P(100*this._a)/100,this},toHsv:function(){var _=o(this._r,this._g,this._b);return{h:_.h*360,s:_.s,v:_.v,a:this._a}},toHsvString:function(){var _=o(this._r,this._g,this._b),k=P(_.h*360),B=P(_.s*100),Z=P(_.v*100);return this._a==1?"hsv("+k+", "+B+"%, "+Z+"%)":"hsva("+k+", "+B+"%, "+Z+"%, "+this._roundA+")"},toHsl:function(){var _=p(this._r,this._g,this._b);return{h:_.h*360,s:_.s,l:_.l,a:this._a}},toHslString:function(){var _=p(this._r,this._g,this._b),k=P(_.h*360),B=P(_.s*100),Z=P(_.l*100);return this._a==1?"hsl("+k+", "+B+"%, "+Z+"%)":"hsla("+k+", "+B+"%, "+Z+"%, "+this._roundA+")"},toHex:function(_){return l(this._r,this._g,this._b,_)},toHexString:function(_){return"#"+this.toHex(_)},toHex8:function(_){return u(this._r,this._g,this._b,this._a,_)},toHex8String:function(_){return"#"+this.toHex8(_)},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(I(this._r,255)*100)+"%",g:P(I(this._g,255)*100)+"%",b:P(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+P(I(this._r,255)*100)+"%, "+P(I(this._g,255)*100)+"%, "+P(I(this._b,255)*100)+"%)":"rgba("+P(I(this._r,255)*100)+"%, "+P(I(this._g,255)*100)+"%, "+P(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[l(this._r,this._g,this._b,!0)]||!1},toFilter:function(_){var k="#"+s(this._r,this._g,this._b,this._a),B=k,Z=this._gradientType?"GradientType = 1, ":"";if(_){var z=R(_);B="#"+s(z._r,z._g,z._b,z._a)}return"progid:DXImageTransform.Microsoft.gradient("+Z+"startColorstr="+k+",endColorstr="+B+")"},toString:function(_){var k=!!_;_=_||this._format;var B=!1,Z=this._a<1&&this._a>=0,z=!k&&Z&&(_==="hex"||_==="hex6"||_==="hex3"||_==="hex4"||_==="hex8"||_==="name");return z?_==="name"&&this._a===0?this.toName():this.toRgbString():(_==="rgb"&&(B=this.toRgbString()),_==="prgb"&&(B=this.toPercentageRgbString()),(_==="hex"||_==="hex6")&&(B=this.toHexString()),_==="hex3"&&(B=this.toHexString(!0)),_==="hex4"&&(B=this.toHex8String(!0)),_==="hex8"&&(B=this.toHex8String()),_==="name"&&(B=this.toName()),_==="hsl"&&(B=this.toHslString()),_==="hsv"&&(B=this.toHsvString()),B||this.toHexString())},clone:function(){return R(this.toString())},_applyModification:function(_,k){var B=_.apply(null,[this].concat([].slice.call(k)));return this._r=B._r,this._g=B._g,this._b=B._b,this.setAlpha(B._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(T,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(_,k){return _.apply(null,[this].concat([].slice.call(k)))},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(x,arguments)},tetrad:function(){return this._applyCombination(d,arguments)}},R.fromRatio=function(_,k){if(typeof _=="object"){var B={};for(var Z in _)_.hasOwnProperty(Z)&&(Z==="a"?B[Z]=_[Z]:B[Z]=Re(_[Z]));_=B}return R(_,k)};function v(_){var k={r:0,g:0,b:0},B=1,Z=null,z=null,he=null,ve=!1,Ae=!1;return typeof _=="string"&&(_=ye(_)),typeof _=="object"&&(Le(_.r)&&Le(_.g)&&Le(_.b)?(k=m(_.r,_.g,_.b),ve=!0,Ae=String(_.r).substr(-1)==="%"?"prgb":"rgb"):Le(_.h)&&Le(_.s)&&Le(_.v)?(Z=Re(_.s),z=Re(_.v),k=f(_.h,Z,z),ve=!0,Ae="hsv"):Le(_.h)&&Le(_.s)&&Le(_.l)&&(Z=Re(_.s),he=Re(_.l),k=h(_.h,Z,he),ve=!0,Ae="hsl"),_.hasOwnProperty("a")&&(B=_.a)),B=M(B),{ok:ve,format:_.format||Ae,r:K(255,G(k.r,0)),g:K(255,G(k.g,0)),b:K(255,G(k.b,0)),a:B}}function m(_,k,B){return{r:I(_,255)*255,g:I(k,255)*255,b:I(B,255)*255}}function p(_,k,B){_=I(_,255),k=I(k,255),B=I(B,255);var Z=G(_,k,B),z=K(_,k,B),he,ve,Ae=(Z+z)/2;if(Z==z)he=ve=0;else{var ue=Z-z;ve=Ae>.5?ue/(2-Z-z):ue/(Z+z);switch(Z){case _:he=(k-B)/ue+(k<B?6:0);break;case k:he=(B-_)/ue+2;break;case B:he=(_-k)/ue+4;break}he/=6}return{h:he,s:ve,l:Ae}}function h(_,k,B){var Z,z,he;_=I(_,360),k=I(k,100),B=I(B,100);function ve(me,be,Ce){return Ce<0&&(Ce+=1),Ce>1&&(Ce-=1),Ce<1/6?me+(be-me)*6*Ce:Ce<1/2?be:Ce<2/3?me+(be-me)*(2/3-Ce)*6:me}if(k===0)Z=z=he=B;else{var Ae=B<.5?B*(1+k):B+k-B*k,ue=2*B-Ae;Z=ve(ue,Ae,_+1/3),z=ve(ue,Ae,_),he=ve(ue,Ae,_-1/3)}return{r:Z*255,g:z*255,b:he*255}}function o(_,k,B){_=I(_,255),k=I(k,255),B=I(B,255);var Z=G(_,k,B),z=K(_,k,B),he,ve,Ae=Z,ue=Z-z;if(ve=Z===0?0:ue/Z,Z==z)he=0;else{switch(Z){case _:he=(k-B)/ue+(k<B?6:0);break;case k:he=(B-_)/ue+2;break;case B:he=(_-k)/ue+4;break}he/=6}return{h:he,s:ve,v:Ae}}function f(_,k,B){_=I(_,360)*6,k=I(k,100),B=I(B,100);var Z=X.floor(_),z=_-Z,he=B*(1-k),ve=B*(1-z*k),Ae=B*(1-(1-z)*k),ue=Z%6,me=[B,ve,he,he,Ae,B][ue],be=[Ae,B,B,ve,he,he][ue],Ce=[he,he,Ae,B,B,ve][ue];return{r:me*255,g:be*255,b:Ce*255}}function l(_,k,B,Z){var z=[ce(P(_).toString(16)),ce(P(k).toString(16)),ce(P(B).toString(16))];return Z&&z[0].charAt(0)==z[0].charAt(1)&&z[1].charAt(0)==z[1].charAt(1)&&z[2].charAt(0)==z[2].charAt(1)?z[0].charAt(0)+z[1].charAt(0)+z[2].charAt(0):z.join("")}function u(_,k,B,Z,z){var he=[ce(P(_).toString(16)),ce(P(k).toString(16)),ce(P(B).toString(16)),ce(Ee(Z))];return z&&he[0].charAt(0)==he[0].charAt(1)&&he[1].charAt(0)==he[1].charAt(1)&&he[2].charAt(0)==he[2].charAt(1)&&he[3].charAt(0)==he[3].charAt(1)?he[0].charAt(0)+he[1].charAt(0)+he[2].charAt(0)+he[3].charAt(0):he.join("")}function s(_,k,B,Z){var z=[ce(Ee(Z)),ce(P(_).toString(16)),ce(P(k).toString(16)),ce(P(B).toString(16))];return z.join("")}R.equals=function(_,k){return!_||!k?!1:R(_).toRgbString()==R(k).toRgbString()},R.random=function(){return R.fromRatio({r:r(),g:r(),b:r()})};function a(_,k){k=k===0?0:k||10;var B=R(_).toHsl();return B.s-=k/100,B.s=g(B.s),R(B)}function O(_,k){k=k===0?0:k||10;var B=R(_).toHsl();return B.s+=k/100,B.s=g(B.s),R(B)}function T(_){return R(_).desaturate(100)}function S(_,k){k=k===0?0:k||10;var B=R(_).toHsl();return B.l+=k/100,B.l=g(B.l),R(B)}function D(_,k){k=k===0?0:k||10;var B=R(_).toRgb();return B.r=G(0,K(255,B.r-P(255*-(k/100)))),B.g=G(0,K(255,B.g-P(255*-(k/100)))),B.b=G(0,K(255,B.b-P(255*-(k/100)))),R(B)}function L(_,k){k=k===0?0:k||10;var B=R(_).toHsl();return B.l-=k/100,B.l=g(B.l),R(B)}function A(_,k){var B=R(_).toHsl(),Z=(B.h+k)%360;return B.h=Z<0?360+Z:Z,R(B)}function C(_){var k=R(_).toHsl();return k.h=(k.h+180)%360,R(k)}function x(_){var k=R(_).toHsl(),B=k.h;return[R(_),R({h:(B+120)%360,s:k.s,l:k.l}),R({h:(B+240)%360,s:k.s,l:k.l})]}function d(_){var k=R(_).toHsl(),B=k.h;return[R(_),R({h:(B+90)%360,s:k.s,l:k.l}),R({h:(B+180)%360,s:k.s,l:k.l}),R({h:(B+270)%360,s:k.s,l:k.l})]}function w(_){var k=R(_).toHsl(),B=k.h;return[R(_),R({h:(B+72)%360,s:k.s,l:k.l}),R({h:(B+216)%360,s:k.s,l:k.l})]}function y(_,k,B){k=k||6,B=B||30;var Z=R(_).toHsl(),z=360/B,he=[R(_)];for(Z.h=(Z.h-(z*k>>1)+720)%360;--k;)Z.h=(Z.h+z)%360,he.push(R(Z));return he}function b(_,k){k=k||6;for(var B=R(_).toHsv(),Z=B.h,z=B.s,he=B.v,ve=[],Ae=1/k;k--;)ve.push(R({h:Z,s:z,v:he})),he=(he+Ae)%1;return ve}R.mix=function(_,k,B){B=B===0?0:B||50;var Z=R(_).toRgb(),z=R(k).toRgb(),he=B/100,ve={r:(z.r-Z.r)*he+Z.r,g:(z.g-Z.g)*he+Z.g,b:(z.b-Z.b)*he+Z.b,a:(z.a-Z.a)*he+Z.a};return R(ve)},R.readability=function(_,k){var B=R(_),Z=R(k);return(X.max(B.getLuminance(),Z.getLuminance())+.05)/(X.min(B.getLuminance(),Z.getLuminance())+.05)},R.isReadable=function(_,k,B){var Z=R.readability(_,k),z,he;he=!1,z=Y(B);switch(z.level+z.size){case"AAsmall":case"AAAlarge":he=Z>=4.5;break;case"AAlarge":he=Z>=3;break;case"AAAsmall":he=Z>=7;break}return he},R.mostReadable=function(_,k,B){var Z=null,z=0,he,ve,Ae,ue;B=B||{},ve=B.includeFallbackColors,Ae=B.level,ue=B.size;for(var me=0;me<k.length;me++)he=R.readability(_,k[me]),he>z&&(z=he,Z=R(k[me]));return R.isReadable(_,Z,{level:Ae,size:ue})||!ve?Z:(B.includeFallbackColors=!1,R.mostReadable(_,["#fff","#000"],B))};var j=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"},U=R.hexNames=E(j);function E(_){var k={};for(var B in _)_.hasOwnProperty(B)&&(k[_[B]]=B);return k}function M(_){return _=parseFloat(_),(isNaN(_)||_<0||_>1)&&(_=1),_}function I(_,k){J(_)&&(_="100%");var B=le(_);return _=K(k,G(0,parseFloat(_))),B&&(_=parseInt(_*k,10)/100),X.abs(_-k)<1e-6?1:_%k/parseFloat(k)}function g(_){return K(1,G(0,_))}function W(_){return parseInt(_,16)}function J(_){return typeof _=="string"&&_.indexOf(".")!=-1&&parseFloat(_)===1}function le(_){return typeof _=="string"&&_.indexOf("%")!=-1}function ce(_){return _.length==1?"0"+_:""+_}function Re(_){return _<=1&&(_=_*100+"%"),_}function Ee(_){return X.round(parseFloat(_)*255).toString(16)}function Oe(_){return W(_)/255}var Te=function(){var _="[-\\+]?\\d+%?",k="[-\\+]?\\d*\\.\\d+%?",B="(?:"+k+")|(?:"+_+")",Z="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",z="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?";return{CSS_UNIT:new RegExp(B),rgb:new RegExp("rgb"+Z),rgba:new RegExp("rgba"+z),hsl:new RegExp("hsl"+Z),hsla:new RegExp("hsla"+z),hsv:new RegExp("hsv"+Z),hsva:new RegExp("hsva"+z),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 Le(_){return!!Te.CSS_UNIT.exec(_)}function ye(_){_=_.replace(N,"").replace($,"").toLowerCase();var k=!1;if(j[_])_=j[_],k=!0;else if(_=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var B;return(B=Te.rgb.exec(_))?{r:B[1],g:B[2],b:B[3]}:(B=Te.rgba.exec(_))?{r:B[1],g:B[2],b:B[3],a:B[4]}:(B=Te.hsl.exec(_))?{h:B[1],s:B[2],l:B[3]}:(B=Te.hsla.exec(_))?{h:B[1],s:B[2],l:B[3],a:B[4]}:(B=Te.hsv.exec(_))?{h:B[1],s:B[2],v:B[3]}:(B=Te.hsva.exec(_))?{h:B[1],s:B[2],v:B[3],a:B[4]}:(B=Te.hex8.exec(_))?{r:W(B[1]),g:W(B[2]),b:W(B[3]),a:Oe(B[4]),format:k?"name":"hex8"}:(B=Te.hex6.exec(_))?{r:W(B[1]),g:W(B[2]),b:W(B[3]),format:k?"name":"hex"}:(B=Te.hex4.exec(_))?{r:W(B[1]+""+B[1]),g:W(B[2]+""+B[2]),b:W(B[3]+""+B[3]),a:Oe(B[4]+""+B[4]),format:k?"name":"hex8"}:(B=Te.hex3.exec(_))?{r:W(B[1]+""+B[1]),g:W(B[2]+""+B[2]),b:W(B[3]+""+B[3]),format:k?"name":"hex"}:!1}function Y(_){var k,B;return _=_||{level:"AA",size:"small"},k=(_.level||"AA").toUpperCase(),B=(_.size||"small").toLowerCase(),k!=="AA"&&k!=="AAA"&&(k="AA"),B!=="small"&&B!=="large"&&(B="small"),{level:k,size:B}}Ye.exports?Ye.exports=R:!(se=function(){return R}.call(we,Q,we,Ye),se!==void 0&&(Ye.exports=se))})(Math)},bT9E:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return X});var se=Q("VTBJ");function X(N,$){var H=Object(se.a)({},N);return Array.isArray($)&&$.forEach(function(P){delete H[P]}),H}},c5Ni:function(Ye,we,Q){},dejd:function(Ye,we,Q){},dmUQ:function(Ye,we,Q){"use strict";var se=Q("Ff2n"),X=Q("rePB"),N=Q("1OyB"),$=Q("vuIU"),H=Q("Ji7U"),P=Q("md7G"),K=Q("foSv"),G=Q("q1tI"),r=Q.n(G),R=Q("TSYQ"),v=Q.n(R),m=Q("4IlW");function p(x,d){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(x);d&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(x,b).enumerable})),w.push.apply(w,y)}return w}function h(x){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(X.a)(x,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(w)):p(Object(w)).forEach(function(y){Object.defineProperty(x,y,Object.getOwnPropertyDescriptor(w,y))})}return x}function o(x){var d=f();return function(){var y=Object(K.a)(x),b;if(d){var j=Object(K.a)(this).constructor;b=Reflect.construct(y,arguments,j)}else b=y.apply(this,arguments);return Object(P.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(x){return!1}}function l(){}function u(x){x.preventDefault()}var s=function(d){return d.replace(/[^\w.-]+/g,"")},a=200,O=600,T=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(x){Object(H.a)(w,x);var d=o(w);function w(y){var b;Object(N.a)(this,w),b=d.call(this,y),b.onKeyDown=function(E){var M=b.props,I=M.onKeyDown,g=M.onPressEnter;if(E.keyCode===m.a.UP){var W=b.getRatio(E);b.up(E,W,null),b.stop()}else if(E.keyCode===m.a.DOWN){var J=b.getRatio(E);b.down(E,J,null),b.stop()}else E.keyCode===m.a.ENTER&&g&&g(E);if(b.recordCursorPosition(),b.lastKeyCode=E.keyCode,I){for(var le=arguments.length,ce=new Array(le>1?le-1:0),Re=1;Re<le;Re++)ce[Re-1]=arguments[Re];I.apply(void 0,[E].concat(ce))}},b.onKeyUp=function(E){var M=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),M){for(var I=arguments.length,g=new Array(I>1?I-1:0),W=1;W<I;W++)g[W-1]=arguments[W];M.apply(void 0,[E].concat(g))}},b.onChange=function(E){var M=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(E)),b.setState({inputValue:b.rawInput}),M(b.toNumber(b.rawInput))},b.onMouseUp=function(){var E=b.props.onMouseUp;b.recordCursorPosition(),E&&E.apply(void 0,arguments)},b.onFocus=function(){var E;b.setState({focused:!0}),(E=b.props).onFocus.apply(E,arguments)},b.onBlur=function(){var E=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var M=b.getCurrentValidValue(b.state.inputValue),I=b.setValue(M,l);if(E){var g=b.input.value,W=b.getInputDisplayValue({focus:!1,value:I});b.input.value=W&&Number(W),E.apply(void 0,arguments),b.input.value=g}},b.getRatio=function(E){var M=1;return E.metaKey||E.ctrlKey?M=.1:E.shiftKey&&(M=10),M},b.getFullNum=function(E){return isNaN(E)?E:/e/i.test(String(E))?Number(E).toFixed(18).replace(/\.?0+$/,""):E},b.getPrecision=function(E){if(S(b.props.precision))return b.props.precision;var M=String(E);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(E){var M=E||b.state,I=M.focused,g=M.inputValue,W=M.value,J;I?J=g:J=b.toPrecisionAsStep(W),J==null&&(J="");var le=b.formatWrapper(J);return S(b.props.decimalSeparator)&&(le=le.toString().replace(".",b.props.decimalSeparator)),le},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(E){}},b.restoreByAfter=function(E){if(E===void 0)return!1;var M=b.input.value,I=M.lastIndexOf(E);if(I===-1)return!1;var g=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(g-1)===E[0]?(b.fixCaret(g,g),!0):I+E.length===M.length?(b.fixCaret(I,I),!0):!1},b.partRestoreByAfter=function(E){return E===void 0?!1:Array.prototype.some.call(E,function(M,I){var g=E.substring(I);return b.restoreByAfter(g)})},b.isNotCompleteNumber=function(E){return isNaN(E)||E===""||E===null||E&&E.toString().indexOf(".")===E.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(E,M,I){b.pressingUpOrDown=!0,b.step("down",E,M,I)},b.up=function(E,M,I){b.pressingUpOrDown=!0,b.step("up",E,M,I)},b.saveInput=function(E){b.input=E};var j=y.value;j===void 0&&(j=y.defaultValue),b.state={focused:y.autoFocus};var U=b.getValidValue(b.toNumber(j));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(U),value:U}),b}return Object($.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var j=this.props,U=j.value,E=j.onChange,M=j.max,I=j.min,g=this.state.focused;if(b){if(!D(b.value,U)||!D(b.max,M)||!D(b.min,I)){var W=g?U:this.getValidValue(U),J;this.pressingUpOrDown?J=W:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:J})}var le="value"in this.props?U:this.state.value;"max"in this.props&&b.max!==M&&typeof le=="number"&&le>M&&E&&E(M),"min"in this.props&&b.min!==I&&typeof le=="number"&&le<I&&E&&E(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ce=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ce=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ce=this.cursorStart):ce=this.input.value.length,this.fixCaret(ce,ce)}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(Re){}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 j=b;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(b){var j=b.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(b){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,E=parseFloat(b);return isNaN(E)?b:(E<j&&(E=j),E>U&&(E=U),E)}},{key:"setValue",value:function(b,j){var U=this.props.precision,E=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),M=this.state.value,I=M===void 0?null:M,g=this.state.inputValue,W=g===void 0?null:g,J=typeof E=="number"?E.toFixed(U):"".concat(E),le=E!==I||J!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},j)):this.setState({value:E,inputValue:this.toPrecisionAsStep(b)},j),le&&this.props.onChange(E),E}},{key:"getMaxPrecision",value:function(b){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,E=U.precision,M=U.step;if(S(E))return E;var I=this.getPrecision(j),g=this.getPrecision(M),W=this.getPrecision(b);return b?Math.max(W,I+g):I+g}},{key:"getPrecisionFactor",value:function(b){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(b,j);return Math.pow(10,U)}},{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 j=Math.abs(this.getMaxPrecision(b));return isNaN(j)?b.toString():Number(b).toFixed(j)}},{key:"toNumber",value:function(b){var j=this.props.precision,U=this.state.focused,E=b&&b.length>16&&U;return this.isNotCompleteNumber(b)||E?b:S(j)?Math.round(b*Math.pow(10,j))/Math.pow(10,j):Number(b)}},{key:"upStep",value:function(b,j){var U=this.props.step,E=this.getPrecisionFactor(b,j),M=Math.abs(this.getMaxPrecision(b,j)),I=((E*b+E*U*j)/E).toFixed(M);return this.toNumber(I)}},{key:"downStep",value:function(b,j){var U=this.props.step,E=this.getPrecisionFactor(b,j),M=Math.abs(this.getMaxPrecision(b,j)),I=((E*b-E*U*j)/E).toFixed(M);return this.toNumber(I)}},{key:"step",value:function(b,j){var U=this,E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var I=this.props;if(I.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var W=this["".concat(b,"Step")](g,E),J=W>I.max||W<I.min;if(W>I.max?W=I.max:W<I.min&&(W=I.min),this.setValue(W,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),J)return;this.autoStepTimer=setTimeout(function(){U[b](j,E,!0)},M?a:O)}},{key:"fixCaret",value:function(b,j){if(b===void 0||j===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,E=this.input.selectionEnd;(b!==U||j!==E)&&this.input.setSelectionRange(b,j)}catch(M){}}},{key:"render",value:function(){var b,j=this.props,U=j.prefixCls,E=j.disabled,M=j.readOnly,I=j.useTouch,g=j.autoComplete,W=j.upHandler,J=j.downHandler,le=j.className,ce=j.max,Re=j.min,Ee=j.style,Oe=j.title,Te=j.onMouseEnter,Le=j.onMouseLeave,ye=j.onMouseOver,Y=j.onMouseOut,_=j.required,k=j.onClick,B=j.tabIndex,Z=j.type,z=j.placeholder,he=j.id,ve=j.inputMode,Ae=j.pattern,ue=j.step,me=j.maxLength,be=j.autoFocus,Ce=j.name,Pe=j.onPaste,Ue=j.onInput,He=Object(se.a)(j,["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"]),Be=this.state,Qe=Be.value,Ge=Be.focused,Xe=v()(U,(b={},Object(X.a)(b,le,!!le),Object(X.a)(b,"".concat(U,"-disabled"),E),Object(X.a)(b,"".concat(U,"-focused"),Ge),b)),Me={};Object.keys(He).forEach(function(ge){(ge.substr(0,5)==="data-"||ge.substr(0,5)==="aria-"||ge==="role")&&(Me[ge]=He[ge])});var it=!M&&!E,qe=this.getInputDisplayValue(null),de=(Qe||Qe===0)&&(isNaN(Qe)||Number(Qe)>=ce),ee=(Qe||Qe===0)&&(isNaN(Qe)||Number(Qe)<=Re),ne=de||E||M,oe=ee||E||M,fe=v()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(X.a)({},"".concat(U,"-handler-up-disabled"),ne)),re=v()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(X.a)({},"".concat(U,"-handler-down-disabled"),oe)),ie=I?{onTouchStart:ne?l:this.up,onTouchEnd:this.stop}:{onMouseDown:ne?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},pe=I?{onTouchStart:oe?l:this.down,onTouchEnd:this.stop}:{onMouseDown:oe?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:Xe,style:Ee,title:Oe,onMouseEnter:Te,onMouseLeave:Le,onMouseOver:ye,onMouseOut:Y,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(U,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":ne,className:fe}),W||r.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:u})),r.a.createElement("span",Object.assign({unselectable:"on"},pe,{role:"button","aria-label":"Decrease Value","aria-disabled":oe,className:re}),J||r.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:u}))),r.a.createElement("div",{className:"".concat(U,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":ce,"aria-valuenow":Qe,required:_,type:Z,placeholder:z,onPaste:Pe,onClick:k,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:B,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:l,onKeyUp:it?this.onKeyUp:l,autoFocus:be,maxLength:me,readOnly:M,disabled:E,max:ce,min:Re,step:ue,name:Ce,title:Oe,id:he,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(qe),pattern:Ae,inputMode:ve,onInput:Ue},Me))))}}]),w}(r.a.Component);L.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:s,required:!1,autoComplete:"off"};var A=L,C=we.a=A},fjLI:function(Ye,we,Q){"use strict";Q.d(we,"f",function(){return p}),Q.d(we,"b",function(){return h}),Q.d(we,"a",function(){return o}),Q.d(we,"d",function(){return f}),Q.d(we,"e",function(){return l}),Q.d(we,"c",function(){return u});var se=Q("8HAY"),X=Q("Vhoy"),N=Q("MI8n"),$=Q("JYp7"),H=Q("pmY6"),P=Q("24hK"),K=Q("nnTU"),G=Q("T8No"),r=Q("Cg/j"),R=Q("t9D7"),v=function(s,a,O,T){var S=arguments.length,D=S<3?a:T===null?T=Object.getOwnPropertyDescriptor(a,O):T,L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(s,a,O,T);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,T){a(O,T,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 N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===h.CommandPalette}}addCommand(s){return this.addCommands($.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(H.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($.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,O=new P.a;for(const{id:T,item:S}of s){let D=this._menuItems.get(T);D||(D=new P.a,this._menuItems.set(T,D)),O.push(D.push(S)),a.add(T)}return this._onDidChangeMenu.fire(a),Object(H.i)(()=>{if(O.size>0){for(let T of O)T();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,T)=>{a.has(T)||s.push({command:O})})}};class l extends se.e{constructor(s,a,O,T){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=T}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=a.getActions(this._options);a.dispose();for(const[,T]of O)T.length>0&&(s.push(...T),s.push(new se.d));return s.length&&s.pop(),s}}let u=class s{constructor(a,O,T,S,D){var L,A;if(this._commandService=D,this.id=a.id,this.label=(T==null?void 0:T.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,T,S,D):void 0,this._options=T,R.d.isThemeIcon(a.icon)&&(this.class=X.a.asClassName(a.icon))}dispose(){}run(...a){var O,T;let S=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(S=[...S,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(S=[...S,...a]),this._commandService.executeCommand(this.id,...S)}};u=v([m(3,G.b),m(4,K.b)],u)},gMzb:function(Ye,we,Q){"use strict";var se=Q("k1fw"),X=Q("oBTY"),N=Q("9og8"),$=Q("tJVT"),H=Q("sRBo"),P=Q("kaz8"),K=Q("WmNS"),G=Q.n(K),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),T=P.a.Group,S=function(d){var w,y,b,j,U,E,M,I,g=d.classroomList,W=d.loading,J=d.user,le=d.exercise_id,ce=le===void 0?null:le,Re=d.homework_common_id,Ee=Re===void 0?null:Re,Oe=d.setitem,Te=d.item,Le=d.type,ye=d.rz,Y=d.dispatch,_=Object(r.useState)([]),k=Object($.a)(_,2),B=k[0],Z=k[1],z=Object(r.useState)({zydatas:[],jbdatas:[],kcdatas:[],zsdatas:[],page:1,per_page:20}),he=Object($.a)(z,2),ve=he[0],Ae=he[1],ue=Object(s.i)(),me=Object(r.useState)(!1),be=Object($.a)(me,2),Ce=be[0],Pe=be[1],Ue=Object(r.useState)(!1),He=Object($.a)(Ue,2),Be=He[0],Qe=He[1],Ge=u.a.useForm(),Xe=Object($.a)(Ge,1),Me=Xe[0];Object(r.useEffect)(function(){ye&&(ve.zydatas=ye,Ae(Object(se.a)({},ve)),Te!=null&&Te.ec_course_id&&it())},[Te,ye]);function it(){return qe.apply(this,arguments)}function qe(){return qe=Object(N.a)(G.a.mark(function re(){return G.a.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return console.log("----",Te),pe.next=3,de(Te==null?void 0:Te.ec_major_school_id);case 3:return pe.next=5,ne(Te==null?void 0:Te.ec_year_id);case 5:return pe.next=7,fe(Te==null?void 0:Te.ec_course_id);case 7:Me.setFieldsValue({ec_course_id:Te==null?void 0:Te.ec_course_id,ec_major_school_id:Te==null?void 0:Te.ec_major_school_id,ec_point_ids:Te==null?void 0:Te.ec_point_ids,ec_year_id:Te==null?void 0:Te.ec_year_id});case 8:case"end":return pe.stop()}},re)})),qe.apply(this,arguments)}function de(re){return ee.apply(this,arguments)}function ee(){return ee=Object(N.a)(G.a.mark(function re(ie){var pe;return G.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return xe.next=2,Object(h.a)("/api/ec_major_schools/".concat(ie,"/ec_years/get_year_list.json"),{method:"get"});case 2:pe=xe.sent,ve.jbdatas=pe==null?void 0:pe.data,Ae(Object(se.a)({},ve)),Me.setFieldsValue({ec_year_id:"",ec_course_id:"",ec_point_ids:[]});case 6:case"end":return xe.stop()}},re)})),ee.apply(this,arguments)}function ne(re){return oe.apply(this,arguments)}function oe(){return oe=Object(N.a)(G.a.mark(function re(ie){var pe;return G.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return xe.next=2,Object(h.a)("/api/ec_years/".concat(ie,"/ec_courses/get_courses.json"),{method:"get"});case 2:pe=xe.sent,ve.kcdatas=pe==null?void 0:pe.data,Ae(Object(se.a)({},ve)),Me.setFieldsValue({ec_course_id:"",ec_point_ids:[]});case 6:case"end":return xe.stop()}},re)})),oe.apply(this,arguments)}var fe=function(){var re=Object(N.a)(G.a.mark(function ie(pe){var ge;return G.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,Object(h.a)("/api/ec_courses/".concat(pe,"/ec_points.json"),{method:"get",params:{ec_course_id:pe}});case 2:ge=Ie.sent,ve.zsdatas=ge==null?void 0:ge.data,Ae(Object(se.a)({},ve));case 5:case"end":return Ie.stop()}},ie)}));return function(pe){return re.apply(this,arguments)}}();return R.a.createElement("div",{className:O.a.from},R.a.createElement(u.a,{form:Me,layout:"inline",onValuesChange:function(ie){console.log("----",ie),ie.ec_major_school_id&&(ve.jbdatas=[],ve.kcdatas=[],ve.zsdatas=[],Ae(Object(se.a)({},ve)),de(ie.ec_major_school_id)),ie.ec_year_id&&(ve.kcdatas=[],ve.zsdatas=[],Ae(Object(se.a)({},ve)),ne(ie.ec_year_id)),ie.ec_course_id&&(ve.zsdatas=[],Ae(Object(se.a)({},ve)),fe(ie.ec_course_id))},onFinish:function(){var re=Object(N.a)(G.a.mark(function ie(pe){return G.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:Oe(pe);case 1:case"end":return xe.stop()}},ie)}));return function(ie){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=ve.zydatas)===null||w===void 0?void 0:w.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u4E13\u4E1A"},ve==null||((y=ve.zydatas)===null||y===void 0)?void 0:y.map(function(re,ie){return R.a.createElement(f.a.Option,{key:ie,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=ve.jbdatas)===null||b===void 0?void 0:b.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u5C4A\u522B"},ve==null||((j=ve.jbdatas)===null||j===void 0)?void 0:j.map(function(re,ie){return R.a.createElement(f.a.Option,{key:ie,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:((U=ve.kcdatas)===null||U===void 0?void 0:U.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"},ve==null||((E=ve.kcdatas)===null||E===void 0)?void 0:E.map(function(re,ie){return R.a.createElement(f.a.Option,{key:ie,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(){Me.submit()},style:{width:150},mode:"multiple",disabled:((M=ve.zsdatas)===null||M===void 0?void 0:M.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"},ve==null||((I=ve.zsdatas)===null||I===void 0)?void 0:I.map(function(re,ie){return R.a.createElement(f.a.Option,{key:ie,value:re==null?void 0:re.id},re==null?void 0:re.name)})))))},D=Object(v.a)(function(x){var d=x.classroomList,w=x.loading,y=x.globalSetting,b=x.user;return{classroomList:d,globalSetting:y,loading:w.effects,user:b}})(S),L=P.a.Group,A=function(d){var w,y,b,j=d.classroomList,U=d.loading,E=d.user,M=d.exercise_id,I=M===void 0?null:M,g=d.homework_common_id,W=g===void 0?null:g,J=d.setitem,le=d.type,ce=d.dispatch,Re=Object(r.useState)([{}]),Ee=Object($.a)(Re,2),Oe=Ee[0],Te=Ee[1],Le=Object(r.useState)([]),ye=Object($.a)(Le,2),Y=ye[0],_=ye[1];function k(){return B.apply(this,arguments)}function B(){return B=Object(N.a)(G.a.mark(function he(){var ve,Ae,ue,me,be;return G.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return Pe.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:W}});case 2:Ae=Pe.sent,(Ae==null||((ve=Ae.data)===null||ve===void 0)?void 0:ve.length)>0&&(be=[],Ae==null||((ue=Ae.data)===null||ue===void 0)||ue.map(function(Ue){var He;Ue==null||((He=Ue.ec_point_ids)===null||He===void 0)||He.map(function(Be){be.push(Be)})}),J(Object(se.a)(Object(se.a)({},Ae==null||((me=Ae.data)===null||me===void 0)?void 0:me[0]),{},{ec_point_ids:be})),Te(Ae==null?void 0:Ae.data));case 4:case"end":return Pe.stop()}},he)})),B.apply(this,arguments)}Object(r.useEffect)(function(){var he,ve;E!=null&&(he=E.userInfo)!==null&&he!==void 0&&(ve=he.course)!==null&&ve!==void 0&&ve.course_school_id&&Z()},[E==null||((w=E.userInfo)===null||w===void 0||((y=w.course)===null||y===void 0))?void 0:y.course_school_id]);function Z(){return z.apply(this,arguments)}function z(){return z=Object(N.a)(G.a.mark(function he(){var ve,Ae,ue;return G.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return be.next=2,Object(h.a)("/api/schools/".concat(E==null||((ve=E.userInfo)===null||ve===void 0||((Ae=ve.course)===null||Ae===void 0))?void 0:Ae.course_school_id,"/ec_majors/get_major_list.json"),{method:"get"});case 2:ue=be.sent,_(ue==null?void 0:ue.data),(W||I)&&k();case 5:case"end":return be.stop()}},he)})),z.apply(this,arguments)}return console.log(Oe),R.a.createElement("div",{style:{display:(b=E.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"),Oe==null?void 0:Oe.map(function(he,ve){return R.a.createElement("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"}},R.a.createElement(D,{rz:Y,item:he,type:ve,setitem:function(ue){Oe.splice(ve,1,ue),Te(Object(X.a)(Oe));var me=[];Oe==null||Oe.map(function(be){var Ce;be==null||((Ce=be.ec_point_ids)===null||Ce===void 0)||Ce.map(function(Pe){me.push(Pe)})}),J(Object(se.a)(Object(se.a)({},ue),{},{ec_point_ids:me}))}}),ve!=0&&R.a.createElement(m.a,{onClick:function(){Oe.splice(ve,1),Te(Object(X.a)(Oe))},style:{marginLeft:10,fontSize:"20px"}}),R.a.createElement(p.a,{onClick:function(){Oe.push({}),Te(Object(X.a)(Oe))},style:{marginLeft:10,fontSize:"20px"}}))}))},C=we.a=Object(v.a)(function(x){var d=x.classroomList,w=x.loading,y=x.globalSetting,b=x.user;return{classroomList:d,globalSetting:y,loading:w.effects,user:b}})(A)},gnOq:function(Ye,we,Q){"use strict";Q.r(we);var se=Q("+L6B"),X=Q("2/Rp"),N=Q("5NDa"),$=Q("5rEg"),H=Q("sPJy"),P=Q("bE4q"),K=Q("k1fw"),G=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),T=Q("500L"),S=Q("1vsH"),D=Q("gMzb"),L=Q("ErOA"),A=function(x){var d,w=x.shixunHomeworks,y=x.newCourse,b=x.globalSetting,j=x.loading,U=x.dispatch,E=x.match,M=R.a.useForm(),I=Object(v.a)(M,1),g=I[0],W=Object(h.useState)({}),J=Object(v.a)(W,2),le=J[0],ce=J[1],Re=Object(h.useState)(),Ee=Object(v.a)(Re,2),Oe=Ee[0],Te=Ee[1],Le=Object(h.useRef)(),ye=w.commonHomeWorkAddDefaultData,Y=Object(h.useState)({}),_=Object(v.a)(Y,2),k=_[0],B=_[1];Object(h.useEffect)(function(){var Ae;setTimeout(function(){document.body.scrollIntoView()},300);var ue=E.params,me=ue.coursesId,be=ue.categoryId;Le.current=(Ae=E.params)===null||Ae===void 0?void 0:Ae.courseId,Te(!!Le.current),Le.current&&Z(),U({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:be,coursesId:me,type:1}})},[]);var Z=function(){var Ae=Object(G.a)(p.a.mark(function ue(){var me;return p.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,U({type:"newCourse/getEditCourseData",payload:{id:Le.current}});case 2:me=Ce.sent,me&&(g.setFieldsValue({name:me.name}),g.setFieldsValue({intro:me.description}),g.setFieldsValue({notice:me.learning_notes}),ce({name:me.name,intro:me.description,notice:me.learning_notes}));case 4:case"end":return Ce.stop()}},ue)}));return function(){return Ae.apply(this,arguments)}}(),z=function(){var Ae=Object(G.a)(p.a.mark(function ue(me){var be,Ce,Pe,Ue,He,Be,Qe;return p.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return be=Object(K.a)({},le),be.attachment_ids&&(be.attachment_ids=be==null||((Ce=be.attachment_ids)===null||Ce===void 0)?void 0:Ce.map(function(Me){return Me.response.id})),be.reference_attachment_ids&&(be.reference_attachment_ids=be==null||((Pe=be.reference_attachment_ids)===null||Pe===void 0)?void 0:Pe.map(function(Me){return Me.response.id})),Ue=E.params,He=Ue.coursesId,Be=Ue.categoryId,Xe.next=6,Object(s.a)(Object(K.a)(Object(K.a)({coursesId:He,category:Be},be),{},{base_on_project:!0,type:1}));case 6:Qe=Xe.sent,(Qe==null?void 0:Qe.status)===0&&(he(Qe.homework_id),Object(S.db)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u65B0\u5EFA\u56FE\u6587\u4F5C\u4E1A"]),f.d.push("/classrooms/".concat(E.params.coursesId,"/common_homework/").concat(Qe.homework_id,"/detail")));case 8:case"end":return Xe.stop()}},ue)}));return function(me){return Ae.apply(this,arguments)}}();function he(Ae){return ve.apply(this,arguments)}function ve(){return ve=Object(G.a)(p.a.mark(function Ae(ue){var me;return p.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(k!=null&&k.ec_point_ids){Ce.next=2;break}return Ce.abrupt("return");case 2:return Ce.next=4,Object(L.a)("/api/ec_courses/".concat(k==null?void 0:k.ec_course_id,"/ec_points/set_work_points.json"),{method:"post",body:Object(K.a)({homework_common_id:ue},k)});case 4:me=Ce.sent;case 5:case"end":return Ce.stop()}},Ae)})),ve.apply(this,arguments)}return o.a.createElement("section",{className:O.a.bg},ye.course_name&&o.a.createElement("section",{className:"animated fadeIn"},o.a.createElement("aside",{className:"mt10"},ye.category&&o.a.createElement(P.a,{separator:">"},o.a.createElement(P.a.Item,null,o.a.createElement(l.a,{to:"/classrooms/".concat(ye.course_id,"/common_homework")},ye.course_name)),o.a.createElement(P.a.Item,null,o.a.createElement(l.a,{to:"/classrooms/".concat(ye.course_id,"/common_homework")},ye.category.category_name)),o.a.createElement(P.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()),ce(Object(K.a)({},g.getFieldsValue()))},onFinish:z},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($.a,{maxLength:60,suffix:"".concat(((d=le.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:le.intro})),o.a.createElement("div",null,o.a.createElement(R.a.Item,{name:"attachment_ids"},o.a.createElement(T.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:le.notice})),o.a.createElement("div",null,o.a.createElement(R.a.Item,{name:"reference_attachment_ids"},o.a.createElement(T.b,null))))),o.a.createElement("div",{className:O.a.mdWrap},o.a.createElement(D.a,{setitem:function(ue){return B(Object(K.a)({},ue))}})),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(X.a,{size:"large",type:"primary",className:"".concat(O.a.button," mr20"),htmlType:"submit",onClick:function(){g.submit()},loading:j["newCourse/editCourse"]||j["newCourse/submitCourse"]},"\u63D0\u4EA4"),o.a.createElement(X.a,{size:"large",type:"primary",ghost:!0,className:O.a.button,onClick:function(){return f.d.push("/classrooms/".concat(E.params.coursesId,"/common_homework"))}},"\u53D6\u6D88")))))};we.default=Object(f.a)(function(C){var x=C.shixunHomeworks,d=C.newCourse,w=C.loading,y=C.globalSetting;return{shixunHomeworks:x,newCourse:d,globalSetting:y,loading:w.effects}})(A)},h78n:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return b});var se=Q("q1tI"),X=Q.n(se),N=Q("TSYQ"),$=Q.n(N),H={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},P=function(E){var M=E.map(function(){return Object(se.useRef)()}),I=Object(se.useRef)();return Object(se.useEffect)(function(){var g=Date.now(),W=!1;Object.keys(M).forEach(function(J){var le=M[J].current;if(!le)return;W=!0;var ce=le.style;ce.transitionDuration=".3s, .3s, .3s, .06s",I.current&&g-I.current<100&&(ce.transitionDuration="0s, 0s")}),W&&(I.current=Date.now())}),[M]};function K(){return K=Object.assign||function(U){for(var E=1;E<arguments.length;E++){var M=arguments[E];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(U[I]=M[I])}return U},K.apply(this,arguments)}function G(U,E){return p(U)||m(U,E)||R(U,E)||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(U,E){if(!U)return;if(typeof U=="string")return v(U,E);var M=Object.prototype.toString.call(U).slice(8,-1);if(M==="Object"&&U.constructor&&(M=U.constructor.name),M==="Map"||M==="Set")return Array.from(U);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return v(U,E)}function v(U,E){(E==null||E>U.length)&&(E=U.length);for(var M=0,I=new Array(E);M<E;M++)I[M]=U[M];return I}function m(U,E){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var M=[],I=!0,g=!1,W=void 0;try{for(var J=U[Symbol.iterator](),le;!(I=(le=J.next()).done)&&!(M.push(le.value),E&&M.length===E);I=!0);}catch(ce){g=!0,W=ce}finally{try{!I&&J.return!=null&&J.return()}finally{if(g)throw W}}return M}function p(U){if(Array.isArray(U))return U}function h(U,E){if(U==null)return{};var M=o(U,E),I,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(g=0;g<W.length;g++){if(I=W[g],E.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,I))continue;M[I]=U[I]}}return M}function o(U,E){if(U==null)return{};var M={},I=Object.keys(U),g,W;for(W=0;W<I.length;W++){if(g=I[W],E.indexOf(g)>=0)continue;M[g]=U[g]}return M}var f=function(E){var M=E.className,I=E.percent,g=E.prefixCls,W=E.strokeColor,J=E.strokeLinecap,le=E.strokeWidth,ce=E.style,Re=E.trailColor,Ee=E.trailWidth,Oe=E.transition,Te=h(E,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Te.gapPosition;var Le=Array.isArray(I)?I:[I],ye=Array.isArray(W)?W:[W],Y=P(Le),_=G(Y,1),k=_[0],B=le/2,Z=100-le/2,z="M ".concat(J==="round"?B:0,",").concat(B,`
|
|
L `).concat(J==="round"?Z:100,",").concat(B),he="0 0 100 ".concat(le),ve=0;return X.a.createElement("svg",K({className:$()("".concat(g,"-line"),M),viewBox:he,preserveAspectRatio:"none",style:ce},Te),X.a.createElement("path",{className:"".concat(g,"-line-trail"),d:z,strokeLinecap:J,stroke:Re,strokeWidth:Ee||le,fillOpacity:"0"}),Le.map(function(Ae,ue){var me={strokeDasharray:"".concat(Ae,"px, 100px"),strokeDashoffset:"-".concat(ve,"px"),transition:Oe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},be=ye[ue]||ye[ye.length-1];return ve+=Ae,X.a.createElement("path",{key:ue,className:"".concat(g,"-line-path"),d:z,strokeLinecap:J,stroke:be,strokeWidth:le,fillOpacity:"0",ref:k[ue],style:me})}))};f.defaultProps=H;var l=f;function u(){return u=Object.assign||function(U){for(var E=1;E<arguments.length;E++){var M=arguments[E];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(U[I]=M[I])}return U},u.apply(this,arguments)}function s(U,E){return D(U)||S(U,E)||O(U,E)||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(U,E){if(!U)return;if(typeof U=="string")return T(U,E);var M=Object.prototype.toString.call(U).slice(8,-1);if(M==="Object"&&U.constructor&&(M=U.constructor.name),M==="Map"||M==="Set")return Array.from(U);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return T(U,E)}function T(U,E){(E==null||E>U.length)&&(E=U.length);for(var M=0,I=new Array(E);M<E;M++)I[M]=U[M];return I}function S(U,E){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var M=[],I=!0,g=!1,W=void 0;try{for(var J=U[Symbol.iterator](),le;!(I=(le=J.next()).done)&&!(M.push(le.value),E&&M.length===E);I=!0);}catch(ce){g=!0,W=ce}finally{try{!I&&J.return!=null&&J.return()}finally{if(g)throw W}}return M}function D(U){if(Array.isArray(U))return U}function L(U,E){if(U==null)return{};var M=A(U,E),I,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(g=0;g<W.length;g++){if(I=W[g],E.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,I))continue;M[I]=U[I]}}return M}function A(U,E){if(U==null)return{};var M={},I=Object.keys(U),g,W;for(W=0;W<I.length;W++){if(g=I[W],E.indexOf(g)>=0)continue;M[g]=U[g]}return M}var C=0;function x(U){return+U.replace("%","")}function d(U){return Array.isArray(U)?U:[U]}function w(U,E,M,I){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,J=50-I/2,le=0,ce=-J,Re=0,Ee=-2*J;switch(W){case"left":le=-J,ce=0,Re=2*J,Ee=0;break;case"right":le=J,ce=0,Re=-2*J,Ee=0;break;case"bottom":ce=J,Ee=2*J;break;default:}var Oe="M 50,50 m ".concat(le,",").concat(ce,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(Re,",").concat(-Ee,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(-Re,",").concat(Ee),Te=Math.PI*2*J,Le={stroke:M,strokeDasharray:"".concat(E/100*(Te-g),"px ").concat(Te,"px"),strokeDashoffset:"-".concat(g/2+U/100*(Te-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Oe,pathStyle:Le}}var y=function(E){var M=E.prefixCls,I=E.strokeWidth,g=E.trailWidth,W=E.gapDegree,J=E.gapPosition,le=E.trailColor,ce=E.strokeLinecap,Re=E.style,Ee=E.className,Oe=E.strokeColor,Te=E.percent,Le=L(E,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ye=Object(se.useMemo)(function(){return C+=1,C},[]),Y=w(0,100,le,I,W,J),_=Y.pathString,k=Y.pathStyle,B=d(Te),Z=d(Oe),z=Z.find(function(me){return Object.prototype.toString.call(me)==="[object Object]"}),he=P(B),ve=s(he,1),Ae=ve[0],ue=function(){var be=0;return B.map(function(Ce,Pe){var Ue=Z[Pe]||Z[Z.length-1],He=Object.prototype.toString.call(Ue)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(ye,")"):"",Be=w(be,Ce,Ue,I,W,J);return be+=Ce,X.a.createElement("path",{key:Pe,className:"".concat(M,"-circle-path"),d:Be.pathString,stroke:He,strokeLinecap:ce,strokeWidth:I,opacity:Ce===0?0:1,fillOpacity:"0",style:Be.pathStyle,ref:Ae[Pe]})})};return X.a.createElement("svg",u({className:$()("".concat(M,"-circle"),Ee),viewBox:"0 0 100 100",style:Re},Le),z&&X.a.createElement("defs",null,X.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(ye),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(z).sort(function(me,be){return x(me)-x(be)}).map(function(me,be){return X.a.createElement("stop",{key:be,offset:me,stopColor:z[me]})}))),X.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:_,stroke:le,strokeLinecap:ce,strokeWidth:g||I,fillOpacity:"0",style:k}),ue().reverse())};y.defaultProps=H;var b=y,j={Line:l,Circle:b}},ic2d:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return $});var se=Q("FWmy"),X=Q("746U");class N{constructor(){this.data=new Map}add(H,P){se.a(X.l(H)),se.a(X.k(P)),se.a(!this.data.has(H),"There is already an extension with this id"),this.data.set(H,P)}as(H){return this.data.get(H)||null}}const $=new N},kSUc:function(Ye,we,Q){},lZu9:function(Ye,we,Q){(function(se){se(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(se){"use strict";se.defineMode("markdown",function(X,N){var $=se.getMode(X,"text/html"),H=$.name=="null";function P(I){if(se.findModeByName){var g=se.findModeByName(I);g&&(I=g.mime||g.mimes[0])}var W=se.getMode(X,I);return W.name=="null"?null:W}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var G in K)K.hasOwnProperty(G)&&N.tokenTypeOverrides[G]&&(K[G]=N.tokenTypeOverrides[G]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=N.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,W){return g.f=g.inline=W,W(I,g)}function a(I,g,W){return g.f=g.block=W,W(I,g)}function O(I){return!I||!/\S/.test(I.string)}function T(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=H;if(!g){var W=se.innerMode($,I.htmlState);g=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}g&&(I.f=x,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 W=I.column()===g.indentation,J=O(g.prevLine.stream),le=g.indentedCode,ce=g.prevLine.hr,Re=g.list!==!1,Ee=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Oe=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Re)){for(g.list=null;Oe<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=Oe-g.listStack[g.listStack.length-1])}var Te=!J&&!ce&&!g.prevLine.header&&(!Re||!le)&&!g.prevLine.fencedCodeEnd,Le=(g.list===!1||ce||J)&&g.indentation<=Ee&&I.match(r),ye=null;if(g.indentationDiff>=4&&(le||g.prevLine.fencedCodeEnd||g.prevLine.header||J))return I.skipToEnd(),g.indentedCode=!0,K.code;if(I.eatSpace())return null;if(W&&g.indentation<=Ee&&(ye=I.match(m))&&ye[1].length<=6)return g.quote=0,g.header=ye[1].length,g.thisLine.header=!0,N.highlightFormatting&&(g.formatting="header"),g.f=g.inline,A(g);if(g.indentation<=Ee&&I.eat(">"))return g.quote=W?1:g.quote+1,N.highlightFormatting&&(g.formatting="quote"),I.eatSpace(),A(g);if(!Le&&!g.setext&&W&&g.indentation<=Ee&&(ye=I.match(R))){var Y=ye[1]?"ol":"ul";return g.indentation=Oe+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,N.taskLists&&I.match(v,!1)&&(g.taskList=!0),g.f=g.inline,N.highlightFormatting&&(g.formatting=["list","list-"+Y]),A(g)}else{if(W&&g.indentation<=Ee&&(ye=I.match(o,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ye[1]+"+ *$"),g.localMode=N.fencedCodeBlockHighlighting&&P(ye[2]||N.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=se.startState(g.localMode)),g.f=g.block=L,N.highlightFormatting&&(g.formatting="code-block"),g.code=-1,A(g);if(g.setext||(!Te||!Re)&&!g.quote&&g.list===!1&&!g.code&&!Le&&!f.test(I.string)&&(ye=I.lookAhead(1))&&(ye=ye.match(p)))return g.setext?(g.header=g.setext,g.setext=0,I.skipToEnd(),N.highlightFormatting&&(g.formatting="header")):(g.header=ye[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,A(g);if(Le)return I.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,K.hr;if(I.peek()==="[")return s(I,g,j)}return s(I,g,g.inline)}function D(I,g){var W=$.token(I,g.htmlState);if(!H){var J=se.innerMode($,g.htmlState);(J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText||g.md_inside&&I.current().indexOf(">")>-1)&&(g.f=x,g.block=S,g.htmlState=null)}return W}function L(I,g){var W=g.listStack[g.listStack.length-1]||0,J=g.indentation<W,le=W+3;if(g.fencedEndRE&&g.indentation<=le&&(J||I.match(g.fencedEndRE))){N.highlightFormatting&&(g.formatting="code-block");var ce;return J||(ce=A(g)),g.localMode=g.localState=null,g.block=S,g.f=x,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,J?a(I,g,g.block):ce}else return g.localMode?g.localMode.token(I,g.localState):(I.skipToEnd(),K.code)}function A(I){var g=[];if(I.formatting){g.push(K.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var W=0;W<I.formatting.length;W++)g.push(K.formatting+"-"+I.formatting[W]),I.formatting[W]==="header"&&g.push(K.formatting+"-"+I.formatting[W]+"-"+I.header),I.formatting[W]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=I.quote?g.push(K.formatting+"-"+I.formatting[W]+"-"+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(K.linkHref,"url"):(I.strong&&g.push(K.strong),I.em&&g.push(K.em),I.strikethrough&&g.push(K.strikethrough),I.emoji&&g.push(K.emoji),I.linkText&&g.push(K.linkText),I.code&&g.push(K.code),I.image&&g.push(K.image),I.imageAltText&&g.push(K.imageAltText,"link"),I.imageMarker&&g.push(K.imageMarker)),I.header&&g.push(K.header,K.header+"-"+I.header),I.quote&&(g.push(K.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=I.quote?g.push(K.quote+"-"+I.quote):g.push(K.quote+"-"+N.maxBlockquoteDepth)),I.list!==!1){var J=(I.listStack.length-1)%3;J?J===1?g.push(K.list2):g.push(K.list3):g.push(K.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 x(I,g){var W=g.text(I,g);if(typeof W!="undefined")return W;if(g.list)return g.list=null,A(g);if(g.taskList){var J=I.match(v,!0)[1]===" ";return J?g.taskOpen=!0:g.taskClosed=!0,N.highlightFormatting&&(g.formatting="task"),g.taskList=!1,A(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&I.match(/^#+$/,!0))return N.highlightFormatting&&(g.formatting="header"),A(g);var le=I.next();if(g.linkTitle){g.linkTitle=!1;var ce=le;le==="("&&(ce=")"),ce=(ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+ce+"\\\\]+|\\\\\\\\|\\\\.)"+ce;if(I.match(new RegExp(Re),!0))return K.linkHref}if(le==="`"){var Ee=g.formatting;N.highlightFormatting&&(g.formatting="code"),I.eatWhile("`");var Oe=I.current().length;if(g.code==0&&(!g.quote||Oe==1))return g.code=Oe,A(g);if(Oe==g.code){var Te=A(g);return g.code=0,Te}else return g.formatting=Ee,A(g)}else if(g.code)return A(g);if(le==="\\"&&(I.next(),N.highlightFormatting)){var Le=A(g),ye=K.formatting+"-escape";return Le?Le+" "+ye:ye}if(le==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,N.highlightFormatting&&(g.formatting="image"),A(g);if(le==="["&&g.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,N.highlightFormatting&&(g.formatting="image"),A(g);if(le==="]"&&g.imageAltText){N.highlightFormatting&&(g.formatting="image");var Le=A(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=w,Le}if(le==="["&&!g.image)return g.linkText&&I.match(/^.*?\]/)||(g.linkText=!0,N.highlightFormatting&&(g.formatting="link")),A(g);if(le==="]"&&g.linkText){N.highlightFormatting&&(g.formatting="link");var Le=A(g);return g.linkText=!1,g.inline=g.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?w:x,Le}if(le==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=d,N.highlightFormatting&&(g.formatting="link");var Le=A(g);return Le?Le+=" ":Le="",Le+K.linkInline}if(le==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=d,N.highlightFormatting&&(g.formatting="link");var Le=A(g);return Le?Le+=" ":Le="",Le+K.linkEmail}if(N.xml&&le==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Y=I.string.indexOf(">",I.pos);if(Y!=-1){var _=I.string.substring(I.start,Y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(_)&&(g.md_inside=!0)}return I.backUp(1),g.htmlState=se.startState($),a(I,g,D)}if(N.xml&&le==="<"&&I.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var k=1,B=I.pos==1?" ":I.string.charAt(I.pos-2);k<3&&I.eat(le);)k++;var Z=I.peek()||" ",z=!/\s/.test(Z)&&(!l.test(Z)||/\s/.test(B)||l.test(B)),he=!/\s/.test(B)&&(!l.test(B)||/\s/.test(Z)||l.test(Z)),ve=null,Ae=null;if(k%2&&(!g.em&&z&&(le==="*"||!he||l.test(B))?ve=!0:g.em==le&&he&&(le==="*"||!z||l.test(Z))&&(ve=!1)),k>1&&(!g.strong&&z&&(le==="*"||!he||l.test(B))?Ae=!0:g.strong==le&&he&&(le==="*"||!z||l.test(Z))&&(Ae=!1)),Ae!=null||ve!=null){N.highlightFormatting&&(g.formatting=ve==null?"strong":Ae==null?"em":"strong em"),ve===!0&&(g.em=le),Ae===!0&&(g.strong=le);var Te=A(g);return ve===!1&&(g.em=!1),Ae===!1&&(g.strong=!1),Te}}else if(le===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return A(g);I.backUp(1)}if(N.strikethrough){if(le==="~"&&I.eatWhile(le)){if(g.strikethrough){N.highlightFormatting&&(g.formatting="strikethrough");var Te=A(g);return g.strikethrough=!1,Te}else if(I.match(/^[^\s]/,!1))return g.strikethrough=!0,N.highlightFormatting&&(g.formatting="strikethrough"),A(g)}else if(le===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return A(g);I.backUp(2)}}if(N.emoji&&le===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,N.highlightFormatting&&(g.formatting="emoji");var ue=A(g);return g.emoji=!1,ue}return le===" "&&(I.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),A(g)}function d(I,g){var W=I.next();if(W===">"){g.f=g.inline=x,N.highlightFormatting&&(g.formatting="link");var J=A(g);return J?J+=" ":J="",J+K.linkInline}return I.match(/^[^>]+/,!0),K.linkInline}function w(I,g){if(I.eatSpace())return null;var W=I.next();return W==="("||W==="["?(g.f=g.inline=b(W==="("?")":"]"),N.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,A(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(I){return function(g,W){var J=g.next();if(J===I){W.f=W.inline=x,N.highlightFormatting&&(W.formatting="link-string");var le=A(W);return W.linkHref=!1,le}return g.match(y[I]),W.linkHref=!0,A(W)}}function j(I,g){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=U,I.next(),N.highlightFormatting&&(g.formatting="link"),g.linkText=!0,A(g)):s(I,g,x)}function U(I,g){if(I.match(/^\]:/,!0)){g.f=g.inline=E,N.highlightFormatting&&(g.formatting="link");var W=A(g);return g.linkText=!1,W}return I.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function E(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=x,K.linkHref+" url")}var M={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:x,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&&se.copyState($,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?se.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 T(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 W=I.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(g.indentation=W,g.indentationDiff=null,W>0)return null}}return g.f(I,g)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:$}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:M}},indent:function(I,g,W){return I.block==D&&$.indent?$.indent(I.htmlState,g,W):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,g,W):se.Pass},blankLine:T,getType:A,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),se.defineMIME("text/markdown","markdown"),se.defineMIME("text/x-markdown","markdown")})},nEHx:function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return se});var se;(function(X){X.DARK="dark",X.LIGHT="light",X.HIGH_CONTRAST="hc"})(se||(se={}))},nnTU:function(Ye,we,Q){"use strict";Q.d(we,"b",function(){return K}),Q.d(we,"a",function(){return G});var se=Q("MI8n"),X=Q("JYp7"),N=Q("pmY6"),$=Q("24hK"),H=Q("746U"),P=Q("Cg/j");const K=Object(P.c)("commandService"),G=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new se.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(H.o)(u,o),f(l,...u)}}const{id:v}=r;let m=this._commands.get(v);m||(m=new $.a,this._commands.set(v,m));let p=m.unshift(r),h=Object(N.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 G.registerCommand(r,(v,...m)=>v.get(K).executeCommand(R,...m))}getCommand(r){const R=this._commands.get(r);return!R||R.isEmpty()?void 0:X.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}};G.registerCommand("noop",()=>{})},osHv:function(Ye,we,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";var X=se.Pos;function N(l,u){return l.line-u.line||l.ch-u.ch}var $="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",H=$+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+$+"]["+H+"]*)","g");function K(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 G(l,u){var s=l.cm.getTokenTypeAt(X(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(!G(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(!G(l,u+1)){l.ch=u;continue}P.lastIndex=u,l.ch=u;var s=P.exec(l.text);if(s&&s.index==u)return s}}function p(l){for(;;){P.lastIndex=l.ch;var u=P.exec(l.text);if(!u){if(r(l))continue;return}if(!G(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(!G(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,T=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:X(T,S),to:X(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,T=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:X(l.line,l.ch),to:X(O,T)}}}}se.registerHelper("fold","xml",function(l,u){for(var s=new K(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 T=X(s.line,s.ch),S=o(s,a[2]);return S&&N(S.from,T)>0?{from:T,to:S.from}:null}}}),se.findMatchingTag=function(l,u,s){var a=new K(l,u.line,u.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var O=v(a),T=O&&X(a.line,a.ch),S=O&&m(a);if(!O||!S||N(a,u)>0)return;var D={from:X(a.line,a.ch),to:T,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 K(l,T.line,T.ch,s),{open:D,close:o(a,S[2]),at:"open"})},se.findEnclosingTag=function(l,u,s,a){for(var O=new K(l,u.line,u.ch,s);;){var T=f(O,a);if(!T)break;var S=new K(l,u.line,u.ch,s),D=o(S,T.tag);if(D)return{open:T,close:D}}},se.scanForClosingTag=function(l,u,s,a){var O=new K(l,u.line,u.ch,a?{from:0,to:a}:null);return o(O,s)}})},p5ED:function(Ye,we,Q){"use strict";var se=Q("+L6B"),X=Q("2/Rp"),N=Q("5Dmo"),$=Q("3S7+"),H=Q("k1fw"),P=Q("9og8"),K=Q("tJVT"),G=Q("WmNS"),r=Q.n(G),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");we.a=function(s){var a,O,T,S,D,L,A,C=s.editOffice,x=C===void 0?"view":C,d=s.data,w=s.theme,y=s.type,b=s.filename,j=s.monacoEditor,U=s.className,E=s.style,M=s.close,I=s.onClose,g=s.hasMask,W=s.disabledDownload,J=Object(R.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),le=Object(K.a)(J,2),ce=le[0],Re=le[1],Ee=Object(R.useState)(""),Oe=Object(K.a)(Ee,2),Te=Oe[0],Le=Oe[1],ye=Object(R.useState)(),Y=Object(K.a)(ye,2),_=Y[0],k=Y[1],B=window.ENV==="build"?"/react/build":"",Z=u.a.PROXY_SERVER||location.origin,z,he=1024*1024,ve=10*he,Ae=Object(R.useRef)();(a=d)!==null&&a!==void 0&&a.startsWith("/api")&&y!=="txt"&&(d=(u.a.API_SERVER||location.origin)+d),y==="office"&&(z=Object(f.T)(d).filesize,z>ve&&(y="other")),b&&j&&(j.filename=b),Object(R.useEffect)(function(){var Ce,Pe,Ue=(Ce=document.cookie)===null||Ce===void 0||((Pe=Ce.replace(/\s/g,""))===null||Pe===void 0)?void 0:Pe.split(";");Ue==null||Ue.map(function(He){var Be=He.split("=");Be[0]==="_educoder_session"&&Le(Be[1])})},[]),Object(R.useEffect)(function(){y==="office"&&ue()},[y,d]);var ue=function(){var Ce=Object(P.a)(r.a.mark(function Pe(){var Ue,He,Be;return r.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:return console.log("data:",d),Ue=d,d.startsWith("http")||(Ue=location.origin+Ue),He=new URL(Ue).pathname.split("/").pop(),Ge.next=6,Object(l.V)({attachment_id:He});case 6:Be=Ge.sent,k(Be);case 8:case"end":return Ge.stop()}},Pe)}));return function(){return Ce.apply(this,arguments)}}(),me=function(){if(d.startsWith("http")||d.startsWith("blob:")){be();return}Object(f.z)(b||"educoder",d,b)},be=function(){Object(f.x)(b||"educoder",decodeURIComponent(d))};return v.a.createElement("div",{style:Object(H.a)({},E||{}),className:"".concat(g&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},M&&v.a.createElement("div",{className:p.a.close,ref:Ae},!W&&v.a.createElement($.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ae.current}},v.a.createElement("span",{onClick:be},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement($.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ae.current}},v.a.createElement("span",{className:"",onClick:I},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[U]," ").concat(U," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(o.b,j)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((O=d)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((T=d)===null||T===void 0?void 0:T.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"&&_&&v.a.createElement("iframe",{src:"".concat(B,"/office.html?key=").concat(_.key,"&url=").concat(Z+_.url,"&callbackUrl=").concat(Z+_.callbackUrl,"&fileType=").concat(_.fileType,"&title=").concat(_.title,"&model=").concat(x,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),y==="html"&&v.a.createElement("iframe",{src:d+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(B,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!W)}),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(X.a,{type:"primary",size:"large",onClick:me},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement(X.a,{type:"primary",size:"large",onClick:me},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ye,we,Q){},pmY6:function(Ye,we,Q){"use strict";Q.d(we,"h",function(){return R}),Q.d(we,"g",function(){return m}),Q.d(we,"f",function(){return p}),Q.d(we,"e",function(){return h}),Q.d(we,"i",function(){return o}),Q.d(we,"b",function(){return f}),Q.d(we,"a",function(){return l}),Q.d(we,"d",function(){return u}),Q.d(we,"c",function(){return s});var se=Q("C/vA"),X=Q("JYp7");const N=!1;let $=null;function H(a){$=a}if(N){const a="__is_disposable_tracked__";H(new class{trackDisposable(O){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[a]||console.log(T)},3e3)}setParent(O,T){if(O&&O!==l.None)try{O[a]=!0}catch(S){}}markAsDisposed(O){if(O&&O!==l.None)try{O[a]=!0}catch(T){}}markAsSingleton(O){}})}function P(a){return $==null||$.trackDisposable(a),a}function K(a){$==null||$.markAsDisposed(a)}function G(a,O){$==null||$.setParent(a,O)}function r(a,O){if(!$)return;for(const T of a)$.setParent(T,O)}function R(a){return $==null||$.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(X.a.is(a)){let O=[];for(const T of a)if(T)try{T.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=P({dispose:Object(se.a)(()=>{K(O),a()})});return O}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,P(this)}dispose(){if(this._isDisposed)return;K(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 G(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,P(this),G(this._store,this)}dispose(){K(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}l.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,P(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&&G(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,K(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&G(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(Ye,we,Q){var se,X;(function(){var N;(function(){"use strict";var K=[,,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,""),T=null,S=[],D=new f;O.type!==u.EOF;){for(a=this._get_next_token(O,T);this._is_comment(a);)D.add(a),a=this._get_next_token(O,T);D.isEmpty()||(a.comments_before=D,D=new f),a.parent=T,this._is_opening(a)?(S.push(T),T=a):T&&this._is_closing(a,T)&&(a.opened=T,T.closed=a,T=S.pop(),a.parent=T),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 T=this._input.read(/.+/g);return T?this._create_token(u.RAW,T):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 T=new o(a,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},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},T=function(w,y){var b=null,j=null;return y.closed?(w==="script"?b="text/javascript":w==="style"&&(b="text/css"),b=O(y)||b,b.search("text/css")>-1?j="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":b.search(/test\/null/)>-1&&(j="null"),j):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,j){this._source_text=w||"",y=y||{},this._js_beautify=b,this._css_beautify=j,this._tag_stack=null;var U=new h(y,"html");this._options=U,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],j={text:"",type:""},U=new C,E=new a(this._options,b),M=new f(w,this._options).tokenize();this._tag_stack=new L(E);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(E,g,U,j),U=I):g.type===l.ATTRIBUTE||g.type===l.EQUALS||g.type===l.VALUE||g.type===l.TEXT&&!U.tag_complete?I=this._handle_inside_tag(E,g,U,M):g.type===l.TAG_CLOSE?I=this._handle_tag_close(E,g,U):g.type===l.TEXT?I=this._handle_text(E,g,U):E.add_raw_token(g),j=I,g=M.next();var W=E._output.get_code(y);return W},A.prototype._handle_tag_close=function(w,y,b){var j={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(),j},A.prototype._handle_inside_tag=function(w,y,b,j){var U=b.has_wrapped_attrs,E={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),U=U||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,W;do{if(W=j.peek(g),W.type===l.ATTRIBUTE){I=!1;break}g+=1}while(g<4&&W.type!==l.EOF&&W.type!==l.TAG_CLOSE);M=!I}M&&(w.print_newline(!1),U=!0)}w.print_token(y),U=U||w.previous_token_wrapped(),b.has_wrapped_attrs=U}return E},A.prototype._handle_text=function(w,y,b){var j={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)),j},A.prototype._print_custom_beatifier_text=function(w,y,b){var j=this;if(y.text!==""){var U=y.text,E,M=1,I="",g="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?E=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?E=this._css_beautify:b.custom_beautifier_name==="html"&&(E=function(Ee,Oe){var Te=new A(Ee,Oe,j._js_beautify,j._css_beautify);return Te.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-w.indent_level);var W=w.get_full_indent(M);if(U=U.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var J=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!J){w.add_raw_token(y);return}I=W+J[1]+`
|
|
`,U=J[4],J[5]&&(g=W+J[5]),U=U.replace(/\n[ \t]*$/,""),(J[2]||J[3].indexOf(`
|
|
`)!==-1)&&(J=J[3].match(/[ \t]+$/),J&&(y.whitespace_before=J[0]))}if(U)if(E){var le=function(){this.eol=`
|
|
`};le.prototype=this._options.raw_options;var ce=new le;U=E(W+U,ce)}else{var Re=y.whitespace_before;Re&&(U=U.replace(new RegExp(`
|
|
(`+Re+")?","g"),`
|
|
`)),U=W+U.replace(/\n/g,`
|
|
`+W)}I&&(U?U=I+U+`
|
|
`+g:U=I+g),w.print_newline(!1),U&&(y.text=U,y.whitespace_before="",y.newlines=0,w.add_raw_token(y),w.print_newline(!0))}},A.prototype._handle_tag_open=function(w,y,b,j){var U=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),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(w.traverse_whitespace(y),this._set_tag_position(w,y,U,b,j),U.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)&&(U.alignment_size=y.text.length+1),!U.tag_complete&&!U.is_unformatted&&(w.alignment_size=U.alignment_size),U};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 j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};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,j,U){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=T(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 E=w.current_line_has_match(/{{#if/);E||w.print_newline(!1)}b.tag_name==="!--"&&U.type===l.TAG_CLOSE&&j.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&&!(j.is_inline_element||j.is_unformatted)&&!(U.type===l.TAG_CLOSE&&b.start_tag_token===j)&&U.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)&&(U.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 x=["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"&&x.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(T,S){h.call(this,T,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(T){return!1},O.prototype._is_opening=function(T){return T.type===s.TAG_OPEN},O.prototype._is_closing=function(T,S){return T.type===s.TAG_CLOSE&&S&&((T.text===">"||T.text==="/>")&&S.text[0]==="<"||T.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(T,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,T,S),D=D||this._read_close(L,S),D=D||this._read_raw_content(L,T,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(T){var S=null,D=null,L=null;if(T==="<"){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(T){var S=null,D=null,L=null;if(T==="<"){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(T,S){var D=null,L=null;return S||T==="<"&&(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(T,S){var D=null,L=null;return S||this._options.indent_handlebars&&T==="{"&&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(T,S){var D=null,L=null;return S&&(S.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(D=this._input.next(),T==="/"&&(D+=this._input.next()),L=this._create_token(s.TAG_CLOSE,D)):S.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),L=this._create_token(s.TAG_CLOSE,"}}"))),L},O.prototype._read_attribute=function(T,S,D){var L=null,A="";if(D&&D.text[0]==="<")if(T==="=")L=this._create_token(s.EQUALS,this._input.next());else if(T==='"'||T==="'"){var C=this._input.next();T==='"'?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(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},O.prototype._read_raw_content=function(T,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(T);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(T){var S="";if(this._options.unformatted_content_delimiter&&(T===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}],G={};function r(v){var m=G[v];if(m!==void 0)return m.exports;var p=G[v]={exports:{}};return K[v](p,p.exports,r),p.exports}var R=r(18);N=R})();var $=N;if(!0)!(se=[Q,Q("6UM0"),Q("TXwP")],X=function(K){var G=Q("6UM0"),r=Q("TXwP");return{html_beautify:function(R,v){return $(R,v,G.js_beautify,r.css_beautify)}}}.apply(we,se),X!==void 0&&(Ye.exports=X));else var H,P})()},"rAM+":function(Ye,we,Q){"use strict";Q.d(we,"a",function(){return X});var se=Q("Qw5x");function X(N,$){var H;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(H=Object(se.a)(N))||$&&N&&typeof N.length=="number"){H&&(N=H);var P=0,K=function(){};return{s:K,n:function(){return P>=N.length?{done:!0}:{done:!1,value:N[P++]}},e:function(m){throw m},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var G=!0,r=!1,R;return{s:function(){H=N[Symbol.iterator]()},n:function(){var m=H.next();return G=m.done,m},e:function(m){r=!0,R=m},f:function(){try{!G&&H.return!=null&&H.return()}finally{if(r)throw R}}}}},rUJ1:function(Ye,we){const Q=/[&<>"']/,se=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,$={"&":"&","<":"<",">":">",'"':""","'":"'"},H=L=>$[L];function P(L,A){if(A){if(Q.test(L))return L.replace(se,H)}else if(X.test(L))return L.replace(N,H);return L}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(L){return L.replace(K,(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:(x,d)=>(d=d.source||d,d=d.replace(r,"$1"),L=L.replace(x,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 x;try{x=decodeURIComponent(G(C)).replace(v,"").toLowerCase()}catch(d){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}A&&!m.test(C)&&(C=u(A,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(x){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]=T(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,x;for(;A<arguments.length;A++){C=arguments[A];for(x in C)Object.prototype.hasOwnProperty.call(C,x)&&(L[x]=C[x])}return L}function O(L,A){const C=L.replace(/\|/g,(w,y,b)=>{let j=!1,U=y;for(;--U>=0&&b[U]==="\\";)j=!j;return j?"|":" |"}),x=C.split(/ \|/);let d=0;if(x.length>A)x.splice(A);else for(;x.length<A;)x.push("");for(;d<x.length;d++)x[d]=x[d].trim().replace(/\\\|/g,"|");return x}function T(L,A,C){const x=L.length;if(x===0)return"";let d=0;for(;d<x;){const w=L.charAt(x-d-1);if(w===A&&!C)d++;else if(w!==A&&C)d++;else break}return L.substr(0,x-d)}function S(L,A){if(L.indexOf(A[1])===-1)return-1;const C=L.length;let x=0,d=0;for(;d<C;d++)if(L[d]==="\\")d++;else if(L[d]===A[0])x++;else if(L[d]===A[1]&&(x--,x<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")}Ye.exports={escape:P,unescape:G,edit:R,cleanUrl:p,resolveUrl:u,noopTest:s,merge:a,splitCells:O,rtrim:T,findClosingBracket:S,checkSanitizeDeprecation:D}},t9D7:function(Ye,we,Q){"use strict";Q.d(we,"b",function(){return K}),Q.d(we,"g",function(){return r}),Q.d(we,"d",function(){return R}),Q.d(we,"e",function(){return v}),Q.d(we,"a",function(){return m}),Q.d(we,"f",function(){return o}),Q.d(we,"c",function(){return f});var se=Q("Vhoy"),X=Q("MI8n"),N=Q("pmY6"),$=Q("Cg/j"),H=Q("ic2d"),P=Q("nEHx");const K=Object($.c)("themeService");var G;(function(l){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}l.isThemeColor=u})(G||(G={}));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"||G.isThemeColor(D.color))}l.isThemeIcon=u;const s=new RegExp(`^\\$\\((${se.a.iconNameExpression}(?:${se.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 T(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=T;function S(D,L){return{id:D.id,color:L?r(L):void 0}}l.asThemeIcon=S,l.asClassNameArray=se.a.asClassNameArray,l.asClassName=se.a.asClassName,l.asCSSSelector=se.a.asCSSSelector})(R||(R={}));function v(l){switch(l){case P.a.DARK:return"vs-dark";case P.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 X.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(N.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new p;H.a.add(m.ThemingContribution,h);function o(l){return h.onColorThemeChange(l)}class f extends N.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(Ye,we,Q){typeof window!="undefined"&&function(X,N){Ye.exports=N()}(this,function(){return function(se){var X={};function N($){if(X[$])return X[$].exports;var H=X[$]={i:$,l:!1,exports:{}};return se[$].call(H.exports,H,H.exports,N),H.l=!0,H.exports}return N.m=se,N.c=X,N.d=function($,H,P){N.o($,H)||Object.defineProperty($,H,{enumerable:!0,get:P})},N.r=function($){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})},N.t=function($,H){if(H&1&&($=N($)),H&8)return $;if(H&4&&typeof $=="object"&&$&&$.__esModule)return $;var P=Object.create(null);if(N.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:$}),H&2&&typeof $!="string")for(var K in $)N.d(P,K,function(G){return $[G]}.bind(null,K));return P},N.n=function($){var H=$&&$.__esModule?function(){return $.default}:function(){return $};return N.d(H,"a",H),H},N.o=function($,H){return Object.prototype.hasOwnProperty.call($,H)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(se,X,N){"use strict";var $=Object.prototype.hasOwnProperty,H="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(H=!1));function K(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function G(v,m,p,h,o){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new K(p,h||v,o),l=H?H+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 P:delete v._events[m]}function R(){this._events=new P,this._eventsCount=0}R.prototype.eventNames=function(){var m=[],p,h;if(this._eventsCount===0)return m;for(h in p=this._events)$.call(p,h)&&m.push(H?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},R.prototype.listeners=function(m){var p=H?H+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=H?H+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=H?H+m:m;if(!this._events[u])return!1;var s=this._events[u],a=arguments.length,O,T;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(T=1,O=new Array(a-1);T<a;T++)O[T-1]=arguments[T];s.fn.apply(s.context,O)}else{var S=s.length,D;for(T=0;T<S;T++){s[T].once&&this.removeListener(m,s[T].fn,void 0,!0);switch(a){case 1:s[T].fn.call(s[T].context);break;case 2:s[T].fn.call(s[T].context,p);break;case 3:s[T].fn.call(s[T].context,p,h);break;case 4:s[T].fn.call(s[T].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[T].fn.apply(s[T].context,O)}}}return!0},R.prototype.on=function(m,p,h){return G(this,m,p,h,!1)},R.prototype.once=function(m,p,h){return G(this,m,p,h,!0)},R.prototype.removeListener=function(m,p,h,o){var f=H?H+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=H?H+m:m,this._events[p]&&r(this,p)):(this._events=new P,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=H,R.EventEmitter=R,se.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(se,X,N){(function($){var H=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,G=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/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=P.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=H.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(K,"");R.length!==(R=R.replace(G,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};se.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(se,X,N){function $(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 H="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+H+").*?\\)";function K(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function G(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)"+K(u)+P,"g"),a;a=s.exec(f);){if(a[3]==="dll-reference")continue;o[h].push(a[3])}for(s=new RegExp("\\("+K(u)+'\\("(dll-reference\\s('+H+'))"\\)\\)'+P,"g");a=s.exec(f);)m[a[2]]||(o[h].push(a[1]),m[a[2]]=N(a[1]).m),o[a[2]]=o[a[2]]||[],o[a[2]].push(a[4]);for(var O=Object.keys(o),T=0;T<O.length;T++)for(var S=0;S<o[O[T]].length;S++)G(o[O[T]][S])&&(o[O[T]][S]=1*o[O[T]][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 T=r(m,m[s][O],s),S=Object.keys(T),D=0;D<S.length;D++)h[S[D]]=h[S[D]]||[],h[S[D]]=h[S[D]].concat(T[S[D]])}return o}se.exports=function(m,p){p=p||{};var h={main:N.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 T=0;o[O][T];)T++;o[O].push(T),h[O][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+O+" = ("+$.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+o[O].map(function(S){return""+JSON.stringify(S)+": "+h[O][S].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+$.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(se,X,N){"use strict";N.r(X),N.d(X,"hlsDefaultConfig",function(){return D}),N.d(X,"mergeConfig",function(){return A}),N.d(X,"enableStreamingMode",function(){return C});var $=N("./src/controller/abr-controller.ts"),H=N("./src/controller/audio-stream-controller.ts"),P=N("./src/controller/audio-track-controller.ts"),K=N("./src/controller/subtitle-stream-controller.ts"),G=N("./src/controller/subtitle-track-controller.ts"),r=N("./src/controller/buffer-controller.ts"),R=N("./src/controller/timeline-controller.ts"),v=N("./src/controller/cap-level-controller.ts"),m=N("./src/controller/fps-controller.ts"),p=N("./src/controller/eme-controller.ts"),h=N("./src/controller/cmcd-controller.ts"),o=N("./src/utils/xhr-loader.ts"),f=N("./src/utils/fetch-loader.ts"),l=N("./src/utils/cues.ts"),u=N("./src/utils/mediakeys-helper.ts"),s=N("./src/utils/logger.ts");function a(){return a=Object.assign||function(x){for(var d=1;d<arguments.length;d++){var w=arguments[d];for(var y in w)Object.prototype.hasOwnProperty.call(w,y)&&(x[y]=w[y])}return x},a.apply(this,arguments)}function O(x,d){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(x);d&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(x,b).enumerable})),w.push.apply(w,y)}return w}function T(x){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(x,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(w)):O(Object(w)).forEach(function(y){Object.defineProperty(x,y,Object.getOwnPropertyDescriptor(w,y))})}return x}function S(x,d,w){return d in x?Object.defineProperty(x,d,{value:w,enumerable:!0,configurable:!0,writable:!0}):x[d]=w,x}var D=T(T({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:$.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:K.SubtitleStreamController,subtitleTrackController:G.default,timelineController:R.TimelineController,audioStreamController:H.default,audioTrackController:P.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(x,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({},x,d)}function C(x){var d=x.loader;if(d!==f.default&&d!==o.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var w=Object(f.fetchSupported)();w&&(x.loader=f.default,x.progressive=!0,x.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/polyfills/number.ts"),H=N("./src/utils/ewma-bandwidth-estimator.ts"),P=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),G=N("./src/errors.ts"),r=N("./src/types/loader.ts"),R=N("./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 H.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(P.Events.FRAG_LOADING,this.onFragLoading,this),l.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(P.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(P.Events.FRAG_LOADING,this.onFragLoading,this),l.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(P.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,T=s.media;if(!l||!T)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||T.paused||!T.playbackRate||!T.readyState)return;var L=performance.now()-S.loading.start,A=Math.abs(T.playbackRate);if(L<=500*D/A)return;var C=s.levels,x=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,j=T.currentTime,U=(K.BufferHelper.bufferInfo(T,j,O.maxBufferHole).end-j)/A;if(U>=2*D/A||b<=U)return;var E=Number.POSITIVE_INFINITY,M;for(M=l.level-1;M>x;M--){var I=C[M].maxBitrate;if(E=D*I/(8*.8*y),E<U)break}if(E>=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($.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: `+E.toFixed(3)+` s
|
|
Time to underbuffer: `+U.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(P.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($.isFiniteNumber)(s.sn)){var O=a?a.stats:s.stats,T=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)+T;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(P.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 T=O.parsing.end-O.loading.start;this.bwEstimator.sample(T,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},o.onError=function(l,u){switch(u.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.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,T=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,x=(K.BufferHelper.bufferInfo(S,L,O.maxBufferHole).end-L)/A,d=this.findBestLevel(C,T,a,x,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(d>=0)return d;R.logger.trace((x?"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(!x){var j=this.bitrateTestDelay;if(j){var U=D?Math.min(D,O.maxLoadingDelay):O.maxLoadingDelay;w=U-j,R.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),y=b=1}}return d=this.findBestLevel(C,T,a,x+w,y,b),Math.max(d,0)},o.findBestLevel=function(l,u,s,a,O,T){for(var S,D=this.fragCurrent,L=this.partCurrent,A=this.lastLoadedFragLevel,C=this.hls.levels,x=C[A],d=!!(x!=null&&(S=x.details)!==null&&S!==void 0&&S.live),w=x==null?void 0:x.codecSet,y=L?L.duration:D?D.duration:0,b=s;b>=u;b--){var j=C[b];if(!j||w&&j.codecSet!==w)continue;var U=j.details,E=(L?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||y,M=void 0;b<=A?M=O*l:M=T*l;var I=C[b].maxBitrate,g=I*E/M;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(M)+"/"+I+"/"+E+"/"+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}();X.default=p},"./src/controller/audio-stream-controller.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/polyfills/number.ts"),H=N("./src/controller/base-stream-controller.ts"),P=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),G=N("./src/controller/fragment-tracker.ts"),r=N("./src/types/level.ts"),R=N("./src/types/loader.ts"),v=N("./src/loader/fragment.ts"),m=N("./src/demux/chunk-cache.ts"),p=N("./src/demux/transmuxer-interface.ts"),h=N("./src/types/transmuxer.ts"),o=N("./src/controller/fragment-finders.ts"),f=N("./src/utils/discontinuities.ts"),l=N("./src/errors.ts"),u=N("./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,x){return C.__proto__=x,C},O(D,L)}var T=100,S=function(D){a(L,D);function L(C,x){var d;return d=D.call(this,C,x,"[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 x=this.hls;x.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(P.Events.ERROR,this.onError,this),x.on(P.Events.BUFFER_RESET,this.onBufferReset,this),x.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var x=this.hls;x.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(P.Events.ERROR,this.onError,this),x.off(P.Events.BUFFER_RESET,this.onBufferReset,this),x.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onInitPtsFound=function(x,d){var w=d.frag,y=d.id,b=d.initPTS;if(y==="main"){var j=w.cc;this.initPTS[w.cc]=b,this.log("InitPTS for cc: "+j+" found from main: "+b),this.videoTrackCC=j,this.state===H.State.WAITING_INIT_PTS&&this.tick()}},A.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=H.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,d>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=H.State.IDLE):(this.loadedmetadata=!1,this.state=H.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},A.doTick=function(){switch(this.state){case H.State.IDLE:this.doTickIdle();break;case H.State.WAITING_TRACK:{var x,d=this.levels,w=this.trackId,y=d==null||((x=d[w])===null||x===void 0)?void 0:x.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=H.State.WAITING_INIT_PTS}break}case H.State.FRAG_LOADING_WAITING_RETRY:{var b,j=performance.now(),U=this.retryDate;(!U||j>=U||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=H.State.IDLE);break}case H.State.WAITING_INIT_PTS:{var E=this.waitingData;if(E){var M=E.frag,I=E.part,g=E.cache,W=E.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=H.State.FRAG_LOADING;var J=g.flush(),le={frag:M,part:I,payload:J,networkDetails:null};this._handleFragmentLoadProgress(le),W&&D.prototype._handleFragmentLoadComplete.call(this,le)}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 ce=this.getLoadPosition(),Re=K.BufferHelper.bufferInfo(this.mediaBuffer,ce,this.config.maxBufferHole),Ee=Object(o.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,M);Ee<0&&(u.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=H.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=H.State.IDLE)},A.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:x,w=d.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},A.doTickIdle=function(){var x,d,w=this.hls,y=this.levels,b=this.media,j=this.trackId,U=w.config;if(!y||!y[j])return;if(!b&&(this.startFragRequested||!U.startFragPrefetch))return;var E=y[j],M=E.details;if(!M||M.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(M)){this.state=H.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,W=this.getMaxBufferLength(),J=this.audioSwitch;if(g>=W&&!J)return;if(!J&&this._streamEnded(I,M)){w.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=H.State.ENDED;return}var le=M.fragments,ce=le[0].start,Re=I.end;if(J){var Ee=this.getLoadPosition();Re=Ee,M.PTSKnown&&Ee<ce&&((I.end>ce||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=ce+.05))}var Oe=this.getNextFragment(Re,M);if(!Oe){this.bufferFlushed=!0;return}((x=Oe.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((d=Oe.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(Oe,M):this.loadFragment(Oe,M,Re)},A.getMaxBufferLength=function(){var x=D.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return d===null?x:Math.max(x,d.len)},A.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(x,d){var w=d.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(y){return new r.Level(y)})},A.onAudioTrackSwitching=function(x,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(T):this.resetTransmuxer(),w?(this.audioSwitch=!0,this.state=H.State.IDLE):this.state=H.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(x,d){this.mainDetails=d.details},A.onAudioTrackLoaded=function(x,d){var w,y=this.levels,b=d.details,j=d.id;if(!y){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var U=y[j],E=0;if(b.live||(w=U.details)!==null&&w!==void 0&&w.live){var M=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!M)return;!U.details&&b.hasProgramDateTime&&M.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(b,M),E=b.fragments[0].start):E=this.alignPlaylists(b,U.details)}U.details=b,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(U.details,E),this.state===H.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=H.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(x){var d,w=x.frag,y=x.part,b=x.payload,j=this.config,U=this.trackId,E=this.levels;if(!E){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=E[U];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=j.defaultAudioCodec||M.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new p.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[w.cc],le=(d=w.initSegment)===null||d===void 0?void 0:d.data;if(J!==void 0){var ce=!1,Re=y?y.index:-1,Ee=Re!==-1,Oe=new h.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,b.byteLength,Re,Ee);W.push(b,le,g,"",w,y,I.totalduration,ce,Oe,J)}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 "+U);var Te=this.waitingData=this.waitingData||{frag:w,part:y,cache:new m.default,complete:!1},Le=Te.cache;Le.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=H.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,x)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(x,d){var w=d.tracks.audio;w&&(this.mediaBuffer=w.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},A.onFragBuffered=function(x,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(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,y)},A.onError=function(x,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!==H.State.ERROR&&this.state!==H.State.STOPPED&&(this.state=d.fatal?H.State.ERROR:H.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===H.State.PARSING||this.state===H.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(x,d){var w=d.type;w===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(x){var d,w="audio",y=this.hls,b=x.remuxResult,j=x.chunkMeta,U=this.getCurrentContext(j);if(!U){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var E=U.frag,M=U.part,I=b.audio,g=b.text,W=b.id3,J=b.initSegment;if(this.fragContextChanged(E))return;if(this.state=H.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,E,j),y.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:w,tracks:J.tracks})),I){var le=I.startPTS,ce=I.endPTS,Re=I.startDTS,Ee=I.endDTS;M&&(M.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:ce,startDTS:Re,endDTS:Ee}),E.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,le,ce,Re,Ee),this.bufferFragmentData(I,E,M,j)}if(W!=null&&(d=W.samples)!==null&&d!==void 0&&d.length){var Oe=s({frag:E,id:w},W);y.trigger(P.Events.FRAG_PARSING_METADATA,Oe)}if(g){var Te=s({frag:E,id:w},g);y.trigger(P.Events.FRAG_PARSING_USERDATA,Te)}},A._bufferInitSegment=function(x,d,w){if(this.state!==H.State.PARSING)return;x.video&&delete x.video;var y=x.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(P.Events.BUFFER_CODECS,x);var b=y.initSegment;if(b!=null&&b.byteLength){var j={type:"audio",frag:d,part:null,chunkMeta:w,parent:d.type,data:b};this.hls.trigger(P.Events.BUFFER_APPENDING,j)}this.tick()},A.loadFragment=function(x,d,w){var y=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||y===G.FragmentState.NOT_LOADED||y===G.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):d.live&&!Object($.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=H.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,x,d,w)))},A.completeAudioSwitch=function(){var x=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,x.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:w})},L}(H.default);X.default=S},"./src/controller/audio-track-controller.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function G(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&&G(p.prototype,h),o&&G(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($.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on($.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off($.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 T=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,T))},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(T){return!s||T.groupId===s});this.selectDefaultTrack&&!a.some(function(T){return T.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($.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===K.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,T=a.groupId,S=T===void 0?"":T,D=a.name,L=a.type,A=a.url;if(this.trackId=l,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger($.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($.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.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(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger($.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}(P.default);X.default=m},"./src/controller/base-playlist-controller.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return r});var $=N("./src/polyfills/number.ts"),H=N("./src/types/level.ts"),P=N("./src/controller/level-helper.ts"),K=N("./src/utils/logger.ts"),G=N("./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=K.logger.log.bind(K.logger,p+":"),this.warn=K.logger.warn.bind(K.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===G.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($.isFiniteNumber)(s))return new H.HlsUrlParameters(s,Object($.isFiniteNumber)(a)?a:void 0,H.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(P.mergeDetails)(o,l),!this.canLoad||!l.live)return;var a,O=void 0,T=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,x=D===L,d=S?0:A;C?(O=x?L+1:D,T=x?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 j=Math.floor(b/l.targetduration);if(O+=j,T!==void 0){var U=Math.round(b%l.targetduration/l.partTarget);T+=U}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+b+" skip sn "+j+" to part "+T)}l.tuneInGoal=b}if(a=this.getDeliveryDirectives(l,h.deliveryDirectives,O,T),S||!x){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(l,h.deliveryDirectives,O,T);var E=Object(P.computeReloadInterval)(l,u);O!==void 0&&l.canBlockReload&&(E-=l.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(E)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(a)},E)}else this.clearTimer()},v.getDeliveryDirectives=function(p,h,o,f){var l=Object(H.getSkipValue)(p,o);return h!=null&&h.skip&&p.deltaUpdateFailed&&(o=h.msn,f=h.part,l=H.HlsSkip.No),new H.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(se,X,N){"use strict";N.r(X),N.d(X,"State",function(){return L}),N.d(X,"default",function(){return A});var $=N("./src/polyfills/number.ts"),H=N("./src/task-loop.ts"),P=N("./src/controller/fragment-tracker.ts"),K=N("./src/utils/buffer-helper.ts"),G=N("./src/utils/logger.ts"),r=N("./src/events.ts"),R=N("./src/errors.ts"),v=N("./src/types/transmuxer.ts"),m=N("./src/utils/mp4-tools.ts"),p=N("./src/utils/discontinuities.ts"),h=N("./src/controller/fragment-finders.ts"),o=N("./src/controller/level-helper.ts"),f=N("./src/loader/fragment-loader.ts"),l=N("./src/crypt/decrypter.ts"),u=N("./src/utils/time-ranges.ts"),s=N("./src/types/loader.ts");function a(C,x){for(var d=0;d<x.length;d++){var w=x[d];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(C,w.key,w)}}function O(C,x,d){return x&&a(C.prototype,x),d&&a(C,d),C}function T(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function S(C,x){C.prototype=Object.create(x.prototype),C.prototype.constructor=C,D(C,x)}function D(C,x){return D=Object.setPrototypeOf||function(w,y){return w.__proto__=y,w},D(C,x)}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(x,C);function x(w,y,b){var j;return j=C.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=L.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=b,j.log=G.logger.log.bind(G.logger,b+":"),j.warn=G.logger.warn.bind(G.logger,b+":"),j.hls=w,j.fragmentLoader=new f.default(w.config),j.fragmentTracker=y,j.config=w.config,j.decrypter=new l.default(w,w.config),w.on(r.Events.KEY_LOADED,j.onKeyLoaded,T(j)),j}var d=x.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 j=this.fragCurrent,U=this.fragmentTracker;if(!b.live&&j&&j.sn===b.endSN&&!y.nextStart){var E=U.getState(j);return E===P.FragmentState.PARTIAL||E===P.FragmentState.OK}return!1},d.onMediaAttached=function(y,b){var j=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===L.STOPPED&&this.startLoad(U.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,j=this.media,U=this.mediaBuffer,E=this.state,M=j?j.currentTime:0,I=K.BufferHelper.bufferInfo(U||j,M,y.maxBufferHole);if(this.log("media seeking to "+(Object($.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+E),E===L.ENDED)this.resetLoadingState();else if(b&&!I.len){var g=y.maxFragLookUpTolerance,W=b.start-g,J=b.start+b.duration+g,le=M>J;(M<W||le)&&(le&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}j&&(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 j=this.levels[b.frag.level].details;j&&this.loadFragment(b.frag,j,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,j){this._loadFragForPlayback(y,b,j)},d._loadFragForPlayback=function(y,b,j){var U=this,E=function(I){if(U.fragContextChanged(y)){U.warn("Fragment "+y.sn+(I.part?" p: "+I.part.index:"")+" of level "+y.level+" was dropped during download."),U.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,U._handleFragmentLoadProgress(I)};this._doFragLoad(y,b,j,E).then(function(M){if(!M)return;U.fragLoadError=0;var I=U.state;if(U.fragContextChanged(y)){(I===L.FRAG_LOADING||I===L.BACKTRACKING||!U.fragCurrent&&I===L.PARSING)&&(U.fragmentTracker.removeFragment(y),U.state=L.IDLE);return}if("payload"in M&&(U.log("Loaded fragment "+y.sn+" of level "+y.level),U.hls.trigger(r.Events.FRAG_LOADED,M),U.state===L.BACKTRACKING)){U.fragmentTracker.backtrack(y,M),U.resetFragmentLoading(y);return}U._handleFragmentLoadComplete(M)}).catch(function(M){U.warn(M),U.resetFragmentLoading(y)})},d.flushMainBuffer=function(y,b,j){if(j===void 0&&(j=null),!(y-b))return;var U={startOffset:y,endOffset:b,type:j};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,U)},d._loadInitSegment=function(y){var b=this;this._doFragLoad(y).then(function(j){if(!j||b.fragContextChanged(y)||!b.levels)throw new Error("init load aborted");return j}).then(function(j){var U=b.hls,E=j.payload,M=y.decryptdata;if(E&&E.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var I=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(E),M.key.buffer,M.iv.buffer).then(function(g){var W=self.performance.now();return U.trigger(r.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:I,tdecrypt:W}}),j.payload=g,j})}return j}).then(function(j){var U=b.fragCurrent,E=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(j.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),j.frag===U&&E.trigger(r.Events.FRAG_BUFFERED,{stats:g,frag:U,part:null,id:y.type}),b.tick()}).catch(function(j){b.warn(j),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 j=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(K.BufferHelper.getBuffered(j))),this.state=L.IDLE,this.tick()},d._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var j=y.frag,U=y.part,E=y.partsLoaded,M=!E||E.length===0||E.some(function(g){return!g}),I=new v.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,U?U.index:-1,!M);b.flush(I)},d._handleFragmentLoadProgress=function(y){},d._doFragLoad=function(y,b,j,U){var E=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(y.start,j||0),this.config.lowLatencyMode&&b){var M=b.partList;if(M&&U){j>y.end&&b.fragmentHint&&(y=b.fragmentHint);var I=this.getNextPart(M,y,j);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(j.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:j}),this.doFragPartsLoad(y,M,I,U).catch(function(W){return E.handleFragLoadError(W)})}else if(!y.url||this.loadedEndOfParts(M,j))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(j.toFixed(3))),Object($.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:j}),this.fragmentLoader.load(y,U).catch(function(W){return E.handleFragLoadError(W)})},d.doFragPartsLoad=function(y,b,j,U){var E=this;return new Promise(function(M,I){var g=[],W=function J(le){var ce=b[le];E.fragmentLoader.loadPart(y,ce,U).then(function(Re){g[ce.index]=Re;var Ee=Re.part;E.hls.trigger(r.Events.FRAG_LOADED,Re);var Oe=b[le+1];if(Oe&&Oe.fragment===y)J(le+1);else return M({frag:y,part:Ee,partsLoaded:g})}).catch(I)};W(j)})},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 j=b.frag,U=b.part,E=b.level,M=self.performance.now();j.stats.parsing.end=M,U&&(U.stats.parsing.end=M),this.updateLevelTiming(j,U,E,y.partial)},d.getCurrentContext=function(y){var b=this.levels,j=y.level,U=y.sn,E=y.part;if(!b||!b[j])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+j+". The current chunk will not be buffered."),null;var M=b[j],I=E>-1?Object(o.getPartWith)(M,U,E):null,g=I?I.fragment:Object(o.getFragmentWithSN)(M,U,this.fragCurrent);return g?{frag:g,part:I,level:M}:null},d.bufferFragmentData=function(y,b,j,U){if(!y||this.state!==L.PARSING)return;var E=y.data1,M=y.data2,I=E;if(E&&M&&(I=Object(m.appendUint8Array)(E,M)),!I||!I.length)return;var g={type:y.type,frag:b,part:j,chunkMeta:U,parent:b.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!j&&this.flushBufferGap(b)},d.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!K.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var j=b.currentTime,U=K.BufferHelper.bufferInfo(b,j,0),E=y.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,E*.25),I=Math.max(Math.min(y.start-M,U.end-M),j+M);y.start-I>M&&this.flushMainBuffer(I,y.start)},d.getFwdBufferInfo=function(y,b){var j=this.config,U=this.getLoadPosition();if(!Object($.isFiniteNumber)(U))return null;var E=K.BufferHelper.bufferInfo(y,U,j.maxBufferHole);if(E.len===0&&E.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(U,b);if(M&&E.nextStart<M.end)return K.BufferHelper.bufferInfo(y,U,Math.max(E.nextStart,j.maxBufferHole))}return E},d.getMaxBufferLength=function(y){var b=this.config,j;return y?j=Math.max(8*b.maxBufferSize/y,b.maxBufferLength):j=b.maxBufferLength,Math.min(j,b.maxMaxBufferLength)},d.reduceMaxBufferLength=function(y){var b=this.config,j=y||b.maxBufferLength;return b.maxMaxBufferLength>=j?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(y,b){var j,U,E=b.fragments,M=E.length;if(!M)return null;var I=this.config,g=E[0].start,W;if(b.live){var J=I.initialLiveManifestSize;if(M<J)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+J+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(b,E),this.startPosition=W?this.hls.liveSyncPosition||W.start:y)}else y<=g&&(W=E[0]);if(!W){var le=I.lowLatencyMode?b.partEnd:b.fragmentEnd;W=this.getFragmentAtPosition(y,le,b)}return(j=W)!==null&&j!==void 0&&j.initSegment&&!((U=W)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},d.getNextPart=function(y,b,j){for(var U=-1,E=!1,M=!0,I=0,g=y.length;I<g;I++){var W=y[I];if(M=M&&!W.independent,U>-1&&j<W.start)break;var J=W.loaded;!J&&(E||W.independent||M)&&W.fragment===b&&(U=I),E=J}return U},d.loadedEndOfParts=function(y,b){var j=y[y.length-1];return j&&b>j.start&&j.loaded},d.getInitialLiveFragment=function(y,b){var j=this.fragPrevious,U=null;if(j){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),U=Object(h.findFragmentByPDT)(b,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var E=j.sn+1;if(E>=y.startSN&&E<=y.endSN){var M=b[E-y.startSN];j.cc===M.cc&&(U=M,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(h.findFragWithCC)(b,j.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(U=this.getFragmentAtPosition(I,this.bitrateTest?y.fragmentEnd:y.edge,y))}return U},d.getFragmentAtPosition=function(y,b,j){var U=this.config,E=this.fragPrevious,M=j.fragments,I=j.endSN,g=j.fragmentHint,W=U.maxFragLookUpTolerance,J=!!(U.lowLatencyMode&&j.partList&&g);J&&g&&!this.bitrateTest&&(M=M.concat(g),I=g.sn);var le;if(y<b){var ce=y>b-W?0:W;le=Object(h.findFragmentByPTS)(E,M,y,ce)}else le=M[M.length-1];if(le){var Re=le.sn-j.startSN,Ee=E&&le.level===E.level,Oe=M[Re+1],Te=this.fragmentTracker.getState(le);if(Te===P.FragmentState.BACKTRACKED){le=null;for(var Le=Re;M[Le]&&this.fragmentTracker.getState(M[Le])===P.FragmentState.BACKTRACKED;)E?le=M[Le--]:le=M[--Le];le||(le=Oe)}else E&&le.sn===E.sn&&!J&&(Ee&&(le.sn<I&&this.fragmentTracker.getState(Oe)!==P.FragmentState.OK?(this.log("SN "+le.sn+" just loaded, load next one: "+Oe.sn),le=Oe):le=null))}return le},d.synchronizeToLiveEdge=function(y){var b=this.config,j=this.media;if(!j)return;var U=this.hls.liveSyncPosition,E=j.currentTime,M=y.fragments[0].start,I=y.edge,g=E>=M-b.maxFragLookUpTolerance&&E<=I;if(U!==null&&j.duration>U&&(E<U||!g)){var W=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*y.targetduration;(!g&&j.readyState<4||E<I-W)&&(this.loadedmetadata||(this.nextLoadPosition=U),j.readyState&&(this.warn("Playback: "+E.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+U.toFixed(3)),j.currentTime=U))}},d.alignPlaylists=function(y,b){var j=this.levels,U=this.levelLastLoaded,E=this.fragPrevious,M=U!==null?j[U]:null,I=y.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var g=y.fragments[0].start,W=!b,J=y.alignedSliding&&Object($.isFiniteNumber)(g);if(W||!J&&!g){Object(p.alignStream)(E,M,y);var le=y.fragments[0].start;return this.log("Live playlist sliding: "+le.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+y.startSN+" prev-sn: "+(E?E.sn:"na")+" fragments: "+I),le}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 j=this.startPosition;if(j<b&&(j=-1),j===-1||this.lastCurrentTime===-1){var U=y.startTimeOffset;Object($.isFiniteNumber)(U)?(j=b+U,U<0&&(j+=y.totalduration),j=Math.min(Math.max(b,j),b+y.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+j),this.startPosition=j):y.live?j=this.hls.liveSyncPosition||b:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},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 j=b.frag;if(!j||j.type!==y)return;var U=this.fragCurrent;console.assert(U&&j.sn===U.sn&&j.level===U.level&&j.urlId===U.urlId,"Frag load error must match current frag to retry");var E=this.config;if(this.fragLoadError+1<=E.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*E.fragLoadingRetryDelay,E.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+y+" "+j.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):(G.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,j){if(!y)return;var U=K.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(b,U,j),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,j,U){var E=this,M=j.details;console.assert(!!M,"level.details must be defined");var I=Object.keys(y.elementaryStreams).reduce(function(g,W){var J=y.elementaryStreams[W];if(J){var le=J.endPTS-J.startPTS;if(le<=0)return E.warn("Could not parse fragment "+y.sn+" "+W+" duration reliably ("+le+") resetting transmuxer to fallback to playlist timing"),E.resetTransmuxer(),g||!1;var ce=U?0:Object(o.updateFragPTSDTS)(M,y,J.startPTS,J.endPTS,J.startDTS,J.endDTS);return E.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:M,level:j,drift:ce,type:W,frag:y,start:J.startPTS,end:J.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(x,[{key:"state",get:function(){return this._state},set:function(y){var b=this._state;b!==y&&(this._state=y,this.log(b+"->"+y))}}]),x}(H.default)},"./src/controller/buffer-controller.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return h});var $=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),P=N("./src/utils/logger.ts"),K=N("./src/errors.ts"),G=N("./src/utils/buffer-helper.ts"),r=N("./src/utils/mediasource-helper.ts"),R=N("./src/loader/fragment.ts"),v=N("./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;P.logger.log("[buffer-controller]: Media source opened"),a&&(u.updateMediaElementDuration(),s.trigger(H.Events.MEDIA_ATTACHED,{media:a})),O&&O.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.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(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(H.Events.BUFFER_RESET,this.onBufferReset,this),u.on(H.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(H.Events.BUFFER_EOS,this.onBufferEos,this),u.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(H.Events.FRAG_PARSED,this.onFragParsed,this),u.on(H.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var u=this.hls;u.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(H.Events.BUFFER_RESET,this.onBufferReset,this),u.off(H.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(H.Events.BUFFER_EOS,this.onBufferEos,this),u.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(H.Events.FRAG_PARSED,this.onFragParsed,this),u.off(H.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,P.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(P.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(O){P.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()):P.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(H.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){P.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(T){if(O){var S=a.tracks[T];if(S&&typeof S.buffer.changeType=="function"){var D=s[T],L=D.codec,A=D.levelCodec,C=D.container,x=(S.levelCodec||S.codec).replace(p,"$1"),d=(A||L).replace(p,"$1");if(x!==d){var w=C+";codecs="+(A||L);a.appendChangeType(T,w)}}}else a.pendingTracks[T]=s[T]}),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,T={execute:function(){var D=a.sourceBuffer[u];D&&(P.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),D.changeType(s)),O.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(D){P.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",D)}};O.append(T,u)},f.onBufferAppending=function(u,s){var a=this,O=this.hls,T=this.operationQueue,S=this.tracks,D=s.data,L=s.type,A=s.frag,C=s.part,x=s.chunkMeta,d=x.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 j=S.audio,U=L==="audio"&&x.id===1&&(j==null?void 0:j.container)==="audio/mpeg",E={execute:function(){if(d.executeStart=self.performance.now(),U){var I=a.sourceBuffer[L];if(I){var g=A.start-I.timestampOffset;Math.abs(g)>=.1&&(P.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,W={};for(var J in g)W[J]=G.BufferHelper.getBuffered(g[J]);a.appendError=0,a.hls.trigger(H.Events.BUFFER_APPENDED,{type:L,frag:A,part:C,chunkMeta:x,parent:A.type,timeRanges:W})},onError:function(I){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+L+" SourceBuffer",I);var g={type:K.ErrorTypes.MEDIA_ERROR,parent:A.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=K.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,g.details=K.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>O.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),O.trigger(H.Events.ERROR,g)}};T.append(E,L)},f.onBufferFlushing=function(u,s){var a=this,O=this.operationQueue,T=function(D){return{execute:a.removeExecutor.bind(a,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(H.Events.BUFFER_FLUSHED,{type:D})},onError:function(A){P.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",A)}}};s.type?O.append(T(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){O.append(T(S),S)})},f.onFragParsed=function(u,s){var a=this,O=s.frag,T=s.part,S=[],D=T?T.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,T&&(T.stats.buffering.end=C);var x=T?T.stats:O.stats;a.hls.trigger(H.Events.FRAG_BUFFERED,{frag:O,part:T,stats:x,id:O.type})};S.length===0&&P.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(T,S){var D=a.sourceBuffer[S];return(!s.type||s.type===S)&&(D&&!D.ended&&(D.ended=!0,P.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),T&&!!(!D||D.ended)},!0);O&&this.blockBuffers(function(){var T=a.mediaSource;if(!T||T.readyState!=="open")return;T.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 T=this.getSourceBufferTypes();if(!T.length)return;var S=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object($.isFiniteNumber)(S)||S<0)return;var D=a.currentTime,L=s.levelTargetDuration,A=Math.max(S,L),C=Math.floor(D/L)*L-A;T.forEach(function(x){var d=O[x];if(d){var w=G.BufferHelper.getBuffered(d);w.length>0&&C>w.start(0)&&(u.trigger(H.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),s.live&&u.trigger(H.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),u.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:x}))}})},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,T=u.fragments[0].start+u.totalduration,S=a.duration,D=Object($.isFiniteNumber)(O.duration)?O.duration:0;u.live&&s.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(u)):(T>D&&T>S||!Object($.isFiniteNumber)(S))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),O.duration=T)},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 T=Math.max(0,a[0].start),S=Math.max(T,T+u.totalduration);s.setLiveSeekableRange(T,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 T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(H.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.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 T in u)if(!s[T]){var S=u[T];if(!S)throw Error("source buffer exists for track "+T+", however track does not");var D=S.levelCodec||S.codec,L=S.container+";codecs="+D;P.logger.log("[buffer-controller]: creating sourceBuffer("+L+")");try{var A=s[T]=a.addSourceBuffer(L),C=T;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[T]={buffer:A,codec:D,container:S.container,levelCodec:S.levelCodec,id:S.id},O++}catch(x){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(H.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:L})}}O&&this.hls.trigger(H.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){P.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(H.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.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,T=this.mediaSource,S=this.operationQueue,D=this.sourceBuffer,L=D[u];if(!O||!T||!L){P.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var A=Object($.isFiniteNumber)(O.duration)?O.duration:Infinity,C=Object($.isFiniteNumber)(T.duration)?T.duration:Infinity,x=Math.max(0,s),d=Math.min(a,A,C);d>x?(P.logger.log("[buffer-controller]: Removing ["+x+","+d+"] from the "+u+" SourceBuffer"),console.assert(!L.updating,u+" sourceBuffer must not be updating"),L.remove(x,d)):S.shiftAndExecuteNext(u)},f.appendExecutor=function(u,s){var a=this.operationQueue,O=this.sourceBuffer,T=O[s];if(!T){P.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}T.ended=!1,console.assert(!T.updating,s+" sourceBuffer must not be updating"),T.appendBuffer(u)},f.blockBuffers=function(u,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var O=this.operationQueue,T=s.map(function(S){return O.appendBlocker(S)});Promise.all(T).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 T=a.bind(this,u);this.listeners[u].push({event:s,listener:T}),O.addEventListener(s,T)},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(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return H});var $=N("./src/utils/logger.ts"),H=function(){function P(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var K=P.prototype;return K.append=function(r,R){var v=this.queues[R];v.push(r),v.length===1&&this.buffers[R]&&this.executeNext(R)},K.insertAbort=function(r,R){var v=this.queues[R];v.unshift(r),this.executeNext(R)},K.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},K.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){$.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(o),(!m||!m.updating)&&(p.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},P}()},"./src/controller/cap-level-controller.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/events.ts");function H(G,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(G,v.key,v)}}function P(G,r,R){return r&&H(G.prototype,r),R&&H(G,R),G}var K=function(){function G(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=G.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($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on($.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var v=this.hls;v.off($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off($.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(v,m){G.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 G.isLevelAllowed(f,m.restrictedLevels)&&f<=v});return this.clientRect=null,G.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},G.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},G.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},P(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),G}();X.default=K},"./src/controller/cmcd-controller.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return h});var $=N("./src/events.ts"),H=N("./src/types/cmcd.ts"),P=N("./src/utils/buffer-helper.ts"),K=N("./src/utils/logger.ts");function G(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&&G(o.prototype,f),l&&G(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:H.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(T){K.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(O){try{var T=O.frag,S=u.hls.levels[T.level],D=u.getObjectType(T),L={d:T.duration*1e3,ot:D};(D===H.CMCDObjectType.VIDEO||D===H.CMCDObjectType.AUDIO||D==H.CMCDObjectType.MUXED)&&(L.br=S.bitrate/1e3,L.tb=u.getTopBandwidth(D),L.bl=u.getBufferLength(D)),u.apply(O,L)}catch(A){K.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($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on($.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var u=this.hls;u.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off($.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:H.CMCDVersion,sf:H.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===H.CMCDObjectType.INIT||s.ot===H.CMCDObjectType.VIDEO||s.ot===H.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 T=o.toQuery(s);if(!T)return;u.url=o.appendQueryToUri(u.url,T)}},f.getObjectType=function(u){var s=u.type;return s==="subtitle"?H.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?H.CMCDObjectType.INIT:s==="audio"?H.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?H.CMCDObjectType.VIDEO:H.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(u){for(var s=0,a=u===H.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=R(a),T;!(T=O()).done;){var S=T.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},f.getBufferLength=function(u){var s=this.hls.media,a=u===H.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var O=P.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 T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.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 T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.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(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},O=function(U){return Math.round(U)},T=function(U){return O(U/100)*100},S=function(U){return encodeURIComponent(U)},D={br:O,d:O,bl:T,dl:T,mtp:T,nor:S,rtp:T,tb:O},L=Object.keys(u||{}).sort(),A=R(L),C;!(C=A()).done;){var x=C.value,d=u[x];if(!a(d))continue;if(x==="v"&&d===1)continue;if(x=="pr"&&d===1)continue;var w=D[x];w&&(d=w(d));var y=typeof d,b=void 0;x==="ot"||x==="sf"||x==="st"?b=x+"="+d:y==="boolean"?b=x:y==="number"?b=x+"="+d:b=x+"="+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"],T=[{},{},{},{}],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;T[C][A]=u[A]}for(var x=0;x<T.length;x++){var d=o.serialize(T[x]);d&&(a["CMCD-"+O[x]]=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(se,X,N){"use strict";N.r(X);var $=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/utils/logger.ts"),K=N("./src/utils/mediakeys-helper.ts");function G(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&&G(h.prototype,o),f&&G(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 K.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($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(l){switch(l){case K.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);P.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(l,O);this.mediaKeysPromise=T.then(function(S){return a._onMediaKeySystemAccessObtained(l,S)}),T.catch(function(S){P.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},o._onMediaKeySystemAccessObtained=function(l,u){var s=this;P.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(T){return a.mediaKeys=T,P.logger.log('Media-keys created for key-system "'+l+'"'),s._onMediaKeysCreated(),T});return O.catch(function(T){P.logger.error("Failed to create media-keys:",T)}),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;P.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(s){u._onKeySessionMessage(l,s.message)},!1)},o._onKeySessionMessage=function(l,u){P.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){P.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),l.update(s)})},o.onMediaEncrypted=function(l){var u=this;if(P.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.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){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.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){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var O=a.mediaKeysSession;if(!O){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+l+'" init data type'),a.mediaKeysSessionInitialized=!0,O.generateRequest(l,u).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(T){P.logger.error("Error generating key-session request:",T),s.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.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(T){P.logger.error(T)}try{a.readyState||a.open("POST",l,!0),O&&O.call(this.hls,a,l)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return a},o._onLicenseRequestReadyStageChange=function(l,u,s,a){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var O=l.response,T=this._licenseResponseCallback;if(T)try{O=T.call(this.hls,l,u)}catch(D){P.logger.error(D)}a(O)}else{if(P.logger.error("License Request XHR failed ("+u+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=R-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,a)}break}},o._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,u){P.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),O=this._createLicenseXhr(a,l,u);P.logger.log("Sending license request to URL: "+a);var T=this._generateLicenseRequestChallenge(s,l);O.send(T)}catch(S){P.logger.error("Failure requesting DRM license: "+S),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.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(K.KeySystems.WIDEVINE,s,a)},r(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();X.default=p},"./src/controller/fps-controller.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/events.ts"),H=N("./src/utils/logger.ts"),P=function(){function K(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 G=K.prototype;return G.setStreamController=function(R){this.streamController=R},G.registerListeners=function(){this.hls.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.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)}},G.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($.Events.FPS_DROP,{currentDropped:o,currentDecoded:f,totalDroppedFrames:m}),l>0&&o>u.config.fpsDroppedMonitoringThreshold*f){var s=u.currentLevel;H.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($.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}},G.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)},K}();X.default=P},"./src/controller/fragment-finders.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"findFragmentByPDT",function(){return P}),N.d(X,"findFragmentByPTS",function(){return K}),N.d(X,"fragmentWithinToleranceTest",function(){return G}),N.d(X,"pdtWithinToleranceTest",function(){return r}),N.d(X,"findFragWithCC",function(){return R});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/binary-search.ts");function P(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object($.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 K(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&&G(p,h,o)===0)return o;var f=H.default.search(m,G.bind(null,p,h));return f||o}function G(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 H.default.search(v,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"FragmentState",function(){return P}),N.d(X,"FragmentTracker",function(){return K});var $=N("./src/events.ts"),H=N("./src/types/loader.ts"),P;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(P||(P={}));var K=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($.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on($.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on($.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off($.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off($.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off($.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,h){if(h===H.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 T=o[a],S=l!==null||O.partial===!0;s.range[a]=h.getBufferedTimes(f,l,S,T)}),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,T=0;T<f.length;T++){var S=f.start(T)-this.bufferPadding,D=f.end(T)+this.bufferPadding;if(O>=S&&a<=D){l.time.push({startPTS:Math.max(u,f.start(T)),endPTS:Math.min(s,f.end(T))});break}else if(u<D&&s>S)l.partial=!0,l.time.push({startPTS:Math.max(u,f.start(T)),endPTS:Math.min(s,f.end(T))});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 T=a[O];if(!T)return;G(T)&&(f=T.body.start-s,l=T.body.end+s,p>=f&&p<=l&&(o=Math.min(p-f,l-p),u<=o&&(h=T.body,u=o)))}),h},v.getState=function(p){var h=r(p),o=this.fragments[h];return o?o.buffered?G(o)?P.PARTIAL:P.OK:o.backtrack?P.BACKTRACKED:P.APPENDING:P.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===H.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 T=0;T<O.length;T++)f.appendedPTS=Math.max(O.end(T),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 G(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(se,X,N){"use strict";N.r(X),N.d(X,"STALL_MINIMUM_DURATION_MS",function(){return G}),N.d(X,"MAX_START_GAP_JUMP",function(){return r}),N.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),N.d(X,"SKIP_BUFFER_RANGE_START",function(){return v}),N.d(X,"default",function(){return m});var $=N("./src/utils/buffer-helper.ts"),H=N("./src/errors.ts"),P=N("./src/events.ts"),K=N("./src/utils/logger.ts"),G=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,T=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;K.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||T)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!$.BufferHelper.getBuffered(u).length)return;var L=$.BufferHelper.bufferInfo(u,a,0),A=L.len>0,C=L.nextStart||0;if(!A&&!C)return;if(O){var x=L.len>r,d=!C||C-a>r&&!this.fragmentTracker.getPartialFragment(a);if(x||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,j=b==null||((w=b.details)===null||w===void 0)?void 0:w.live,U=j?b.details.targetduration*2:r;if(y>0&&y<=U){this._trySkipBufferHole(null);return}}var E=self.performance.now();if(s===null){this.stalled=E;return}var M=E-s;!O&&M>=G&&this._reportStall(L.len);var I=$.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,T=s.getPartialFragment(O);if(T){var S=this._trySkipBufferHole(T);if(S)return}f.len>u.maxBufferHole&&l>u.highBufferWatchdogPeriod*1e3&&(K.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,K.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+f+")"),l.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.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,T=$.BufferHelper.getBuffered(s),S=0;S<T.length;S++){var D=T.start(S);if(a+l.maxBufferHole>=O&&a<D){var L=Math.max(D+v,s.currentTime+R);return K.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+L),this.moved=!0,this.stalled=null,s.currentTime=L,f&&u.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+L,frag:f}),L}O=T.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;K.logger.warn("Nudging 'currentTime' from "+s+" to "+O),u.currentTime=O,l.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+f.nudgeMaxRetry+" nudges"),l.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/events.ts"),H=N("./src/utils/texttrack-utils.ts"),P=N("./src/demux/id3.ts"),K=.25,G=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($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var m=this.hls;m.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(m,p){this.media=p.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(H.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(H.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=P.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+K);for(var T=0;T<u.length;T++){var S=u[T];if(!P.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(H.removeCuesInRange)(l,h,o)}},r}();X.default=G},"./src/controller/latency-controller.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return r});var $=N("./src/errors.ts"),H=N("./src/events.ts"),P=N("./src/utils/logger.ts");function K(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 G(R,v,m){return v&&K(R.prototype,v),m&&K(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(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(H.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(H.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(H.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(H.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!==$.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.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),T=a<O;if(h.live&&T&&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},G(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,T=a&&o||h;(O.liveSyncDuration||O.liveSyncDurationCount||T===0)&&(T=u!==void 0?u:s*f);var S=f,D=1;return T+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(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return l});var $=N("./src/types/level.ts"),H=N("./src/events.ts"),P=N("./src/errors.ts"),K=N("./src/utils/codecs.ts"),G=N("./src/controller/level-helper.ts"),r=N("./src/controller/base-playlist-controller.ts"),R=N("./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,T){return O.__proto__=T,O},o(u,s)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(u){h(s,u);function s(O){var T;return T=u.call(this,O,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var a=s.prototype;return a._registerListeners=function(){var T=this.hls;T.on(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(H.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(H.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var T=this.hls;T.off(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(H.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(H.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 T=this._levels;T.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},a.onManifestLoaded=function(T,S){var D=[],L=[],A=[],C,x={},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=x[g],d?d.url.push(M.url):(d=new $.Level(M),x[g]=d,D.push(d)),I&&(I.AUDIO&&Object(G.addGroupId)(d,"audio",I.AUDIO),I.SUBTITLES&&Object(G.addGroupId)(d,"text",I.SUBTITLES))}),(w||y)&&b&&(D=D.filter(function(M){var I=M.videoCodec,g=M.width,W=M.height;return!!I||!!(g&&W)})),D=D.filter(function(M){var I=M.audioCodec,g=M.videoCodec;return(!I||Object(K.isCodecSupportedInMp4)(I,"audio"))&&(!g||Object(K.isCodecSupportedInMp4)(g,"video"))}),S.audioTracks&&(L=S.audioTracks.filter(function(M){return!M.audioCodec||Object(K.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(G.assignTrackIdsByGroup)(L)),S.subtitles&&(A=S.subtitles,Object(G.assignTrackIdsByGroup)(A)),D.length>0){C=D[0].bitrate,D.sort(function(M,I){return M.bitrate-I.bitrate}),this._levels=D;for(var j=0;j<D.length;j++)if(D[j].bitrate===C){this._firstLevel=j,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+C);break}var U=b&&!y,E={levels:D,audioTracks:L,subtitleTracks:A,firstLevel:this._firstLevel,stats:S.stats,audio:b,video:y,altAudio:!U&&L.some(function(M){return!!M.url})};this.hls.trigger(H.Events.MANIFEST_PARSED,E),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(H.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(T,S){if(u.prototype.onError.call(this,T,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,x;switch(S.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var d=this._levels[S.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=S.frag.level)):x=S.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(C=!1),x=D.level),A=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:x=S.level,A=!0;break}x!==void 0&&this.recoverLevel(S,x,A,C)},a.recoverLevel=function(T,S,D,L){var A=T.details,C=this._levels[S];if(C.loadError++,D){var x=this.retryLoadingOrFail(T);if(x)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(L){var d=C.url.length;if(d>1&&C.loadError<d)T.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),T.levelRetry=!0,this.hls.nextAutoLevel=w)}}},a.redundantFailover=function(T){var S=this._levels[T],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=T}},a.onFragLoaded=function(T,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(T,S){var D,L=S.level,A=S.details,C=this._levels[L];if(!C){var x;this.warn("Invalid level index "+L),(x=S.deliveryDirectives)!==null&&x!==void 0&&x.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(T,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(T){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(T)try{A=T.addDirectives(A)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+S+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+L+" "+A),this.clearTimer(),this.hls.trigger(H.Events.LEVEL_LOADING,{url:A,level:S,id:L,deliveryDirectives:T||null})}},a.removeLevel=function(T,S){var D=function(C,x){return x!==S},L=this._levels.filter(function(A,C){return C!==T?!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 x=A.details;return x!=null&&x.fragments&&x.fragments.forEach(function(d){d.level=C}),A});this._levels=L,this.hls.trigger(H.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(T){var S,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===T&&(S=D[T])!==null&&S!==void 0&&S.details)return;if(T<0||T>=D.length){var L=T<0;if(this.hls.trigger(H.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:L,reason:"invalid level idx"}),L)return;T=Math.min(T,D.length-1)}this.clearTimer();var A=this.currentLevelIndex,C=D[A],x=D[T];this.log("switching to level "+T+" from "+A),this.currentLevelIndex=T;var d=v({},x,{level:T,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete d._urlId,this.hls.trigger(H.Events.LEVEL_SWITCHING,d);var w=x.details;if(!w||w.live){var y=this.switchParams(x.uri,C==null?void 0:C.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),s}(r.default)},"./src/controller/level-helper.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"addGroupId",function(){return P}),N.d(X,"assignTrackIdsByGroup",function(){return K}),N.d(X,"updatePTS",function(){return G}),N.d(X,"updateFragPTSDTS",function(){return R}),N.d(X,"mergeDetails",function(){return v}),N.d(X,"mapPartIntersection",function(){return m}),N.d(X,"mapFragmentIntersection",function(){return p}),N.d(X,"adjustSliding",function(){return h}),N.d(X,"addSliding",function(){return o}),N.d(X,"computeReloadInterval",function(){return f}),N.d(X,"getFragmentWithSN",function(){return l}),N.d(X,"getPartWith",function(){return u});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/logger.ts");function P(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 K(s){var a={};s.forEach(function(O){var T=O.groupId||"";O.id=a[T]=a[T]||0,a[T]++})}function G(s,a,O){var T=s[a],S=s[O];r(T,S)}function r(s,a){var O=a.startPTS;if(Object($.isFiniteNumber)(O)){var T=0,S;a.sn>s.sn?(T=O-s.start,S=s):(T=s.start-O,S=a),S.duration!==T&&(S.duration=T)}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,T,S,D){var L=T-O;L<=0&&(H.logger.warn("Fragment should have a positive duration",a),T=O+a.duration,D=S+a.duration);var A=O,C=T,x=a.startPTS,d=a.endPTS;if(Object($.isFiniteNumber)(x)){var w=Math.abs(x-O);Object($.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(w,a.deltaPTS):a.deltaPTS=w,A=Math.max(O,x),O=Math.min(O,x),S=Math.min(S,a.startDTS),C=Math.min(T,d),T=Math.max(T,d),D=Math.max(D,a.endDTS)}a.duration=T-O;var y=O-a.start;a.appendedPTS=T,a.start=a.startPTS=O,a.maxStartPTS=A,a.startDTS=S,a.endPTS=T,a.minEndPTS=C,a.endDTS=D;var b=a.sn;if(!s||b<s.startSN||b>s.endSN)return 0;var j,U=b-s.startSN,E=s.fragments;for(E[U]=a,j=U;j>0;j--)r(E[j],E[j-1]);for(j=U;j<E.length-1;j++)r(E[j],E[j+1]);return s.fragmentHint&&r(E[E.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function v(s,a){for(var O=null,T=s.fragments,S=T.length-1;S>=0;S--){var D=T[S].initSegment;if(D){O=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var L=0,A;if(p(s,a,function(j,U){j.relurl&&(L=j.cc-U.cc),Object($.isFiniteNumber)(j.startPTS)&&Object($.isFiniteNumber)(j.endPTS)&&(U.start=U.startPTS=j.startPTS,U.startDTS=j.startDTS,U.appendedPTS=j.appendedPTS,U.maxStartPTS=j.maxStartPTS,U.endPTS=j.endPTS,U.endDTS=j.endDTS,U.minEndPTS=j.minEndPTS,U.duration=j.endPTS-j.startPTS,U.duration&&(A=U),a.PTSKnown=a.alignedSliding=!0),U.elementaryStreams=j.elementaryStreams,U.loader=j.loader,U.stats=j.stats,U.urlId=j.urlId,j.initSegment&&(U.initSegment=j.initSegment,O=j.initSegment)}),O){var C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;C.forEach(function(j){var U;(!j.initSegment||j.initSegment.relurl===((U=O)===null||U===void 0?void 0:U.relurl))&&(j.initSegment=O)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(j){return!j}),a.deltaUpdateFailed)){H.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=a.skippedSegments;x--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var d=a.fragments;if(L){H.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(j,U){U.elementaryStreams=j.elementaryStreams,U.stats=j.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 T=0,S=0,D=s.length;S<=D;S++){var L=s[S],A=a[S+T];L&&A&&L.index===A.index&&L.fragment.sn===A.fragment.sn?O(L,A):T--}}function p(s,a,O){for(var T=a.skippedSegments,S=Math.max(s.startSN,a.startSN)-a.startSN,D=(s.fragmentHint?1:0)+(T?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,x=S;x<=D;x++){var d=C[L+x],w=A[x];T&&!w&&x<T&&(w=a.fragments[x]=d),d&&w&&O(d,w)}}function h(s,a){var O=a.startSN+a.skippedSegments-s.startSN,T=s.fragments;if(O<0||O>=T.length)return;o(a,T[O].start)}function o(s,a){if(a){for(var O=s.fragments,T=s.skippedSegments;T<O.length;T++)O[T].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function f(s,a){var O=1e3*s.levelTargetDuration,T=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 x=333*s.misses;A=Math.max(Math.min(T,L*2),x),s.availabilityDelay=(s.availabilityDelay||0)+A}else A=T;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 T=s.details,S=T.fragments[a-T.startSN];return S||(S=T.fragmentHint,S&&S.sn===a?S:a<T.startSN&&O&&O.sn===a?O:null)}function u(s,a,O){if(!s||!s.details)return null;var T=s.details.partList;if(T)for(var S=T.length;S--;){var D=T[S];if(D.index===O&&D.fragment.sn===a)return D}return null}},"./src/controller/stream-controller.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return T});var $=N("./src/polyfills/number.ts"),H=N("./src/controller/base-stream-controller.ts"),P=N("./src/is-supported.ts"),K=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),r=N("./src/controller/fragment-tracker.ts"),R=N("./src/types/loader.ts"),v=N("./src/loader/fragment.ts"),m=N("./src/demux/transmuxer-interface.ts"),p=N("./src/types/transmuxer.ts"),h=N("./src/controller/gap-controller.ts"),o=N("./src/errors.ts"),f=N("./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,T=function(S){s(D,S);function D(A,C){var x;return x=S.call(this,A,C,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var L=D.prototype;return L._registerListeners=function(){var C=this.hls;C.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),C.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.on(K.Events.ERROR,this.onError,this),C.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L._unregisterListeners=function(){var C=this.hls;C.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.off(K.Events.ERROR,this.onError,this),C.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},L.startLoad=function(C){if(this.levels){var x=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}x>0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),C=x),this.state=H.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=H.State.STOPPED},L.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},L.doTick=function(){switch(this.state){case H.State.IDLE:this.doTickIdle();break;case H.State.WAITING_LEVEL:{var C,x=this.levels,d=this.level,w=x==null||((C=x[d])===null||C===void 0)?void 0:C.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=H.State.IDLE;break}break}case H.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),j=this.retryDate;(!j||b>=j||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=H.State.IDLE)}break;default:break}this.onTickEnd()},L.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},L.doTickIdle=function(){var C,x,d=this.hls,w=this.levelLastLoaded,y=this.levels,b=this.media,j=d.config,U=d.nextLoadLevel;if(w===null||!b&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[U])return;var E=y[U];this.level=d.nextLoadLevel=U;var M=E.details;if(!M||this.state===H.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==U){this.state=H.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(I===null)return;var g=I.len,W=this.getMaxBufferLength(E.maxBitrate);if(g>=W)return;if(this._streamEnded(I,M)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,J),this.state=H.State.ENDED;return}var le=I.end,ce=this.getNextFragment(le,M);if(this.couldBacktrack&&!this.fragPrevious&&ce&&ce.sn!=="initSegment"){var Re=ce.sn-M.startSN;Re>1&&(ce=M.fragments[Re-1],this.fragmentTracker.removeFragment(ce))}if(ce&&this.fragmentTracker.getState(ce)===r.FragmentState.OK&&this.nextLoadPosition>le){var Ee=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,Ee,R.PlaylistLevelType.MAIN),ce=this.getNextFragment(this.nextLoadPosition,M)}if(!ce)return;ce.initSegment&&!ce.initSegment.data&&!this.bitrateTest&&(ce=ce.initSegment),((C=ce.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((x=ce.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ce,M):this.loadFragment(ce,M,le)},L.loadFragment=function(C,x,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,x,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 x=this.fragmentTracker.getAppendedFrag(C,R.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},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,x=this.media;if(x!=null&&x.readyState){var d,w=this.getAppendedFrag(x.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!x.paused&&C){var y=this.hls.nextLoadLevel,b=C[y],j=this.fragLastKbps;j&&this.fragCurrent?d=this.fragCurrent.duration*b.maxBitrate/(1e3*j)+1:d=0}else d=0;var U=this.getBufferedFrag(x.currentTime+d);if(U){var E=this.followingBufferedFrag(U);if(E){this.abortCurrentFrag();var M=E.maxStartPTS?E.maxStartPTS:E.start,I=E.duration,g=Math.max(U.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===H.State.KEY_LOADING&&(this.state=H.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},L.flushMainBuffer=function(C,x){S.prototype.flushMainBuffer.call(this,C,x,this.altAudio?"video":null)},L.onMediaAttached=function(C,x){S.prototype.onMediaAttached.call(this,C,x);var d=x.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,x=C?C.currentTime:null;Object($.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},L.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},L.onManifestParsed=function(C,x){var d=!1,w=!1,y;x.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(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},L.onLevelLoading=function(C,x){var d=this.levels;if(!d||this.state!==H.State.IDLE)return;var w=d[x.level];(!w.details||w.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(w.details))&&(this.state=H.State.WAITING_LEVEL)},L.onLevelLoaded=function(C,x){var d,w=this.levels,y=x.level,b=x.details,j=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:"+j);var U=this.fragCurrent;U&&(this.state===H.State.FRAG_LOADING||this.state===H.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==x.level&&U.loader&&(this.state=H.State.IDLE,U.loader.abort()));var E=w[y],M=0;if(b.live||(d=E.details)!==null&&d!==void 0&&d.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;M=this.alignPlaylists(b,E.details)}if(E.details=b,this.levelLastLoaded=y,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===H.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=H.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,M),this.tick()},L._handleFragmentLoadProgress=function(C){var x,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 j=b[d.level],U=j.details;if(!U){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var E=j.videoCodec,M=U.PTSKnown||!U.live,I=(x=d.initSegment)===null||x===void 0?void 0:x.data,g=this._getAudioCodec(j),W=this.transmuxer=this.transmuxer||new m.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=w?w.index:-1,le=J!==-1,ce=new p.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,y.byteLength,J,le),Re=this.initPTS[d.cc];W.push(y,I,g,E,d,w,U.totalduration,M,ce,Re)},L.onAudioTrackSwitching=function(C,x){var d=this.altAudio,w=!!x.url,y=x.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 j=this.hls;d&&j.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:y})}},L.onAudioTrackSwitched=function(C,x){var d=x.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,x){var d=x.tracks,w,y,b=!1;for(var j in d){var U=d[j];if(U.id==="main"){if(y=j,w=U,j==="video"){var E=d[j];E&&(this.videoBuffer=E.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,x){var d=x.frag,w=x.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===H.State.PARSED&&(this.state=H.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,x){switch(x.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,x);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==H.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=H.State.ERROR):!x.levelRetry&&this.state===H.State.WAITING_LEVEL&&(this.state=H.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===H.State.PARSING||this.state===H.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,x=this.gapController;if(!C||!x||!C.readyState)return;var d=G.BufferHelper.getBuffered(C);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},L.onFragLoadEmergencyAborted=function(){this.state=H.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},L.onBufferFlushed=function(C,x){var d=x.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,x){this.levels=x.levels},L.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},L.seekToStartPos=function(){var C=this.media,x=C.currentTime,d=this.startPosition;if(d>=0&&x<d){if(C.seeking){f.logger.log("could not seek to "+d+", already seeking at "+x);return}var w=G.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 "+x),C.currentTime=d}},L._getAudioCodec=function(C){var x=this.config.defaultAudioCodec||C.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},L._loadBitrateTestFrag=function(C){var x=this;this._doFragLoad(C).then(function(d){var w=x.hls;if(!d||w.nextLoadLevel||x.fragContextChanged(C))return;x.fragLoadError=0,x.state=H.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var y=C.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),w.trigger(K.Events.FRAG_LOADED,d)})},L._handleTransmuxComplete=function(C){var x,d="main",w=this.hls,y=C.remuxResult,b=C.chunkMeta,j=this.getCurrentContext(b);if(!j){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 U=j.frag,E=j.part,M=j.level,I=y.video,g=y.text,W=y.id3,J=y.initSegment,le=this.altAudio?void 0:y.audio;if(this.fragContextChanged(U))return;if(this.state=H.State.PARSING,J){J.tracks&&(this._bufferInitSegment(M,J.tracks,U,b),w.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:d,tracks:J.tracks}));var ce=J.initPTS,Re=J.timescale;Object($.isFiniteNumber)(ce)&&(this.initPTS[U.cc]=ce,w.trigger(K.Events.INIT_PTS_FOUND,{frag:U,id:d,initPTS:ce,timescale:Re}))}if(I&&y.independent!==!1){if(M.details){var Ee=I.startPTS,Oe=I.endPTS,Te=I.startDTS,Le=I.endDTS;if(E)E.elementaryStreams[I.type]={startPTS:Ee,endPTS:Oe,startDTS:Te,endDTS:Le};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<Ee){this.backtrack(U);return}U.setElementaryStreamInfo(I.type,U.start,Oe,U.start,Le,!0)}U.setElementaryStreamInfo(I.type,Ee,Oe,Te,Le),this.bufferFragmentData(I,U,E,b)}}else if(y.independent===!1){this.backtrack(U);return}if(le){var Y=le.startPTS,_=le.endPTS,k=le.startDTS,B=le.endDTS;E&&(E.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:_,startDTS:k,endDTS:B}),U.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,Y,_,k,B),this.bufferFragmentData(le,U,E,b)}if(W!=null&&(x=W.samples)!==null&&x!==void 0&&x.length){var Z={frag:U,id:d,samples:W.samples};w.trigger(K.Events.FRAG_PARSING_METADATA,Z)}if(g){var z={frag:U,id:d,samples:g.samples};w.trigger(K.Events.FRAG_PARSING_USERDATA,z)}},L._bufferInitSegment=function(C,x,d,w){var y=this;if(this.state!==H.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var b=x.audio,j=x.video,U=x.audiovideo;if(b){var E=C.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(E&&(E.indexOf("mp4a.40.5")!==-1?E="mp4a.40.2":E="mp4a.40.5"),b.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(E="mp4a.40.5")),M.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(E="mp4a.40.2",this.log("Android: force audio codec to "+E)),C.audioCodec&&C.audioCodec!==E&&this.log('Swapping manifest audio codec "'+C.audioCodec+'" for "'+E+'"'),b.levelCodec=E,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(E||"")+"/"+(C.audioCodec||"")+"/"+b.codec+"]")}j&&(j.levelCodec=C.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(C.videoCodec||"")+"/"+j.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(C.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(I){var g=x[I],W=g.initSegment;W!=null&&W.byteLength&&y.hls.trigger(K.Events.BUFFER_APPENDING,{type:I,data:W,frag:d,part:null,chunkMeta:w,parent:d.type})}),this.tick()},L.backtrack=function(C){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(C);var x=this.fragmentTracker.backtrack(C);this.fragPrevious=null,this.nextLoadPosition=C.start,x?this.resetFragmentLoading(C):this.state=H.State.BACKTRACKING},L.checkFragmentChanged=function(){var C=this.media,x=null;if(C&&C.readyState>1&&C.seeking===!1){var d=C.currentTime;if(G.BufferHelper.isBuffered(C,d)?x=this.getAppendedFrag(d):G.BufferHelper.isBuffered(C,d+.1)&&(x=this.getAppendedFrag(d+.1)),x){var w=this.fragPlaying,y=x.level;(!w||x.sn!==w.sn||w.level!==y||x.urlId!==w.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:x}),(!w||w.level!==y)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=x)}}},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 x=this.getAppendedFrag(C.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var x=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(H.default)},"./src/controller/subtitle-stream-controller.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"SubtitleStreamController",function(){return s});var $=N("./src/events.ts"),H=N("./src/utils/logger.ts"),P=N("./src/utils/buffer-helper.ts"),K=N("./src/controller/fragment-finders.ts"),G=N("./src/utils/discontinuities.ts"),r=N("./src/controller/level-helper.ts"),R=N("./src/controller/fragment-tracker.ts"),v=N("./src/controller/base-stream-controller.ts"),m=N("./src/types/loader.ts"),p=N("./src/types/level.ts");function h(a,O){for(var T=0;T<O.length;T++){var S=O[T];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function o(a,O,T){return O&&h(a.prototype,O),T&&h(a,T),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 T=O.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var D=this.hls;D.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on($.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on($.Events.ERROR,this.onError,this),D.on($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var D=this.hls;D.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off($.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off($.Events.ERROR,this.onError,this),D.off($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(u),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(D,L){this.mainDetails=L.details},T.onSubtitleFragProcessed=function(D,L){var A=L.frag,C=L.success;if(this.fragPrevious=A,this.state=v.State.IDLE,!C)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var d,w=A.start,y=0;y<x.length;y++)if(w>=x[y].start&&w<=x[y].end){d=x[y];break}var b=A.start+A.duration;d?d.end=b:(d={start:w,end:b},x.push(d)),this.fragmentTracker.fragBuffered(A)},T.onBufferFlushing=function(D,L){var A=L.startOffset,C=L.endOffset;if(A===0&&C!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,d=this.levels;if(!d.length||!d[x]||!d[x].details)return;var w=d[x].details,y=w.targetduration,b=C-y;if(b<=0)return;L.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(j){for(var U=0;U<j.length;){if(j[U].end<=b){j.shift();continue}else if(j[U].start<b)j[U].start=b;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(A,b,m.PlaylistLevelType.SUBTITLE)}},T.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},T.onSubtitleTracksUpdated=function(D,L){var A=this,C=L.subtitleTracks;this.tracksBuffered=[],this.levels=C.map(function(x){return new p.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){A.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},T.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)},T.onSubtitleTrackLoaded=function(D,L){var A,C=L.details,x=L.id,d=this.currentTrackId,w=this.levels;if(!w.length)return;var y=w[d];if(x>=w.length||x!==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 j=b.fragments[0];if(!y.details)C.hasProgramDateTime&&b.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(C,b):j&&Object(r.addSliding)(C,j.start);else{var U=this.alignPlaylists(C,y.details);U===0&&j&&Object(r.addSliding)(C,j.start)}}if(y.details=C,this.levelLastLoaded=x,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var E=Object(K.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);E||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},T._handleFragmentLoadComplete=function(D){var L=D.frag,A=D.payload,C=L.decryptdata,x=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();x.trigger($.Events.FRAG_DECRYPTED,{frag:L,payload:w,stats:{tstart:d,tdecrypt:y}})})}},T.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,x=C.targetduration,d=this.config,w=this.media,y=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-x,d.maxBufferHole),b=y.end,j=y.len,U=this.getMaxBufferLength()+x;if(j>U)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var E=C.fragments,M=E.length,I=C.edge,g,W=this.fragPrevious;if(b<I){var J=d.maxFragLookUpTolerance;W&&C.hasProgramDateTime&&(g=Object(K.findFragmentByPDT)(E,W.endProgramDateTime,J)),g||(g=Object(K.findFragmentByPTS)(W,E,b,J),!g&&W&&W.start<E[0].start&&(g=E[0]))}else g=E[M-1];(D=g)!==null&&D!==void 0&&D.encrypted?(H.logger.log("Loading key for "+g.sn),this.state=v.State.KEY_LOADING,this.hls.trigger($.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===R.FragmentState.NOT_LOADED&&this.loadFragment(g,C,b)}},T.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(se,X,N){"use strict";N.r(X);var $=N("./src/events.ts"),H=N("./src/utils/texttrack-utils.ts"),P=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function G(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&&G(h.prototype,o),f&&G(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($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on($.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var u=this.hls;u.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off($.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(H.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,T=this.trackId,S=this.tracksInGroup[T];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,T=this.tracks.filter(function(L){return!a||L.groupId===a});this.tracksInGroup=T;var S=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=a;var D={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger($.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===K.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,T=s.url;if(u)try{T=u.addDirectives(T)}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($.Events.SUBTITLE_TRACK_LOADING,{url:T,id:a,groupId:O,deliveryDirectives:u||null})}},f.toggleTrackModes=function(u){var s=this,a=this.media,O=this.subtitleDisplay,T=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[T];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 T=O[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,T){var S=T.id,D=T.groupId,L=D===void 0?"":D,A=T.name,C=T.type,x=T.url;this.hls.trigger($.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:L,name:A,type:C,url:x});var d=this.switchParams(T.url,s==null?void 0:s.details);this.loadPlaylist(d)}else this.hls.trigger($.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}(P.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}X.default=m},"./src/controller/timeline-controller.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"TimelineController",function(){return p});var $=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),P=N("./src/utils/cea-608-parser.ts"),K=N("./src/utils/output-filter.ts"),G=N("./src/utils/webvtt-parser.ts"),r=N("./src/utils/texttrack-utils.ts"),R=N("./src/utils/imsc1-ttml-parser.ts"),v=N("./src/types/loader.ts"),m=N("./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 K.default(this,"textTrack1"),O=new K.default(this,"textTrack2"),T=new K.default(this,"textTrack3"),S=new K.default(this,"textTrack4");this.cea608Parser1=new P.default(1,a,O),this.cea608Parser2=new P.default(3,T,S)}s.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(H.Events.FRAG_LOADING,this.onFragLoading,this),s.on(H.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(H.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(H.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(H.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(H.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=l.prototype;return u.destroy=function(){var a=this.hls;a.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(H.Events.FRAG_LOADING,this.onFragLoading,this),a.off(H.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(H.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(H.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(H.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(H.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(a,O,T,S,D){for(var L=!1,A=D.length;A--;){var C=D[A],x=o(C[0],C[1],O,T);if(x>=0&&(C[0]=Math.min(C[0],O),C[1]=Math.max(C[1],T),L=!0,x/(T-O)>.5))return}if(L||D.push([O,T]),this.config.renderTextTracksNatively){var d=this.captionsTracks[a];this.Cues.newCue(d,O,T,S)}else{var w=this.Cues.newCue(null,O,T,S);this.hls.trigger(H.Events.CUES_PARSED,{type:"captions",cues:w,track:a})}},u.onInitPtsFound=function(a,O){var T=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(x){T.onFragLoaded(H.Events.FRAG_LOADED,x)}))},u.getExistingTrack=function(a){var O=this.media;if(O)for(var T=0;T<O.textTracks.length;T++){var S=O.textTracks[T];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,T=this.captionsTracks,S=this.media,D=O[a],L=D.label,A=D.languageCode,C=this.getExistingTrack(a);if(C)T[a]=C,Object(r.clearCurrentCues)(T[a]),Object(r.sendAddTrackEvent)(T[a],S);else{var x=this.createTextTrack("captions",L,A);x&&(x[a]=!0,T[a]=x)}},u.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var O=this.captionsProperties[a];if(!O)return;var T=O.label,S={_id:a,label:T,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[a]=S,this.hls.trigger(H.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(a,O,T){var S=this.media;return S?S.addTextTrack(a,O,T):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 T=0;T<O.length;T++)Object(r.clearCurrentCues)(O[T])},u.onSubtitleTracksUpdated=function(a,O){var T=this;this.textTracks=[];var S=O.subtitleTracks||[],D=S.some(function(x){return x.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(x,d){var w;if(d<A.length){for(var y=null,b=0;b<A.length;b++)if(h(A[b],x)){y=A[b];break}y&&(w=y)}w?Object(r.clearCurrentCues)(w):(w=T.createTextTrack("subtitles",x.name,x.lang),w&&(w.mode="disabled")),w&&(w.groupId=x.groupId,T.textTracks.push(w))})}else if(!L&&this.tracks&&this.tracks.length){var C=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(H.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:C})}}},u.onManifestLoaded=function(a,O){var T=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=T.captionsProperties[L];if(!A)return;A.label=S.name,S.lang&&(A.languageCode=S.lang),A.media=S})},u.onFragLoading=function(a,O){var T=this.cea608Parser1,S=this.cea608Parser2,D=this.lastSn,L=this.lastPartIndex;if(!this.enabled||!(T&&S))return;if(O.frag.type===v.PlaylistLevelType.MAIN){var A,C,x=O.frag.sn,d=(A=O==null||((C=O.part)===null||C===void 0)?void 0:C.index)!=null?A:-1;x===D+1||x===D&&d===L+1||(T.reset(),S.reset()),this.lastSn=x,this.lastPartIndex=d}},u.onFragLoaded=function(a,O){var T=O.frag,S=O.payload,D=this.initPTS,L=this.unparsedVttFrags;if(T.type===v.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object($.isFiniteNumber)(D[T.cc])){L.push(O),D.length&&this.hls.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var A=T.decryptdata;if(A==null||A.key==null||A.method!=="AES-128"){var C=this.tracks[T.level],x=this.vttCCs;x[T.cc]||(x[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),C&&C.textCodec===R.IMSC1_CODEC?this._parseIMSC1(T,S):this._parseVTTs(T,S,x)}}else this.hls.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(a,O){var T=this,S=this.hls;Object(R.parseIMSC1)(O,this.initPTS[a.cc],this.timescale[a.cc],function(D){T._appendCues(D,a.level),S.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(D){m.logger.log("Failed to parse IMSC1: "+D),S.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:D})})},u._parseVTTs=function(a,O,T){var S=this,D=this.hls;Object(G.parseWebVTT)(O,this.initPTS[a.cc],this.timescale[a.cc],T,a.cc,a.start,function(L){S._appendCues(L,a.level),D.trigger(H.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(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:L})})},u._fallbackToIMSC1=function(a,O){var T=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,T._parseIMSC1(a,O)},function(){S.textCodec="wvtt"})},u._appendCues=function(a,O){var T=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;T.trigger(H.Events.CUES_PARSED,{type:"subtitles",cues:a,track:L})}},u.onFragDecrypted=function(a,O){var T=O.frag;if(T.type===v.PlaylistLevelType.SUBTITLE){if(!Object($.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(H.Events.FRAG_LOADED,O)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(a,O){var T=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(T&&S))return;for(var D=0;D<O.samples.length;D++){var L=O.samples[D].bytes;if(L){var A=this.extractCea608Data(L);T.addData(O.samples[D].pts,A[0]),S.addData(O.samples[D].pts,A[1])}}},u.onBufferFlushing=function(a,O){var T=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],T,S)})}if(this.config.renderTextTracksNatively&&(T===0&&D!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(d){return Object(r.removeCuesInRange)(x[d],T,D)})}},u.extractCea608Data=function(a){for(var O=a[0]&31,T=2,S=[[],[]],D=0;D<O;D++){var L=a[T++],A=127&a[T++],C=127&a[T++],x=(4&L)!==0,d=3&L;if(A===0&&C===0)continue;x&&((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(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return $});var $=function(){function H(K,G){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=G}var P=H.prototype;return P.decrypt=function(G,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,G)},H}()},"./src/crypt/aes-decryptor.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"removePadding",function(){return H}),N.d(X,"default",function(){return P});var $=N("./src/utils/typed-array.ts");function H(K){var G=K.byteLength,r=G&&new DataView(K.buffer).getUint8(G-1);return r?Object($.sliceUint8)(K,0,G-r):K}var P=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var G=K.prototype;return G.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},G.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],T=new Uint32Array(256),S=0,D=0,L=0;for(L=0;L<256;L++)L<128?T[L]=L<<1:T[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=T[S],x=T[C],d=T[x],w=T[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^x*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^T[T[T[d^C]]],D^=T[T[D]]):S=D=1}},G.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,T=this.invSubMix,S=T[0],D=T[1],L=T[2],A=T[3],C,x;for(f=0;f<o;f++){if(f<h){C=u[f]=v[f];continue}x=C,f%h===0?(x=x<<8|x>>>24,x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255],x^=O[f/h|0]<<24):h>6&&f%h===4&&(x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255]),u[f]=C=(u[f-h]^x)>>>0}for(l=0;l<o;l++)f=o-l,l&3?x=u[f]:x=u[f-4],l<4||f<=4?s[l]=x:s[l]=S[a[x>>>24]]^D[a[x>>>16&255]]^L[a[x>>>8&255]]^A[a[x&255]],s[l]=s[l]>>>0},G.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},G.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),T=O[0],S=O[1],D=O[2],L=O[3],A=new Int32Array(R),C=new Int32Array(A.length),x,d,w,y,b,j,U,E,M,I,g,W,J,le,ce=this.networkToHostOrderSwap;v<A.length;){for(M=ce(A[v]),I=ce(A[v+1]),g=ce(A[v+2]),W=ce(A[v+3]),b=M^h[0],j=W^h[1],U=g^h[2],E=I^h[3],J=4,le=1;le<p;le++)x=l[b>>>24]^u[j>>16&255]^s[U>>8&255]^a[E&255]^h[J],d=l[j>>>24]^u[U>>16&255]^s[E>>8&255]^a[b&255]^h[J+1],w=l[U>>>24]^u[E>>16&255]^s[b>>8&255]^a[j&255]^h[J+2],y=l[E>>>24]^u[b>>16&255]^s[j>>8&255]^a[U&255]^h[J+3],b=x,j=d,U=w,E=y,J=J+4;x=o[b>>>24]<<24^o[j>>16&255]<<16^o[U>>8&255]<<8^o[E&255]^h[J],d=o[j>>>24]<<24^o[U>>16&255]<<16^o[E>>8&255]<<8^o[b&255]^h[J+1],w=o[U>>>24]<<24^o[E>>16&255]<<16^o[b>>8&255]<<8^o[j&255]^h[J+2],y=o[E>>>24]<<24^o[b>>16&255]<<16^o[j>>8&255]<<8^o[U&255]^h[J+3],C[v]=ce(x^T),C[v+1]=ce(y^S),C[v+2]=ce(w^D),C[v+3]=ce(d^L),T=M,S=I,D=g,L=W,v=v+4}return C.buffer},K}()},"./src/crypt/decrypter.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return v});var $=N("./src/crypt/aes-crypto.ts"),H=N("./src/crypt/fast-aes-key.ts"),P=N("./src/crypt/aes-decryptor.ts"),K=N("./src/utils/logger.ts"),G=N("./src/utils/mp4-tools.ts"),r=N("./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(P.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(G.appendUint8Array)(a,o),this.remainderData=null);var O=this.getValidChunk(o);if(!O.length)return null;u&&(l=u);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new P.default),T.expandKey(f);var S=s;return this.currentResult=T.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 H.default(s,f)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var O=new $.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 K.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;K.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return $});var $=function(){function H(K,G){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=G}var P=H.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},H}()},"./src/demux/aacdemuxer.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/demux/base-audio-demuxer.ts"),H=N("./src/demux/adts.ts"),P=N("./src/utils/logger.ts"),K=N("./src/demux/id3.ts");function G(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){G(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=K.getID3Data(o,0)||[],l=f.length,u=o.length;l<u;l++)if(H.probe(o,l))return P.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(o,f){return H.canParse(o,f)},p.appendFrame=function(o,f,l){H.initTrackConfig(o,this.observer,f,l,o.manifestCodec);var u=H.appendFrame(o,f,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},m}($.default);R.minProbeByteLength=9,X.default=R},"./src/demux/adts.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"getAudioConfig",function(){return K}),N.d(X,"isHeaderPattern",function(){return G}),N.d(X,"getHeaderLength",function(){return r}),N.d(X,"getFullFrameLength",function(){return R}),N.d(X,"canGetFrameLength",function(){return v}),N.d(X,"isHeader",function(){return m}),N.d(X,"canParse",function(){return p}),N.d(X,"probe",function(){return h}),N.d(X,"initTrackConfig",function(){return o}),N.d(X,"getFrameDuration",function(){return f}),N.d(X,"parseFrameHeader",function(){return l}),N.d(X,"appendFrame",function(){return u});var $=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),P=N("./src/events.ts");function K(s,a,O,T){var S,D,L,A,C=navigator.userAgent.toLowerCase(),x=T,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(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.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,$.logger.log("manifest codec:"+T+", 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),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&w>=6?D=w-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(w>=6&&L===1||/vivaldi/i.test(C))||!T&&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:x}}function G(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&&G(s,a)}function p(s,a){return v(s,a)&&G(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 T=R(s,a);if(T<=O)return!1;var S=a+T;return S===s.length||m(s,S)}return!1}function o(s,a,O,T,S){if(!s.samplerate){var D=K(a,O,T,S);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,$.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function f(s){return 1024*9e4/s}function l(s,a,O,T,S){var D=r(s,a),L=R(s,a);if(L-=D,L>0){var A=O+T*S;return{headerLength:D,frameLength:L,stamp:A}}}function u(s,a,O,T,S){var D=f(s.samplerate),L=l(a,O,T,S,D);if(L){var A=L.frameLength,C=L.headerLength,x=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:x};return w||s.samples.push(b),{sample:b,length:d,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"initPTSFn",function(){return R});var $=N("./src/polyfills/number.ts"),H=N("./src/demux/id3.ts"),P=N("./src/demux/dummy-demuxed-track.ts"),K=N("./src/utils/mp4-tools.ts"),G=N("./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(K.appendUint8Array)(this.cachedData,h),this.cachedData=null);var f=H.getID3Data(h,0),l=f?f.length:0,u,s,a=this._audioTrack,O=this._id3Track,T=f?H.getTimeStamp(f):void 0,S=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(T,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 H.canParse(h,l)?(f=H.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(G.sliceUint8)(h,u);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,L):this.cachedData=L}}return{audioTrack:a,avcTrack:Object(P.dummyTrack)(),id3Track:O,textTrack:Object(P.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(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},m.destroy=function(){},v}(),R=function(m,p){return Object($.isFiniteNumber)(m)?m*90:p*9e4};X.default=r},"./src/demux/chunk-cache.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return $});var $=function(){function P(){this.chunks=[],this.dataLength=0}var K=P.prototype;return K.push=function(r){this.chunks.push(r),this.dataLength+=r.length},K.flush=function(){var r=this.chunks,R=this.dataLength,v;if(r.length)r.length===1?v=r[0]:v=H(r,R);else return new Uint8Array(0);return this.reset(),v},K.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function H(P,K){for(var G=new Uint8Array(K),r=0,R=0;R<P.length;R++){var v=P[R];G.set(v,r),r+=v.length}return G}},"./src/demux/dummy-demuxed-track.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"dummyTrack",function(){return $});function $(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/utils/logger.ts"),H=function(){function P(G){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=G,this.bytesAvailable=G.byteLength,this.word=0,this.bitsAvailable=0}var K=P.prototype;return K.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},K.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)},K.readBits=function(r){var R=Math.min(this.bitsAvailable,r),v=this.word>>>32-R;return r>32&&$.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},K.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()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(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},K.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),T=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);f();var D=f();if(l(5),a(3),f(),T(),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),T(),T(),a(1),s())for(h=L!==3?8:12,o=0;o<h;o++)s()&&(o<6?S(16):S(64))}T();var A=u();if(A===0)u();else if(A===1)for(a(1),O(),O(),p=u(),o=0;o<p;o++)O();T(),a(1);var C=u(),x=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)*(x+1)*16-(d?2:4)*(v+m),pixelRatio:w}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();X.default=H},"./src/demux/id3.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"isHeader",function(){return $}),N.d(X,"isFooter",function(){return H}),N.d(X,"getID3Data",function(){return P}),N.d(X,"canParse",function(){return G}),N.d(X,"getTimeStamp",function(){return r}),N.d(X,"isTimeStampFrame",function(){return R}),N.d(X,"getID3Frames",function(){return m}),N.d(X,"decodeFrame",function(){return p}),N.d(X,"utf8ArrayToStr",function(){return u}),N.d(X,"testables",function(){return s});var $=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)))},H=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)))},P=function(S,D){for(var L=D,A=0;$(S,D);){A+=10;var C=K(S,D+6);A+=C,H(S,D+10)&&(A+=10),D+=A}return A>0?S.subarray(L,L+A):void 0},K=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},G=function(S,D){return $(S,D)&&K(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=K(S,4),A=10;return{type:D,size:L,data:S.subarray(A,A+L)}},m=function(S){for(var D=0,L=[];$(S,D);){var A=K(S,D+6);D+=10;for(var C=D+A;D+8<C;){var x=v(S.subarray(D)),d=p(x);d&&L.push(d),D+=x.size+10}H(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 x=S.length,d,w,y,b="",j=0;j<x;){if(d=S[j++],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[j++],b+=String.fromCharCode((d&31)<<6|w&63);break;case 14:w=S[j++],y=S[j++],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(se,X,N){"use strict";N.r(X);var $=N("./src/demux/base-audio-demuxer.ts"),H=N("./src/demux/id3.ts"),P=N("./src/utils/logger.ts"),K=N("./src/demux/mpegaudio.ts");function G(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){G(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=H.getID3Data(o,0)||[],l=f.length,u=o.length;l<u;l++)if(K.probe(o,l))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(o,f){return K.canParse(o,f)},p.appendFrame=function(o,f,l){return this.initPTS===null?void 0:K.appendFrame(o,f,l,this.initPTS,this.frameIndex)},m}($.default);R.minProbeByteLength=4,X.default=R},"./src/demux/mp4demuxer.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/utils/mp4-tools.ts"),H=N("./src/demux/dummy-demuxed-track.ts"),P=function(){function K(r,R){this.remainderData=null,this.config=void 0,this.config=R}var G=K.prototype;return G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.resetContiguity=function(){},K.probe=function(R){return Object($.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},G.demux=function(R){var v=R,m=Object(H.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object($.appendUint8Array)(this.remainderData,R));var p=Object($.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(H.dummyTrack)(),avcTrack:m,id3Track:Object(H.dummyTrack)(),textTrack:Object(H.dummyTrack)()}},G.flush=function(){var R=Object(H.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(H.dummyTrack)(),avcTrack:R,id3Track:Object(H.dummyTrack)(),textTrack:Object(H.dummyTrack)()}},G.demuxSampleAes=function(R,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},K}();P.minProbeByteLength=1024,X.default=P},"./src/demux/mpegaudio.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"appendFrame",function(){return r}),N.d(X,"parseHeader",function(){return R}),N.d(X,"isHeaderPattern",function(){return v}),N.d(X,"isHeader",function(){return m}),N.d(X,"canParse",function(){return p}),N.d(X,"probe",function(){return h});var $=null,H=[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],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[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,T=u+s*O,S={unit:f.subarray(l,l+a.frameLength),pts:T,dts:T};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,T=o[f+3]>>6,S=l===3?3-u:u===3?3:4,D=H[S*14+s-1]*1e3,L=l===3?0:l===2?1:2,A=P[L*3+a],C=T===3?1:2,x=K[l][u],d=G[u],w=x*8*d,y=Math.floor(x*D/A+O)*d;if($===null){var b=navigator.userAgent||"",j=b.match(/Chrome\/(\d+)/i);$=j?parseInt(j[1]):0}var U=!!$&&$<=87;return U&&u===2&&D>=224e3&&T===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(se,X,N){"use strict";N.r(X);var $=N("./src/crypt/decrypter.ts"),H=N("./src/demux/tsdemuxer.ts"),P=function(){function K(r,R,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new $.default(r,R,{removePKCS7Padding:!1})}var G=K.prototype;return G.decryptBuffer=function(R,v){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,v)},G.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)})},G.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}},G.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},G.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},G.decryptAvcSample=function(R,v,m,p,h,o){var f=Object(H.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)})},G.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}}},K}();X.default=P},"./src/demux/transmuxer-interface.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return h});var $=N("./node_modules/webworkify-webpack/index.js"),H=N.n($),P=N("./src/events.ts"),K=N("./src/demux/transmuxer.ts"),G=N("./src/utils/logger.ts"),r=N("./src/errors.ts"),R=N("./src/utils/mediasource-helper.ts"),v=N("./node_modules/eventemitter3/index.js"),m=N.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 T=l.config,S=function(x,d){d=d||{},d.frag=O.frag,d.id=O.id,l.trigger(x,d)};this.observer=new v.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,S),this.observer.on(P.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(T.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var A;try{A=this.worker=$("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),A.addEventListener("message",this.onwmsg),A.onerror=function(C){l.trigger(P.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(T)})}catch(C){G.logger.warn("Error in worker:",C),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new K.default(this.observer,D,T,L,u),this.worker=null}}else this.transmuxer=new K.default(this.observer,D,T,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,T,S,D,L,A,C){var x=this;A.transmuxing.start=self.performance.now();var d=this.transmuxer,w=this.worker,y=S?S.start:T.start,b=T.decryptdata,j=this.frag,U=!(j&&T.cc===j.cc),E=!(j&&A.level===j.level),M=j?A.sn-j.sn:-1,I=this.part?A.part-this.part.index:1,g=!E&&(M===1||M===0&&I===1),W=self.performance.now();(E||M||T.stats.parsing.start===0)&&(T.stats.parsing.start=W),S&&(I||!g)&&(S.stats.parsing.start=W);var J=new K.TransmuxState(U,g,L,E,y);if(!g||U){G.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+A.sn+" p: "+A.part+" level: "+A.level+" id: "+A.id+`
|
|
discontinuity: `+U+`
|
|
trackSwitch: `+E+`
|
|
contiguous: `+g+`
|
|
accurateTimeOffset: `+L+`
|
|
timeOffset: `+y);var le=new K.TransmuxConfig(a,O,s,D,C);this.configureTransmuxer(le)}if(this.frag=T,this.part=S,w)w.postMessage({cmd:"demux",data:u,decryptdata:b,chunkMeta:A,state:J},u instanceof ArrayBuffer?[u]:[]);else if(d){var ce=d.push(u,b,A,J);Object(K.isPromise)(ce)?ce.then(function(Re){x.handleTransmuxComplete(Re)}):this.handleTransmuxComplete(ce)}},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 T=a.flush(u);Object(K.isPromise)(T)?T.then(function(S){s.handleFlushResult(S,u)}):this.handleFlushResult(T,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(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return r});var $=N("./src/demux/transmuxer.ts"),H=N("./src/events.ts"),P=N("./src/utils/logger.ts"),K=N("./node_modules/eventemitter3/index.js"),G=N.n(K);function r(h){var o=new K.EventEmitter,f=function(u,s){h.postMessage({event:u,data:s})};o.on(H.Events.FRAG_DECRYPTED,f),o.on(H.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 $.default(o,u.typeSupported,s,u.vendor,u.id),Object(P.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($.isPromise)(a)?a.then(function(S){R(h,S)}):R(h,a);break}case"flush":{var O=u.chunkMeta,T=h.transmuxer.flush(O);Object($.isPromise)(T)?T.then(function(S){m(h,S,O)}):m(h,T,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(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return s}),N.d(X,"isPromise",function(){return T}),N.d(X,"TransmuxConfig",function(){return S}),N.d(X,"TransmuxState",function(){return D});var $=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/crypt/decrypter.ts"),K=N("./src/demux/aacdemuxer.ts"),G=N("./src/demux/mp4demuxer.ts"),r=N("./src/demux/tsdemuxer.ts"),R=N("./src/demux/mp3demuxer.ts"),v=N("./src/remux/mp4-remuxer.ts"),m=N("./src/remux/passthrough-remuxer.ts"),p=N("./src/demux/chunk-cache.ts"),h=N("./src/utils/mp4-tools.ts"),o=N("./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:G.default,remux:m.default},{demux:K.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,x,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=x,this.config=d,this.vendor=w,this.id=y}var A=L.prototype;return A.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},A.push=function(x,d,w,y){var b=this,j=w.transmuxing;j.executeStart=f();var U=new Uint8Array(x),E=this.cache,M=this.config,I=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var W=a(U,d);if(W&&W.method==="AES-128"){var J=this.getDecrypter();if(M.enableSoftwareAES){var le=J.softwareDecrypt(U,W.key.buffer,W.iv.buffer);if(!le)return j.executeEnd=f(),O(w);U=new Uint8Array(le)}else return this.decryptionPromise=J.webCryptoDecrypt(U,W.key.buffer,W.iv.buffer).then(function(ve){var Ae=b.push(ve,null,w);return b.decryptionPromise=null,Ae}),this.decryptionPromise}var ce=y||I,Re=ce.contiguous,Ee=ce.discontinuity,Oe=ce.trackSwitch,Te=ce.accurateTimeOffset,Le=ce.timeOffset,ye=g.audioCodec,Y=g.videoCodec,_=g.defaultInitPts,k=g.duration,B=g.initSegmentData;if((Ee||Oe)&&this.resetInitSegment(B,ye,Y,k),Ee&&this.resetInitialTimestamp(_),Re||this.resetContiguity(),this.needsProbing(U,Ee,Oe)){if(E.dataLength){var Z=E.flush();U=Object(h.appendUint8Array)(Z,U)}this.configureTransmuxer(U,g)}var z=this.transmux(U,W,Le,Te,w),he=this.currentTransmuxState;return he.contiguous=!0,he.discontinuity=!1,he.trackSwitch=!1,j.executeEnd=f(),z},A.flush=function(x){var d=this,w=x.transmuxing;w.executeStart=f();var y=this.decrypter,b=this.cache,j=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return d.flush(x)});var E=[],M=j.timeOffset;if(y){var I=y.flush();I&&E.push(this.push(I,null,x))}var g=b.dataLength;b.reset();var W=this.demuxer,J=this.remuxer;if(!W||!J)return g>=u&&this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=f(),[O(x)];var le=W.flush(M);return T(le)?le.then(function(ce){return d.flushRemux(E,ce,x),E}):(this.flushRemux(E,le,x),E)},A.flushRemux=function(x,d,w){var y=d.audioTrack,b=d.avcTrack,j=d.id3Track,U=d.textTrack,E=this.currentTransmuxState,M=E.accurateTimeOffset,I=E.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,j,U,I,M,!0,this.id);x.push({remuxResult:g,chunkMeta:w}),w.transmuxing.executeEnd=f()},A.resetInitialTimestamp=function(x){var d=this.demuxer,w=this.remuxer;if(!d||!w)return;d.resetTimeStamp(x),w.resetTimeStamp(x)},A.resetContiguity=function(){var x=this.demuxer,d=this.remuxer;if(!x||!d)return;x.resetContiguity(),d.resetNextTimestamp()},A.resetInitSegment=function(x,d,w,y){var b=this.demuxer,j=this.remuxer;if(!b||!j)return;b.resetInitSegment(d,w,y),j.resetInitSegment(x,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(x,d,w,y,b){var j;return d&&d.method==="SAMPLE-AES"?j=this.transmuxSampleAes(x,d,w,y,b):j=this.transmuxUnencrypted(x,w,y,b),j},A.transmuxUnencrypted=function(x,d,w,y){var b=this.demuxer.demux(x,d,!1,!this.config.progressive),j=b.audioTrack,U=b.avcTrack,E=b.id3Track,M=b.textTrack,I=this.remuxer.remux(j,U,E,M,d,w,!1,this.id);return{remuxResult:I,chunkMeta:y}},A.transmuxSampleAes=function(x,d,w,y,b){var j=this;return this.demuxer.demuxSampleAes(x,d,w).then(function(U){var E=j.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,w,y,!1,j.id);return{remuxResult:E,chunkMeta:b}})},A.configureTransmuxer=function(x,d){for(var w=this.config,y=this.observer,b=this.typeSupported,j=this.vendor,U=d.audioCodec,E=d.defaultInitPts,M=d.duration,I=d.initSegmentData,g=d.videoCodec,W,J=0,le=l.length;J<le;J++)if(l[J].demux.probe(x)){W=l[J];break}W||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:G.default,remux:m.default});var ce=this.demuxer,Re=this.remuxer,Ee=W.remux,Oe=W.demux;(!Re||!(Re instanceof Ee))&&(this.remuxer=new Ee(y,w,b,j)),(!ce||!(ce instanceof Oe))&&(this.demuxer=new Oe(y,w,b),this.probe=Oe.probe),this.resetInitSegment(I,U,g,M),this.resetInitialTimestamp(E)},A.needsProbing=function(x,d,w){return!this.demuxer||!this.remuxer||d||w},A.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new P.default(this.observer,this.config)),x},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 T(L){return"then"in L&&L.then instanceof Function}var S=function(A,C,x,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=x,this.duration=d,this.defaultInitPts=w},D=function(A,C,x,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=x,this.trackSwitch=d,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"discardEPB",function(){return O});var $=N("./src/demux/adts.ts"),H=N("./src/demux/mpegaudio.ts"),P=N("./src/demux/exp-golomb.ts"),K=N("./src/demux/id3.ts"),G=N("./src/demux/sample-aes.ts"),r=N("./src/events.ts"),R=N("./src/utils/mp4-tools.ts"),v=N("./src/utils/logger.ts"),m=N("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},h=function(){function T(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}T.probe=function(L){var A=T.syncOffset(L);return A<0?!1:(A&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},T.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},T.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=T.prototype;return S.resetInitSegment=function(L,A,C){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",C),this._audioTrack=T.createTrack("audio",C),this._id3Track=T.createTrack("id3",C),this._txtTrack=T.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,x){C===void 0&&(C=!1),x===void 0&&(x=!1),C||(this.sampleAes=null);var d,w=this._avcTrack,y=this._audioTrack,b=this._id3Track,j=w.pid,U=w.pesData,E=y.pid,M=b.pid,I=y.pesData,g=b.pesData,W=!1,J=this.pmtParsed,le=this._pmtId,ce=L.length;if(this.remainderData&&(L=Object(R.appendUint8Array)(this.remainderData,L),ce=L.length,this.remainderData=null),ce<188&&!x)return this.remainderData=L,{audioTrack:y,avcTrack:w,id3Track:b,textTrack:this._txtTrack};var Re=Math.max(0,T.syncOffset(L));ce-=(ce+Re)%188,ce<L.byteLength&&!x&&(this.remainderData=new Uint8Array(L.buffer,ce,L.buffer.byteLength-ce));for(var Ee=Re;Ee<ce;Ee+=188)if(L[Ee]===71){var Oe=!!(L[Ee+1]&64),Te=((L[Ee+1]&31)<<8)+L[Ee+2],Le=(L[Ee+3]&48)>>4,ye=void 0;if(Le>1){if(ye=Ee+5+L[Ee+4],ye===Ee+188)continue}else ye=Ee+4;switch(Te){case j:Oe&&(U&&(d=u(U))&&this.parseAVCPES(d,!1),U={data:[],size:0}),U&&(U.data.push(L.subarray(ye,Ee+188)),U.size+=Ee+188-ye);break;case E:Oe&&(I&&(d=u(I))&&(y.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),I={data:[],size:0}),I&&(I.data.push(L.subarray(ye,Ee+188)),I.size+=Ee+188-ye);break;case M:Oe&&(g&&(d=u(g))&&this.parseID3PES(d),g={data:[],size:0}),g&&(g.data.push(L.subarray(ye,Ee+188)),g.size+=Ee+188-ye);break;case 0:Oe&&(ye+=L[ye]+1),le=this._pmtId=f(L,ye);break;case le:{Oe&&(ye+=L[ye]+1);var Y=l(L,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);j=Y.avc,j>0&&(w.pid=j),E=Y.audio,E>0&&(y.pid=E,y.isAAC=Y.isAAC),M=Y.id3,M>0&&(b.pid=M),W&&!J&&(v.logger.log("reparse from beginning"),W=!1,Ee=Re-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!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=U,y.pesData=I,b.pesData=g;var _={audioTrack:y,avcTrack:w,id3Track:b,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(_),_},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,x=L.id3Track,d=C.pesData,w=A.pesData,y=x.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),x.pesData=null):x.pesData=y},S.demuxSampleAes=function(L,A,C){var x=this.demux(L,C,!0,!this.config.progressive),d=this.sampleAes=new G.default(this.observer,this.config,A);return this.decrypt(x,d)},S.decrypt=function(L,A){return new Promise(function(C){var x=L.audioTrack,d=L.avcTrack;x.samples&&x.isAAC?A.decryptAacSamples(x.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,x=this._avcTrack,d=this.parseAVCNALu(L.data),w=!1,y=this.avcSample,b,j=!1;L.data=null,y&&d.length&&!x.audFound&&(s(y,x),y=this.avcSample=o(!1,L.pts,L.dts,"")),d.forEach(function(U){switch(U.type){case 1:{b=!0,y||(y=C.avcSample=o(!0,L.pts,L.dts,"")),w&&(y.debug+="NDR "),y.frame=!0;var E=U.data;if(j&&E.length>4){var M=new P.default(E).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 P.default(O(U.data));I.readUByte();for(var g=0,W=0,J=!1,le=0;!J&&I.bytesAvailable>1;){g=0;do le=I.readUByte(),g+=le;while(le===255);W=0;do le=I.readUByte(),W+=le;while(le===255);if(g===4&&I.bytesAvailable!==0){J=!0;var ce=I.readUByte();if(ce===181){var Re=I.readUShort();if(Re===49){var Ee=I.readUInt();if(Ee===1195456820){var Oe=I.readUByte();if(Oe===3){for(var Te=I.readUByte(),Le=I.readUByte(),ye=31&Te,Y=[Te,Le],_=0;_<ye;_++)Y.push(I.readUByte()),Y.push(I.readUByte()),Y.push(I.readUByte());a(C._txtTrack.samples,{type:3,pts:L.pts,bytes:Y})}}}}}else if(g===5&&I.bytesAvailable!==0){if(J=!0,W>16){for(var k=[],B=0;B<16;B++)k.push(I.readUByte().toString(16)),(B===3||B===5||B===7||B===9)&&k.push("-");for(var Z=W-16,z=new Uint8Array(Z),he=0;he<Z;he++)z[he]=I.readUByte();a(C._txtTrack.samples,{pts:L.pts,payloadType:g,uuid:k.join(""),userData:Object(K.utf8ArrayToStr)(z),userDataBytes:z})}}else if(W<I.bytesAvailable)for(var ve=0;ve<W;ve++)I.readUByte()}break}case 7:if(b=!0,j=!0,w&&y&&(y.debug+="SPS "),!x.sps){var Ae=new P.default(U.data),ue=Ae.readSPS();x.width=ue.width,x.height=ue.height,x.pixelRatio=ue.pixelRatio,x.sps=[U.data],x.duration=C._duration;for(var me=U.data.subarray(1,4),be="avc1.",Ce=0;Ce<3;Ce++){var Pe=me[Ce].toString(16);Pe.length<2&&(Pe="0"+Pe),be+=Pe}x.codec=be}break;case 8:b=!0,w&&y&&(y.debug+="PPS "),x.pps||(x.pps=[U.data]);break;case 9:b=!1,x.audFound=!0,y&&s(y,x),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 "+U.type+" ");break}if(y&&b){var Ue=y.units;Ue.push(U)}}),A&&y&&(s(y,x),this.avcSample=null)},S.getLastNalUnit=function(){var L,A=this.avcSample,C;if(!A||A.units.length===0){var x=this._avcTrack.samples;A=x[x.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,x=C.naluState||0,d=x,w=[],y=0,b,j,U,E=-1,M=0;for(x===-1&&(E=0,M=L[0]&31,x=0,y=1);y<A;){if(b=L[y++],!x){x=b?0:1;continue}if(x===1){x=b?0:2;continue}if(!b)x=3;else if(b===1){if(E>=0){var I={data:L.subarray(E,y-x-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))),j=y-x-1,j>0)){var W=new Uint8Array(g.data.byteLength+j);W.set(g.data,0),W.set(L.subarray(0,j),g.data.byteLength),g.data=W,g.state=0}}y<A?(U=L[y]&31,E=y,M=U,x=0):x=-1}else x=0}if(E>=0&&x>=0){var J={data:L.subarray(E,A),type:M,state:x};w.push(J)}if(w.length===0){var le=this.getLastNalUnit();if(le){var ce=new Uint8Array(le.data.byteLength+L.byteLength);ce.set(le.data,0),ce.set(L,le.data.byteLength),le.data=ce}}return C.naluState=x,w},S.parseAACPES=function(L){var A=0,C=this._audioTrack,x=this.aacOverFlow,d=L.data;if(x){this.aacOverFlow=null;var w=x.sample.unit.byteLength,y=Math.min(x.missing,w),b=w-y;x.sample.unit.set(d.subarray(0,y),b),C.samples.push(x.sample),A=x.missing}var j,U;for(j=A,U=d.length;j<U-1&&!$.isHeader(d,j);j++);if(j!==A){var E,M;if(j<U-1?(E="AAC PES did not start with ADTS header,offset:"+j,M=!1):(E="no ADTS header found in AAC PES",M=!0),v.logger.warn("parsing error:"+E),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:E}),M)return}$.initTrackConfig(C,this.observer,d,j,this.audioCodec);var I;if(L.pts!==void 0)I=L.pts;else if(x){var g=$.getFrameDuration(C.samplerate);I=x.sample.pts+g}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;j<U;)if($.isHeader(d,j)){if(j+5<U){var J=$.appendFrame(C,d,j,I,W);if(J)if(J.missing)this.aacOverFlow=J;else{j+=J.length,W++;continue}}break}else j++},S.parseMPEGPES=function(L){var A=L.data,C=A.length,x=0,d=0,w=L.pts;if(w===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<C;)if(H.isHeader(A,d)){var y=H.appendFrame(this._audioTrack,A,d,w,x);if(y)d+=y.length,x++;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)},T}();h.minProbeByteLength=188;function o(T,S,D,L){return{key:T,frame:!1,pts:S,dts:D,units:[],debug:L,length:0}}function f(T,S){return(T[S+10]&31)<<8|T[S+11]}function l(T,S,D,L){var A={audio:-1,avc:-1,id3:-1,isAAC:!0},C=(T[S+1]&15)<<8|T[S+2],x=S+3+C-4,d=(T[S+10]&15)<<8|T[S+11];for(S+=12+d;S<x;){var w=(T[S+1]&31)<<8|T[S+2];switch(T[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+=((T[S+3]&15)<<8|T[S+4])+5}return A}function u(T){var S=0,D,L,A,C,x,d=T.data;if(!T||T.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>T.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?(x=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,C-x>60*9e4&&(v.logger.warn(Math.round((C-x)/9e4)+"s delta between PTS and DTS, align them"),C=x)):x=C),A=D[8];var j=A+9;if(T.size<=j)return null;T.size-=j;for(var U=new Uint8Array(T.size),E=0,M=d.length;E<M;E++){D=d[E];var I=D.byteLength;if(j)if(j>I){j-=I;continue}else D=D.subarray(j),I-=j,j=0;U.set(D,S),S+=I}return L&&(L-=A+3),{data:U,pts:C,dts:x,len:L}}return null}function s(T,S){if(T.units.length&&T.frame){if(T.pts===void 0){var D=S.samples,L=D.length;if(L){var A=D[L-1];T.pts=A.pts,T.dts=A.dts}else{S.dropped++;return}}S.samples.push(T)}T.debug.length&&v.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function a(T,S){var D=T.length;if(D>0){if(S.pts>=T[D-1].pts)T.push(S);else for(var L=D-1;L>=0;L--)if(S.pts<T[L].pts){T.splice(L,0,S);break}}else T.push(S)}function O(T){for(var S=T.byteLength,D=[],L=1;L<S-2;)T[L]===0&&T[L+1]===0&&T[L+2]===3?(D.push(L+2),L+=2):L++;if(D.length===0)return T;var A=S-D.length,C=new Uint8Array(A),x=0;for(L=0;L<A;x++,L++)x===D[0]&&(x++,D.shift()),C[L]=T[x];return C}X.default=h},"./src/errors.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"ErrorTypes",function(){return $}),N.d(X,"ErrorDetails",function(){return H});var $;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})($||($={}));var H;(function(P){P.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",P.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",P.KEY_SYSTEM_NO_SESSION="keySystemNoSession",P.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",P.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",P.MANIFEST_LOAD_ERROR="manifestLoadError",P.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",P.MANIFEST_PARSING_ERROR="manifestParsingError",P.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",P.LEVEL_EMPTY_ERROR="levelEmptyError",P.LEVEL_LOAD_ERROR="levelLoadError",P.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",P.LEVEL_SWITCH_ERROR="levelSwitchError",P.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",P.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",P.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",P.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",P.FRAG_LOAD_ERROR="fragLoadError",P.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",P.FRAG_DECRYPT_ERROR="fragDecryptError",P.FRAG_PARSING_ERROR="fragParsingError",P.REMUX_ALLOC_ERROR="remuxAllocError",P.KEY_LOAD_ERROR="keyLoadError",P.KEY_LOAD_TIMEOUT="keyLoadTimeOut",P.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",P.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",P.BUFFER_APPEND_ERROR="bufferAppendError",P.BUFFER_APPENDING_ERROR="bufferAppendingError",P.BUFFER_STALLED_ERROR="bufferStalledError",P.BUFFER_FULL_ERROR="bufferFullError",P.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",P.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",P.INTERNAL_EXCEPTION="internalException",P.INTERNAL_ABORTED="aborted",P.UNKNOWN="unknown"})(H||(H={}))},"./src/events.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"Events",function(){return $});var $;(function(H){H.MEDIA_ATTACHING="hlsMediaAttaching",H.MEDIA_ATTACHED="hlsMediaAttached",H.MEDIA_DETACHING="hlsMediaDetaching",H.MEDIA_DETACHED="hlsMediaDetached",H.BUFFER_RESET="hlsBufferReset",H.BUFFER_CODECS="hlsBufferCodecs",H.BUFFER_CREATED="hlsBufferCreated",H.BUFFER_APPENDING="hlsBufferAppending",H.BUFFER_APPENDED="hlsBufferAppended",H.BUFFER_EOS="hlsBufferEos",H.BUFFER_FLUSHING="hlsBufferFlushing",H.BUFFER_FLUSHED="hlsBufferFlushed",H.MANIFEST_LOADING="hlsManifestLoading",H.MANIFEST_LOADED="hlsManifestLoaded",H.MANIFEST_PARSED="hlsManifestParsed",H.LEVEL_SWITCHING="hlsLevelSwitching",H.LEVEL_SWITCHED="hlsLevelSwitched",H.LEVEL_LOADING="hlsLevelLoading",H.LEVEL_LOADED="hlsLevelLoaded",H.LEVEL_UPDATED="hlsLevelUpdated",H.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",H.LEVELS_UPDATED="hlsLevelsUpdated",H.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",H.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",H.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",H.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",H.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",H.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",H.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",H.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",H.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",H.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",H.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",H.CUES_PARSED="hlsCuesParsed",H.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",H.INIT_PTS_FOUND="hlsInitPtsFound",H.FRAG_LOADING="hlsFragLoading",H.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",H.FRAG_LOADED="hlsFragLoaded",H.FRAG_DECRYPTED="hlsFragDecrypted",H.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",H.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",H.FRAG_PARSING_METADATA="hlsFragParsingMetadata",H.FRAG_PARSED="hlsFragParsed",H.FRAG_BUFFERED="hlsFragBuffered",H.FRAG_CHANGED="hlsFragChanged",H.FPS_DROP="hlsFpsDrop",H.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",H.ERROR="hlsError",H.DESTROYING="hlsDestroying",H.KEY_LOADING="hlsKeyLoading",H.KEY_LOADED="hlsKeyLoaded",H.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",H.BACK_BUFFER_REACHED="hlsBackBufferReached"})($||($={}))},"./src/hls.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return T});var $=N("./node_modules/url-toolkit/src/url-toolkit.js"),H=N.n($),P=N("./src/loader/playlist-loader.ts"),K=N("./src/loader/key-loader.ts"),G=N("./src/controller/id3-track-controller.ts"),r=N("./src/controller/latency-controller.ts"),R=N("./src/controller/level-controller.ts"),v=N("./src/controller/fragment-tracker.ts"),m=N("./src/controller/stream-controller.ts"),p=N("./src/is-supported.ts"),h=N("./src/utils/logger.ts"),o=N("./src/config.ts"),f=N("./node_modules/eventemitter3/index.js"),l=N.n(f),u=N("./src/events.ts"),s=N("./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 T=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,x=A.bufferController,d=A.capLevelController,w=A.fpsController,y=this.abrController=new C(this),b=this.bufferController=new x(this),j=this.capLevelController=new d(this),U=new w(this),E=new P.default(this),M=new K.default(this),I=new G.default(this),g=this.levelController=new R.default(this),W=new v.FragmentTracker(this),J=this.streamController=new m.default(this,W);j.setStreamController(J),U.setStreamController(J);var le=[g,J];this.networkControllers=le;var ce=[E,M,y,b,j,U,I,W];this.audioTrackController=this.createController(A.audioTrackController,null,le),this.createController(A.audioStreamController,W,le),this.subtitleTrackController=this.createController(A.subtitleTrackController,null,le),this.createController(A.subtitleStreamController,W,le),this.createController(A.timelineController,null,ce),this.emeController=this.createController(A.emeController,null,ce),this.cmcdController=this.createController(A.cmcdController,null,ce),this.latencyController=this.createController(r.default,null,ce),this.coreComponents=ce}var D=S.prototype;return D.createController=function(A,C,x){if(A){var d=C?new A(this,C):new A(this);return x&&x.push(d),d}return null},D.on=function(A,C,x){x===void 0&&(x=this),this._emitter.on(A,C,x)},D.once=function(A,C,x){x===void 0&&(x=this),this._emitter.once(A,C,x)},D.removeAllListeners=function(A){this._emitter.removeAllListeners(A)},D.off=function(A,C,x,d){x===void 0&&(x=this),this._emitter.off(A,C,x,d)},D.listeners=function(A){return this._emitter.listeners(A)},D.emit=function(A,C,x){return this._emitter.emit(A,C,x)},D.trigger=function(A,C){if(this.config.debug)return this.emit(A,A,C);try{return this.emit(A,A,C)}catch(x){h.logger.error("An internal error happened while handling event "+A+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:A,error:x})}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,x=this.url,d=this.url=$.buildAbsoluteURL(self.location.href,A,{alwaysNormalize:!0});h.logger.log("loadSource:"+d),C&&x&&x!==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 x=A.length,d=0;d<x;d++)if(A[d].maxBitrate>C)return d;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,C=this.autoLevelCapping,x;return C===-1&&A&&A.length?x=A.length-1:x=C,x}},{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}();T.defaultConfig=void 0},"./src/is-supported.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"isSupported",function(){return P}),N.d(X,"changeTypeSupported",function(){return K});var $=N("./src/utils/mediasource-helper.ts");function H(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var G=Object($.getMediaSource)();if(!G)return!1;var r=H(),R=G&&typeof G.isTypeSupported=="function"&&G.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 K(){var G,r=H();return typeof(r==null||((G=r.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return h}),N.d(X,"LoadError",function(){return f});var $=N("./src/polyfills/number.ts"),H=N("./src/errors.ts");function P(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,v(l,u)}function K(l){var u=typeof Map=="function"?new Map:void 0;return K=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 G(a,arguments,m(this).constructor)}return O.prototype=Object.create(a.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v(O,a)},K(l)}function G(l,u,s){return r()?G=Reflect.construct:G=function(O,T,S){var D=[null];D.push.apply(D,T);var L=Function.bind.apply(O,D),A=new L;return S&&v(A,S.prototype),A},G.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 T=this,S=a.url;if(!S)return Promise.reject(new f({type:H.ErrorTypes.NETWORK_ERROR,details:H.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,x){T.loader&&T.loader.destroy();var d=T.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(j,U,E,M){T.resetLoader(a,d),C({frag:a,part:null,payload:j.data,networkDetails:M})},onError:function(j,U,E){T.resetLoader(a,d),x(new f({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:j,networkDetails:E}))},onAbort:function(j,U,E){T.resetLoader(a,d),x(new f({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:E}))},onTimeout:function(j,U,E){T.resetLoader(a,d),x(new f({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:E}))},onProgress:function(j,U,E,M){O&&O({frag:a,part:null,payload:E,networkDetails:M})}})})},u.loadPart=function(a,O,T){var S=this;this.abort();var D=this.config,L=D.fLoader,A=D.loader;return new Promise(function(C,x){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(j,U,E,M){S.resetLoader(a,d),S.updateStatsFromPart(a,O);var I={frag:a,part:O,payload:j.data,networkDetails:M};T(I),C(I)},onError:function(j,U,E){S.resetLoader(a,d),x(new f({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:O,response:j,networkDetails:E}))},onAbort:function(j,U,E){a.stats.aborted=O.stats.aborted,S.resetLoader(a,d),x(new f({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:O,networkDetails:E}))},onTimeout:function(j,U,E){S.resetLoader(a,d),x(new f({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:O,networkDetails:E}))}})})},u.updateStatsFromPart=function(a,O){var T=a.stats,S=O.stats,D=S.total;if(T.loaded+=S.loaded,D){var L=Math.round(a.duration/O.duration),A=Math.min(Math.round(T.loaded/D),L),C=L-A,x=C*Math.round(T.loaded/A);T.total=T.loaded+x}else T.total=Math.max(T.loaded,T.total);var d=T.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,T=s.byteRangeEndOffset;return Object($.isFiniteNumber)(O)&&Object($.isFiniteNumber)(T)&&(a.rangeStart=O,a.rangeEnd=T),a}var f=function(l){P(u,l);function u(s){for(var a,O=arguments.length,T=new Array(O>1?O-1:0),S=1;S<O;S++)T[S-1]=arguments[S];return a=l.call.apply(l,[this].concat(T))||this,a.data=void 0,a.data=s,a}return u}(K(Error))},"./src/loader/fragment.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"ElementaryStreamTypes",function(){return h}),N.d(X,"BaseSegment",function(){return o}),N.d(X,"Fragment",function(){return f}),N.d(X,"Part",function(){return l});var $=N("./src/polyfills/number.ts"),H=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(H),K=N("./src/utils/logger.ts"),G=N("./src/loader/level-key.ts"),r=N("./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,T){return O.__proto__=T,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,T){var S=O.split("@",2),D=[];S.length===1?D[0]=T?T.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(H.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,T){var S;return S=u.call(this,T)||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(T){for(var S=new Uint8Array(16),D=12;D<16;D++)S[D]=T>>8*(15-D)&255;return S},a.setDecryptDataFromLevelKey=function(T,S){var D=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(D=G.LevelKey.fromURI(T.uri),D.method=T.method,D.iv=this.createInitializationVector(S),D.keyFormat="identity"),D},a.setElementaryStreamInfo=function(T,S,D,L,A,C){C===void 0&&(C=!1);var x=this.elementaryStreams,d=x[T];if(!d){x[T]={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 T=this.elementaryStreams;T[h.AUDIO]=null,T[h.VIDEO]=null,T[h.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object($.isFiniteNumber)(this.programDateTime))return null;var T=Object($.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),s}(o),l=function(u){R(s,u);function s(a,O,T,S,D){var L;L=u.call(this,T)||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(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return K});var $=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/utils/logger.ts"),K=function(){function G(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var r=G.prototype;return r._registerListeners=function(){this.hls.on($.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off($.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){P.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&&(P.logger.warn("abort previous key loader for type:"+h),o.abort()),!f){P.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},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,O,T)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger($.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,m,p){var h=p.frag;if(!h.decryptdata){P.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($.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($.Events.ERROR,{type:H.ErrorTypes.NETWORK_ERROR,details:H.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($.Events.ERROR,{type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},G}()},"./src/loader/level-details.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"LevelDetails",function(){return G});var $=N("./src/polyfills/number.ts");function H(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 P(r,R,v){return R&&H(r.prototype,R),v&&H(r,v),r}var K=10,G=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},P(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object($.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var 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(se,X,N){"use strict";N.r(X),N.d(X,"LevelKey",function(){return G});var $=N("./node_modules/url-toolkit/src/url-toolkit.js"),H=N.n($);function P(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 K(r,R,v){return R&&P(r.prototype,R),v&&P(r,v),r}var G=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($.buildAbsoluteURL)(R,v,{alwaysNormalize:!0}):this._uri=R}return K(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"LoadStats",function(){return $});var $=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(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return s});var $=N("./src/polyfills/number.ts"),H=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(H),K=N("./src/loader/fragment.ts"),G=N("./src/loader/level-details.ts"),r=N("./src/loader/level-key.ts"),R=N("./src/utils/attr-list.ts"),v=N("./src/utils/logger.ts"),m=N("./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=H.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 x=0;x<A.length;x++){var d=A[x];if(d.id===C)return d}},D.convertAVC1ToAVCOTI=function(A){var C=A.split(".");if(C.length>2){var x=C.shift()+".";return x+=parseInt(C.shift()).toString(16),x+=("000"+parseInt(C.shift()).toString(16)).substr(-4),x}return A},D.resolve=function(A,C){return H.buildAbsoluteURL(C,A,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(A,C){var x=[],d={},w=!1;p.lastIndex=0;for(var y;(y=p.exec(A))!=null;)if(y[1]){var b=new R.AttrList(y[1]),j={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(y[2],C)},U=b.decimalResolution("RESOLUTION");U&&(j.width=U.width,j.height=U.height),a((b.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=D.convertAVC1ToAVCOTI(j.videoCodec)),x.push(j)}else if(y[3]){var E=new R.AttrList(y[3]);E["DATA-ID"]&&(w=!0,d[E["DATA-ID"]]=E)}return{levels:x,sessionData:w?d:null}},D.parseMasterPlaylistMedia=function(A,C,x,d){d===void 0&&(d=[]);var w,y=[],b=0;for(h.lastIndex=0;(w=h.exec(A))!==null;){var j=new R.AttrList(w[1]);if(j.TYPE===x){var U={attrs:j,bitrate:0,id:b++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:x,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?D.resolve(j.URI,C):""};if(d.length){var E=D.findGroup(d,U.groupId)||d[0];O(U,E,"audioCodec"),O(U,E,"textCodec")}y.push(U)}}return y},D.parseLevelPlaylist=function(A,C,x,d,w){var y=new G.LevelDetails(C),b=y.fragments,j=null,U=0,E=0,M=0,I=0,g=null,W=new K.Fragment(d,C),J,le,ce,Re=-1,Ee=!1;for(o.lastIndex=0,y.m3u8=A;(J=o.exec(A))!==null;){Ee&&(Ee=!1,W=new K.Fragment(d,C),W.start=M,W.sn=U,W.cc=I,W.level=x,j&&(W.initSegment=j,W.rawProgramDateTime=j.rawProgramDateTime));var Oe=J[1];if(Oe){W.duration=parseFloat(Oe);var Te=(" "+J[2]).slice(1);W.title=Te||null,W.tagList.push(Te?["INF",Oe,Te]:["INF",Oe])}else if(J[3])Object($.isFiniteNumber)(W.duration)&&(W.start=M,ce&&(W.levelkey=ce),W.sn=U,W.level=x,W.cc=I,W.urlId=w,b.push(W),W.relurl=(" "+J[3]).slice(1),S(W,g),g=W,M+=W.duration,U++,E=0,Ee=!0);else if(J[4]){var Le=(" "+J[4]).slice(1);g?W.setByteRange(Le,g):W.setByteRange(Le)}else if(J[5])W.rawProgramDateTime=(" "+J[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Re===-1&&(Re=b.length);else{if(J=J[0].match(f),!J){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(le=1;le<J.length&&!(typeof J[le]!="undefined");le++);var ye=(" "+J[le]).slice(1),Y=(" "+J[le+1]).slice(1),_=J[le+2]?(" "+J[le+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":y.type=Y.toUpperCase();break;case"MEDIA-SEQUENCE":U=y.startSN=parseInt(Y);break;case"SKIP":{var k=new R.AttrList(Y),B=k.decimalInteger("SKIPPED-SEGMENTS");if(Object($.isFiniteNumber)(B)){y.skippedSegments=B;for(var Z=B;Z--;)b.unshift(null);U+=B}var z=k.enumeratedString("RECENTLY-REMOVED-DATERANGES");z&&(y.recentlyRemovedDateranges=z.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(Y);break;case"VERSION":y.version=parseInt(Y);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(Y||_)&&W.tagList.push(_?[Y,_]:[Y]);break;case"DIS":I++;case"GAP":W.tagList.push([ye]);break;case"BITRATE":W.tagList.push([ye,Y]);break;case"DISCONTINUITY-SEQ":I=parseInt(Y);break;case"KEY":{var he,ve=new R.AttrList(Y),Ae=ve.enumeratedString("METHOD"),ue=ve.URI,me=ve.hexadecimalInteger("IV"),be=ve.enumeratedString("KEYFORMATVERSIONS"),Ce=ve.enumeratedString("KEYID"),Pe=(he=ve.enumeratedString("KEYFORMAT"))!=null?he:"identity",Ue=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ue.indexOf(Pe)>-1){v.logger.warn("Keyformat "+Pe+" is not supported from the manifest");continue}else if(Pe!=="identity")continue;Ae&&(ce=r.LevelKey.fromURL(C,ue),ue&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ae)>=0&&(ce.method=Ae,ce.keyFormat=Pe,Ce&&(ce.keyID=Ce),be&&(ce.keyFormatVersions=be),ce.iv=me));break}case"START":{var He=new R.AttrList(Y),Be=He.decimalFloatingPoint("TIME-OFFSET");Object($.isFiniteNumber)(Be)&&(y.startTimeOffset=Be);break}case"MAP":{var Qe=new R.AttrList(Y);W.relurl=Qe.URI,Qe.BYTERANGE&&W.setByteRange(Qe.BYTERANGE),W.level=x,W.sn="initSegment",ce&&(W.levelkey=ce),W.initSegment=null,j=W,Ee=!0;break}case"SERVER-CONTROL":{var Ge=new R.AttrList(Y);y.canBlockReload=Ge.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=Ge.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&Ge.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=Ge.optionalFloat("PART-HOLD-BACK",0),y.holdBack=Ge.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Xe=new R.AttrList(Y);y.partTarget=Xe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Me=y.partList;Me||(Me=y.partList=[]);var it=E>0?Me[Me.length-1]:void 0,qe=E++,de=new K.Part(new R.AttrList(Y),W,C,qe,it);Me.push(de),W.duration+=de.duration;break}case"PRELOAD-HINT":{var ee=new R.AttrList(Y);y.preloadHint=ee;break}case"RENDITION-REPORT":{var ne=new R.AttrList(Y);y.renditionReports=y.renditionReports||[],y.renditionReports.push(ne);break}default:v.logger.warn("line parsed but not handled: "+J);break}}}g&&!g.relurl?(b.pop(),M-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(S(W,g),W.cc=I,y.fragmentHint=W);var oe=b.length,fe=b[0],re=b[oe-1];if(M+=y.skippedSegments*y.targetduration,M>0&&oe&&re){y.averagetargetduration=M/oe;var ie=re.sn;y.endSN=ie!=="initSegment"?ie:0,fe&&(y.startCC=fe.cc,fe.initSegment||y.fragments.every(function(pe){return pe.relurl&&u(pe.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new K.Fragment(d,C),W.relurl=re.relurl,W.level=x,W.sn="initSegment",fe.initSegment=W,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(M+=y.fragmentHint.duration),y.totalduration=M,y.endCC=I,Re>0&&T(b,Re),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 x=C.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});L[A+"Codec"]=x.length>0?x[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 T(D,L){for(var A=D[L],C=L;C--;){var x=D[C];if(!x)return;x.programDateTime=A.programDateTime-x.duration*1e3,A=x}}function S(D,L){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):L!=null&&L.programDateTime&&(D.programDateTime=L.endProgramDateTime),Object($.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),P=N("./src/errors.ts"),K=N("./src/utils/logger.ts"),G=N("./src/utils/mp4-tools.ts"),r=N("./src/loader/m3u8-parser.ts"),R=N("./src/types/loader.ts"),v=N("./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(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(H.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(H.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var u=this.hls;u.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(H.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(H.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(u){var s=this.hls.config,a=s.pLoader,O=s.loader,T=a||O,S=new T(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,T=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:null,level:O,responseType:"text",type:R.PlaylistContextType.LEVEL,url:T,deliveryDirectives:S})},f.onAudioTrackLoading=function(u,s){var a=s.id,O=s.groupId,T=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:S})},f.onSubtitleTrackLoading=function(u,s){var a=s.id,O=s.groupId,T=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:S})},f.load=function(u){var s,a=this.hls.config,O=this.getInternalLoader(u);if(O){var T=O.context;if(T&&T.url===u.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.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 x=C.partTarget,d=C.targetduration;x&&d&&(D=Math.min(Math.max(x*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 T=u.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,a,"no EXTM3U delimiter",O);return}s.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.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 T=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 x=A.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),d=A.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),w=r.default.parseMasterPlaylistMedia(S,D,"AUDIO",x),y=r.default.parseMasterPlaylistMedia(S,D,"SUBTITLES",d),b=r.default.parseMasterPlaylistMedia(S,D,"CLOSED-CAPTIONS");if(w.length){var j=w.some(function(U){return!U.url});!j&&A[0].audioCodec&&!A[0].attrs.AUDIO&&(K.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:""}))}T.trigger(H.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 T=this.hls,S=a.id,D=a.level,L=a.type,A=p(u,a),C=Object($.isFiniteNumber)(S)?S:0,x=Object($.isFiniteNumber)(D)?D:C,d=m(a),w=r.default.parseLevelPlaylist(u.data,A,x,d,C);if(!w.fragments.length){T.trigger(H.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.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};T.trigger(H.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:A,stats:s,networkDetails:O,sessionData:null})}if(s.parsing.end=performance.now(),w.needSidxRanges){var b,j=(b=w.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:j,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(G.parseSegmentIndex)(new Uint8Array(u.data));if(!a)return;var O=a.references,T=s.levelDetails;O.forEach(function(S,D){var L=S.info,A=T.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(H.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.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),K.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 T=P.ErrorDetails.UNKNOWN,S=!1,D=this.getInternalLoader(u);switch(u.type){case R.PlaylistContextType.MANIFEST:T=a?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case R.PlaylistContextType.LEVEL:T=a?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case R.PlaylistContextType.AUDIO_TRACK:T=a?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:T=a?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}D&&this.resetInternalLoader(u.type);var L={type:P.ErrorTypes.NETWORK_ERROR,details:T,fatal:S,url:u.url,loader:D,context:u,networkDetails:s};O&&(L.response=O),this.hls.trigger(H.Events.ERROR,L)},f.handlePlaylistLoaded=function(u,s,a,O){var T=a.type,S=a.level,D=a.id,L=a.groupId,A=a.loader,C=a.levelDetails,x=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(T){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(H.Events.LEVEL_LOADED,{details:C,level:S||0,id:D||0,stats:s,networkDetails:O,deliveryDirectives:x});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(H.Events.AUDIO_TRACK_LOADED,{details:C,id:D||0,groupId:L||"",stats:s,networkDetails:O,deliveryDirectives:x});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(H.Events.SUBTITLE_TRACK_LOADED,{details:C,id:D||0,groupId:L||"",stats:s,networkDetails:O,deliveryDirectives:x});break}},o}();X.default=h},"./src/polyfills/number.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"isFiniteNumber",function(){return $}),N.d(X,"MAX_SAFE_INTEGER",function(){return H});var $=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},H=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(se,X,N){"use strict";N.r(X);var $=function(){function H(){}return H.getSilentFrame=function(K,G){switch(K){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(G===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(G===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},H}();X.default=$},"./src/remux/mp4-generator.ts":function(se,X,N){"use strict";N.r(X);var $=Math.pow(2,32)-1,H=function(){function P(){}return P.init=function(){P.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var G;for(G in P.types)P.types.hasOwnProperty(G)&&(P.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.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]);P.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]);P.STTS=P.STSC=P.STCO=m,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.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]);P.FTYP=P.box(P.types.ftyp,p,o,p,h),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,v))},P.box=function(G){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(G,4),p=0,r=8;p<h;p++)o.set(v[p],r),r+=v[p].byteLength;return o},P.hdlr=function(G){return P.box(P.types.hdlr,P.HDLR_TYPES[G])},P.mdat=function(G){return P.box(P.types.mdat,G)},P.mdhd=function(G,r){r*=G;var R=Math.floor(r/($+1)),v=Math.floor(r%($+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},P.mdia=function(G){return P.box(P.types.mdia,P.mdhd(G.timescale,G.duration),P.hdlr(G.type),P.minf(G))},P.mfhd=function(G){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},P.minf=function(G){return G.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(G)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(G))},P.moof=function(G,r,R){return P.box(P.types.moof,P.mfhd(G),P.traf(R,r))},P.moov=function(G){for(var r=G.length,R=[];r--;)R[r]=P.trak(G[r]);return P.box.apply(null,[P.types.moov,P.mvhd(G[0].timescale,G[0].duration)].concat(R).concat(P.mvex(G)))},P.mvex=function(G){for(var r=G.length,R=[];r--;)R[r]=P.trex(G[r]);return P.box.apply(null,[P.types.mvex].concat(R))},P.mvhd=function(G,r){r*=G;var R=Math.floor(r/($+1)),v=Math.floor(r%($+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,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 P.box(P.types.mvhd,m)},P.sdtp=function(G){var r=G.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 P.box(P.types.sdtp,R)},P.stbl=function(G){return P.box(P.types.stbl,P.stsd(G),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))},P.avc1=function(G){var r=[],R=[],v,m,p;for(v=0;v<G.sps.length;v++)m=G.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<G.pps.length;v++)m=G.pps[v],p=m.byteLength,R.push(p>>>8&255),R.push(p&255),R=R.concat(Array.prototype.slice.call(m));var h=P.box(P.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|G.sps.length].concat(r).concat([G.pps.length]).concat(R))),o=G.width,f=G.height,l=G.pixelRatio[0],u=G.pixelRatio[1];return P.box(P.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,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},P.esds=function(G){var r=G.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(G.config).concat([6,1,2]))},P.mp4a=function(G){var r=G.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),P.box(P.types.esds,P.esds(G)))},P.mp3=function(G){var r=G.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},P.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(G)):P.box(P.types.stsd,P.STSD,P.mp4a(G)):P.box(P.types.stsd,P.STSD,P.avc1(G))},P.tkhd=function(G){var r=G.id,R=G.duration*G.timescale,v=G.width,m=G.height,p=Math.floor(R/($+1)),h=Math.floor(R%($+1));return P.box(P.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]))},P.traf=function(G,r){var R=P.sdtp(G),v=G.id,m=Math.floor(r/($+1)),p=Math.floor(r%($+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),P.box(P.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])),P.trun(G,R.length+16+20+8+16+8+8),R)},P.trak=function(G){return G.duration=G.duration||4294967295,P.box(P.types.trak,P.tkhd(G),P.mdia(G))},P.trex=function(G){var r=G.id;return P.box(P.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]))},P.trun=function(G,r){var R=G.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 P.box(P.types.trun,p)},P.initSegment=function(G){P.types||P.init();var r=P.moov(G),R=new Uint8Array(P.FTYP.byteLength+r.byteLength);return R.set(P.FTYP),R.set(r,P.FTYP.byteLength),R},P}();H.types=void 0,H.HDLR_TYPES=void 0,H.STTS=void 0,H.STSC=void 0,H.STCO=void 0,H.STSZ=void 0,H.VMHD=void 0,H.SMHD=void 0,H.STSD=void 0,H.FTYP=void 0,H.DINF=void 0,X.default=H},"./src/remux/mp4-remuxer.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return s}),N.d(X,"normalizePts",function(){return a});var $=N("./src/polyfills/number.ts"),H=N("./src/remux/aac-helper.ts"),P=N("./src/remux/mp4-generator.ts"),K=N("./src/events.ts"),G=N("./src/errors.ts"),r=N("./src/utils/logger.ts"),R=N("./src/types/loader.ts"),v=N("./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,x,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=x,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 x=!1,d=C.reduce(function(w,y){var b=y.pts-w;return b<-4294967296?(x=!0,a(w,y.pts)):b>0?w:y.pts},C[0].pts);return x&&r.logger.debug("PTS rollover detected"),d},L.remux=function(C,x,d,w,y,b,j,U){var E,M,I,g,W,J,le=y,ce=y,Re=C.pid>-1,Ee=x.pid>-1,Oe=x.samples.length,Te=C.samples.length>0,Le=Oe>1,ye=(!Re||Te)&&(!Ee||Le)||this.ISGenerated||j;if(ye){this.ISGenerated||(I=this.generateIS(C,x,y));var Y=this.isVideoContiguous,_=-1;if(Le&&(_=O(x.samples),!Y&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,_>0){r.logger.warn("[mp4-remuxer]: Dropped "+_+" out of "+Oe+" video samples due to a missing keyframe");var k=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(_),x.dropped+=_,ce+=(x.samples[0].pts-k)/(x.timescale||9e4)}else _===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Oe+" video samples"),J=!1);if(this.ISGenerated){if(Te&&Le){var B=this.getVideoStartPts(x.samples),Z=a(C.samples[0].pts,B)-B,z=Z/x.inputTimeScale;le+=Math.max(0,z),ce+=Math.max(0,-z)}if(Te){if(C.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(C,x,y)),M=this.remuxAudio(C,le,this.isAudioContiguous,b,Ee||Le||U===R.PlaylistLevelType.AUDIO?ce:void 0),Le){var he=M?M.endPTS-M.startPTS:0;x.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(C,x,y)),E=this.remuxVideo(x,ce,Y,he)}}else Le&&(E=this.remuxVideo(x,ce,Y,0));E&&(E.firstKeyFrame=_,E.independent=_!==-1)}}return this.ISGenerated&&(d.samples.length&&(W=this.remuxID3(d,y)),w.samples.length&&(g=this.remuxText(w,y))),{audio:M,video:E,initSegment:I,independent:J,text:g,id3:W}},L.generateIS=function(C,x,d){var w=C.samples,y=x.samples,b=this.typeSupported,j={},U=!Object($.isFiniteNumber)(this._initPTS),E="audio/mp4",M,I,g;if(U&&(M=I=Infinity),C.config&&w.length&&(C.timescale=C.samplerate,C.isAAC||(b.mpeg?(E="audio/mpeg",C.codec=""):b.mp3&&(C.codec="mp3")),j.audio={id:"audio",container:E,codec:C.codec,initSegment:!C.isAAC&&b.mpeg?new Uint8Array(0):P.default.initSegment([C]),metadata:{channelCount:C.channelCount}},U&&(g=C.inputTimeScale,M=I=w[0].pts-Math.round(g*d))),x.sps&&x.pps&&y.length&&(x.timescale=x.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:P.default.initSegment([x]),metadata:{width:x.width,height:x.height}},U)){g=x.inputTimeScale;var W=this.getVideoStartPts(y),J=Math.round(g*d);I=Math.min(I,a(y[0].dts,W)-J),M=Math.min(M,W-J)}if(Object.keys(j).length)return this.ISGenerated=!0,U&&(this._initPTS=M,this._initDTS=I),{tracks:j,initPTS:M,timescale:g}},L.remuxVideo=function(C,x,d,w){var y=C.inputTimeScale,b=C.samples,j=[],U=b.length,E=this._initPTS,M=this.nextAvcDts,I=8,g,W,J,le=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,Re=0,Ee=!1;if(!d||M===null){var Oe=x*y,Te=b[0].pts-a(b[0].dts,b[0].pts);M=Oe-Te}for(var Le=0;Le<U;Le++){var ye=b[Le];if(ye.pts=a(ye.pts-E,M),ye.dts=a(ye.dts-E,M),ye.dts>ye.pts){var Y=9e4*.2;Re=Math.max(Math.min(Re,ye.pts-ye.dts),-1*Y)}ye.dts<b[Le>0?Le-1:Le].dts&&(Ee=!0)}Ee&&b.sort(function(yt,ot){var at=yt.dts-ot.dts,Lt=yt.pts-ot.pts;return at||Lt}),W=b[0].dts,J=b[b.length-1].dts;var _=Math.round((J-W)/(U-1));if(Re<0){if(Re<_*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-_,!0)+" ms");for(var k=Re,B=0;B<U;B++)b[B].dts=k=Math.max(k,b[B].pts-_),b[B].pts=Math.max(k,b[B].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Re,!0)+" ms to overcome this issue");for(var Z=0;Z<U;Z++)b[Z].dts=b[Z].dts+Re}W=b[0].dts}if(d){var z=W-M,he=z>_,ve=z<-1;if(he||ve){he?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(z,!0)+" ms ("+z+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-z,!0)+" ms ("+z+"dts) overlapping between fragments detected"),W=M;var Ae=b[0].pts-z;b[0].dts=W,b[0].pts=Ae,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Ae,!0)+"/"+Object(v.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(z,!0)+" ms")}}u&&(W=Math.max(0,W));for(var ue=0,me=0,be=0;be<U;be++){for(var Ce=b[be],Pe=Ce.units,Ue=Pe.length,He=0,Be=0;Be<Ue;Be++)He+=Pe[Be].data.length;me+=He,ue+=Ue,Ce.length=He,Ce.dts=Math.max(Ce.dts,W),Ce.pts=Math.max(Ce.pts,Ce.dts,0),le=Math.min(Ce.pts,le),ce=Math.max(Ce.pts,ce)}J=b[U-1].dts;var Qe=me+4*ue+8,Ge;try{Ge=new Uint8Array(Qe)}catch(yt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating video mdat "+Qe});return}var Xe=new DataView(Ge.buffer);Xe.setUint32(0,Qe),Ge.set(P.default.types.mdat,4);for(var Me=0;Me<U;Me++){for(var it=b[Me],qe=it.units,de=0,ee=0,ne=qe.length;ee<ne;ee++){var oe=qe[ee],fe=oe.data,re=oe.data.byteLength;Xe.setUint32(I,re),I+=4,Ge.set(fe,I),I+=re,de+=4+re}if(Me<U-1)g=b[Me+1].dts-it.dts;else{var ie=this.config,pe=it.dts-b[Me>0?Me-1:Me].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(ie.maxBufferHole*y),xe=(w?le+w*y:this.nextAudioPts)-it.pts;xe>ge?(g=xe-pe,g<0&&(g=pe),r.logger.log("[mp4-remuxer]: It is approximately "+xe/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=pe}else g=pe}var Ie=Math.round(it.pts-it.dts);j.push(new T(it.key,g,de,Ie))}if(j.length&&f&&f<70){var Ne=j[0].flags;Ne.dependsOn=2,Ne.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=J+g,this.isVideoContiguous=!0;var ze=P.default.moof(C.sequenceNumber++,W,m({},C,{samples:j})),et="video",rt={data1:ze,data2:Ge,startPTS:le/y,endPTS:(ce+g)/y,startDTS:W/y,endDTS:M/y,type:et,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(Ge.length,"MDAT length must not be zero"),rt},L.remuxAudio=function(C,x,d,w,y){var b=C.inputTimeScale,j=C.samplerate?C.samplerate:b,U=b/j,E=C.isAAC?h:o,M=E*U,I=this._initPTS,g=!C.isAAC&&this.typeSupported.mpeg,W=[],J=C.samples,le=g?0:8,ce=this.nextAudioPts||-1,Re=x*b;if(this.isAudioContiguous=d=d||J.length&&ce>0&&(w&&Math.abs(Re-ce)<9e3||Math.abs(a(J[0].pts-I,Re)-ce)<20*M),J.forEach(function(fe){fe.pts=a(fe.pts-I,Re)}),!d||ce<0){if(J=J.filter(function(fe){return fe.pts>=0}),!J.length)return;y===0?ce=0:w?ce=Math.max(0,Re):ce=J[0].pts}if(C.isAAC)for(var Ee=y!==void 0,Oe=this.config.maxAudioFramesDrift,Te=0,Le=ce;Te<J.length;Te++){var ye=J[Te],Y=ye.pts,_=Y-Le,k=Math.abs(1e3*_/b);if(_<=-Oe*M&&Ee)Te===0&&(r.logger.warn("Audio frame @ "+(Y/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*_/b)+" ms."),this.nextAudioPts=ce=Le=Y);else if(_>=Oe*M&&k<p&&Ee){var B=Math.round(_/M);Le=Y-B*M,Le<0&&(B--,Le+=M),Te===0&&(this.nextAudioPts=ce=Le),r.logger.warn("[mp4-remuxer]: Injecting "+B+" audio frame @ "+(Le/b).toFixed(3)+"s due to "+Math.round(1e3*_/b)+" ms gap.");for(var Z=0;Z<B;Z++){var z=Math.max(Le,0),he=H.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);he||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),he=ye.unit.subarray()),J.splice(Te,0,{unit:he,pts:z}),Le+=M,Te++}}ye.pts=Le,Le+=M}for(var ve=null,Ae=null,ue,me=0,be=J.length;be--;)me+=J[be].unit.byteLength;for(var Ce=0,Pe=J.length;Ce<Pe;Ce++){var Ue=J[Ce],He=Ue.unit,Be=Ue.pts;if(Ae!==null){var Qe=W[Ce-1];Qe.duration=Math.round((Be-Ae)/U)}else if(d&&C.isAAC&&(Be=ce),ve=Be,me>0){me+=le;try{ue=new Uint8Array(me)}catch(fe){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:me,reason:"fail allocating audio mdat "+me});return}if(!g){var Ge=new DataView(ue.buffer);Ge.setUint32(0,me),ue.set(P.default.types.mdat,4)}}else return;ue.set(He,le);var Xe=He.byteLength;le+=Xe,W.push(new T(!0,E,Xe,0)),Ae=Be}var Me=W.length;if(!Me)return;var it=W[W.length-1];this.nextAudioPts=ce=Ae+U*it.duration;var qe=g?new Uint8Array(0):P.default.moof(C.sequenceNumber++,ve/U,m({},C,{samples:W}));C.samples=[];var de=ve/b,ee=ce/b,ne="audio",oe={data1:qe,data2:ue,startPTS:de,endPTS:ee,startDTS:de,endDTS:ee,type:ne,hasAudio:!0,hasVideo:!1,nb:Me};return this.isAudioContiguous=!0,console.assert(ue.length,"MDAT length must not be zero"),oe},L.remuxEmptyAudio=function(C,x,d,w){var y=C.inputTimeScale,b=C.samplerate?C.samplerate:y,j=y/b,U=this.nextAudioPts,E=(U!==null?U:w.startDTS*y)+this._initDTS,M=w.endDTS*y+this._initDTS,I=j*h,g=Math.ceil((M-E)/I),W=H.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],le=0;le<g;le++){var ce=E+le*I;J.push({unit:W,pts:ce,dts:ce})}return C.samples=J,this.remuxAudio(C,x,d,!1)},L.remuxID3=function(C,x){var d=C.samples.length;if(!d)return;for(var w=C.inputTimeScale,y=this._initPTS,b=this._initDTS,j=0;j<d;j++){var U=C.samples[j];U.pts=a(U.pts-y,x*w)/w,U.dts=a(U.dts-b,x*w)/w}var E=C.samples;return C.samples=[],{samples:E}},L.remuxText=function(C,x){var d=C.samples.length;if(!d)return;for(var w=C.inputTimeScale,y=this._initPTS,b=0;b<d;b++){var j=C.samples[b];j.pts=a(j.pts-y,x*w)/w}C.samples.sort(function(E,M){return E.pts-M.pts});var U=C.samples;return C.samples=[],{samples:U}},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 T=function(L,A,C,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=A,this.size=C,this.cts=x,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(se,X,N){"use strict";N.r(X);var $=N("./src/polyfills/number.ts"),H=N("./src/utils/mp4-tools.ts"),P=N("./src/loader/fragment.ts"),K=N("./src/utils/logger.ts"),G=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(H.parseInitSegment)(h);o||(o=R(l.audio,P.ElementaryStreamTypes.AUDIO)),f||(f=R(l.video,P.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"}:K.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($.isFiniteNumber)(a)||(a=this.lastEndDTS=u||0);var T=o.samples;if(!T||!T.length)return O;var S={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(T),D=this.initData),!D||!D.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object($.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=r(D,T,a));var L=Object(H.getDuration)(T,D),A=a,C=L+A;Object(H.offsetStartDTS)(D,T,s),L>0?this.lastEndDTS=C:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!D.audio,d=!!D.video,w="";x&&(w+="audio"),d&&(w+="video");var y={data1:T,startPTS:A,startDTS:A,endPTS:C,endDTS:C,type:w,hasAudio:x,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(H.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===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=G},"./src/task-loop.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return $});var $=function(){function H(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=H.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},H}()},"./src/types/cmcd.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"CMCDVersion",function(){return $}),N.d(X,"CMCDObjectType",function(){return H}),N.d(X,"CMCDStreamingFormat",function(){return P}),N.d(X,"CMCDStreamType",function(){return K});var $=1,H;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(H||(H={}));var P;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(P||(P={}));var K;(function(G){G.VOD="v",G.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"HlsSkip",function(){return P}),N.d(X,"getSkipValue",function(){return K}),N.d(X,"HlsUrlParameters",function(){return G}),N.d(X,"Level",function(){return r});function $(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 H(R,v,m){return v&&$(R.prototype,v),m&&$(R,m),R}var P;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(P||(P={}));function K(R,v){var m=R.canSkipUntil,p=R.canSkipDateRanges,h=R.endSN,o=v!==void 0?v-h:0;return m&&o<m?p?P.v2:P.Yes:P.No}var G=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 H(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(se,X,N){"use strict";N.r(X),N.d(X,"PlaylistContextType",function(){return $}),N.d(X,"PlaylistLevelType",function(){return H});var $;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})($||($={}));var H;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(H||(H={}))},"./src/types/transmuxer.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"ChunkMetadata",function(){return $});var $=function(K,G,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=H(),this.buffering={audio:H(),video:H(),audiovideo:H()},this.level=K,this.sn=G,this.id=r,this.size=R,this.part=v,this.partial=m};function H(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"AttrList",function(){return P});var $=/^(\d+)x(\d+)$/,H=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function K(r){typeof r=="string"&&(r=K.parseAttrList(r));for(var R in r)r.hasOwnProperty(R)&&(this[R]=r[R])}var G=K.prototype;return G.decimalInteger=function(R){var v=parseInt(this[R],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.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},G.hexadecimalIntegerAsNumber=function(R){var v=parseInt(this[R],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.decimalFloatingPoint=function(R){return parseFloat(this[R])},G.optionalFloat=function(R,v){var m=this[R];return m?parseFloat(m):v},G.enumeratedString=function(R){return this[R]},G.bool=function(R){return this[R]==="YES"},G.decimalResolution=function(R){var v=$.exec(this[R]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},K.parseAttrList=function(R){var v,m={},p='"';for(H.lastIndex=0;(v=H.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},K}()},"./src/utils/binary-search.ts":function(se,X,N){"use strict";N.r(X);var $={search:function(P,K){for(var G=0,r=P.length-1,R=null,v=null;G<=r;){R=(G+r)/2|0,v=P[R];var m=K(v);if(m>0)G=R+1;else if(m<0)r=R-1;else return v}return null}};X.default=$},"./src/utils/buffer-helper.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"BufferHelper",function(){return P});var $=N("./src/utils/logger.ts"),H={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function K(){}return K.isBuffered=function(r,R){try{if(r){for(var v=K.getBuffered(r),m=0;m<v.length;m++)if(R>=v.start(m)&&R<=v.end(m))return!0}}catch(p){}return!1},K.bufferInfo=function(r,R,v){try{if(r){var m=K.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}},K.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,T=m[a].end;if(R+v>=O&&R<T)u=O,s=T,f=s-R;else if(R+v<O){l=O;break}}return{len:f,start:u||0,end:s||0,nextStart:l}},K.getBuffered=function(r){try{return r.buffered}catch(R){return $.logger.log("failed to get media.buffered",R),H}},K}()},"./src/utils/cea-608-parser.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"Row",function(){return s}),N.d(X,"CaptionScreen",function(){return a});var $=N("./src/utils/logger.ts"),H={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},P=function(C){var x=C;return H.hasOwnProperty(C)&&(x=H[C]),String.fromCharCode(x)},K=15,G=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&&$.logger.log(this.time+" ["+d+"] "+w)},A}(),f=function(C){for(var x=[],d=0;d<C.length;d++)x.push(C[d].toString(16));return x},l=function(){function A(x,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=x||"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(x,d,w,y,b,j){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new l(d,w,y,b,j)}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(x){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<G;d++)this.chars.push(new u);this.logger=x,this.pos=0,this.currPenState=new l}var C=A.prototype;return C.equals=function(d){for(var w=!0,y=0;y<G;y++)if(!this.chars[y].equals(d.chars[y])){w=!1;break}return w},C.copy=function(d){for(var w=0;w<G;w++)this.chars[w].copy(d.chars[w])},C.isEmpty=function(){for(var d=!0,w=0;w<G;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>G&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},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=P(d);if(this.pos>=G){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<G;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<G;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(x){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<K;d++)this.rows.push(new s(x));this.logger=x,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var C=A.prototype;return C.reset=function(){for(var d=0;d<K;d++)this.rows[d].clear();this.currRow=K-1},C.equals=function(d){for(var w=!0,y=0;y<K;y++)if(!this.rows[y].equals(d.rows[y])){w=!1;break}return w},C.copy=function(d){for(var w=0;w<K;w++)this.rows[w].copy(d.rows[w])},C.isEmpty=function(){for(var d=!0,w=0;w<K;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<K;y++)this.rows[y].clear();var b=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var U=j.rows[b].cueStartTime,E=this.logger.time;if(U&&E!==null&&U<E)for(var M=0;M<this.nrRollUpRows;M++)this.rows[w-this.nrRollUpRows+M+1].copy(j.rows[b+M])}}this.currRow=w;var I=this.rows[this.currRow];if(d.indent!==null){var g=d.indent,W=Math.max(g-1,0);I.setCursor(d.indent),d.color=I.chars[W].penState.foreground}var J={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(J)},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,j=0;j<K;j++){var U=this.rows[j].getTextString();U&&(b=j+1,d?w.push("Row "+b+": '"+U+"'"):w.push(U.trim()))}return w.length>0&&(d?y="["+w.join(" | ")+"]":y=w.join(`
|
|
`)),y},C.getTextAndFormat=function(){return this.rows},A}(),O=function(){function A(x,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=x,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[K-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[K-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}(),T=function(){function A(x,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(x,d,y),new O(x+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,j,U=!1;this.logger.time=d;for(var E=0;E<w.length;E+=2){if(b=w[E]&127,j=w[E+1]&127,b===0&&j===0)continue;if(this.logger.log(h.DATA,"["+f([w[E],w[E+1]])+"] -> ("+f([b,j])+")"),y=this.parseCmd(b,j),y||(y=this.parseMidrow(b,j)),y||(y=this.parsePAC(b,j)),y||(y=this.parseBackgroundAttributes(b,j)),!y&&(U=this.parseChars(b,j),U)){var M=this.currentChannel;if(M&&M>0){var I=this.channels[M];I.insertChars(U)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!U&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+f([b,j])+" orig: "+f([w[E],w[E+1]]))}},C.parseCmd=function(d,w){var y=this.cmdHistory,b=(d===20||d===28||d===21||d===29)&&w>=32&&w<=47,j=(d===23||d===31)&&w>=33&&w<=35;if(!(b||j))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 U=d===20||d===21||d===23?1:2,E=this.channels[U];return d===20||d===21||d===28||d===29?w===32?E.ccRCL():w===33?E.ccBS():w===34?E.ccAOF():w===35?E.ccAON():w===36?E.ccDER():w===37?E.ccRU(2):w===38?E.ccRU(3):w===39?E.ccRU(4):w===40?E.ccFON():w===41?E.ccRDC():w===42?E.ccTR():w===43?E.ccRTD():w===44?E.ccEDM():w===45?E.ccCR():w===46?E.ccENM():w===47&&E.ccEOC():E.ccTO(w-32),S(d,w,y),this.currentChannel=U,!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,j=(d>=17&&d<=23||d>=25&&d<=31)&&w>=64&&w<=127,U=(d===16||d===24)&&w>=64&&w<=95;if(!(j||U))return!1;if(D(d,w,b))return S(null,null,b),!0;var E=d<=23?1:2;w>=64&&w<=95?y=E===1?r[d]:v[d]:y=E===1?R[d]:m[d];var M=this.channels[E];return M?(M.setPAC(this.interpretPAC(y,w)),S(d,w,b),this.currentChannel=E,!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,j=null;if(d>=25?(y=2,j=d-8):(y=1,j=d),j>=17&&j<=19){var U;j===17?U=w+80:j===18?U=w+112:U=w+144,this.logger.log(h.INFO,"Special char '"+P(U)+"' in channel "+y),b=[U]}else d>=32&&d<=127&&(b=w===0?[d]:[d,w]);if(b){var E=f(b);this.logger.log(h.DEBUG,"Char codes = "+E.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 j,U={};d===16||d===24?(j=Math.floor((w-32)/2),U.background=p[j],w%2===1&&(U.background=U.background+"_semi")):w===45?U.background="transparent":(U.foreground="black",w===47&&(U.underline=!0));var E=d<=23?1:2,M=this.channels[E];return M.setBkgData(U),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,x){x.a=A,x.b=C}function D(A,C,x){return x.a===A&&x.b===C}function L(){return{a:null,b:null}}X.default=T},"./src/utils/codecs.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"isCodecType",function(){return H}),N.d(X,"isCodecSupportedInMp4",function(){return P});var $={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 H(K,G){var r=$[G];return!!r&&r[K.slice(0,4)]===!0}function P(K,G){return MediaSource.isTypeSupported((G||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/utils/vttparser.ts"),H=N("./src/utils/webvtt-parser.ts"),P=N("./src/utils/texttrack-utils.ts"),K=/\s/,G={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 T=0;T<o.chars.length;T++)K.test(o.chars[T].uchar)&&l?u++:(s+=o.chars[T].uchar,l=!1);o.cueStartTime=v,v===m&&(m+=1e-4),u>=16?u--:u++;var S=Object($.fixLineBreaks)(s.trim()),D=Object(H.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(P.addCueToTrack)(R,L)})),h}};X.default=G},"./src/utils/discontinuities.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"findFirstFragWithCC",function(){return K}),N.d(X,"shouldAlignOnDiscontinuities",function(){return G}),N.d(X,"findDiscontinuousReferenceFrag",function(){return r}),N.d(X,"adjustSlidingStart",function(){return v}),N.d(X,"alignStream",function(){return m}),N.d(X,"alignPDT",function(){return h}),N.d(X,"alignFragmentByPDTDelta",function(){return o}),N.d(X,"alignMediaPlaylistByPDT",function(){return f});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/logger.ts"),P=N("./src/controller/level-helper.ts");function K(l,u){for(var s=null,a=0,O=l.length;a<O;a++){var T=l[a];if(T&&T.cc===u){s=T;break}}return s}function G(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){H.logger.log("No fragments to align");return}var O=K(s,a[0].cc);if(!O||O&&!O.startPTS){H.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(P.adjustSliding)(u.details,s)}function p(l,u,s){if(G(l,s,u)){var a=r(s.details,u);a&&Object($.isFiniteNumber)(a.start)&&(H.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($.isFiniteNumber)(O)&&(H.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(T){o(T,O)}),l.fragmentHint&&o(l.fragmentHint,O),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/utils/ewma.ts"),H=function(){function P(G,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 $.default(G),this.fast_=new $.default(r)}var K=P.prototype;return K.update=function(r,R){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new $.default(r,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new $.default(R,m.getEstimate(),m.getTotalWeight()))},K.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)},K.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},P}();X.default=H},"./src/utils/ewma.ts":function(se,X,N){"use strict";N.r(X);var $=function(){function H(K,G,r){G===void 0&&(G=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=G,this.totalWeight_=r}var P=H.prototype;return P.sample=function(G,r){var R=Math.pow(this.alpha_,G);this.estimate_=r*(1-R)+R*this.estimate_,this.totalWeight_+=G},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},H}();X.default=$},"./src/utils/fetch-loader.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"fetchSupported",function(){return o});var $=N("./src/polyfills/number.ts"),H=N("./src/loader/load-stats.ts"),P=N("./src/demux/chunk-cache.ts");function K(a,O){a.prototype=Object.create(O.prototype),a.prototype.constructor=a,m(a,O)}function G(a){var O=typeof Map=="function"?new Map:void 0;return G=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)},G(a)}function r(a,O,T){return R()?r=Reflect.construct:r=function(D,L,A){var C=[null];C.push.apply(C,L);var x=Function.bind.apply(D,C),d=new x;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(T){return T.__proto__||Object.getPrototypeOf(T)},p(a)}function h(){return h=Object.assign||function(a){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var S in T)Object.prototype.hasOwnProperty.call(T,S)&&(a[S]=T[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(T){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=T.fetchSetup||u,this.controller=new self.AbortController,this.stats=new H.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 x=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,x),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 j=b.status,U=b.statusText;throw new s(U||"fetch, bad network response",j,b)}return C.loading.first=Math.max(self.performance.now(),C.loading.start),C.total=parseInt(b.headers.get("Content-Length")||"0"),d&&Object($.isFiniteNumber)(D.highWaterMark)?A.loadProgressively(b,C,S,D.highWaterMark,d):w?b.arrayBuffer():b.text()}).then(function(b){var j=A.response;self.clearTimeout(A.requestTimeout),C.loading.end=Math.max(self.performance.now(),C.loading.first),C.loaded=C.total=b[y];var U={url:j.url,data:b};d&&!Object($.isFiniteNumber)(D.highWaterMark)&&d(C,S,b,j),L.onSuccess(U,C,S,j)}).catch(function(b){if(self.clearTimeout(A.requestTimeout),C.aborted)return;var j=b.code||0;L.onError({code:j,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 x=new P.default,d=S.body.getReader(),w=function y(){return d.read().then(function(b){if(b.done)return x.dataLength&&C(D,L,x.flush(),S),Promise.resolve(new ArrayBuffer(0));var j=b.value,U=j.length;return D.loaded+=U,U<A||x.dataLength?(x.push(j),x.dataLength>=A&&C(D,L,x.flush(),S)):C(D,L,j,S),y()}).catch(function(){return Promise.reject()})};return w()},a}();function l(a,O){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(h({},a.headers))};return a.rangeEnd&&T.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),T}function u(a,O){return new self.Request(a.url,O)}var s=function(a){K(O,a);function O(T,S,D){var L;return L=a.call(this,T)||this,L.code=void 0,L.details=void 0,L.code=S,L.details=D,L}return O}(G(Error));X.default=f},"./src/utils/imsc1-ttml-parser.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"IMSC1_CODEC",function(){return v}),N.d(X,"parseIMSC1",function(){return o});var $=N("./src/utils/mp4-tools.ts"),H=N("./src/utils/vttparser.ts"),P=N("./src/utils/vttcue.ts"),K=N("./src/demux/id3.ts"),G=N("./src/utils/timescale-conversion.ts"),r=N("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(A){for(var C=1;C<arguments.length;C++){var x=arguments[C];for(var d in x)Object.prototype.hasOwnProperty.call(x,d)&&(A[d]=x[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,x,d,w){var y=Object($.findBox)(new Uint8Array(A),["mdat"]);if(y.length===0){w(new Error("Could not parse IMSC1 mdat"));return}var b=y[0],j=Object(K.utf8ArrayToStr)(new Uint8Array(A,b.start,b.end-b.start)),U=Object(G.toTimescaleFromScale)(C,1,x);try{d(f(j,U))}catch(E){w(E)}}function f(A,C){var x=new DOMParser,d=x.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},{}),j=w.getAttribute("xml:space")!=="preserve",U=u(l(w,"styling","style")),E=u(l(w,"layout","region")),M=l(w,"body","[begin]");return[].map.call(M,function(I){var g=s(I,j);if(!g||!I.hasAttribute("begin"))return null;var W=S(I.getAttribute("begin"),b),J=S(I.getAttribute("dur"),b),le=S(I.getAttribute("end"),b);if(W===null)throw T(I);if(le===null){if(J===null)throw T(I);le=W+J}var ce=new P.default(W-C,le-C,g);ce.id=Object(r.generateCueId)(ce.startTime,ce.endTime,ce.text);var Re=E[I.getAttribute("region")],Ee=U[I.getAttribute("style")];ce.position=10,ce.size=80;var Oe=a(Re,Ee),Te=Oe.textAlign;if(Te){var Le=h[Te];Le&&(ce.lineAlign=Le),ce.align=Te}return R(ce,Oe),ce}).filter(function(I){return I!==null})}function l(A,C,x){var d=A.getElementsByTagName(C)[0];return d?[].slice.call(d.querySelectorAll(x)):[]}function u(A){return A.reduce(function(C,x){var d=x.getAttribute("xml:id");return d&&(C[d]=x),C},{})}function s(A,C){return[].slice.call(A.childNodes).reduce(function(x,d,w){var y;return d.nodeName==="br"&&w?x+`
|
|
`:(y=d.childNodes)!==null&&y!==void 0&&y.length?s(d,C):C?x+d.textContent.trim().replace(/\s+/g," "):x+d.textContent},"")}function a(A,C){var x="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(w,y){var b=O(C,x,y)||O(A,x,y);return b&&(w[y]=b),w},{})}function O(A,C,x){return A.hasAttributeNS(C,x)?A.getAttributeNS(C,x):null}function T(A){return new Error("Could not parse ttml timestamp "+A)}function S(A,C){if(!A)return null;var x=Object(H.parseTimeStamp)(A);return x===null&&(m.test(A)?x=D(A,C):p.test(A)&&(x=L(A,C))),x}function D(A,C){var x=m.exec(A),d=(x[4]|0)+(x[5]|0)/C.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+d/C.frameRate}function L(A,C){var x=p.exec(A),d=Number(x[1]),w=x[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(se,X,N){"use strict";N.r(X),N.d(X,"enableLogs",function(){return r}),N.d(X,"logger",function(){return R});var $=function(){},H={trace:$,debug:$,log:$,warn:$,info:$,error:$},P=H;function K(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):$}function G(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){P[o]=v[o]?v[o].bind(v):K(o)})}function r(v){if(self.console&&v===!0||typeof v=="object"){G(v,"debug","log","info","warn","error");try{P.log()}catch(m){P=H}}else P=H}var R=P},"./src/utils/mediakeys-helper.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"KeySystems",function(){return $}),N.d(X,"requestMediaKeySystemAccess",function(){return H});var $;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})($||($={}));var H=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"getMediaSource",function(){return $});function $(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"bin2str",function(){return G}),N.d(X,"readUint16",function(){return r}),N.d(X,"readUint32",function(){return R}),N.d(X,"writeUint32",function(){return v}),N.d(X,"findBox",function(){return m}),N.d(X,"parseSegmentIndex",function(){return p}),N.d(X,"parseInitSegment",function(){return h}),N.d(X,"getStartDTS",function(){return o}),N.d(X,"getDuration",function(){return f}),N.d(X,"computeRawDurationFromSamples",function(){return l}),N.d(X,"offsetStartDTS",function(){return u}),N.d(X,"segmentValidRange",function(){return s}),N.d(X,"appendUint8Array",function(){return a});var $=N("./src/utils/typed-array.ts"),H=N("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,K=[].push;function G(O){return String.fromCharCode.apply(null,O)}function r(O,T){"data"in O&&(T+=O.start,O=O.data);var S=O[T]<<8|O[T+1];return S<0?65536+S:S}function R(O,T){"data"in O&&(T+=O.start,O=O.data);var S=O[T]<<24|O[T+1]<<16|O[T+2]<<8|O[T+3];return S<0?4294967296+S:S}function v(O,T,S){"data"in O&&(T+=O.start,O=O.data),O[T]=S>>24,O[T+1]=S>>16&255,O[T+2]=S>>8&255,O[T+3]=S&255}function m(O,T){var S=[];if(!T.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 x=R(D,C),d=G(D.subarray(C+4,C+8)),w=x>1?C+x:A;if(d===T[0])if(T.length===1)S.push({data:D,start:C+8,end:w});else{var y=m({data:D,start:C+8,end:w},T.slice(1));y.length&&K.apply(S,y)}C=w}return S}function p(O){var T=m(O,["moov"]),S=T[0],D=S?S.end:null,L=m(O,["sidx"]);if(!L||!L[0])return null;var A=[],C=L[0],x=C.data[0],d=x===0?8:16,w=R(C,d);d+=4;var y=0,b=0;x===0?d+=8:d+=16,d+=2;var j=C.end+b,U=r(C,d);d+=2;for(var E=0;E<U;E++){var M=d,I=R(C,M);M+=4;var g=I&2147483647,W=(I&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=R(C,M);M+=4,A.push({referenceSize:g,subsegmentDuration:J,info:{duration:J/w,start:j,end:j+g-1}}),j+=g,M+=4,d=M}return{earliestPresentationTime:y,timescale:w,version:x,referencesCount:U,references:A,moovEndOffset:D}}function h(O){for(var T=[],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],x=C===0?12:20,d=R(A,x),w=m(L,["mdia","mdhd"])[0];if(w){C=w.data[w.start],x=C===0?12:20;var y=R(w,x),b=m(L,["mdia","hdlr"])[0];if(b){var j=G(b.data.subarray(b.start+8,b.start+12)),U={soun:H.ElementaryStreamTypes.AUDIO,vide:H.ElementaryStreamTypes.VIDEO}[j];if(U){var E=m(L,["mdia","minf","stbl","stsd"])[0],M=void 0;E&&(M=G(E.data.subarray(E.start+12,E.start+16))),T[d]={timescale:y,type:U},T[U]={timescale:y,id:d,codec:M}}}}}}var I=m(O,["moov","mvex","trex"]);return I.forEach(function(g){var W=R(g,4),J=T[W];J&&(J.default={duration:R(g,12),flags:R(g,20)})}),T}function o(O,T){return m(T,["moof","traf"]).reduce(function(S,D){var L=m(D,["tfdt"])[0],A=L.data[L.start],C=m(D,["tfhd"]).reduce(function(x,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 j=y.timescale||9e4,U=b/j;if(isFinite(U)&&(x===null||U<x))return U}return x},null);return C!==null&&isFinite(C)&&(S===null||C<S)?C:S},null)||0}function f(O,T){for(var S=0,D=0,L=0,A=m(O,["moof","traf"]),C=0;C<A.length;C++){var x=A[C],d=m(x,["tfhd"])[0],w=R(d,4),y=T[w];if(!y)continue;var b=y.default,j=R(d,0)|(b==null?void 0:b.flags),U=b==null?void 0:b.duration;j&8&&(j&2?U=R(d,12):U=R(d,8));for(var E=y.timescale||9e4,M=m(x,["trun"]),I=0;I<M.length;I++){if(U){var g=R(M[I],4);S=U*g}else S=l(M[I]);y.type===H.ElementaryStreamTypes.VIDEO?D+=S/E:y.type===H.ElementaryStreamTypes.AUDIO&&(L+=S/E)}}if(D===0&&L===0){var W=p(O);if(W!=null&&W.references)return W.references.reduce(function(J,le){return J+le.info.duration||0},0)}return D||L}function l(O){var T=R(O,0),S=8;T&1&&(S+=4),T&4&&(S+=4);for(var D=0,L=R(O,4),A=0;A<L;A++){if(T&256){var C=R(O,S);D+=C,S+=4}T&512&&(S+=4),T&1024&&(S+=4),T&2048&&(S+=4)}return D}function u(O,T,S){m(T,["moof","traf"]).forEach(function(D){m(D,["tfhd"]).forEach(function(L){var A=R(L,4),C=O[A];if(!C)return;var x=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*x);else{y*=Math.pow(2,32),y+=R(d,8),y-=S*x,y=Math.max(y,0);var b=Math.floor(y/(P+1)),j=Math.floor(y%(P+1));v(d,4,b),v(d,8,j)}})})})}function s(O){var T={valid:null,remainder:null},S=m(O,["moof"]);if(S){if(S.length<2)return T.remainder=O,T}else return T;var D=S[S.length-1];return T.valid=Object($.sliceUint8)(O,0,D.start-8),T.remainder=Object($.sliceUint8)(O,D.start-8),T}function a(O,T){var S=new Uint8Array(O.length+T.length);return S.set(O),S.set(T,O.length),S}},"./src/utils/output-filter.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"default",function(){return $});var $=function(){function H(K,G){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=G}var P=H.prototype;return P.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},P.newCue=function(G,r,R){(this.startTime===null||this.startTime>G)&&(this.startTime=G),this.endTime=r,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},H}()},"./src/utils/texttrack-utils.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"sendAddTrackEvent",function(){return H}),N.d(X,"addCueToTrack",function(){return P}),N.d(X,"clearCurrentCues",function(){return K}),N.d(X,"removeCuesInRange",function(){return G}),N.d(X,"getCuesInRange",function(){return R});var $=N("./src/utils/logger.ts");function H(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 P(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){$.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 K(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 G(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(se,X,N){"use strict";N.r(X);var $={toString:function(P){for(var K="",G=P.length,r=0;r<G;r++)K+="["+P.start(r).toFixed(3)+","+P.end(r).toFixed(3)+"]";return K}};X.default=$},"./src/utils/timescale-conversion.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"toTimescaleFromBase",function(){return H}),N.d(X,"toTimescaleFromScale",function(){return P}),N.d(X,"toMsFromMpegTsClock",function(){return K}),N.d(X,"toMpegTsClockFromTimescale",function(){return G});var $=9e4;function H(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 P(r,R,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),H(r,R,1/v,m)}function K(r,R){return R===void 0&&(R=!1),H(r,1e3,1/$,R)}function G(r,R){return R===void 0&&(R=1),H(r,$,1/R)}},"./src/utils/typed-array.ts":function(se,X,N){"use strict";N.r(X),N.d(X,"sliceUint8",function(){return $});function $(H,P,K){return Uint8Array.prototype.slice?H.slice(P,K):new Uint8Array(Array.prototype.slice.call(H,P,K))}},"./src/utils/vttcue.ts":function(se,X,N){"use strict";N.r(X),X.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var $=["","lr","rl"],H=["start","middle","end","left","right"];function P(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 K(v){return P($,v)}function G(v){return P(H,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,T="",S=!0,D="auto",L="start",A=50,C="middle",x=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 T},set:function(y){var b=K(y);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=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=G(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=G(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 x},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");x=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},o,{get:function(){return d},set:function(y){var b=G(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(se,X,N){"use strict";N.r(X),N.d(X,"parseTimeStamp",function(){return P}),N.d(X,"fixLineBreaks",function(){return m}),N.d(X,"VTTParser",function(){return p});var $=N("./src/utils/vttcue.ts"),H=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 P(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 K=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 G(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],T=a[1];o(O,T)}}var r=new $.default(0,0,""),R=r.align==="middle"?"middle":"center";function v(h,o,f){var l=h;function u(){var O=P(h);if(O===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),O}function s(O,T){var S=new K;G(O,function(A,C){var x;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":x=C.split(","),S.integer(A,x[0]),S.percent(A,x[0])&&S.set("snapToLines",!1),S.alt(A,x[0],["auto"]),x.length===2&&S.alt("lineAlign",x[1],["start",R,"end"]);break;case"position":x=C.split(","),S.percent(A,x[0]),x.length===2&&S.alt("positionAlign",x[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/),T.region=S.get("region",null),T.vertical=S.get("vertical","");var D=S.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),T.line=D,T.lineAlign=S.get("lineAlign","start"),T.snapToLines=S.get("snapToLines",!0),T.size=S.get("size",100),T.align=S.get("align",R);var L=S.get("position","auto");L==="auto"&&r.position===50&&(L=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.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 H,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){G(L,function(A,C){},/:/)}try{var O="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;O=s();var T=O.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[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 $.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(se,X,N){"use strict";N.r(X),N.d(X,"generateCueId",function(){return p}),N.d(X,"parseWebVTT",function(){return o});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/vttparser.ts"),P=N("./src/demux/id3.ts"),K=N("./src/utils/timescale-conversion.ts"),G=N("./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($.isFiniteNumber)(u)||!Object($.isFiniteNumber)(s)||!Object($.isFiniteNumber)(a)||!Object($.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(;(T=O)!==null&&T!==void 0&&T.new;){var T;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,T,S){var D=new H.VTTParser,L=Object(P.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(r,`
|
|
`).split(`
|
|
`),A=[],C=Object(K.toMpegTsClockFromTimescale)(l,u),x="00:00.000",d=0,w=0,y,b=!0,j=!1;D.oncue=function(U){var E=s[a],M=s.ccOffset,I=(d-C)/9e4;if(E!=null&&E.new&&(w!==void 0?M=s.ccOffset=E.start:h(s,a,I)),I&&(M=I-s.presentationOffset),j){var g=U.endTime-U.startTime,W=Object(G.normalizePts)((U.startTime+M-w)*9e4,O*9e4)/9e4;U.startTime=W,U.endTime=W+g}var J=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(J)),U.id||(U.id=p(U.startTime,U.endTime,J)),U.endTime>0&&A.push(U)},D.onparsingerror=function(U){y=U},D.onflush=function(){if(y){S(y);return}T(A)},L.forEach(function(U){if(b)if(R(U,"X-TIMESTAMP-MAP=")){b=!1,j=!0,U.substr(16).split(",").forEach(function(E){R(E,"LOCAL:")?x=E.substr(6):R(E,"MPEGTS:")&&(d=parseInt(E.substr(7)))});try{w=v(x)/1e3}catch(E){j=!1,y=E}return}else U===""&&(b=!1);D.parse(U+`
|
|
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(se,X,N){"use strict";N.r(X);var $=N("./src/utils/logger.ts"),H=N("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,K=function(){function G(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 H.LoadStats,this.retryDelay=0}var r=G.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?($.logger.error(f+" while loading "+v.url),this.callbacks.onError({code:f,text:m.statusText},v,m)):($.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(){$.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&&P.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},G}();X.default=K}}).default})},vHTk:function(Ye,we,Q){Ye.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},we55:function(Ye,we,Q){Ye.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(Ye,we,Q){"use strict";Q.d(we,"c",function(){return H}),Q.d(we,"b",function(){return P}),Q.d(we,"d",function(){return K}),Q.d(we,"a",function(){return r}),Q.d(we,"e",function(){return R});var se=Q("9og8"),X=Q("WmNS"),N=Q.n(X),$=Q("ErOA");function H(v){return Object($.c)("libraries/".concat(v,".json"))}function P(){return Object($.c)("library_tags.json")}function K(v){return G.apply(this,arguments)}function G(){return G=Object(se.a)(N.a.mark(function v(m){var p;return N.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Object($.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)})),G.apply(this,arguments)}function r(v){return Object($.f)("libraries.json",v)}function R(v,m){return Object($.g)("libraries/".concat(v,".json"),m)}},y5JW:function(Ye,we,Q){"use strict";Q.d(we,"c",function(){return f}),Q.d(we,"a",function(){return l});var se=Q("DZo9"),X=Q("8z0m"),N=Q("+L6B"),$=Q("2/Rp"),H=Q("9og8"),P=Q("miYZ"),K=Q("tsqr"),G=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]}we.b=function(u){var s=u.value,a=s===void 0?[]:s,O=u.action,T=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,x=u.accept,d=x===void 0?null:x,w={multiple:!1,fileList:a,accept:d,withCredentials:!0,beforeUpload:function(j){var U=j.size/1024/1024;return!0},action:"".concat(h.a.API_SERVER,"/api/attachments.json"),onChange:function(j){var U,E,M=Object(r.a)(j.fileList);if(M=M.map(function(W){return W.name.indexOf(f)===-1&&(W.name="".concat(W.name).concat(f).concat(l(W.size))),Object(G.a)({},W)}),j.file.status==="done"&&((U=j.file)===null||U===void 0||((E=U.response)===null||E===void 0)?void 0:E.status)===-1){var I,g;K.b.error((I=j.file)===null||I===void 0||((g=I.response)===null||g===void 0)?void 0:g.message),T([]);return}T(M)},onRemove:function(){var b=Object(H.a)(v.a.mark(function U(E){var M,I,g;return v.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(M=E.size/1024/1024,!(E.status==="uploading")){J.next=3;break}return J.abrupt("return",!0);case 3:if(M<L){J.next=7;break}return J.abrupt("return",!0);case 7:if(I=E.response?E.response.id:E.uid,!I){J.next=15;break}return J.next=11,Object(o.d)(E.response?E.response.id:E.id);case 11:return g=J.sent,J.abrupt("return",g);case 15:return J.abrupt("return",!0);case 16:case"end":return J.stop()}},U)}));function j(U){return b.apply(this,arguments)}return j}()};function y(b){b.preventDefault(),b.stopPropagation()}return p.a.createElement("div",{className:"single-upload ".concat(S||"")},p.a.createElement(X.a,w,p.a.createElement($.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(Ye,we,Q){}}]);
|