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.
139 lines
838 KiB
139 lines
838 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[205,6,7,20],{"+NIl":function(ot,Xe,te){(function(oe){oe(te("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(H,L){"use strict";function z(A,b){A.cmdState.push(b)}function I(A){return A.cmdState.length>0?A.cmdState[A.cmdState.length-1]:null}function P(A){var b=A.cmdState.pop();b&&b.closeBracket()}function B(A){for(var b=A.cmdState,g=b.length-1;g>=0;g--){var c=b[g];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function N(A,b,g){return function(){this.name=A,this.bracketNo=0,this.style=b,this.styles=g,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var _={};_.importmodule=N("importmodule","tag",["string","builtin"]),_.documentclass=N("documentclass","tag",["","atom"]),_.usepackage=N("usepackage","tag",["atom"]),_.begin=N("begin","tag",["atom"]),_.end=N("end","tag",["atom"]),_.label=N("label","tag",["atom"]),_.ref=N("ref","tag",["atom"]),_.eqref=N("eqref","tag",["atom"]),_.cite=N("cite","tag",["atom"]),_.bibitem=N("bibitem","tag",["atom"]),_.Bibitem=N("Bibitem","tag",["atom"]),_.RBibitem=N("RBibitem","tag",["atom"]),_.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function O(A,b){A.f=b}function y(A,b){var g;if(A.match(/^\\[a-zA-Z@]+/)){var c=A.current().slice(1);return g=_.hasOwnProperty(c)?_[c]:_.DEFAULT,g=new g,z(b,g),O(b,R),g.style}if(A.match(/^\\[$&%#{}_]/))return"tag";if(A.match(/^\\[,;!\/\\]/))return"tag";if(A.match("\\["))return O(b,function(u,d){return C(u,d,"\\]")}),"keyword";if(A.match("\\("))return O(b,function(u,d){return C(u,d,"\\)")}),"keyword";if(A.match("$$"))return O(b,function(u,d){return C(u,d,"$$")}),"keyword";if(A.match("$"))return O(b,function(u,d){return C(u,d,"$")}),"keyword";var o=A.next();if(o=="%")return A.skipToEnd(),"comment";if(o=="}"||o=="]"){if(g=I(b),g)g.closeBracket(o),O(b,R);else return"error";return"bracket"}else return o=="{"||o=="["?(g=_.DEFAULT,g=new g,z(b,g),"bracket"):/\d/.test(o)?(A.eatWhile(/[\w.%]/),"atom"):(A.eatWhile(/[\w\-_]/),g=B(b),g.name=="begin"&&(g.argument=A.current()),g.styleIdentifier())}function C(A,b,g){if(A.eatSpace())return null;if(g&&A.match(g))return O(b,y),"keyword";if(A.match(/^\\[a-zA-Z@]+/))return"tag";if(A.match(/^[a-zA-Z]+/))return"variable-2";if(A.match(/^\\[$&%#{}_]/))return"tag";if(A.match(/^\\[,;!\/]/))return"tag";if(A.match(/^[\^_&]/))return"tag";if(A.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(A.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=A.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(A.skipToEnd(),"comment"):"error"}function R(A,b){var g=A.peek(),c;return g=="{"||g=="["?(c=I(b),c.openBracket(g),A.eat(g),O(b,y),"bracket"):/[ \t\r]/.test(g)?(A.eat(g),null):(O(b,y),P(b),y(A,b))}return{startState:function(){var A=L.inMathMode?function(b,g){return C(b,g)}:y;return{cmdState:[],f:A}},copyState:function(A){return{cmdState:A.cmdState.slice(),f:A.f}},token:function(A,b){return b.f(A,b)},blankLine:function(A){A.f=y,A.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"19Vz":function(ot,Xe,te){(function(oe){oe(te("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(N,_,O){var y=O&&O!=oe.Init;if(_&&!y)N.on("blur",I),N.on("change",P),N.on("swapDoc",P),oe.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){z(N)}),P(N);else if(!_&&y){N.off("blur",I),N.off("change",P),N.off("swapDoc",P),oe.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),H(N);var C=N.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}_&&!N.hasFocus()&&I(N)});function H(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function L(N){H(N);var _=N.state.placeholder=document.createElement("pre");_.style.cssText="height: 0; overflow: visible",_.style.direction=N.getOption("direction"),_.className="CodeMirror-placeholder CodeMirror-line-like";var O=N.getOption("placeholder");typeof O=="string"&&(O=document.createTextNode(O)),_.appendChild(O),N.display.lineSpace.insertBefore(_,N.display.lineSpace.firstChild)}function z(N){setTimeout(function(){var _=!1,O=N.getInputField();O.nodeName=="TEXTAREA"?_=!O.value:N.lineCount()==1&&(_=!/[^\u200b]/.test(O.querySelector(".CodeMirror-line").textContent)),_?L(N):H(N)},20)}function I(N){B(N)&&L(N)}function P(N){var _=N.getWrapperElement(),O=B(N);_.className=_.className.replace(" CodeMirror-empty","")+(O?" CodeMirror-empty":""),O?L(N):H(N)}function B(N){return N.lineCount()===1&&N.getLine(0)===""}})},"1eCo":function(ot,Xe,te){(function(oe){oe(te("VrN/"))})(function(oe){"use strict";var H={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},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(z,I){var P=z.indentUnit,B={},N=I.htmlMode?H:L;for(var _ in N)B[_]=N[_];for(var _ in I)B[_]=I[_];var O,y;function C(i,x){function m(U){return x.tokenize=U,U(i,x)}var E=i.next();if(E=="<")return i.eat("!")?i.eat("[")?i.match("CDATA[")?m(b("atom","]]>")):null:i.match("--")?m(b("comment","-->")):i.match("DOCTYPE",!0,!0)?(i.eatWhile(/[\w\._\-]/),m(g(1))):null:i.eat("?")?(i.eatWhile(/[\w\._\-]/),x.tokenize=b("meta","?>"),"meta"):(O=i.eat("/")?"closeTag":"openTag",x.tokenize=R,"tag bracket");if(E=="&"){var D;return i.eat("#")?i.eat("x")?D=i.eatWhile(/[a-fA-F\d]/)&&i.eat(";"):D=i.eatWhile(/[\d]/)&&i.eat(";"):D=i.eatWhile(/[\w\.\-:]/)&&i.eat(";"),D?"atom":"error"}else return i.eatWhile(/[^&<]/),null}C.isInText=!0;function R(i,x){var m=i.next();if(m==">"||m=="/"&&i.eat(">"))return x.tokenize=C,O=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return O="equals",null;if(m=="<"){x.tokenize=C,x.state=d,x.tagName=x.tagStart=null;var E=x.tokenize(i,x);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(m)?(x.tokenize=A(m),x.stringStartCol=i.column(),x.tokenize(i,x)):(i.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function A(i){var x=function(m,E){for(;!m.eol();)if(m.next()==i){E.tokenize=R;break}return"string"};return x.isInAttribute=!0,x}function b(i,x){return function(m,E){for(;!m.eol();){if(m.match(x)){E.tokenize=C;break}m.next()}return i}}function g(i){return function(x,m){for(var E;(E=x.next())!=null;){if(E=="<")return m.tokenize=g(i+1),m.tokenize(x,m);if(E==">")if(i==1){m.tokenize=C;break}else return m.tokenize=g(i-1),m.tokenize(x,m)}return"meta"}}function c(i,x,m){this.prev=i.context,this.tagName=x,this.indent=i.indented,this.startOfLine=m,(B.doNotIndent.hasOwnProperty(x)||i.context&&i.context.noIndent)&&(this.noIndent=!0)}function o(i){i.context&&(i.context=i.context.prev)}function u(i,x){for(var m;;){if(!i.context)return;if(m=i.context.tagName,!B.contextGrabbers.hasOwnProperty(m)||!B.contextGrabbers[m].hasOwnProperty(x))return;o(i)}}function d(i,x,m){return i=="openTag"?(m.tagStart=x.column(),T):i=="closeTag"?p:d}function T(i,x,m){return i=="word"?(m.tagName=x.current(),y="tag",v):B.allowMissingTagName&&i=="endTag"?(y="tag bracket",v(i,x,m)):(y="error",T)}function p(i,x,m){if(i=="word"){var E=x.current();return m.context&&m.context.tagName!=E&&B.implicitlyClosed.hasOwnProperty(m.context.tagName)&&o(m),m.context&&m.context.tagName==E||B.matchClosing===!1?(y="tag",h):(y="tag error",S)}else return B.allowMissingTagName&&i=="endTag"?(y="tag bracket",h(i,x,m)):(y="error",S)}function h(i,x,m){return i!="endTag"?(y="error",h):(o(m),d)}function S(i,x,m){return y="error",h(i,x,m)}function v(i,x,m){if(i=="word")return y="attribute",l;if(i=="endTag"||i=="selfcloseTag"){var E=m.tagName,D=m.tagStart;return m.tagName=m.tagStart=null,i=="selfcloseTag"||B.autoSelfClosers.hasOwnProperty(E)?u(m,E):(u(m,E),m.context=new c(m,E,D==m.indented)),d}return y="error",v}function l(i,x,m){return i=="equals"?f:(B.allowMissing||(y="error"),v(i,x,m))}function f(i,x,m){return i=="string"?s:i=="word"&&B.allowUnquoted?(y="string",v):(y="error",v(i,x,m))}function s(i,x,m){return i=="string"?s:v(i,x,m)}return{startState:function(i){var x={tokenize:C,state:d,indented:i||0,tagName:null,tagStart:null,context:null};return i!=null&&(x.baseIndent=i),x},token:function(i,x){if(!x.tagName&&i.sol()&&(x.indented=i.indentation()),i.eatSpace())return null;O=null;var m=x.tokenize(i,x);return(m||O)&&m!="comment"&&(y=null,x.state=x.state(O||m,i,x),y&&(m=y=="error"?m+" error":y)),m},indent:function(i,x,m){var E=i.context;if(i.tokenize.isInAttribute)return i.tagStart==i.indented?i.stringStartCol+1:i.indented+P;if(E&&E.noIndent)return oe.Pass;if(i.tokenize!=R&&i.tokenize!=C)return m?m.match(/^(\s*)/)[0].length:0;if(i.tagName)return B.multilineTagIndentPastTag!==!1?i.tagStart+i.tagName.length+2:i.tagStart+P*(B.multilineTagIndentFactor||1);if(B.alignCDATA&&/<!\[CDATA\[/.test(x))return 0;var D=x&&/^<(\/)?([\w_:\.-]*)/.exec(x);if(D&&D[1])for(;E;)if(E.tagName==D[2]){E=E.prev;break}else if(B.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(D)for(;E;){var U=B.contextGrabbers[E.tagName];if(U&&U.hasOwnProperty(D[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+P:i.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:B.htmlMode?"html":"xml",helperType:B.htmlMode?"html":"xml",skipAttribute:function(i){i.state==f&&(i.state=v)},xmlCurrentTag:function(i){return i.tagName?{name:i.tagName,close:i.type=="closeTag"}:null},xmlCurrentContext:function(i){for(var x=[],m=i.context;m;m=m.prev)m.tagName&&x.push(m.tagName);return x.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(ot,Xe,te){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),H=new Uint8Array(16);function L(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe(H)}var z=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function I(R){return typeof R=="string"&&z.test(R)}for(var P=I,B=[],N=0;N<256;++N)B.push((N+256).toString(16).substr(1));function _(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=(B[R[A+0]]+B[R[A+1]]+B[R[A+2]]+B[R[A+3]]+"-"+B[R[A+4]]+B[R[A+5]]+"-"+B[R[A+6]]+B[R[A+7]]+"-"+B[R[A+8]]+B[R[A+9]]+"-"+B[R[A+10]]+B[R[A+11]]+B[R[A+12]]+B[R[A+13]]+B[R[A+14]]+B[R[A+15]]).toLowerCase();if(!P(b))throw TypeError("Stringified UUID is invalid");return b}var O=_;function y(R,A,b){R=R||{};var g=R.random||(R.rng||L)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,A){b=b||0;for(var c=0;c<16;++c)A[b+c]=g[c];return A}return O(g)}var C=Xe.a=y},"7ahc":function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return T});var oe=te("k1fw"),H=te("0Owb"),L=te("+L6B"),z=te("2/Rp"),I=te("y8nQ"),P=te("Vl3Y"),B=te("tJVT"),N=te("OaEy"),_=te("2fM7"),O=te("cDcd"),y=te.n(O),C=te("VrN/"),R=te.n(C),A=te("p77/"),b=te.n(A),g=te("c5Ni"),c=te.n(g),o=_.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};Xe.b=function(p){var h=p.callback,S=p.onCancel,v=Object(O.useState)("python"),l=Object(B.a)(v,2),f=l[0],s=l[1];function i(m){s(d[m][1])}function x(m){h(m)}return y.a.createElement(P.a,Object(H.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:x}),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(_.a,{onChange:i},Object.keys(d).map(function(m){return y.a.createElement(o,{key:m,value:m},d[m][0])}))),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(T,{mode:f})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(z.a,{type:"ghost",onClick:S},"\u53D6\u6D88")))};function T(p){var h=p.value,S=p.onChange,v=p.mode,l=p.options,f=l===void 0?{}:l,s=Object(O.useRef)(),i=Object(O.useState)(),x=Object(B.a)(i,2),m=x[0],E=x[1];return Object(O.useEffect)(function(){if(m){function D(U){var j=U.getValue();S&&S(j)}return m.on("change",D),function(){m.off("change",D)}}},[m,S]),Object(O.useEffect)(function(){m&&m.setOption("mode",v)},[m,v]),Object(O.useEffect)(function(){m&&((h!==m.getValue()||h==="")&&setTimeout(function(){m.setValue(h||" ")},300))},[m,h]),Object(O.useEffect)(function(){if(s.current&&!m){var D=R.a.fromTextArea(s.current,Object(oe.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},f));E(D)}},[s.current,m]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:s}))}},"7ixt":function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return L});var oe={adjustX:1,adjustY:1},H=[0,0],L={left:{points:["cr","cl"],overflow:oe,offset:[-4,0],targetOffset:H},right:{points:["cl","cr"],overflow:oe,offset:[4,0],targetOffset:H},top:{points:["bc","tc"],overflow:oe,offset:[0,-4],targetOffset:H},bottom:{points:["tc","bc"],overflow:oe,offset:[0,4],targetOffset:H},topLeft:{points:["bl","tl"],overflow:oe,offset:[0,-4],targetOffset:H},leftTop:{points:["tr","tl"],overflow:oe,offset:[-4,0],targetOffset:H},topRight:{points:["br","tr"],overflow:oe,offset:[0,-4],targetOffset:H},rightTop:{points:["tl","tr"],overflow:oe,offset:[4,0],targetOffset:H},bottomRight:{points:["tr","br"],overflow:oe,offset:[0,4],targetOffset:H},rightBottom:{points:["bl","br"],overflow:oe,offset:[4,0],targetOffset:H},bottomLeft:{points:["tl","bl"],overflow:oe,offset:[0,4],targetOffset:H},leftBottom:{points:["br","bl"],overflow:oe,offset:[-4,0],targetOffset:H}},z=L},"815F":function(ot,Xe,te){"use strict";te.d(Xe,"e",function(){return B}),te.d(Xe,"c",function(){return _}),te.d(Xe,"d",function(){return O}),te.d(Xe,"a",function(){return C}),te.d(Xe,"f",function(){return R}),te.d(Xe,"b",function(){return A});var oe=te("KQm4"),H=te("VTBJ"),L=te("Ff2n"),z=te("Zm9Q"),I=te("Kwbf"),P=te("OZM5");function B(b,g){return b!=null?b:g}function N(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=new Map;function c(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(o||[]).forEach(function(d){var T=d.key,p=d.children;Object(I.a)(T!=null,"Tree node must have a certain key: [".concat(u).concat(T,"]"));var h=String(T);Object(I.a)(!g.has(h)||T===null||T===void 0,"Same 'key' exist in the Tree: ".concat(h)),g.set(h,!0),c(p,"".concat(u).concat(h," > "))})}c(b)}function _(b){function g(c){var o=Object(z.a)(c);return o.map(function(u){if(!Object(P.i)(u))return Object(I.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var d=u.key,T=u.props,p=T.children,h=Object(L.a)(T,["children"]),S=Object(H.a)({key:d},h),v=g(p);return v.length&&(S.children=v),S}).filter(function(u){return u})}return g(b)}function O(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(g===!0?[]:g),o=[];function u(d){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(p,h){var S=Object(P.h)(T?T.pos:"0",h),v=B(p.key,S),l=Object(H.a)(Object(H.a)({},p),{},{parent:T,pos:S,children:null,data:p,isStart:[].concat(Object(oe.a)(T?T.isStart:[]),[h===0]),isEnd:[].concat(Object(oe.a)(T?T.isEnd:[]),[h===d.length-1])});return o.push(l),g===!0||c.has(v)?l.children=u(p.children||[],l):l.children=[],l})}return u(b),o}function y(b,g,c){var o;c?typeof c=="string"?o=function(T){return T[c]}:typeof c=="function"&&(o=function(T){return c(T)}):o=function(T,p){return B(T.key,p)};function u(d,T,p){var h=d?d.children:b,S=d?Object(P.h)(p.pos,T):"0";if(d){var v=o(d,S),l={node:d,index:T,pos:S,key:v,parentPos:p.node?p.pos:null,level:p.level+1};g(l)}h&&h.forEach(function(f,s){u(f,s,{node:d,pos:S,level:p?p.level+1:-1})})}u(null)}function C(b){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=g.initWrapper,o=g.processEntity,u=g.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,T={},p={},h={posEntities:T,keyEntities:p};return c&&(h=c(h)||h),y(b,function(S){var v=S.node,l=S.index,f=S.pos,s=S.key,i=S.parentPos,x=S.level,m={node:v,index:l,key:s,pos:f,level:x},E=B(s,f);T[f]=m,p[E]=m,m.parent=T[i],m.parent&&(m.parent.children=m.parent.children||[],m.parent.children.push(m)),o&&o(m,h)},d),u&&u(h),h}function R(b,g){var c=g.expandedKeys,o=g.selectedKeys,u=g.loadedKeys,d=g.loadingKeys,T=g.checkedKeys,p=g.halfCheckedKeys,h=g.dragOverNodeKey,S=g.dropPosition,v=g.keyEntities,l=v[b],f={eventKey:b,expanded:c.indexOf(b)!==-1,selected:o.indexOf(b)!==-1,loaded:u.indexOf(b)!==-1,loading:d.indexOf(b)!==-1,checked:T.indexOf(b)!==-1,halfChecked:p.indexOf(b)!==-1,pos:String(l?l.pos:""),dragOver:h===b&&S===0,dragOverGapTop:h===b&&S===-1,dragOverGapBottom:h===b&&S===1};return f}function A(b){var g=b.data,c=b.expanded,o=b.selected,u=b.checked,d=b.loaded,T=b.loading,p=b.halfChecked,h=b.dragOver,S=b.dragOverGapTop,v=b.dragOverGapBottom,l=b.pos,f=b.active,s=Object(H.a)(Object(H.a)({},g),{},{expanded:c,selected:o,checked:u,loaded:d,loading:T,halfChecked:p,dragOver:h,dragOverGapTop:S,dragOverGapBottom:v,pos:l,active:f});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(I.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),b}}),s}},"8EBN":function(ot,Xe,te){(function(oe){oe(te("VrN/"))})(function(oe){"use strict";oe.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 H=0;H<oe.modeInfo.length;H++){var L=oe.modeInfo[H];L.mimes&&(L.mime=L.mimes[0])}oe.findModeByMIME=function(z){z=z.toLowerCase();for(var I=0;I<oe.modeInfo.length;I++){var P=oe.modeInfo[I];if(P.mime==z)return P;if(P.mimes){for(var B=0;B<P.mimes.length;B++)if(P.mimes[B]==z)return P}}if(/\+xml$/.test(z))return oe.findModeByMIME("application/xml");if(/\+json$/.test(z))return oe.findModeByMIME("application/json")},oe.findModeByExtension=function(z){z=z.toLowerCase();for(var I=0;I<oe.modeInfo.length;I++){var P=oe.modeInfo[I];if(P.ext){for(var B=0;B<P.ext.length;B++)if(P.ext[B]==z)return P}}},oe.findModeByFileName=function(z){for(var I=0;I<oe.modeInfo.length;I++){var P=oe.modeInfo[I];if(P.file&&P.file.test(z))return P}var B=z.lastIndexOf("."),N=B>-1&&z.substring(B+1,z.length);if(N)return oe.findModeByExtension(N)},oe.findModeByName=function(z){z=z.toLowerCase();for(var I=0;I<oe.modeInfo.length;I++){var P=oe.modeInfo[I];if(P.name.toLowerCase()==z)return P;if(P.alias){for(var B=0;B<P.alias.length;B++)if(P.alias[B].toLowerCase()==z)return P}}}})},"8Jsi":function(ot,Xe,te){"use strict";te.d(Xe,"d",function(){return i}),te.d(Xe,"a",function(){return Z}),te.d(Xe,"b",function(){return xe}),te.d(Xe,"c",function(){return le});var oe=te("1OyB"),H=te("vuIU"),L=te("Ji7U"),z=te("LK+K"),I=te("KQm4"),P=te("U8pU"),B=te("ODXe"),N=te("VTBJ"),_=te("cDcd"),O=te("qNPg"),y=te("2Qr1"),C=te("815F"),R=te("NvD2"),A=te("wPlo"),b=te("6cGi"),g=te("Kwbf"),c=te("4IlW"),o=te("YrtM"),u=te("fAei"),d=_.createContext(null);function T(Se,Re){if(!Se)return!0;var _e=Se.data,Ne=_e.disabled,Fe=_e.disableCheckbox;switch(Re){case"select":return Ne;case"checkbox":return Ne||Fe}return!1}function p(Se,Re){var _e=_.useCallback(function(Fe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",Ce=arguments.length>2?arguments[2]:void 0,He=Se.get(Fe);return!Ce&&T(He,Ue)?null:He},[Se]),Ne=_.useCallback(function(Fe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",Ce=arguments.length>2?arguments[2]:void 0,He=Re.get(Fe);return!Ce&&T(He,Ue)?null:He},[Re]);return[_e,Ne]}function h(Se){return _.useMemo(function(){var Re=new Map,_e=new Map;return Se.forEach(function(Ne){Re.set(Ne.key,Ne),_e.set(Ne.data.value,Ne)}),[Re,_e]},[Se])}var S={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},v=function(Re,_e){var Ne=Re.prefixCls,Fe=Re.height,Ue=Re.itemHeight,Ce=Re.virtual,He=Re.options,je=Re.flattenOptions,we=Re.multiple,Ie=Re.searchValue,ge=Re.onSelect,ce=Re.onToggleOpen,me=Re.open,q=Re.notFoundContent,ne=Re.onMouseEnter,se=_.useContext(d),pe=se.checkable,ye=se.checkedKeys,Le=se.halfCheckedKeys,Ke=se.treeExpandedKeys,Je=se.treeDefaultExpandAll,et=se.treeDefaultExpandedKeys,Qe=se.onTreeExpand,yt=se.treeIcon,st=se.showTreeIcon,rt=se.switcherIcon,Tt=se.treeLine,mt=se.treeNodeFilterProp,vt=se.loadData,bt=se.treeLoadedKeys,ft=se.treeMotion,At=se.onTreeLoad,Ut=_.useRef(),Wt=Object(o.a)(function(){return He},[me,He],function(Zt,jt){return jt[0]&&Zt[1]!==jt[1]}),Jt=h(je),Rt=Object(B.a)(Jt,2),Lr=Rt[0],Qt=Rt[1],zt=p(Lr,Qt),dr=Object(B.a)(zt,2),_t=dr[0],nt=dr[1],Yt=_.useMemo(function(){return ye.map(function(Zt){var jt=nt(Zt);return jt?jt.key:null})},[ye]),gr=_.useMemo(function(){return pe?{checked:Yt,halfChecked:Le}:null},[Yt,Le,pe]);_.useEffect(function(){if(me&&!we&&Yt.length){var Zt;(Zt=Ut.current)===null||Zt===void 0||Zt.scrollTo({key:Yt[0]})}},[me]);var er=String(Ie).toLowerCase(),St=function(jt){return er?String(jt[mt]).toLowerCase().includes(er):!1},rr=_.useState(et),$t=Object(B.a)(rr,2),sn=$t[0],Ge=$t[1],ct=_.useState(null),Zr=Object(B.a)(ct,2),Or=Zr[0],qr=Zr[1],Rr=_.useMemo(function(){return Ke?Object(I.a)(Ke):Ie?Or:sn},[sn,Or,er,Ke]);_.useEffect(function(){Ie&&qr(je.map(function(Zt){return Zt.key}))},[Ie]);var ln=function(jt){Ge(jt),qr(jt),Qe&&Qe(jt)},ht=function(jt){jt.preventDefault()},Nr=function(jt,Mt){var xt=Mt.node.key,nr=_t(xt,pe?"checkbox":"select");nr!==null&&ge(nr.data.value,{selected:!ye.includes(nr.data.value)}),we||ce(!1)},Ye=_.useState(null),Hr=Object(B.a)(Ye,2),ir=Hr[0],pn=Hr[1],cr=_t(ir);if(_.useImperativeHandle(_e,function(){return{onKeyDown:function(jt){var Mt,xt=jt.which;switch(xt){case c.a.UP:case c.a.DOWN:case c.a.LEFT:case c.a.RIGHT:(Mt=Ut.current)===null||Mt===void 0||Mt.onKeyDown(jt);break;case c.a.ENTER:{cr!==null&&Nr(null,{node:{key:ir},selected:!ye.includes(cr.data.value)});break}case c.a.ESC:ce(!1)}},onKeyUp:function(){}}}),Wt.length===0)return _.createElement("div",{role:"listbox",className:"".concat(Ne,"-empty"),onMouseDown:ht},q);var yr={};return bt&&(yr.loadedKeys=bt),Rr&&(yr.expandedKeys=Rr),_.createElement("div",{onMouseDown:ht,onMouseEnter:ne},cr&&me&&_.createElement("span",{style:S,"aria-live":"assertive"},cr.data.value),_.createElement(u.b,Object.assign({ref:Ut,focusable:!1,prefixCls:"".concat(Ne,"-tree"),treeData:Wt,height:Fe,itemHeight:Ue,virtual:Ce,multiple:we,icon:yt,showIcon:st,switcherIcon:rt,showLine:Tt,loadData:Ie?null:vt,motion:ft,checkable:pe,checkStrictly:!0,checkedKeys:gr,selectedKeys:pe?[]:Yt,defaultExpandAll:Je},yr,{onActiveChange:pn,onSelect:Nr,onCheck:Nr,onExpand:ln,onLoad:At,filterTreeNode:St})))},l=_.forwardRef(v);l.displayName="OptionList";var f=l,s=function(){return null},i=s,x=te("Ff2n"),m=te("Zm9Q");function E(Se){return Object(m.a)(Se).map(function(Re){if(!_.isValidElement(Re)||!Re.type)return null;var _e=Re.key,Ne=Re.props,Fe=Ne.children,Ue=Ne.value,Ce=Object(x.a)(Ne,["children","value"]),He=Object(N.a)({key:_e,value:Ue},Ce),je=E(Fe);return je.length&&(He.children=je),He}).filter(function(Re){return Re})}function D(Se){if(!Se)return Se;var Re=Object(N.a)({},Se);return"props"in Re||Object.defineProperty(Re,"props",{get:function(){return Object(g.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),Re}}),Re}function U(Se,Re,_e,Ne,Fe){var Ue=null,Ce=null;function He(){function je(we){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return we.map(function(ce,me){var q="".concat(Ie,"-").concat(me),ne=_e.includes(ce.value),se=je(ce.children||[],q,ne),pe=_.createElement(i,Object.assign({},ce),se.map(function(Le){return Le.node}));if(Re===ce.value&&(Ue=pe),ne){var ye={pos:q,node:pe,children:se};return ge||Ce.push(ye),ye}return null}).filter(function(ce){return ce})}Ce||(Ce=[],je(Ne),Ce.sort(function(we,Ie){var ge=we.node.props.value,ce=Ie.node.props.value,me=_e.indexOf(ge),q=_e.indexOf(ce);return me-q}))}Object.defineProperty(Se,"triggerNode",{get:function(){return Object(g.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),He(),Ue}}),Object.defineProperty(Se,"allCheckedNodes",{get:function(){return Object(g.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),He(),Fe?Ce:Ce.map(function(we){var Ie=we.node;return Ie})}})}function j(Se){return Array.isArray(Se)?Se:Se!==void 0?[Se]:[]}function K(Se,Re){var _e=new Map;return Re.forEach(function(Ne){var Fe=Ne.data;_e.set(Fe.value,Fe)}),Se.map(function(Ne){return D(_e.get(Ne))})}function k(Se,Re){var _e=K([Se],Re)[0];return _e?_e.disabled:!1}function M(Se){return Se.disabled||Se.disableCheckbox||Se.checkable===!1}function G(Se){for(var Re=Se.parent,_e=0,Ne=Re;Ne;)Ne=Ne.parent,_e+=1;return _e}function ee(Se){function Re(Ne){return(Ne||[]).map(function(Fe){var Ue=Fe.value,Ce=Fe.key,He=Fe.children,je=Object(N.a)(Object(N.a)({},Fe),{},{key:"key"in Fe?Ce:Ue});return He&&(je.children=Re(He)),je})}var _e=Object(C.d)(Re(Se),!0);return _e.map(function(Ne){return{key:Ne.data.key,data:Ne.data,level:G(Ne)}})}function ue(Se){return function(Re,_e){var Ne=_e[Se];return String(Ne).toLowerCase().includes(String(Re).toLowerCase())}}function de(Se,Re,_e){var Ne=_e.optionFilterProp,Fe=_e.filterOption;if(Fe===!1)return Re;var Ue;typeof Fe=="function"?Ue=Fe:Ue=ue(Ne);function Ce(He){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return He.map(function(we){var Ie=we.children,ge=je||Ue(Se,D(we)),ce=Ce(Ie||[],ge);return ge||ce.length?Object(N.a)(Object(N.a)({},we),{},{children:ce}):null}).filter(function(we){return we})}return Ce(Re)}function be(Se,Re,_e,Ne){var Fe=new Map;return j(Re).forEach(function(Ue){Ue&&Object(P.a)(Ue)==="object"&&"value"in Ue&&Fe.set(Ue.value,Ue)}),Se.map(function(Ue){var Ce={value:Ue},He=_e(Ue,"select",!0),je=He?Ne(He.data):Ue;if(Fe.has(Ue)){var we=Fe.get(Ue);Ce.label="label"in we?we.label:je,"halfChecked"in we&&(Ce.halfChecked=we.halfChecked)}else Ce.label=je;return Ce})}function Ee(Se,Re){var _e=new Set(Se);return _e.add(Re),Array.from(_e)}function ae(Se,Re){var _e=new Set(Se);return _e.delete(Re),Array.from(_e)}function $(Se){var Re=Se.searchPlaceholder,_e=Se.treeCheckStrictly,Ne=Se.treeCheckable,Fe=Se.labelInValue,Ue=Se.value,Ce=Se.multiple;Object(g.a)(!Re,"`searchPlaceholder` has been removed."),_e&&Fe===!1&&Object(g.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(Fe||_e)&&Object(g.a)(j(Ue).every(function(He){return He&&Object(P.a)(He)==="object"&&"value"in He}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),_e||Ce||Ne?Object(g.a)(!Ue||Array.isArray(Ue),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(g.a)(!Array.isArray(Ue),"`value` should not be array when `TreeSelect` is single mode.")}var re=$,J=10;function ie(Se,Re){var _e=Re.id,Ne=Re.pId,Fe=Re.rootPId,Ue={},Ce=[],He=Se.map(function(je){var we=Object(N.a)({},je),Ie=we[_e];return Ue[Ie]=we,we.key=we.key||Ie,we});return He.forEach(function(je){var we=je[Ne],Ie=Ue[we];Ie&&(Ie.children=Ie.children||[],Ie.children.push(je)),(we===Fe||!Ie&&Fe===null)&&Ce.push(je)}),Ce}function V(Se,Re){var _e=0,Ne=new Set;function Fe(Ue){return(Ue||[]).map(function(Ce){var He=Ce.key,je=Ce.value,we=Ce.children,Ie=Object(x.a)(Ce,["key","value","children"]),ge="value"in Ce?je:He,ce=Object(N.a)(Object(N.a)({},Ie),{},{key:He!=null?He:ge,value:ge,title:Re(Ce)});return"children"in Ce&&(ce.children=Fe(we)),ce})}return Fe(Se)}function Y(Se,Re,_e){var Ne=_e.getLabelProp,Fe=_e.simpleMode,Ue=_.useRef({});return Se?(Ue.current.formatTreeData=Ue.current.treeData===Se?Ue.current.formatTreeData:V(Fe?ie(Se,Object(N.a)({id:"id",pId:"pId",rootPId:null},Fe!==!0?Fe:{})):Se,Ne),Ue.current.treeData=Se):Ue.current.formatTreeData=Ue.current.children===Re?Ue.current.formatTreeData:V(E(Re),Ne),Ue.current.formatTreeData}var Z="SHOW_ALL",le="SHOW_PARENT",xe="SHOW_CHILD";function he(Se,Re,_e){var Ne=new Set(Se);return Re===xe?Se.filter(function(Fe){var Ue=_e[Fe];return!(Ue&&Ue.children&&Ue.children.every(function(Ce){var He=Ce.node;return M(He)||Ne.has(He.key)}))}):Re===le?Se.filter(function(Fe){var Ue=_e[Fe],Ce=Ue?Ue.parent:null;return!(Ce&&!M(Ce.node)&&Ne.has(Ce.node.key))}):Se}function Te(Se,Re){var _e=Re.value,Ne=Re.getEntityByValue,Fe=Re.getEntityByKey,Ue=Re.treeConduction,Ce=Re.showCheckedStrategy,He=Re.conductKeyEntities,je=Re.getLabelProp;return _.useMemo(function(){var we=Se;if(Ue){var Ie=he(Se.map(function(ge){var ce=Ne(ge);return ce?ce.key:ge}),Ce,He);we=Ie.map(function(ge){var ce=Fe(ge);return ce?ce.data.value:ge})}return be(we,_e,Ne,je)},[Se,_e,Ue,Ce,Ne])}var De=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Pe=Object(O.a)({prefixCls:"rc-tree-select",components:{optionList:f},convertChildrenToData:function(){return null},flattenOptions:ee,getLabeledValue:y.e,filterOptions:de,isValueDisabled:k,findValueOption:K,omitDOMProps:function(Re){var _e=Object(N.a)({},Re);return De.forEach(function(Ne){delete _e[Ne]}),_e}});Pe.displayName="Select";var Be=_.forwardRef(function(Se,Re){var _e=Se.multiple,Ne=Se.treeCheckable,Fe=Se.treeCheckStrictly,Ue=Se.showCheckedStrategy,Ce=Ue===void 0?"SHOW_CHILD":Ue,He=Se.labelInValue,je=Se.loadData,we=Se.treeLoadedKeys,Ie=Se.treeNodeFilterProp,ge=Ie===void 0?"value":Ie,ce=Se.treeNodeLabelProp,me=Se.treeDataSimpleMode,q=Se.treeData,ne=Se.treeExpandedKeys,se=Se.treeDefaultExpandedKeys,pe=Se.treeDefaultExpandAll,ye=Se.children,Le=Se.treeIcon,Ke=Se.showTreeIcon,Je=Se.switcherIcon,et=Se.treeLine,Qe=Se.treeMotion,yt=Se.filterTreeNode,st=Se.dropdownPopupAlign,rt=Se.onChange,Tt=Se.onTreeExpand,mt=Se.onTreeLoad,vt=Se.onDropdownVisibleChange,bt=Se.onSelect,ft=Se.onDeselect,At=Ne||Fe,Ut=_e||At,Wt=Ne&&!Fe,Jt=Fe||He,Rt=_.useRef(null);_.useImperativeHandle(Re,function(){return{focus:Rt.current.focus,blur:Rt.current.blur}});var Lr=function(xt){return q&&xt.label||xt.title},Qt=function(xt){return ce?xt[ce]:Lr(xt)},zt=Y(q,ye,{getLabelProp:Lr,simpleMode:me}),dr=Object(_.useMemo)(function(){return ee(zt)},[zt]),_t=h(dr),nt=Object(B.a)(_t,2),Yt=nt[0],gr=nt[1],er=p(Yt,gr),St=Object(B.a)(er,2),rr=St[0],$t=St[1],sn=Object(_.useMemo)(function(){return Wt?Object(C.a)(zt):{keyEntities:null}},[zt,Ne,Fe]),Ge=sn.keyEntities,ct=Object(b.a)(Se.defaultValue,{value:Se.value}),Zr=Object(B.a)(ct,2),Or=Zr[0],qr=Zr[1],Rr=function(xt){var nr=[],fr=[];return xt.forEach(function(Kt){$t(Kt)?fr.push(Kt):nr.push(Kt)}),{missingRawValues:nr,existRawValues:fr}},ln=Object(_.useMemo)(function(){var Mt=[],xt=[];if(j(Or).forEach(function(Ft){if(Ft&&Object(P.a)(Ft)==="object"&&"value"in Ft)if(Ft.halfChecked&&Fe){var _r=$t(Ft.value);Mt.push(_r?_r.key:Ft.value)}else xt.push(Ft.value);else xt.push(Ft)}),Wt){var nr=Rr(xt),fr=nr.missingRawValues,Kt=nr.existRawValues,Sr=Kt.map(function(Ft){return $t(Ft).key}),Ur=Object(R.a)(Sr,!0,Ge),kr=Ur.checkedKeys,Vt=Ur.halfCheckedKeys;return[[].concat(Object(I.a)(fr),Object(I.a)(kr.map(function(Ft){return rr(Ft).data.value}))),Vt]}return[xt,Mt]},[Or,Ut,Jt,Ne,Fe]),ht=Object(B.a)(ln,2),Nr=ht[0],Ye=ht[1],Hr=Te(Nr,{treeConduction:Wt,value:Or,showCheckedStrategy:Ce,conductKeyEntities:Ge,getEntityByValue:$t,getEntityByKey:rr,getLabelProp:Qt}),ir=function(xt,nr,fr){if(qr(Ut?xt:xt[0]),rt){var Kt=xt;if(Wt&&Ce!=="SHOW_ALL"){var Sr=xt.map(function(Cr){var wr=$t(Cr);return wr?wr.key:Cr}),Ur=he(Sr,Ce,Ge);Kt=Ur.map(function(Cr){var wr=rr(Cr);return wr?wr.data.value:Cr})}var kr=nr||{triggerValue:void 0,selected:void 0},Vt=kr.triggerValue,Ft=kr.selected,_r=Jt?be(Kt,Or,$t,Qt):Kt;if(Fe){var Fr=Ye.map(function(Cr){var wr=rr(Cr);return wr?wr.data.value:Cr}).filter(function(Cr){return!Kt.includes(Cr)});_r=[].concat(Object(I.a)(_r),Object(I.a)(be(Fr,Or,$t,Qt)))}var Xt={preValue:Hr,triggerValue:Vt},Sn=!0;(Fe||fr==="selection"&&!Ft)&&(Sn=!1),U(Xt,Vt,xt,zt,Sn),At?Xt.checked=Ft:Xt.selected=Ft,rt(Ut?_r:_r[0],Jt?null:Kt.map(function(Cr){var wr=$t(Cr);return wr?Qt(wr.data):null}),Xt)}},pn=function(xt,nr,fr){var Kt=xt;if(!Ut)ir([xt],{selected:!0,triggerValue:xt},fr);else{var Sr=Ee(Nr,xt);if(Wt){var Ur=Rr(Sr),kr=Ur.missingRawValues,Vt=Ur.existRawValues,Ft=Vt.map(function(Xt){return $t(Xt).key}),_r=Object(R.a)(Ft,!0,Ge),Fr=_r.checkedKeys;Sr=[].concat(Object(I.a)(kr),Object(I.a)(Fr.map(function(Xt){return rr(Xt).data.value})))}ir(Sr,{selected:!0,triggerValue:xt},fr)}bt&&bt(Kt,nr)},cr=function(xt,nr,fr){var Kt=xt,Sr=ae(Nr,xt);if(Wt){var Ur=Rr(Sr),kr=Ur.missingRawValues,Vt=Ur.existRawValues,Ft=Vt.map(function(Xt){return $t(Xt).key}),_r=Object(R.a)(Ft,{checked:!1,halfCheckedKeys:Ye},Ge),Fr=_r.checkedKeys;Sr=[].concat(Object(I.a)(kr),Object(I.a)(Fr.map(function(Xt){return rr(Xt).data.value})))}ir(Sr,{selected:!1,triggerValue:xt},fr),ft&&ft(Kt,nr)},yr=function(){ir([],null,"clear")},Zt=_.useCallback(function(Mt){if(vt){var xt={};Object.defineProperty(xt,"documentClickClose",{get:function(){return Object(g.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),vt(Mt,xt)}},[vt]),jt={optionLabelProp:null,optionFilterProp:ge,dropdownAlign:st,internalProps:{mark:A.a,onClear:yr,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:pn,onRawDeselect:cr}};return"filterTreeNode"in Se&&(jt.filterOption=yt),_.createElement(d.Provider,{value:{checkable:At,loadData:je,treeLoadedKeys:we,onTreeLoad:mt,checkedKeys:Nr,halfCheckedKeys:Ye,treeDefaultExpandAll:pe,treeExpandedKeys:ne,treeDefaultExpandedKeys:se,onTreeExpand:Tt,treeIcon:Le,treeMotion:Qe,showTreeIcon:Ke,switcherIcon:Je,treeLine:et,treeNodeFilterProp:ge}},_.createElement(Pe,Object.assign({ref:Rt,mode:Ut?"multiple":null},Se,jt,{value:Hr,labelInValue:!0,options:zt,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:Zt})))}),Me=function(Se){Object(L.a)(_e,Se);var Re=Object(z.a)(_e);function _e(){var Ne;return Object(oe.a)(this,_e),Ne=Re.apply(this,arguments),Ne.selectRef=_.createRef(),Ne.focus=function(){Ne.selectRef.current.focus()},Ne.blur=function(){Ne.selectRef.current.blur()},Ne}return Object(H.a)(_e,[{key:"render",value:function(){return _.createElement(Be,Object.assign({ref:this.selectRef},this.props))}}]),_e}(_.Component);Me.TreeNode=i,Me.SHOW_ALL=Z,Me.SHOW_PARENT=le,Me.SHOW_CHILD=xe;var ke=Me,Ve=Xe.e=ke},"8hTe":function(ot,Xe,te){ot.exports={button:"button___1wy9m"}},"8pgt":function(ot,Xe,te){ot.exports={flexRow:"flexRow___2kcn2",flexColumn:"flexColumn___2bS_0",formWrap:"formWrap___3t-wi",example:"example___2J2YZ",footerWrap:"footerWrap___3u6gg"}},"9Bee":function(ot,Xe,te){"use strict";var oe=te("DYRE"),H=te("zeV3"),L=te("+L6B"),z=te("2/Rp"),I=te("k1fw"),P=te("tJVT"),B=te("cDcd"),N=te.n(B),_=te("vg9a"),O=te("DlQD"),y=te.n(O),C=te("rUJ1");function R(ae,$){var re=ae.match(/^(\s+)(?:```)/);if(re===null)return $;var J=re[1];return $.split(`
|
|
`).map(function(ie){var V=ie.match(/^\s+/);if(V===null)return ie;var Y=Object(P.a)(V,1),Z=Y[0];return Z.length>=J.length?ie.slice(J.length):ie}).join(`
|
|
`)}var A=[],b=["<ul>"],g=new y.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function o(){A.length=0,b=["<ul>"]}var u={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function d(ae,$,re,J){if($>=ae.length||ae[$].level<=re)return $;var ie=ae[$];J.push("<li><a href='#"+ie.anchor+"'>"+ie.text+"</a>"),$++;var V=[];return $=d(ae,$,ie.level,V),V.length>0&&(J.push("<ul>"),V.forEach(function(Y){J.push(Y)}),J.push("</ul>")),J.push("</li>"),$=d(ae,$,re,J),$}function T(){return d(A,0,0,b),b.push("</ul>"),b.join("")}var p={heading:function($){var re=c.exec($);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fences:function($){var re=this.rules.block.fences.exec($);if(re){var J=re[0],ie=R(J,re[3]||""),V=re[2]?re[2].trim():re[2];if(["latex","katex","math"].indexOf(V)>=0){var Y=v(),Z=ie;ie=Y,l[Y]={type:"block",expression:Z}}return{type:"code",raw:J,lang:V,text:ie}}}},h=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,v=function(){return"__special_katext_id_".concat(S++,"__")},l={};function f(){return l}function s(){S=0,l={}}function i(ae){return ae=ae.replace(h,function($,re){var J=v();return l[J]={type:"inline",expression:re},J}),ae}var x=g.listitem;g.listitem=function(ae){return x(i(ae))};var m=g.paragraph;g.paragraph=function(ae){return m(i(ae))};var E=g.tablecell;g.tablecell=function(ae,$){return E(i(ae),$)},g.code=function(ae,$,re){var J=($||"").match(/\S*/)[0];return J?["latex","katex","math"].indexOf(J)>=0?"<p class='editormd-tex'>".concat(ae,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat($,'">').concat(re?ae:Object(C.escape)(ae,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(re?ae:Object(C.escape)(ae,!0))+"</code></pre>"},g.heading=function(ae,$,re){var J=this.options.headerPrefix+re.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return A.push({anchor:J,level:$,text:ae}),"<h"+$+' id="'+J+'">'+ae+"</h"+$+">"},y.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),y.a.use({tokenizer:p,renderer:g});var D=y.a,U=te("SJMd"),j=te("ulZh"),K=te.n(j),k=te("m3rI"),M=te("Oy/b"),G=te("p5ED"),ee=te("8hTe"),ue=te.n(ee),de=/<pre[^>]*>/g;function be(ae){var $=document.createElement("div");return $.innerHTML=ae,$.childNodes.length===0?"":$.childNodes[0].nodeValue}var Ee=Xe.a=function(ae){var $=ae.value,re=$===void 0?"":$,J=ae.edit,ie=J===void 0?!1:J,V=ae.className,Y=ae.showTextOnly,Z=ae.showLines,le=ae.replaces,xe=ae.zoomImg,he=ae.hasMask,Te=ae.style,De=Te===void 0?{}:Te,Pe=ae.stylesPrev,Be=Pe===void 0?{}:Pe,Me=String(re),ke=Object(B.useRef)(),Ve=Object(B.useRef)(),Se=Object(B.useState)(""),Re=Object(P.a)(Se,2),_e=Re[0],Ne=Re[1],Fe=Object(B.useState)("office"),Ue=Object(P.a)(Fe,2),Ce=Ue[0],He=Ue[1],je=Object(B.useMemo)(function(){try{var me=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,q=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ne=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Me=Me.replace(me,"("+k.a.API_SERVER+"/api/attachments/").replace(q,'"'+k.a.API_SERVER+"/api/attachments/").replace(ne,'"'+k.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(Le){}var se=D(Me),pe=f();if(Me.match(/\[TOC\]/)&&(se=se.replace("<p>[TOC]</p>",T()),o()),se=se.replace(/(__special_katext_id_\d+__)/g,function(Le,Ke){var Je=pe[Ke],et=Je.type,Qe=Je.expression;return Object(M.renderToString)(be(Qe)||"",{displayMode:et==="block",throwOnError:!1,output:"html"})}),se=se.replace(/▁/g,"\u2581\u2581\u2581"),s(),Y){var ye=document.createElement("div");return ye.innerHTML=se,ye.innerText}return setTimeout(function(){return ge()},500),se},[Me]),we=Object(B.useRef)();u.WebkitLineClamp=Z,Z&&(De=Object(I.a)(Object(I.a)({},De),u));function Ie(me){var q=me.target;if(q.tagName.toUpperCase()==="IMG"){if(xe){var ne=q.getAttribute("src");Ne(ne),He("image")}}else if(q.tagName.toUpperCase()==="A"){var se=q.getAttribute("href");if(se.indexOf("office")>-1)me.preventDefault(),Ne(se),He("office");else if(se.indexOf("application/pdf")>-1)me.preventDefault(),Ne(se),He("pdf");else if(se.indexOf("text/html")>-1)me.preventDefault(),Ne(se),He("html");else if(se.startsWith("#")){me.preventDefault();var pe=document.getElementById(se.replace("#",""));pe&&pe.scrollIntoView(!0)}}}var ge=function(){var q,ne=(q=we.current)===null||q===void 0?void 0:q.querySelectorAll("video");ne==null||ne.forEach(function(se){if(se.oncontextmenu=function(){return!1},se.src.indexOf(".m3u8")>-1&&!se.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var pe=new K.a;pe.loadSource(se.src),pe.attachMedia(se)}}})};Object(B.useEffect)(function(){if(we.current&&je&&(je.match(de)&&window.PR.prettyPrint()),we.current)return we.current.addEventListener("click",Ie),function(){we.current.removeEventListener("click",Ie),s(),o()}},[je,we.current,Ie]);var ce=function(q){if(!ie)return;q.target.nodeName==="IMG"?(ke.current.style.display="flex",ke.current.style.width=q.target.clientWidth+"px",ke.current.style.height=q.target.clientHeight+"px",ke.current.style.top=q.target.offsetTop+"px",ke.current.style.left=q.target.offsetLeft+"px",Ve.current.src=q.target.getAttribute("src")):ke.current.style.display="none"};return N.a.createElement("div",{style:{position:"relative"}},N.a.createElement("div",{ref:we,style:Object(I.a)({},De),className:"".concat(V||""," markdown-body ").concat(ue.a.mdBody),onMouseOver:ce,dangerouslySetInnerHTML:{__html:je}}),N.a.createElement("div",{ref:ke,className:ue.a.button},N.a.createElement(H.a,null,N.a.createElement(z.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),N.a.createElement(z.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),N.a.createElement("img",{ref:Ve,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),N.a.createElement(G.a,{close:!0,data:_e,type:_e!=null&&_e.length?Ce:"",style:Object(I.a)({},Be),onClose:function(){return Ne("")}}))}},"9VGf":function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return L});var oe=te("cDcd"),H=te.n(oe);function L(z,I){var P=Object(oe.useRef)();Object(oe.useEffect)(function(){P.current=z}),Object(oe.useEffect)(function(){function B(){P.current()}if(I!==null){var N=setInterval(B,I);return function(){return clearInterval(N)}}},[I])}},Bd2K:function(ot,Xe,te){(function(oe){oe(te("VrN/"),te("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(_,O,y){if(y!=oe.Init&&y&&_.removeKeyMap("autoCloseTags"),!O)return;var C={name:"autoCloseTags"};(typeof O!="object"||O.whenClosing!==!1)&&(C["'/'"]=function(R){return P(R)}),(typeof O!="object"||O.whenOpening!==!1)&&(C["'>'"]=function(R){return z(R)}),_.addKeyMap(C)});var H=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],L=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function z(_){if(_.getOption("disableInput"))return oe.Pass;for(var O=_.listSelections(),y=[],C=_.getOption("autoCloseTags"),R=0;R<O.length;R++){if(!O[R].empty())return oe.Pass;var A=O[R].head,b=_.getTokenAt(A),g=oe.innerMode(_.getMode(),b.state),c=g.state,o=g.mode.xmlCurrentTag&&g.mode.xmlCurrentTag(c),u=o&&o.name;if(!u)return oe.Pass;var d=g.mode.configuration=="html",T=typeof C=="object"&&C.dontCloseTags||d&&H,p=typeof C=="object"&&C.indentTags||d&&L;b.end>A.ch&&(u=u.slice(0,u.length-b.end+A.ch));var h=u.toLowerCase();if(!u||b.type=="string"&&(b.end!=A.ch||!/[\"\']/.test(b.string.charAt(b.string.length-1))||b.string.length==1)||b.type=="tag"&&o.close||b.string.indexOf("/")==A.ch-b.start-1||T&&B(T,h)>-1||N(_,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(c)||[],u,A,!0))return oe.Pass;var S=typeof C=="object"&&C.emptyTags;if(S&&B(S,u)>-1){y[R]={text:"/>",newPos:oe.Pos(A.line,A.ch+2)};continue}var v=p&&B(p,h)>-1;y[R]={indent:v,text:">"+(v?`
|
|
|
|
`:"")+"</"+u+">",newPos:v?oe.Pos(A.line+1,0):oe.Pos(A.line,A.ch+1)}}for(var l=typeof C=="object"&&C.dontIndentOnAutoClose,R=O.length-1;R>=0;R--){var f=y[R];_.replaceRange(f.text,O[R].head,O[R].anchor,"+insert");var s=_.listSelections().slice(0);s[R]={head:f.newPos,anchor:f.newPos},_.setSelections(s),!l&&f.indent&&(_.indentLine(f.newPos.line,null,!0),_.indentLine(f.newPos.line+1,null,!0))}}function I(_,O){for(var y=_.listSelections(),C=[],R=O?"/":"</",A=_.getOption("autoCloseTags"),b=typeof A=="object"&&A.dontIndentOnSlash,g=0;g<y.length;g++){if(!y[g].empty())return oe.Pass;var c=y[g].head,o=_.getTokenAt(c),u=oe.innerMode(_.getMode(),o.state),d=u.state;if(O&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=c.ch-1))return oe.Pass;var T,p=u.mode.name!="xml"&&_.getMode().name=="htmlmixed";if(p&&u.mode.name=="javascript")T=R+"script";else if(p&&u.mode.name=="css")T=R+"style";else{var h=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(d);if(!h||h.length&&N(_,h,h[h.length-1],c))return oe.Pass;T=R+h[h.length-1]}_.getLine(c.line).charAt(o.end)!=">"&&(T+=">"),C[g]=T}if(_.replaceSelections(C),y=_.listSelections(),!b)for(var g=0;g<y.length;g++)(g==y.length-1||y[g].head.line<y[g+1].head.line)&&_.indentLine(y[g].head.line)}function P(_){return _.getOption("disableInput")?oe.Pass:I(_,!0)}oe.commands.closeTag=function(_){return I(_)};function B(_,O){if(_.indexOf)return _.indexOf(O);for(var y=0,C=_.length;y<C;++y)if(_[y]==O)return y;return-1}function N(_,O,y,C,R){if(!oe.scanForClosingTag)return!1;var A=Math.min(_.lastLine()+1,C.line+500),b=oe.scanForClosingTag(_,C,null,A);if(!b||b.tag!=y)return!1;for(var g=R?1:0,c=O.length-1;c>=0&&O[c]==y;c--)++g;C=b.to;for(var c=1;c<g;c++){var o=oe.scanForClosingTag(_,C,null,A);if(!o||o.tag!=y)return!1;C=o.to}return!0}})},BjJ7:function(ot,Xe,te){"use strict";te.d(Xe,"d",function(){return H}),te.d(Xe,"c",function(){return L}),te.d(Xe,"e",function(){return z}),te.d(Xe,"b",function(){return I}),te.d(Xe,"a",function(){return B});var oe=te("m3rI");function H(N){var _=!0;if(N.length>0){for(var O=0;O<N.length;O++)if(N[O].compile_success==0||!N[O].compile_success){_=!1;break}}else _=!1;return _}function L(N){for(var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",O=[],y=0;y<N.length;y++){var C=N[y],R=_?"".concat(_,"/").concat(C.name):"".concat(C.name);O.push({title:C.name,isLeaf:!(C.type==="tree"),key:R})}return O}function z(N,_,O){for(var y=0;y<N.length;y++){var C=N[y];if(C.key===_){C.children=O;break}C.children&&z(C.children,_,O)}return N}function I(N,_,O){var y;return function(){var C=this,R=arguments,A=function(){y=null,O||N.apply(C,R)},b=O&&!y;clearTimeout(y),y=setTimeout(A,_),b&&N.apply(C,R)}}var P=!0,B=oe.a.API_SERVER},"C+DQ":function(ot,Xe,te){},DlQD:function(ot,Xe,te){(function(oe,H){ot.exports=H()})(this,function(){"use strict";function oe(ge,ce){for(var me=0;me<ce.length;me++){var q=ce[me];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(ge,q.key,q)}}function H(ge,ce,me){return ce&&oe(ge.prototype,ce),me&&oe(ge,me),ge}function L(ge,ce){if(!ge)return;if(typeof ge=="string")return z(ge,ce);var me=Object.prototype.toString.call(ge).slice(8,-1);if(me==="Object"&&ge.constructor&&(me=ge.constructor.name),me==="Map"||me==="Set")return Array.from(ge);if(me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(me))return z(ge,ce)}function z(ge,ce){(ce==null||ce>ge.length)&&(ce=ge.length);for(var me=0,q=new Array(ce);me<ce;me++)q[me]=ge[me];return q}function I(ge,ce){var me;if(typeof Symbol=="undefined"||ge[Symbol.iterator]==null){if(Array.isArray(ge)||(me=L(ge))||ce&&ge&&typeof ge.length=="number"){me&&(ge=me);var q=0;return function(){return q>=ge.length?{done:!0}:{done:!1,value:ge[q++]}}}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 me=ge[Symbol.iterator](),me.next.bind(me)}function P(ge,ce){return ce={exports:{}},ge(ce,ce.exports),ce.exports}var B=P(function(ge){function ce(){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 me(q){ge.exports.defaults=q}ge.exports={defaults:ce(),getDefaults:ce,changeDefaults:me}}),N=B.defaults,_=B.getDefaults,O=B.changeDefaults,y=/[&<>"']/,C=/[&<>"']/g,R=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,b={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(ce){return b[ce]};function c(ge,ce){if(ce){if(y.test(ge))return ge.replace(C,g)}else if(R.test(ge))return ge.replace(A,g);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(ge){return ge.replace(o,function(ce,me){return me=me.toLowerCase(),me==="colon"?":":me.charAt(0)==="#"?me.charAt(1)==="x"?String.fromCharCode(parseInt(me.substring(2),16)):String.fromCharCode(+me.substring(1)):""})}var d=/(^|[^\[])\^/g;function T(ge,ce){ge=ge.source||ge,ce=ce||"";var me={replace:function(ne,se){return se=se.source||se,se=se.replace(d,"$1"),ge=ge.replace(ne,se),me},getRegex:function(){return new RegExp(ge,ce)}};return me}var p=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function S(ge,ce,me){if(ge){var q;try{q=decodeURIComponent(u(me)).replace(p,"").toLowerCase()}catch(ne){return null}if(q.indexOf("javascript:")===0||q.indexOf("vbscript:")===0||q.indexOf("data:")===0)return null}ce&&!h.test(me)&&(me=i(ce,me));try{me=encodeURI(me).replace(/%25/g,"%")}catch(ne){return null}return me}var v={},l=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(ge,ce){v[" "+ge]||(l.test(ge)?v[" "+ge]=ge+"/":v[" "+ge]=D(ge,"/",!0)),ge=v[" "+ge];var me=ge.indexOf(":")===-1;return ce.substring(0,2)==="//"?me?ce:ge.replace(f,"$1")+ce:ce.charAt(0)==="/"?me?ce:ge.replace(s,"$1")+ce:ge+ce}var x={exec:function(){}};function m(ge){for(var ce=1,me,q;ce<arguments.length;ce++){me=arguments[ce];for(q in me)Object.prototype.hasOwnProperty.call(me,q)&&(ge[q]=me[q])}return ge}function E(ge,ce){var me=ge.replace(/\|/g,function(se,pe,ye){for(var Le=!1,Ke=pe;--Ke>=0&&ye[Ke]==="\\";)Le=!Le;return Le?"|":" |"}),q=me.split(/ \|/),ne=0;if(q.length>ce)q.splice(ce);else for(;q.length<ce;)q.push("");for(;ne<q.length;ne++)q[ne]=q[ne].trim().replace(/\\\|/g,"|");return q}function D(ge,ce,me){var q=ge.length;if(q===0)return"";for(var ne=0;ne<q;){var se=ge.charAt(q-ne-1);if(se===ce&&!me)ne++;else if(se!==ce&&me)ne++;else break}return ge.substr(0,q-ne)}function U(ge,ce){if(ge.indexOf(ce[1])===-1)return-1;for(var me=ge.length,q=0,ne=0;ne<me;ne++)if(ge[ne]==="\\")ne++;else if(ge[ne]===ce[0])q++;else if(ge[ne]===ce[1]&&(q--,q<0))return ne;return-1}function j(ge){ge&&ge.sanitize&&!ge.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 K={escape:c,unescape:u,edit:T,cleanUrl:S,resolveUrl:i,noopTest:x,merge:m,splitCells:E,rtrim:D,findClosingBracket:U,checkSanitizeDeprecation:j},k=B.defaults,M=K.rtrim,G=K.splitCells,ee=K.escape,ue=K.findClosingBracket;function de(ge,ce,me){var q=ce.href,ne=ce.title?ee(ce.title):null,se=ge[1].replace(/\\([\[\]])/g,"$1");return ge[0].charAt(0)!=="!"?{type:"link",raw:me,href:q,title:ne,text:se}:{type:"image",raw:me,href:q,title:ne,text:ee(se)}}function be(ge,ce){var me=ge.match(/^(\s+)(?:```)/);if(me===null)return ce;var q=me[1];return ce.split(`
|
|
`).map(function(ne){var se=ne.match(/^\s+/);if(se===null)return ne;var pe=se[0];return pe.length>=q.length?ne.slice(q.length):ne}).join(`
|
|
`)}var Ee=function(){function ge(me){this.options=me||k}var ce=ge.prototype;return ce.space=function(q){var ne=this.rules.block.newline.exec(q);if(ne)return ne[0].length>1?{type:"space",raw:ne[0]}:{raw:`
|
|
`}},ce.code=function(q,ne){var se=this.rules.block.code.exec(q);if(se){var pe=ne[ne.length-1];if(pe&&pe.type==="paragraph")return{raw:se[0],text:se[0].trimRight()};var ye=se[0].replace(/^ {4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:M(ye,`
|
|
`)}}},ce.fences=function(q){var ne=this.rules.block.fences.exec(q);if(ne){var se=ne[0],pe=be(se,ne[3]||"");return{type:"code",raw:se,lang:ne[2]?ne[2].trim():ne[2],text:pe}}},ce.heading=function(q){var ne=this.rules.block.heading.exec(q);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},ce.nptable=function(q){var ne=this.rules.block.nptable.exec(q);if(ne){var se={type:"table",header:G(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ne[0]};if(se.header.length===se.align.length){var pe=se.align.length,ye;for(ye=0;ye<pe;ye++)/^ *-+: *$/.test(se.align[ye])?se.align[ye]="right":/^ *:-+: *$/.test(se.align[ye])?se.align[ye]="center":/^ *:-+ *$/.test(se.align[ye])?se.align[ye]="left":se.align[ye]=null;for(pe=se.cells.length,ye=0;ye<pe;ye++)se.cells[ye]=G(se.cells[ye],se.header.length);return se}}},ce.hr=function(q){var ne=this.rules.block.hr.exec(q);if(ne)return{type:"hr",raw:ne[0]}},ce.blockquote=function(q){var ne=this.rules.block.blockquote.exec(q);if(ne){var se=ne[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ne[0],text:se}}},ce.list=function(q){var ne=this.rules.block.list.exec(q);if(ne){for(var se=ne[0],pe=ne[2],ye=pe.length>1,Le=pe[pe.length-1]===")",Ke={type:"list",raw:se,ordered:ye,start:ye?+pe.slice(0,-1):"",loose:!1,items:[]},Je=ne[0].match(this.rules.block.item),et=!1,Qe,yt,st,rt,Tt,mt,vt,bt=Je.length,ft=0;ft<bt;ft++)Qe=Je[ft],se=Qe,yt=Qe.length,Qe=Qe.replace(/^ *([*+-]|\d+[.)]) */,""),~Qe.indexOf(`
|
|
`)&&(yt-=Qe.length,Qe=this.options.pedantic?Qe.replace(/^ {1,4}/gm,""):Qe.replace(new RegExp("^ {1,"+yt+"}","gm"),"")),ft!==bt-1&&(st=this.rules.block.bullet.exec(Je[ft+1])[0],(ye?st.length===1||!Le&&st[st.length-1]===")":st.length>1||this.options.smartLists&&st!==pe)&&(rt=Je.slice(ft+1).join(`
|
|
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-rt.length),ft=bt-1)),Tt=et||/\n\n(?!\s*$)/.test(Qe),ft!==bt-1&&(et=Qe.charAt(Qe.length-1)===`
|
|
`,Tt||(Tt=et)),Tt&&(Ke.loose=!0),mt=/^\[[ xX]\] /.test(Qe),vt=void 0,mt&&(vt=Qe[1]!==" ",Qe=Qe.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:se,task:mt,checked:vt,loose:Tt,text:Qe});return Ke}},ce.html=function(q){var ne=this.rules.block.html.exec(q);if(ne)return{type:this.options.sanitize?"paragraph":"html",raw:ne[0],pre:!this.options.sanitizer&&(ne[1]==="pre"||ne[1]==="script"||ne[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):ee(ne[0]):ne[0]}},ce.def=function(q){var ne=this.rules.block.def.exec(q);if(ne){ne[3]&&(ne[3]=ne[3].substring(1,ne[3].length-1));var se=ne[1].toLowerCase().replace(/\s+/g," ");return{tag:se,raw:ne[0],href:ne[2],title:ne[3]}}},ce.table=function(q){var ne=this.rules.block.table.exec(q);if(ne){var se={type:"table",header:G(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
|
|
`):[]};if(se.header.length===se.align.length){se.raw=ne[0];var pe=se.align.length,ye;for(ye=0;ye<pe;ye++)/^ *-+: *$/.test(se.align[ye])?se.align[ye]="right":/^ *:-+: *$/.test(se.align[ye])?se.align[ye]="center":/^ *:-+ *$/.test(se.align[ye])?se.align[ye]="left":se.align[ye]=null;for(pe=se.cells.length,ye=0;ye<pe;ye++)se.cells[ye]=G(se.cells[ye].replace(/^ *\| *| *\| *$/g,""),se.header.length);return se}}},ce.lheading=function(q){var ne=this.rules.block.lheading.exec(q);if(ne)return{type:"heading",raw:ne[0],depth:ne[2].charAt(0)==="="?1:2,text:ne[1]}},ce.paragraph=function(q){var ne=this.rules.block.paragraph.exec(q);if(ne)return{type:"paragraph",raw:ne[0],text:ne[1].charAt(ne[1].length-1)===`
|
|
`?ne[1].slice(0,-1):ne[1]}},ce.text=function(q,ne){var se=this.rules.block.text.exec(q);if(se){var pe=ne[ne.length-1];return pe&&pe.type==="text"?{raw:se[0],text:se[0]}:{type:"text",raw:se[0],text:se[0]}}},ce.escape=function(q){var ne=this.rules.inline.escape.exec(q);if(ne)return{type:"escape",raw:ne[0],text:ee(ne[1])}},ce.tag=function(q,ne,se){var pe=this.rules.inline.tag.exec(q);if(pe)return!ne&&/^<a /i.test(pe[0])?ne=!0:ne&&/^<\/a>/i.test(pe[0])&&(ne=!1),!se&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?se=!0:se&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(se=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:ne,inRawBlock:se,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ee(pe[0]):pe[0]}},ce.link=function(q){var ne=this.rules.inline.link.exec(q);if(ne){var se=ue(ne[2],"()");if(se>-1){var pe=ne[0].indexOf("!")===0?5:4,ye=pe+ne[1].length+se;ne[2]=ne[2].substring(0,se),ne[0]=ne[0].substring(0,ye).trim(),ne[3]=""}var Le=ne[2],Ke="";if(this.options.pedantic){var Je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Je?(Le=Je[1],Ke=Je[3]):Ke=""}else Ke=ne[3]?ne[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var et=de(ne,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},ne[0]);return et}},ce.reflink=function(q,ne){var se;if((se=this.rules.inline.reflink.exec(q))||(se=this.rules.inline.nolink.exec(q))){var pe=(se[2]||se[1]).replace(/\s+/g," ");if(pe=ne[pe.toLowerCase()],!pe||!pe.href){var ye=se[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Le=de(se,pe,se[0]);return Le}},ce.strong=function(q,ne,se){se===void 0&&(se="");var pe=this.rules.inline.strong.start.exec(q);if(pe&&(!pe[1]||pe[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){ne=ne.slice(-1*q.length);var ye=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Le;(pe=ye.exec(ne))!=null;)if(Le=this.rules.inline.strong.middle.exec(ne.slice(0,pe.index+3)),Le)return{type:"strong",raw:q.slice(0,Le[0].length),text:q.slice(2,Le[0].length-2)}}},ce.em=function(q,ne,se){se===void 0&&(se="");var pe=this.rules.inline.em.start.exec(q);if(pe&&(!pe[1]||pe[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){ne=ne.slice(-1*q.length);var ye=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Le;(pe=ye.exec(ne))!=null;)if(Le=this.rules.inline.em.middle.exec(ne.slice(0,pe.index+2)),Le)return{type:"em",raw:q.slice(0,Le[0].length),text:q.slice(1,Le[0].length-1)}}},ce.codespan=function(q){var ne=this.rules.inline.code.exec(q);if(ne){var se=ne[2].replace(/\n/g," "),pe=/[^ ]/.test(se),ye=se.startsWith(" ")&&se.endsWith(" ");return pe&&ye&&(se=se.substring(1,se.length-1)),se=ee(se,!0),{type:"codespan",raw:ne[0],text:se}}},ce.br=function(q){var ne=this.rules.inline.br.exec(q);if(ne)return{type:"br",raw:ne[0]}},ce.del=function(q){var ne=this.rules.inline.del.exec(q);if(ne)return{type:"del",raw:ne[0],text:ne[1]}},ce.autolink=function(q,ne){var se=this.rules.inline.autolink.exec(q);if(se){var pe,ye;return se[2]==="@"?(pe=ee(this.options.mangle?ne(se[1]):se[1]),ye="mailto:"+pe):(pe=ee(se[1]),ye=pe),{type:"link",raw:se[0],text:pe,href:ye,tokens:[{type:"text",raw:pe,text:pe}]}}},ce.url=function(q,ne){var se;if(se=this.rules.inline.url.exec(q)){var pe,ye;if(se[2]==="@")pe=ee(this.options.mangle?ne(se[0]):se[0]),ye="mailto:"+pe;else{var Le;do Le=se[0],se[0]=this.rules.inline._backpedal.exec(se[0])[0];while(Le!==se[0]);pe=ee(se[0]),se[1]==="www."?ye="http://"+pe:ye=pe}return{type:"link",raw:se[0],text:pe,href:ye,tokens:[{type:"text",raw:pe,text:pe}]}}},ce.inlineText=function(q,ne,se){var pe=this.rules.inline.text.exec(q);if(pe){var ye;return ne?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ee(pe[0]):pe[0]:ye=ee(this.options.smartypants?se(pe[0]):pe[0]),{type:"text",raw:pe[0],text:ye}}},ge}(),ae=K.noopTest,$=K.edit,re=K.merge,J={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:ae,table:ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};J._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,J._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,J.def=$(J.def).replace("label",J._label).replace("title",J._title).getRegex(),J.bullet=/(?:[*+-]|\d{1,9}[.)])/,J.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,J.item=$(J.item,"gm").replace(/bull/g,J.bullet).getRegex(),J.list=$(J.list).replace(/bull/g,J.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+J.def.source+")").getRegex(),J._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",J._comment=/<!--(?!-?>)[\s\S]*?-->/,J.html=$(J.html,"i").replace("comment",J._comment).replace("tag",J._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),J.paragraph=$(J._paragraph).replace("hr",J.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",J._tag).getRegex(),J.blockquote=$(J.blockquote).replace("paragraph",J.paragraph).getRegex(),J.normal=re({},J),J.gfm=re({},J.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*|$)"}),J.gfm.nptable=$(J.gfm.nptable).replace("hr",J.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",J._tag).getRegex(),J.gfm.table=$(J.gfm.table).replace("hr",J.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",J._tag).getRegex(),J.pedantic=re({},J.normal,{html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",J._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:ae,paragraph:$(J.normal._paragraph).replace("hr",J.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",J.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ae,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:ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ie._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ie.punctuation=$(ie.punctuation).replace(/punctuation/g,ie._punctuation).getRegex(),ie._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ie._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ie.em.start=$(ie.em.start).replace(/punctuation/g,ie._punctuation).getRegex(),ie.em.middle=$(ie.em.middle).replace(/punctuation/g,ie._punctuation).replace(/overlapSkip/g,ie._overlapSkip).getRegex(),ie.em.endAst=$(ie.em.endAst,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.em.endUnd=$(ie.em.endUnd,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.start=$(ie.strong.start).replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.middle=$(ie.strong.middle).replace(/punctuation/g,ie._punctuation).replace(/blockSkip/g,ie._blockSkip).getRegex(),ie.strong.endAst=$(ie.strong.endAst,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.endUnd=$(ie.strong.endUnd,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.blockSkip=$(ie._blockSkip,"g").getRegex(),ie.overlapSkip=$(ie._overlapSkip,"g").getRegex(),ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ie._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])?)+(?![-_])/,ie.autolink=$(ie.autolink).replace("scheme",ie._scheme).replace("email",ie._email).getRegex(),ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ie.tag=$(ie.tag).replace("comment",J._comment).replace("attribute",ie._attribute).getRegex(),ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ie.link=$(ie.link).replace("label",ie._label).replace("href",ie._href).replace("title",ie._title).getRegex(),ie.reflink=$(ie.reflink).replace("label",ie._label).getRegex(),ie.reflinkSearch=$(ie.reflinkSearch,"g").replace("reflink",ie.reflink).replace("nolink",ie.nolink).getRegex(),ie.normal=re({},ie),ie.pedantic=re({},ie.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:$(/^!?\[(label)\]\((.*?)\)/).replace("label",ie._label).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie._label).getRegex()}),ie.gfm=re({},ie.normal,{escape:$(ie.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ie.gfm.url=$(ie.gfm.url,"i").replace("email",ie.gfm._extended_email).getRegex(),ie.breaks=re({},ie.gfm,{br:$(ie.br).replace("{2,}","*").getRegex(),text:$(ie.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var V={block:J,inline:ie},Y=B.defaults,Z=V.block,le=V.inline;function xe(ge){return ge.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(ge){var ce="",me,q,ne=ge.length;for(me=0;me<ne;me++)q=ge.charCodeAt(me),Math.random()>.5&&(q="x"+q.toString(16)),ce+="&#"+q+";";return ce}var Te=function(){function ge(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||Y,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var q={block:Z.normal,inline:le.normal};this.options.pedantic?(q.block=Z.pedantic,q.inline=le.pedantic):this.options.gfm&&(q.block=Z.gfm,this.options.breaks?q.inline=le.breaks:q.inline=le.gfm),this.tokenizer.rules=q}ge.lex=function(q,ne){var se=new ge(ne);return se.lex(q)};var ce=ge.prototype;return ce.lex=function(q){return q=q.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(q,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(q,ne,se){ne===void 0&&(ne=[]),se===void 0&&(se=!0),q=q.replace(/^ +$/gm,"");for(var pe,ye,Le,Ke;q;){if(pe=this.tokenizer.space(q)){q=q.substring(pe.raw.length),pe.type&&ne.push(pe);continue}if(pe=this.tokenizer.code(q,ne)){q=q.substring(pe.raw.length),pe.type?ne.push(pe):(Ke=ne[ne.length-1],Ke.raw+=`
|
|
`+pe.raw,Ke.text+=`
|
|
`+pe.text);continue}if(pe=this.tokenizer.fences(q)){q=q.substring(pe.raw.length),ne.push(pe);continue}if(pe=this.tokenizer.heading(q)){q=q.substring(pe.raw.length),ne.push(pe);continue}if(pe=this.tokenizer.nptable(q)){q=q.substring(pe.raw.length),ne.push(pe);continue}if(pe=this.tokenizer.hr(q)){q=q.substring(pe.raw.length),ne.push(pe);continue}if(pe=this.tokenizer.blockquote(q)){q=q.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],se),ne.push(pe);continue}if(pe=this.tokenizer.list(q)){for(q=q.substring(pe.raw.length),Le=pe.items.length,ye=0;ye<Le;ye++)pe.items[ye].tokens=this.blockTokens(pe.items[ye].text,[],!1);ne.push(pe);continue}if(pe=this.tokenizer.html(q)){q=q.substring(pe.raw.length),ne.push(pe);continue}if(se&&(pe=this.tokenizer.def(q))){q=q.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(q)){q=q.substring(pe.raw.length),ne.push(pe);continue}if(pe=this.tokenizer.lheading(q)){q=q.substring(pe.raw.length),ne.push(pe);continue}if(se&&(pe=this.tokenizer.paragraph(q))){q=q.substring(pe.raw.length),ne.push(pe);continue}if(pe=this.tokenizer.text(q,ne)){q=q.substring(pe.raw.length),pe.type?ne.push(pe):(Ke=ne[ne.length-1],Ke.raw+=`
|
|
`+pe.raw,Ke.text+=`
|
|
`+pe.text);continue}if(q){var Je="Infinite loop on byte: "+q.charCodeAt(0);if(this.options.silent){console.error(Je);break}else throw new Error(Je)}}return ne},ce.inline=function(q){var ne,se,pe,ye,Le,Ke,Je=q.length;for(ne=0;ne<Je;ne++){Ke=q[ne];switch(Ke.type){case"paragraph":case"text":case"heading":{Ke.tokens=[],this.inlineTokens(Ke.text,Ke.tokens);break}case"table":{for(Ke.tokens={header:[],cells:[]},ye=Ke.header.length,se=0;se<ye;se++)Ke.tokens.header[se]=[],this.inlineTokens(Ke.header[se],Ke.tokens.header[se]);for(ye=Ke.cells.length,se=0;se<ye;se++)for(Le=Ke.cells[se],Ke.tokens.cells[se]=[],pe=0;pe<Le.length;pe++)Ke.tokens.cells[se][pe]=[],this.inlineTokens(Le[pe],Ke.tokens.cells[se][pe]);break}case"blockquote":{this.inline(Ke.tokens);break}case"list":{for(ye=Ke.items.length,se=0;se<ye;se++)this.inline(Ke.items[se].tokens);break}}}return q},ce.inlineTokens=function(q,ne,se,pe,ye){ne===void 0&&(ne=[]),se===void 0&&(se=!1),pe===void 0&&(pe=!1),ye===void 0&&(ye="");var Le,Ke=q,Je;if(this.tokens.links){var et=Object.keys(this.tokens.links);if(et.length>0)for(;(Je=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)et.includes(Je[0].slice(Je[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Je=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;q;){if(Le=this.tokenizer.escape(q)){q=q.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.tag(q,se,pe)){q=q.substring(Le.raw.length),se=Le.inLink,pe=Le.inRawBlock,ne.push(Le);continue}if(Le=this.tokenizer.link(q)){q=q.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,pe)),ne.push(Le);continue}if(Le=this.tokenizer.reflink(q,this.tokens.links)){q=q.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,pe)),ne.push(Le);continue}if(Le=this.tokenizer.strong(q,Ke,ye)){q=q.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],se,pe),ne.push(Le);continue}if(Le=this.tokenizer.em(q,Ke,ye)){q=q.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],se,pe),ne.push(Le);continue}if(Le=this.tokenizer.codespan(q)){q=q.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.br(q)){q=q.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.del(q)){q=q.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],se,pe),ne.push(Le);continue}if(Le=this.tokenizer.autolink(q,he)){q=q.substring(Le.raw.length),ne.push(Le);continue}if(!se&&(Le=this.tokenizer.url(q,he))){q=q.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.inlineText(q,pe,xe)){q=q.substring(Le.raw.length),ye=Le.raw.slice(-1),ne.push(Le);continue}if(q){var Qe="Infinite loop on byte: "+q.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return ne},H(ge,null,[{key:"rules",get:function(){return{block:Z,inline:le}}}]),ge}(),De=B.defaults,Pe=K.cleanUrl,Be=K.escape,Me=function(){function ge(me){this.options=me||De}var ce=ge.prototype;return ce.code=function(q,ne,se){var pe=(ne||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(q,pe);ye!=null&&ye!==q&&(se=!0,q=ye)}return pe?'<pre><code class="'+this.options.langPrefix+Be(pe,!0)+'">'+(se?q:Be(q,!0))+`</code></pre>
|
|
`:"<pre><code>"+(se?q:Be(q,!0))+`</code></pre>
|
|
`},ce.blockquote=function(q){return`<blockquote>
|
|
`+q+`</blockquote>
|
|
`},ce.html=function(q){return q},ce.heading=function(q,ne,se,pe){return this.options.headerIds?"<h"+ne+' id="'+this.options.headerPrefix+pe.slug(se)+'">'+q+"</h"+ne+`>
|
|
`:"<h"+ne+">"+q+"</h"+ne+`>
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ce.list=function(q,ne,se){var pe=ne?"ol":"ul",ye=ne&&se!==1?' start="'+se+'"':"";return"<"+pe+ye+`>
|
|
`+q+"</"+pe+`>
|
|
`},ce.listitem=function(q){return"<li>"+q+`</li>
|
|
`},ce.checkbox=function(q){return"<input "+(q?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(q){return"<p>"+q+`</p>
|
|
`},ce.table=function(q,ne){return ne&&(ne="<tbody>"+ne+"</tbody>"),`<table>
|
|
<thead>
|
|
`+q+`</thead>
|
|
`+ne+`</table>
|
|
`},ce.tablerow=function(q){return`<tr>
|
|
`+q+`</tr>
|
|
`},ce.tablecell=function(q,ne){var se=ne.header?"th":"td",pe=ne.align?"<"+se+' align="'+ne.align+'">':"<"+se+">";return pe+q+"</"+se+`>
|
|
`},ce.strong=function(q){return"<strong>"+q+"</strong>"},ce.em=function(q){return"<em>"+q+"</em>"},ce.codespan=function(q){return"<code>"+q+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(q){return"<del>"+q+"</del>"},ce.link=function(q,ne,se){if(q=Pe(this.options.sanitize,this.options.baseUrl,q),q===null)return se;var pe='<a href="'+Be(q)+'"';return ne&&(pe+=' title="'+ne+'"'),pe+=">"+se+"</a>",pe},ce.image=function(q,ne,se){if(q=Pe(this.options.sanitize,this.options.baseUrl,q),q===null)return se;var pe='<img src="'+q+'" alt="'+se+'"';return ne&&(pe+=' title="'+ne+'"'),pe+=this.options.xhtml?"/>":">",pe},ce.text=function(q){return q},ge}(),ke=function(){function ge(){}var ce=ge.prototype;return ce.strong=function(q){return q},ce.em=function(q){return q},ce.codespan=function(q){return q},ce.del=function(q){return q},ce.html=function(q){return q},ce.text=function(q){return q},ce.link=function(q,ne,se){return""+se},ce.image=function(q,ne,se){return""+se},ce.br=function(){return""},ge}(),Ve=function(){function ge(){this.seen={}}var ce=ge.prototype;return ce.slug=function(q){var ne=q.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ne)){var se=ne;do this.seen[se]++,ne=se+"-"+this.seen[se];while(this.seen.hasOwnProperty(ne))}return this.seen[ne]=0,ne},ge}(),Se=B.defaults,Re=K.unescape,_e=function(){function ge(me){this.options=me||Se,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ke,this.slugger=new Ve}ge.parse=function(q,ne){var se=new ge(ne);return se.parse(q)};var ce=ge.prototype;return ce.parse=function(q,ne){ne===void 0&&(ne=!0);var se="",pe,ye,Le,Ke,Je,et,Qe,yt,st,rt,Tt,mt,vt,bt,ft,At,Ut,Wt,Jt=q.length;for(pe=0;pe<Jt;pe++){rt=q[pe];switch(rt.type){case"space":continue;case"hr":{se+=this.renderer.hr();continue}case"heading":{se+=this.renderer.heading(this.parseInline(rt.tokens),rt.depth,Re(this.parseInline(rt.tokens,this.textRenderer)),this.slugger);continue}case"code":{se+=this.renderer.code(rt.text,rt.lang,rt.escaped);continue}case"table":{for(yt="",Qe="",Ke=rt.header.length,ye=0;ye<Ke;ye++)Qe+=this.renderer.tablecell(this.parseInline(rt.tokens.header[ye]),{header:!0,align:rt.align[ye]});for(yt+=this.renderer.tablerow(Qe),st="",Ke=rt.cells.length,ye=0;ye<Ke;ye++){for(et=rt.tokens.cells[ye],Qe="",Je=et.length,Le=0;Le<Je;Le++)Qe+=this.renderer.tablecell(this.parseInline(et[Le]),{header:!1,align:rt.align[Le]});st+=this.renderer.tablerow(Qe)}se+=this.renderer.table(yt,st);continue}case"blockquote":{st=this.parse(rt.tokens),se+=this.renderer.blockquote(st);continue}case"list":{for(Tt=rt.ordered,mt=rt.start,vt=rt.loose,Ke=rt.items.length,st="",ye=0;ye<Ke;ye++)ft=rt.items[ye],At=ft.checked,Ut=ft.task,bt="",ft.task&&(Wt=this.renderer.checkbox(At),vt?ft.tokens.length>0&&ft.tokens[0].type==="text"?(ft.tokens[0].text=Wt+" "+ft.tokens[0].text,ft.tokens[0].tokens&&ft.tokens[0].tokens.length>0&&ft.tokens[0].tokens[0].type==="text"&&(ft.tokens[0].tokens[0].text=Wt+" "+ft.tokens[0].tokens[0].text)):ft.tokens.unshift({type:"text",text:Wt}):bt+=Wt),bt+=this.parse(ft.tokens,vt),st+=this.renderer.listitem(bt,Ut,At);se+=this.renderer.list(st,Tt,mt);continue}case"html":{se+=this.renderer.html(rt.text);continue}case"paragraph":{se+=this.renderer.paragraph(this.parseInline(rt.tokens));continue}case"text":{for(st=rt.tokens?this.parseInline(rt.tokens):rt.text;pe+1<Jt&&q[pe+1].type==="text";)rt=q[++pe],st+=`
|
|
`+(rt.tokens?this.parseInline(rt.tokens):rt.text);se+=ne?this.renderer.paragraph(st):st;continue}default:{var Rt='Token with "'+rt.type+'" type was not found.';if(this.options.silent){console.error(Rt);return}else throw new Error(Rt)}}}return se},ce.parseInline=function(q,ne){ne=ne||this.renderer;var se="",pe,ye,Le=q.length;for(pe=0;pe<Le;pe++){ye=q[pe];switch(ye.type){case"escape":{se+=ne.text(ye.text);break}case"html":{se+=ne.html(ye.text);break}case"link":{se+=ne.link(ye.href,ye.title,this.parseInline(ye.tokens,ne));break}case"image":{se+=ne.image(ye.href,ye.title,ye.text);break}case"strong":{se+=ne.strong(this.parseInline(ye.tokens,ne));break}case"em":{se+=ne.em(this.parseInline(ye.tokens,ne));break}case"codespan":{se+=ne.codespan(ye.text);break}case"br":{se+=ne.br();break}case"del":{se+=ne.del(this.parseInline(ye.tokens,ne));break}case"text":{se+=ne.text(ye.text);break}default:{var Ke='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Ke);return}else throw new Error(Ke)}}}return se},ge}(),Ne=K.merge,Fe=K.checkSanitizeDeprecation,Ue=K.escape,Ce=B.getDefaults,He=B.changeDefaults,je=B.defaults;function we(ge,ce,me){if(typeof ge=="undefined"||ge===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ge!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ge)+", string expected");if(typeof ce=="function"&&(me=ce,ce=null),ce=Ne({},we.defaults,ce||{}),Fe(ce),me){var q=ce.highlight,ne;try{ne=Te.lex(ge,ce)}catch(Le){return me(Le)}var se=function(Ke){var Je;if(!Ke)try{Je=_e.parse(ne,ce)}catch(et){Ke=et}return ce.highlight=q,Ke?me(Ke):me(null,Je)};if(!q||q.length<3)return se();if(delete ce.highlight,!ne.length)return se();var pe=0;we.walkTokens(ne,function(Le){Le.type==="code"&&(pe++,setTimeout(function(){q(Le.text,Le.lang,function(Ke,Je){if(Ke)return se(Ke);Je!=null&&Je!==Le.text&&(Le.text=Je,Le.escaped=!0),pe--,pe===0&&se()})},0))}),pe===0&&se();return}try{var ye=Te.lex(ge,ce);return ce.walkTokens&&we.walkTokens(ye,ce.walkTokens),_e.parse(ye,ce)}catch(Le){if(Le.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Ue(Le.message+"",!0)+"</pre>";throw Le}}we.options=we.setOptions=function(ge){return Ne(we.defaults,ge),He(we.defaults),we},we.getDefaults=Ce,we.defaults=je,we.use=function(ge){var ce=Ne({},ge);if(ge.renderer&&function(){var q=we.defaults.renderer||new Me,ne=function(ye){var Le=q[ye];q[ye]=function(){for(var Ke=arguments.length,Je=new Array(Ke),et=0;et<Ke;et++)Je[et]=arguments[et];var Qe=ge.renderer[ye].apply(q,Je);return Qe===!1&&(Qe=Le.apply(q,Je)),Qe}};for(var se in ge.renderer)ne(se);ce.renderer=q}(),ge.tokenizer&&function(){var q=we.defaults.tokenizer||new Ee,ne=function(ye){var Le=q[ye];q[ye]=function(){for(var Ke=arguments.length,Je=new Array(Ke),et=0;et<Ke;et++)Je[et]=arguments[et];var Qe=ge.tokenizer[ye].apply(q,Je);return Qe===!1&&(Qe=Le.apply(q,Je)),Qe}};for(var se in ge.tokenizer)ne(se);ce.tokenizer=q}(),ge.walkTokens){var me=we.defaults.walkTokens;ce.walkTokens=function(q){ge.walkTokens(q),me&&me(q)}}we.setOptions(ce)},we.walkTokens=function(ge,ce){for(var me=I(ge),q;!(q=me()).done;){var ne=q.value;ce(ne);switch(ne.type){case"table":{for(var se=I(ne.tokens.header),pe;!(pe=se()).done;){var ye=pe.value;we.walkTokens(ye,ce)}for(var Le=I(ne.tokens.cells),Ke;!(Ke=Le()).done;)for(var Je=Ke.value,et=I(Je),Qe;!(Qe=et()).done;){var yt=Qe.value;we.walkTokens(yt,ce)}break}case"list":{we.walkTokens(ne.items,ce);break}default:ne.tokens&&we.walkTokens(ne.tokens,ce)}}},we.Parser=_e,we.parser=_e.parse,we.Renderer=Me,we.TextRenderer=ke,we.Lexer=Te,we.lexer=Te.lex,we.Tokenizer=Ee,we.Slugger=Ve,we.parse=we;var Ie=we;return Ie})},ELLl:function(ot,Xe,te){(function(oe){oe(te("VrN/"))})(function(oe){var H={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},L=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(b,g,c){c&&c!=oe.Init&&(b.removeKeyMap(I),b.state.closeBrackets=null),g&&(P(z(g,"pairs")),b.state.closeBrackets=g,b.addKeyMap(I))});function z(b,g){return g=="pairs"&&typeof b=="string"?b:typeof b=="object"&&b[g]!=null?b[g]:H[g]}var I={Backspace:_,Enter:O};function P(b){for(var g=0;g<b.length;g++){var c=b.charAt(g),o="'"+c+"'";I[o]||(I[o]=B(c))}}P(H.pairs+"`");function B(b){return function(g){return C(g,b)}}function N(b){var g=b.state.closeBrackets;if(!g||g.override)return g;var c=b.getModeAt(b.getCursor());return c.closeBrackets||g}function _(b){var g=N(b);if(!g||b.getOption("disableInput"))return oe.Pass;for(var c=z(g,"pairs"),o=b.listSelections(),u=0;u<o.length;u++){if(!o[u].empty())return oe.Pass;var d=R(b,o[u].head);if(!d||c.indexOf(d)%2!=0)return oe.Pass}for(var u=o.length-1;u>=0;u--){var T=o[u].head;b.replaceRange("",L(T.line,T.ch-1),L(T.line,T.ch+1),"+delete")}}function O(b){var g=N(b),c=g&&z(g,"explode");if(!c||b.getOption("disableInput"))return oe.Pass;for(var o=b.listSelections(),u=0;u<o.length;u++){if(!o[u].empty())return oe.Pass;var d=R(b,o[u].head);if(!d||c.indexOf(d)%2!=0)return oe.Pass}b.operation(function(){var T=b.lineSeparator()||`
|
|
`;b.replaceSelection(T+T,null),b.execCommand("goCharLeft"),o=b.listSelections();for(var p=0;p<o.length;p++){var h=o[p].head.line;b.indentLine(h,null,!0),b.indentLine(h+1,null,!0)}})}function y(b){var g=oe.cmpPos(b.anchor,b.head)>0;return{anchor:new L(b.anchor.line,b.anchor.ch+(g?-1:1)),head:new L(b.head.line,b.head.ch+(g?1:-1))}}function C(b,g){var c=N(b);if(!c||b.getOption("disableInput"))return oe.Pass;var o=z(c,"pairs"),u=o.indexOf(g);if(u==-1)return oe.Pass;for(var d=z(c,"closeBefore"),T=z(c,"triples"),p=o.charAt(u+1)==g,h=b.listSelections(),S=u%2==0,v,l=0;l<h.length;l++){var f=h[l],s=f.head,i,x=b.getRange(s,L(s.line,s.ch+1));if(S&&!f.empty())i="surround";else if((p||!S)&&x==g)p&&A(b,s)?i="both":T.indexOf(g)>=0&&b.getRange(s,L(s.line,s.ch+3))==g+g+g?i="skipThree":i="skip";else if(p&&s.ch>1&&T.indexOf(g)>=0&&b.getRange(L(s.line,s.ch-2),s)==g+g){if(s.ch>2&&/\bstring/.test(b.getTokenTypeAt(L(s.line,s.ch-2))))return oe.Pass;i="addFour"}else if(p){var m=s.ch==0?" ":b.getRange(L(s.line,s.ch-1),s);if(!oe.isWordChar(x)&&m!=g&&!oe.isWordChar(m))i="both";else return oe.Pass}else if(S&&(x.length===0||/\s/.test(x)||d.indexOf(x)>-1))i="both";else return oe.Pass;if(!v)v=i;else if(v!=i)return oe.Pass}var E=u%2?o.charAt(u-1):g,D=u%2?g:o.charAt(u+1);b.operation(function(){if(v=="skip")b.execCommand("goCharRight");else if(v=="skipThree")for(var U=0;U<3;U++)b.execCommand("goCharRight");else if(v=="surround"){for(var j=b.getSelections(),U=0;U<j.length;U++)j[U]=E+j[U]+D;b.replaceSelections(j,"around"),j=b.listSelections().slice();for(var U=0;U<j.length;U++)j[U]=y(j[U]);b.setSelections(j)}else v=="both"?(b.replaceSelection(E+D,null),b.triggerElectric(E+D),b.execCommand("goCharLeft")):v=="addFour"&&(b.replaceSelection(E+E+E+E,"before"),b.execCommand("goCharRight"))})}function R(b,g){var c=b.getRange(L(g.line,g.ch-1),L(g.line,g.ch+1));return c.length==2?c:null}function A(b,g){var c=b.getTokenAt(L(g.line,g.ch+1));return/\bstring/.test(c.type)&&c.start==g.ch&&(g.ch==0||!/\bstring/.test(b.getTokenTypeAt(g)))}})},GfqC:function(ot,Xe,te){"use strict";var oe=te("cDcd"),H=te.n(oe),L=te("TSYQ"),z=te.n(L);function I(K,k){var M="cannot "+K.method+" "+K.action+" "+k.status+"'",G=new Error(M);return G.status=k.status,G.method=K.method,G.url=K.action,G}function P(K){var k=K.responseText||K.response;if(!k)return k;try{return JSON.parse(k)}catch(M){return k}}function B(K){var k=new XMLHttpRequest;K.onProgress&&k.upload&&(k.upload.onprogress=function(ue){ue.total>0&&(ue.percent=ue.loaded/ue.total*100),K.onProgress(ue)});var M=new FormData;K.data&&Object.keys(K.data).forEach(function(ee){var ue=K.data[ee];if(Array.isArray(ue)){ue.forEach(function(de){M.append(ee+"[]",de)});return}M.append(ee,K.data[ee])}),K.file instanceof Blob?M.append(K.filename,K.file,K.file.name):M.append(K.filename,K.file),k.onerror=function(ue){K.onError(ue)},k.onload=function(){return k.status<200||k.status>=300?K.onError(I(K,k),P(k)):K.onSuccess(P(k),k)},k.open(K.method,K.action,!0),K.withCredentials&&"withCredentials"in k&&(k.withCredentials=!0);var G=K.headers||{};return G["X-Requested-With"]!==null&&k.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(G).forEach(function(ee){G[ee]!==null&&k.setRequestHeader(ee,G[ee])}),k.send(M),{abort:function(){k.abort()}}}var N=+new Date,_=0;function O(){return"rc-upload-"+N+"-"+ ++_}function y(K,k){return K.indexOf(k,K.length-k.length)!==-1}var C=function(K,k){if(K&&k){var M=Array.isArray(k)?k:k.split(","),G=K.name||"",ee=K.type||"",ue=ee.replace(/\/.*$/,"");return M.some(function(de){var be=de.trim();return be.charAt(0)==="."?y(G.toLowerCase(),be.toLowerCase()):/\/\*$/.test(be)?ue===be.replace(/\/.*$/,""):ee===be})}return!0};function R(K,k){var M=K.createReader(),G=[];function ee(){M.readEntries(function(ue){var de=Array.prototype.slice.apply(ue);G=G.concat(de);var be=!de.length;be?k(G):ee()})}ee()}var A=function(k,M,G){var ee=function ue(de,be){be=be||"",de.isFile?de.file(function(Ee){G(Ee)&&(de.fullPath&&!Ee.webkitRelativePath&&(Object.defineProperties(Ee,{webkitRelativePath:{writable:!0}}),Ee.webkitRelativePath=de.fullPath.replace(/^\//,""),Object.defineProperties(Ee,{webkitRelativePath:{writable:!1}})),M([Ee]))}):de.isDirectory&&R(de,function(Ee){Ee.forEach(function(ae){ue(ae,""+be+de.name+"/")})})};k.forEach(function(ue){ee(ue.webkitGetAsEntry())})},b=A,g=Object.assign||function(K){for(var k=1;k<arguments.length;k++){var M=arguments[k];for(var G in M)Object.prototype.hasOwnProperty.call(M,G)&&(K[G]=M[G])}return K},c=function(){function K(k,M){var G=[],ee=!0,ue=!1,de=void 0;try{for(var be=k[Symbol.iterator](),Ee;!(ee=(Ee=be.next()).done)&&!(G.push(Ee.value),M&&G.length===M);ee=!0);}catch(ae){ue=!0,de=ae}finally{try{!ee&&be.return&&be.return()}finally{if(ue)throw de}}return G}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return K(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function K(k,M){for(var G=0;G<M.length;G++){var ee=M[G];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(k,ee.key,ee)}}return function(k,M,G){return M&&K(k.prototype,M),G&&K(k,G),k}}();function u(K,k,M){return k in K?Object.defineProperty(K,k,{value:M,enumerable:!0,configurable:!0,writable:!0}):K[k]=M,K}function d(K,k){var M={};for(var G in K){if(k.indexOf(G)>=0)continue;if(!Object.prototype.hasOwnProperty.call(K,G))continue;M[G]=K[G]}return M}function T(K,k){if(!(K instanceof k))throw new TypeError("Cannot call a class as a function")}function p(K,k){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:K}function h(K,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);K.prototype=Object.create(k&&k.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(K,k):K.__proto__=k)}var S=function(k){return Object.keys(k).reduce(function(M,G){return(G.substr(0,5)==="data-"||G.substr(0,5)==="aria-"||G==="role")&&(M[G]=k[G]),M},{})},v=function(K){h(k,K);function k(){var M,G,ee,ue;T(this,k);for(var de=arguments.length,be=Array(de),Ee=0;Ee<de;Ee++)be[Ee]=arguments[Ee];return ue=(G=(ee=p(this,(M=k.__proto__||Object.getPrototypeOf(k)).call.apply(M,[this].concat(be))),ee),ee.state={uid:O()},ee.reqs={},ee.onChange=function(ae){var $=ae.target.files;ee.uploadFiles($),ee.reset()},ee.onClick=function(ae){var $=ee.fileInput;if(!$)return;var re=ee.props,J=re.children,ie=re.onClick;J&&J.type==="button"&&($.parentNode.focus(),$.parentNode.querySelector("button").blur()),$.click(),ie&&ie(ae)},ee.onKeyDown=function(ae){ae.key==="Enter"&&ee.onClick()},ee.onFileDrop=function(ae){var $=ee.props.multiple;if(ae.preventDefault(),ae.type==="dragover")return;if(ee.props.directory)b(Array.prototype.slice.call(ae.dataTransfer.items),ee.uploadFiles,function(J){return C(J,ee.props.accept)});else{var re=Array.prototype.slice.call(ae.dataTransfer.files).filter(function(J){return C(J,ee.props.accept)});$===!1&&(re=re.slice(0,1)),ee.uploadFiles(re)}},ee.uploadFiles=function(ae){var $=Array.prototype.slice.call(ae);$.map(function(re){return re.uid=O(),re}).forEach(function(re){ee.upload(re,$)})},ee.saveFileInput=function(ae){ee.fileInput=ae},G),p(ee,ue)}return o(k,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(G,ee){var ue=this,de=this.props;if(!de.beforeUpload)return setTimeout(function(){return ue.post(G)},0);var be=de.beforeUpload(G,ee);be&&be.then?be.then(function(Ee){var ae=Object.prototype.toString.call(Ee);return ae==="[object File]"||ae==="[object Blob]"?ue.post(Ee):ue.post(G)}).catch(function(Ee){console.log(Ee)}):be!==!1&&setTimeout(function(){return ue.post(G)},0);return}},{key:"post",value:function(G){var ee=this;if(!this._isMounted)return;var ue=this.props,de=ue.onStart,be=ue.onProgress,Ee=ue.transformFile,ae=Ee===void 0?function($){return $}:Ee;new Promise(function($){var re=ue.action;return typeof re=="function"&&(re=re(G)),$(re)}).then(function($){var re=G.uid,J=ue.customRequest||B,ie=Promise.resolve(ae(G)).then(function(V){var Y=ue.data;return typeof Y=="function"&&(Y=Y(V)),Promise.all([V,Y])}).catch(function(V){console.error(V)});ie.then(function(V){var Y=c(V,2),Z=Y[0],le=Y[1],xe={action:$,filename:ue.name,data:le,file:Z,headers:ue.headers,withCredentials:ue.withCredentials,method:ue.method||"post",onProgress:be?function(he){be(he,G)}:null,onSuccess:function(Te,De){delete ee.reqs[re],ue.onSuccess(Te,G,De)},onError:function(Te,De){delete ee.reqs[re],ue.onError(Te,De,G)}};de(G),ee.reqs[re]=J(xe)})})}},{key:"reset",value:function(){this.setState({uid:O()})}},{key:"abort",value:function(G){var ee=this.reqs;if(G){var ue=G;G&&G.uid&&(ue=G.uid),ee[ue]&&ee[ue].abort&&ee[ue].abort(),delete ee[ue]}else Object.keys(ee).forEach(function(de){ee[de]&&ee[de].abort&&ee[de].abort(),delete ee[de]})}},{key:"render",value:function(){var G,ee=this.props,ue=ee.component,de=ee.prefixCls,be=ee.className,Ee=ee.disabled,ae=ee.id,$=ee.style,re=ee.multiple,J=ee.accept,ie=ee.children,V=ee.directory,Y=ee.openFileDialogOnClick,Z=ee.onMouseEnter,le=ee.onMouseLeave,xe=d(ee,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),he=z()((G={},u(G,de,!0),u(G,de+"-disabled",Ee),u(G,be,be),G)),Te=Ee?{}:{onClick:Y?this.onClick:function(){},onKeyDown:Y?this.onKeyDown:function(){},onMouseEnter:Z,onMouseLeave:le,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return H.a.createElement(ue,g({},Te,{className:he,role:"button",style:$}),H.a.createElement("input",g({},S(xe),{id:ae,type:"file",ref:this.saveFileInput,onClick:function(Pe){return Pe.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:J,directory:V?"directory":null,webkitdirectory:V?"webkitdirectory":null,multiple:re,onChange:this.onChange})),ie)}}]),k}(oe.Component),l=v,f=Object.assign||function(K){for(var k=1;k<arguments.length;k++){var M=arguments[k];for(var G in M)Object.prototype.hasOwnProperty.call(M,G)&&(K[G]=M[G])}return K},s=function(){function K(k,M){for(var G=0;G<M.length;G++){var ee=M[G];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(k,ee.key,ee)}}return function(k,M,G){return M&&K(k.prototype,M),G&&K(k,G),k}}();function i(K,k){if(!(K instanceof k))throw new TypeError("Cannot call a class as a function")}function x(K,k){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:K}function m(K,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);K.prototype=Object.create(k&&k.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(K,k):K.__proto__=k)}function E(){}var D=function(K){m(k,K);function k(){var M,G,ee,ue;i(this,k);for(var de=arguments.length,be=Array(de),Ee=0;Ee<de;Ee++)be[Ee]=arguments[Ee];return ue=(G=(ee=x(this,(M=k.__proto__||Object.getPrototypeOf(k)).call.apply(M,[this].concat(be))),ee),ee.saveUploader=function(ae){ee.uploader=ae},G),x(ee,ue)}return s(k,[{key:"abort",value:function(G){this.uploader.abort(G)}},{key:"render",value:function(){return H.a.createElement(l,f({},this.props,{ref:this.saveUploader}))}}]),k}(oe.Component);D.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:E,onError:E,onSuccess:E,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var U=D,j=Xe.a=U},Gytx:function(ot,Xe){ot.exports=function(oe,H,L,z){var I=L?L.call(z,oe,H):void 0;if(I!==void 0)return!!I;if(oe===H)return!0;if(typeof oe!="object"||!oe||typeof H!="object"||!H)return!1;var P=Object.keys(oe),B=Object.keys(H);if(P.length!==B.length)return!1;for(var N=Object.prototype.hasOwnProperty.bind(H),_=0;_<P.length;_++){var O=P[_];if(!N(O))return!1;var y=oe[O],C=H[O];if(I=L?L.call(z,y,C,O):void 0,I===!1||I===void 0&&y!==C)return!1}return!0}},HmJG:function(ot,Xe,te){},LdHM:function(ot,Xe,te){"use strict";te.d(Xe,"b",function(){return d}),te.d(Xe,"a",function(){return p});var oe=te("1OyB"),H=te("vuIU"),L=te("Ji7U"),z=te("LK+K"),I=te("cDcd"),P=te("rePB"),B=te("Ff2n"),N=te("ODXe"),_=te("4IlW"),O=te("bX4T"),y=te("YrtM"),C=te("TSYQ"),R=te.n(C),A=te("+nKL"),b=te("8OUc"),g=function(G,ee){var ue=G.prefixCls,de=G.id,be=G.flattenOptions,Ee=G.childrenAsData,ae=G.values,$=G.searchValue,re=G.multiple,J=G.defaultActiveFirstOption,ie=G.height,V=G.itemHeight,Y=G.notFoundContent,Z=G.open,le=G.menuItemSelectedIcon,xe=G.virtual,he=G.onSelect,Te=G.onToggleOpen,De=G.onActiveValue,Pe=G.onScroll,Be=G.onMouseEnter,Me="".concat(ue,"-item"),ke=Object(y.a)(function(){return be},[Z,be],function(Ie,ge){return ge[0]&&Ie[1]!==ge[1]}),Ve=I.useRef(null),Se=function(ge){ge.preventDefault()},Re=function(ge){Ve.current&&Ve.current.scrollTo({index:ge})},_e=function(ge){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=ke.length,q=0;q<me;q+=1){var ne=(ge+q*ce+me)%me,se=ke[ne],pe=se.group,ye=se.data;if(!pe&&!ye.disabled)return ne}return-1},Ne=I.useState(function(){return _e(0)}),Fe=Object(N.a)(Ne,2),Ue=Fe[0],Ce=Fe[1],He=function(ge){Ce(ge);var ce=ke[ge];if(!ce){De(null,-1);return}De(ce.data.value,ge)};I.useEffect(function(){He(J!==!1?_e(0):-1)},[ke.length,$]),I.useEffect(function(){var Ie=setTimeout(function(){if(!re&&Z&&ae.size===1){var ge=Array.from(ae)[0],ce=ke.findIndex(function(me){var q=me.data;return q.value===ge});He(ce),Re(ce)}});return function(){return clearTimeout(Ie)}},[Z]);var je=function(ge){ge!==void 0&&he(ge,{selected:!ae.has(ge)}),re||Te(!1)};if(I.useImperativeHandle(ee,function(){return{onKeyDown:function(ge){var ce=ge.which;switch(ce){case _.a.UP:case _.a.DOWN:{var me=0;if(ce===_.a.UP?me=-1:ce===_.a.DOWN&&(me=1),me!==0){var q=_e(Ue+me,me);Re(q),He(q)}break}case _.a.ENTER:{var ne=ke[Ue];ne&&!ne.data.disabled?je(ne.data.value):je(void 0),Z&&ge.preventDefault();break}case _.a.ESC:Te(!1)}},onKeyUp:function(){},scrollTo:function(ge){Re(ge)}}}),ke.length===0)return I.createElement("div",{role:"listbox",id:"".concat(de,"_list"),className:"".concat(Me,"-empty"),onMouseDown:Se},Y);function we(Ie){var ge=ke[Ie];if(!ge)return null;var ce=ge.data||{},me=ce.value,q=ce.label,ne=ce.children,se=Object(O.a)(ce,!0),pe=Ee?ne:q;return ge?I.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},se,{key:Ie,role:"option",id:"".concat(de,"_list_").concat(Ie),"aria-selected":ae.has(me)}),me):null}return I.createElement(I.Fragment,null,I.createElement("div",{role:"listbox",id:"".concat(de,"_list"),style:{height:0,width:0,overflow:"hidden"}},we(Ue-1),we(Ue),we(Ue+1)),I.createElement(A.a,{itemKey:"key",ref:Ve,data:ke,height:ie,itemHeight:V,fullHeight:!1,onMouseDown:Se,onScroll:Pe,virtual:xe,onMouseEnter:Be},function(Ie,ge){var ce,me=Ie.group,q=Ie.groupOption,ne=Ie.data,se=ne.label,pe=ne.key;if(me)return I.createElement("div",{className:R()(Me,"".concat(Me,"-group"))},se!==void 0?se:pe);var ye=ne.disabled,Le=ne.value,Ke=ne.title,Je=ne.children,et=ne.style,Qe=ne.className,yt=Object(B.a)(ne,["disabled","value","title","children","style","className"]),st=ae.has(Le),rt="".concat(Me,"-option"),Tt=R()(Me,rt,Qe,(ce={},Object(P.a)(ce,"".concat(rt,"-grouped"),q),Object(P.a)(ce,"".concat(rt,"-active"),Ue===ge&&!ye),Object(P.a)(ce,"".concat(rt,"-disabled"),ye),Object(P.a)(ce,"".concat(rt,"-selected"),st),ce)),mt=Ee?Je:se,vt=!le||typeof le=="function"||st;return I.createElement("div",Object.assign({},yt,{"aria-selected":st,className:Tt,title:Ke,onMouseMove:function(){if(Ue===ge||ye)return;He(ge)},onClick:function(){ye||je(Le)},style:et}),I.createElement("div",{className:"".concat(rt,"-content")},mt||Le),I.isValidElement(le)||st,vt&&I.createElement(b.a,{className:"".concat(Me,"-option-state"),customizeIcon:le,customizeIconProps:{isSelected:st}},st?"\u2713":null))}))},c=I.forwardRef(g);c.displayName="OptionList";var o=c,u=function(){return null};u.isSelectOption=!0;var d=u,T=function(){return null};T.isSelectOptGroup=!0;var p=T,h=te("VTBJ"),S=te("Zm9Q");function v(M){var G=M.key,ee=M.props,ue=ee.children,de=ee.value,be=Object(B.a)(ee,["children","value"]);return Object(h.a)({key:G,value:de!==void 0?de:G,children:ue},be)}function l(M){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(S.a)(M).map(function(ee,ue){if(!I.isValidElement(ee)||!ee.type)return null;var de=ee.type.isSelectOptGroup,be=ee.key,Ee=ee.props,ae=Ee.children,$=Object(B.a)(Ee,["children"]);return G||!de?v(ee):Object(h.a)(Object(h.a)({key:"__RC_SELECT_GRP__".concat(be===null?ue:be,"__"),label:be},$),{},{options:l(ae)})}).filter(function(ee){return ee})}var f=te("2Qr1"),s=te("qNPg"),i=te("U8pU"),x=te("Kwbf"),m=te("WKfj");function E(M){var G=M.mode,ee=M.options,ue=M.children,de=M.backfill,be=M.allowClear,Ee=M.placeholder,ae=M.getInputElement,$=M.showSearch,re=M.onSearch,J=M.defaultOpen,ie=M.autoFocus,V=M.labelInValue,Y=M.value,Z=M.inputValue,le=M.optionLabelProp,xe=G==="multiple"||G==="tags",he=$!==void 0?$:xe||G==="combobox",Te=ee||l(ue);if(Object(x.a)(G!=="tags"||Te.every(function(Me){return!Me.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var De=Te.some(function(Me){return Me.options?Me.options.some(function(ke){return typeof("value"in ke?ke.value:ke.key)=="number"}):typeof("value"in Me?Me.value:Me.key)=="number"});Object(x.a)(!De,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(x.a)(G!=="combobox"||!le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(x.a)(G==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(x.a)(G==="combobox"||!ae,"`getInputElement` only work with `combobox` mode."),Object(x.b)(G!=="combobox"||!ae||!be||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),re&&!he&&G!=="combobox"&&G!=="tags"&&Object(x.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(x.b)(!J||ie,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Y!=null){var Pe=Object(m.d)(Y);Object(x.a)(!V||Pe.every(function(Me){return Object(i.a)(Me)==="object"&&("key"in Me||"value"in Me)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(x.a)(!xe||Array.isArray(Y),"`value` should be array when `mode` is `multiple` or `tags`")}if(ue){var Be=null;Object(S.a)(ue).some(function(Me){if(!I.isValidElement(Me)||!Me.type)return!1;var ke=Me.type;if(ke.isSelectOption)return!1;if(ke.isSelectOptGroup){var Ve=Object(S.a)(Me.props.children).every(function(Se){return!I.isValidElement(Se)||!Me.type||Se.type.isSelectOption?!0:(Be=Se.type,!1)});return!Ve}return Be=ke,!0}),Be&&Object(x.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Be.displayName||Be.name||Be,"`.")),Object(x.a)(Z===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var D=E,U=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:l,flattenOptions:f.d,getLabeledValue:f.e,filterOptions:f.b,isValueDisabled:f.g,findValueOption:f.c,warningProps:D,fillOptionsWithMissingValue:f.a}),j=function(M){Object(L.a)(ee,M);var G=Object(z.a)(ee);function ee(){var ue;return Object(oe.a)(this,ee),ue=G.apply(this,arguments),ue.selectRef=I.createRef(),ue.focus=function(){ue.selectRef.current.focus()},ue.blur=function(){ue.selectRef.current.blur()},ue}return Object(H.a)(ee,[{key:"render",value:function(){return I.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),ee}(I.Component);j.Option=d,j.OptGroup=p;var K=j,k=Xe.c=K},M8RZ:function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return _});var oe=te("fWQN"),H=te("mtLc"),L=te("yKVA"),z=te("879j"),I=te("cDcd"),P=te.n(I),B=te("faye"),N=te.n(B),_=function(O){Object(L.a)(C,O);var y=Object(z.a)(C);function C(R){var A;Object(oe.a)(this,C),A=y.call(this,R);var b=window.document;return A.node=b.createElement("div"),b.body.appendChild(A.node),A}return Object(H.a)(C,[{key:"render",value:function(){var A=this.props.children;return Object(B.createPortal)(A,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(P.a.Component)},NvD2:function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return P});var oe=te("Kwbf");function H(B,N){var _=new Set;return B.forEach(function(O){N.has(O)||_.add(O)}),_}function L(B){var N=B||{},_=N.disabled,O=N.disableCheckbox,y=N.checkable;return!!(_||O)||y===!1}function z(B,N,_,O){for(var y=new Set(B),C=new Set,R=0;R<=_;R+=1){var A=N.get(R)||new Set;A.forEach(function(o){var u=o.key,d=o.node,T=o.children,p=T===void 0?[]:T;y.has(u)&&!O(d)&&p.filter(function(h){return!O(h.node)}).forEach(function(h){y.add(h.key)})})}for(var b=new Set,g=_;g>=0;g-=1){var c=N.get(g)||new Set;c.forEach(function(o){var u=o.parent,d=o.node;if(O(d)||!o.parent||b.has(o.parent.key))return;if(O(o.parent.node)){b.add(u.key);return}var T=!0,p=!1;(u.children||[]).filter(function(h){return!O(h.node)}).forEach(function(h){var S=h.key,v=y.has(S);T&&!v&&(T=!1),!p&&(v||C.has(S))&&(p=!0)}),T&&y.add(u.key),p&&C.add(u.key),b.add(u.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(H(C,y))}}function I(B,N,_,O,y){for(var C=new Set(B),R=new Set(N),A=0;A<=O;A+=1){var b=_.get(A)||new Set;b.forEach(function(u){var d=u.key,T=u.node,p=u.children,h=p===void 0?[]:p;!C.has(d)&&!R.has(d)&&!y(T)&&h.filter(function(S){return!y(S.node)}).forEach(function(S){C.delete(S.key)})})}R=new Set;for(var g=new Set,c=O;c>=0;c-=1){var o=_.get(c)||new Set;o.forEach(function(u){var d=u.parent,T=u.node;if(y(T)||!u.parent||g.has(u.parent.key))return;if(y(u.parent.node)){g.add(d.key);return}var p=!0,h=!1;(d.children||[]).filter(function(S){return!y(S.node)}).forEach(function(S){var v=S.key,l=C.has(v);p&&!l&&(p=!1),!h&&(l||R.has(v))&&(h=!0)}),p||C.delete(d.key),h&&R.add(d.key),g.add(d.key)})}return{checkedKeys:Array.from(C),halfCheckedKeys:Array.from(H(R,C))}}function P(B,N,_,O){var y=[],C;O?C=O:C=L;var R=new Set(B.filter(function(c){var o=!!_[c];return o||y.push(c),o})),A=new Map,b=0;Object.keys(_).forEach(function(c){var o=_[c],u=o.level,d=A.get(u);d||(d=new Set,A.set(u,d)),d.add(o),b=Math.max(b,u)}),Object(oe.a)(!y.length,"Tree missing follow keys: ".concat(y.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var g;return N===!0?g=z(R,A,b,C):g=I(R,N.halfCheckedKeys,A,b,C),g}},OLES:function(ot,Xe,te){"use strict";var oe=te("U8pU"),H=te("VTBJ"),L=te("Ff2n"),z=te("cDcd"),I=te("uciX"),P=te("7ixt"),B=function(R){var A=R.overlay,b=R.prefixCls,g=R.id,c=R.overlayInnerStyle;return z.createElement("div",{className:"".concat(b,"-inner"),id:g,role:"tooltip",style:c},typeof A=="function"?A():A)},N=B,_=function(R,A){var b=R.overlayClassName,g=R.trigger,c=g===void 0?["hover"]:g,o=R.mouseEnterDelay,u=o===void 0?0:o,d=R.mouseLeaveDelay,T=d===void 0?.1:d,p=R.overlayStyle,h=R.prefixCls,S=h===void 0?"rc-tooltip":h,v=R.children,l=R.onVisibleChange,f=R.afterVisibleChange,s=R.transitionName,i=R.animation,x=R.placement,m=x===void 0?"right":x,E=R.align,D=E===void 0?{}:E,U=R.destroyTooltipOnHide,j=U===void 0?!1:U,K=R.defaultVisible,k=R.getTooltipContainer,M=R.overlayInnerStyle,G=Object(L.a)(R,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ee=Object(z.useRef)(null);Object(z.useImperativeHandle)(A,function(){return ee.current});var ue=Object(H.a)({},G);"visible"in R&&(ue.popupVisible=R.visible);var de=function(){var re=R.arrowContent,J=re===void 0?null:re,ie=R.overlay,V=R.id;return[z.createElement("div",{className:"".concat(S,"-arrow"),key:"arrow"},J),z.createElement(N,{key:"content",prefixCls:S,id:V,overlay:ie,overlayInnerStyle:M})]},be=!1,Ee=!1;if(typeof j=="boolean")be=j;else if(j&&Object(oe.a)(j)==="object"){var ae=j.keepParent;be=ae===!0,Ee=ae===!1}return z.createElement(I.a,Object.assign({popupClassName:b,prefixCls:S,popup:de,action:c,builtinPlacements:P.a,popupPlacement:m,ref:ee,popupAlign:D,getPopupContainer:k,onPopupVisibleChange:l,afterPopupVisibleChange:f,popupTransitionName:s,popupAnimation:i,defaultPopupVisible:K,destroyPopupOnHide:be,autoDestroy:Ee,mouseLeaveDelay:T,popupStyle:p,mouseEnterDelay:u},ue),v)},O=Object(z.forwardRef)(_),y=Xe.a=O},OZM5:function(ot,Xe,te){"use strict";te.d(Xe,"b",function(){return O}),te.d(Xe,"a",function(){return y}),te.d(Xe,"k",function(){return C}),te.d(Xe,"h",function(){return R}),te.d(Xe,"i",function(){return A}),te.d(Xe,"g",function(){return b}),te.d(Xe,"c",function(){return g}),te.d(Xe,"d",function(){return c}),te.d(Xe,"j",function(){return d}),te.d(Xe,"e",function(){return T}),te.d(Xe,"f",function(){return p});var oe=te("KQm4"),H=te("U8pU"),L=te("Ff2n"),z=te("cDcd"),I=te.n(z),P=te("Kwbf"),B=te("WaYH"),N=.25,_=2;function O(h,S){var v=h.slice(),l=v.indexOf(S);return l>=0&&v.splice(l,1),v}function y(h,S){var v=h.slice();return v.indexOf(S)===-1&&v.push(S),v}function C(h){return h.split("-")}function R(h,S){return"".concat(h,"-").concat(S)}function A(h){return h&&h.type&&h.type.isTreeNode}function b(h,S){var v=[h],l=S[h];function f(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(i){var x=i.key,m=i.children;v.push(x),f(m)})}return f(l.children),v}function g(h,S){var v=h.clientY,l=S.selectHandle.getBoundingClientRect(),f=l.top,s=l.bottom,i=l.height,x=Math.max(i*N,_);return v<=f+x?-1:v>=s-x?1:0}function c(h,S){if(!h)return;var v=S.multiple;return v?h.slice():h.length?[h[0]]:h}var o=function(S){return S};function u(h,S){if(!h)return[];var v=S||{},l=v.processProps,f=l===void 0?o:l,s=Array.isArray(h)?h:[h];return s.map(function(i){var x=i.children,m=Object(L.a)(i,["children"]),E=u(x,S);return I.a.createElement(B.a,Object.assign({},f(m)),E)})}function d(h){if(!h)return null;var S;if(Array.isArray(h))S={checkedKeys:h,halfCheckedKeys:void 0};else if(Object(H.a)(h)==="object")S={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Object(P.a)(!1,"`checkedKeys` is not an array or an object"),null;return S}function T(h,S){var v=new Set;function l(f){if(v.has(f))return;var s=S[f];if(!s)return;v.add(f);var i=s.parent,x=s.node;if(x.disabled)return;i&&l(i.key)}return(h||[]).forEach(function(f){l(f)}),Object(oe.a)(v)}function p(h){var S={};return Object.keys(h).forEach(function(v){(v.startsWith("data-")||v.startsWith("aria-"))&&(S[v]=h[v])}),S}},Ot1p:function(ot,Xe,te){"use strict";var oe=te("2qtc"),H=te("kLXV"),L=te("rAM+"),z=te("miYZ"),I=te("tsqr"),P=te("9og8"),B=te("tJVT"),N=te("jrin"),_=te("WmNS"),O=te.n(_),y=te("cDcd"),C=te.n(y),R=te("VrN/"),A=te.n(R),b=te("bdgK"),g=te("p77/"),c=te("Bd2K"),o=te("ELLl"),u=te("19Vz"),d=te("lZu9"),T=te("+NIl"),p=te("kSUc"),h=te("9Bee"),S=function(ye){var Le=ye.value,Ke=Le===void 0?"":Le,Je=ye.className,et=ye.showTextOnly,Qe=ye.showLines,yt=ye.style,st=yt===void 0?{}:yt,rt=Object(y.useMemo)(function(){return""},[Ke]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:rt}}))},v=te("0Owb"),l=te("dejd"),f=te("C+DQ"),s=te("1vsH"),i=te("m3rI"),x=[{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 m(ye){var Le=ye.onActionCallback,Ke=ye.title,Je=ye.icon,et=ye.actionName,Qe=ye.className,yt=Qe===void 0?"":Qe,st=ye.children;function rt(){Le(et)}return C.a.createElement("a",{title:Ke,className:yt,onClick:rt},C.a.createElement("i",{className:"md-iconfont ".concat(Je)}),st)}var E=function(ye){var Le=ye.watch,Ke=ye.showNullButton,Je=ye.onActionCallback,et=ye.fullScreen,Qe=ye.insertTemp,yt=ye.hidetoolBar,st=ye.uuid,rt=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.G)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(i.a.PROXY_SERVER)));var Tt=[].concat(x,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!yt&&Tt.map(function(mt,vt){return C.a.createElement("li",{key:vt},mt.actionName?C.a.createElement(m,Object(v.a)({},mt,{onActionCallback:Je})):C.a.createElement("span",{className:"v-line"}))}),Ke?C.a.createElement("li",null,C.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Je},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Qe&&C.a.createElement("li",null,C.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Qe),onActionCallback:Je},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(m,{icon:"".concat(et?"icon-shrink":"icon-enlarge"),title:et?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Je})))},D=te("M8RZ"),U=te("+L6B"),j=te("2/Rp"),K=te("y8nQ"),k=te("Vl3Y"),M=te("5NDa"),G=te("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ue=function(ye){var Le=ye.callback,Ke=ye.onCancel;function Je(et){Le(et)}return C.a.createElement(k.a,Object(v.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Je}),C.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(G.a,null)),C.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(G.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(j.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},de=te("7ahc"),be=te("HmJG"),Ee=te("BjJ7"),ae=k.a.useForm,$={width:280,marginRight:10},re={labelCol:{span:5},wrapperCol:{span:19}},J=function(ye){var Le=ye.callback,Ke=ye.onCancel,Je=ae(),et=Object(B.a)(Je,1),Qe=et[0];function yt(Tt){Le(Tt)}function st(Tt,mt){if(Tt.status===-1){I.b.error(Tt.message);return}Qe.setFieldsValue({src:"/api/attachments/".concat(Tt.id),type:mt.type})}function rt(Tt){var mt=Tt.target.files[0];V(mt,st)}return C.a.createElement(k.a,Object(v.a)({form:Qe},re,{className:"upload-image-panel",onFinish:yt}),C.a.createElement(k.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(k.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},C.a.createElement(G.a,{style:$})),C.a.createElement(ie,{onFileChange:rt}))),C.a.createElement(k.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},C.a.createElement(G.a,{style:{width:264}})),C.a.createElement(k.a.Item,{style:{textAlign:"right"}},C.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(j.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))};function ie(ye){var Le=ye.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:Le}))}function V(ye,Le){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ke=new FormData;Ke.append("editormd-image-file",ye),Ke.append("file_param_name","editormd-image-file"),Ke.append("byxhr","true");var Je=new window.XMLHttpRequest;Je.withCredentials=!0,Je.addEventListener("load",function(et){Le(JSON.parse(et.target.responseText),ye)},!1),Je.addEventListener("error",function(et){console.error(et)},!1),Je.open("POST","".concat(Ee.a,"/api/attachments.json")),Je.send(Ke)}var Y=te("giR+"),Z=te("fyUT"),le=te("7Kak"),xe=te("9yH6"),he=xe.a.Group,Te={margin:"0 8px"},De=function(ye){var Le=ye.callback,Ke=ye.onCancel;function Je(et){Le(et)}return C.a.createElement(k.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Je},C.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},C.a.createElement("span",{style:Te},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:Te},"\u884C\u6570"),C.a.createElement(k.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(Z.a,null)),C.a.createElement("span",{style:Te},"\u5217\u6570"),C.a.createElement(k.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(Z.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},C.a.createElement("span",{style:Te},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(k.a.Item,{name:"align"},C.a.createElement(he,null,C.a.createElement(xe.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(xe.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(xe.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(xe.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(j.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},Pe=te("ErOA"),Be=te("7Cbv"),Me="link",ke="upload-image",Ve="code-block",Se="add-table",Re="------------",_e={default:Re,left:":".concat(Re),center:":".concat(Re,":"),right:"".concat(Re,":")},Ne=te("9VGf"),Fe,Ue;function Ce(){}var He=0,je=1e4,we="\u2581",Ie=`
|
|
**\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 ge(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,me=ce?"Cmd":"Ctrl",q=["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"],ne=(Fe={},Object(N.a)(Fe,me+"-B","bold"),Object(N.a)(Fe,me+"-I","italic"),Fe),se=(Ue={},Object(N.a)(Ue,Me,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(Ue,Ve,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(Ue,ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(N.a)(Ue,Se,"\u6DFB\u52A0\u8868\u683C"),Ue),pe=Xe.a=function(ye){var Le=ye.defaultValue,Ke=Le===void 0?"":Le,Je=ye.onChange,et=ye.width,Qe=et===void 0?"100%":et,yt=ye.height,st=yt===void 0?400:yt,rt=ye.miniToolbar,Tt=rt===void 0?!1:rt,mt=ye.isFocus,vt=mt===void 0?!1:mt,bt=ye.watch,ft=ye.insertTemp,At=ye.mode,Ut=At===void 0?"markdown":At,Wt=ye.id,Jt=Wt===void 0?"markdown-editor-id":Wt,Rt=ye.showResizeBar,Lr=Rt===void 0?!1:Rt,Qt=ye.noStorage,zt=Qt===void 0?!1:Qt,dr=ye.showNullButton,_t=dr===void 0?!1:dr,nt=ye.hidetoolBar,Yt=nt===void 0?!1:nt,gr=ye.fullScreen,er=gr===void 0?!1:gr,St=ye.onBlur,rr=ye.onCMBeforeChange,$t=ye.onFullScreen,sn=ye.className,Ge=sn===void 0?"":sn,ct=ye.disablePaste,Zr=ct===void 0?!1:ct,Or=ye.placeholder,qr=Or===void 0?"":Or,Rr=ye.values,ln=Rr===void 0?"":Rr,ht=Object(y.useState)(null),Nr=Object(B.a)(ht,2),Ye=Nr[0],Hr=Nr[1],ir=Object(y.useState)(Ke),pn=Object(B.a)(ir,2),cr=pn[0],yr=pn[1],Zt=Object(y.useState)(bt),jt=Object(B.a)(Zt,2),Mt=jt[0],xt=jt[1],nr=Object(y.useState)(er),fr=Object(B.a)(nr,2),Kt=fr[0],Sr=fr[1],Ur=Object(y.useState)(""),kr=Object(B.a)(Ur,2),Vt=kr[0],Ft=kr[1],_r=Object(y.useState)(0),Fr=Object(B.a)(_r,2),Xt=Fr[0],Sn=Fr[1],Cr=Object(y.useState)(st),wr=Object(B.a)(Cr,2),Jn=wr[0],Lt=wr[1],lt=Object(y.useState)(!1),tt=Object(B.a)(lt,2),or=tt[0],Pt=tt[1],hr=Object(y.useRef)(Object(Be.a)()),en=Object(y.useRef)(!1),un=Object(y.useRef)(),Gr=Object(y.useRef)(),Br=Object(y.useRef)(),jr=Object(y.useRef)(),dn=Object(y.useRef)(),mn=function(){var ut=Object(P.a)(O.a.mark(function Et(){var pt,wt;return O.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(Pe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:hr.current}});case 2:wt=Ht.sent,wt!=null&&(pt=wt.attachments)!==null&&pt!==void 0&&pt.length&&(console.log("cm:",Ye,Gr),wt.attachments.map(function(Ot){Ot.content_type.indexOf("image")>-1?Ye.replaceSelection(".concat(Ot.content_type,")")):Ot.content_type.indexOf("video")>-1?Ye.replaceSelection('<video width="100%" controls src="'.concat(i.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ot.content_type.indexOf("pdf")>-1?Ye.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,'&disposition=inline" target="_blank">').concat(Ot.name,"</a>")):Ye.replaceSelection("[".concat(Ot.name,"](").concat(i.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,")"))}));case 4:case"end":return Ht.stop()}},Et)}));return function(){return ut.apply(this,arguments)}}();Object(y.useEffect)(function(){yr(ln),Ye==null||Ye.setValue(ln)},[ln]),Object(y.useEffect)(function(){$t==null||$t(Kt)},[Kt]),Object(y.useEffect)(function(){if(Gr.current){var ut=A.a.fromTextArea(Gr.current,{mode:Ut,lineNumbers:!Tt,lineWrapping:!0,value:Ke,autoCloseTags:!0,autoCloseBrackets:!0});vt&&ut.focus();function Et(pt,wt){if(Zr){wt.preventDefault();return}var kt=wt.clipboardData;if(kt){var Ht=kt.types.toString(),Ot=kt.items;if(Ht==="Files"||kt.types.indexOf("Files")>-1){if(wt.preventDefault(),Ut=="stex")return;try{var mr,zr=Ot[1];((mr=Ot[0])===null||mr===void 0?void 0:mr.kind)==="file"&&(zr=Ot[0]);var Dt=zr.getAsFile(),Dn=Dt.name.split(".").pop();V(Dt,function(It){if(It.id){var Vr,Pr,gn;(Dt==null||((Vr=Dt.type)===null||Vr===void 0)?void 0:Vr.indexOf("image"))>-1?ut.replaceSelection(".concat(It.content_type,")")):(Dt==null||((Pr=Dt.type)===null||Pr===void 0)?void 0:Pr.indexOf("video"))>-1?ut.replaceSelection('<video width="100%" controls src="'.concat(i.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(Dt==null||((gn=Dt.type)===null||gn===void 0)?void 0:gn.indexOf("pdf"))>-1?ut.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):q.includes(Dn)?ut.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ut.replaceSelection("[".concat(Dt.name,"](").concat(i.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){I.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ut.on("paste",Et),ut.on("dragleave",function(pt,wt){Br.current.classList.remove("mouse-hover-md")}),ut.on("dragover",function(pt,wt){Br.current.classList.add("mouse-hover-md")}),ut.on("drop",function(pt,wt){Br.current.classList.add("mouse-hover-md");var kt;if(kt=wt.dataTransfer.files,kt.length>0){wt.preventDefault(),wt.stopPropagation();for(var Ht=function(zr){var Dt=kt[zr],Dn=Dt.name.split(".").pop();V(Dt,function(It){if(It.id){var Vr,Pr,gn;(Dt==null||((Vr=Dt.type)===null||Vr===void 0)?void 0:Vr.indexOf("image"))>-1?ut.replaceSelection(".concat(It.content_type,")")):(Dt==null||((Pr=Dt.type)===null||Pr===void 0)?void 0:Pr.indexOf("video"))>-1?ut.replaceSelection('<video width="100%" controls src="'.concat(i.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(Dt==null||((gn=Dt.type)===null||gn===void 0)?void 0:gn.indexOf("pdf"))>-1?ut.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):q.includes(Dn)?ut.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ut.replaceSelection("[".concat(Dt.name,"](").concat(i.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")})},Ot=0;Ot<kt.length;Ot++)Ht(Ot)}}),Hr(ut),function(){ut.off("paste",Et)}}},[]);var pr=Object(y.useCallback)(function(){if(Br.current)try{}catch(ut){console.log(ut,"---- to set md editor body height")}},[Jn,Br,Kt]);Object(y.useEffect)(function(){function ut(){var pt=new b.default(function(wt){var kt=Object(L.a)(wt),Ht;try{for(kt.s();!(Ht=kt.n()).done;){var Ot=Ht.value;(Ot.target.offsetHeight>0||Ot.target.offsetWidth>0)&&(pr(),Ye.setSize("100%","100%"),Ye.refresh())}}catch(mr){kt.e(mr)}finally{kt.f()}});return pt.observe(Gr.current.parentElement),pt}if(Ye){var Et=ut();return function(){Et.unobserve(Gr.current.parentElement)}}},[Ye,pr]),Object(y.useEffect)(function(){if(Ye){for(var ut=[],Et=function(){var Ot=wt[pt];kt=Object(B.a)(Ot,2);var mr=kt[0],zr=kt[1],Dt=Object(N.a)({},mr,function(){vn(zr)});ut.push(Dt),Ye.addKeyMap(Dt)},pt=0,wt=Object.entries(ne);pt<wt.length;pt++){var kt;Et()}return un.current=setInterval(function(){en.current&&mn()},4e3),function(){clearInterval(un.current);var Ht=Object(L.a)(ut),Ot;try{for(Ht.s();!(Ot=Ht.n()).done;){var mr=Ot.value;Ye.removeKeyMap(mr)}}catch(zr){Ht.e(zr)}finally{Ht.f()}}}},[Ye]),Object(y.useEffect)(function(){er!==Kt&&Sr(er)},[er]),Object(Ne.a)(function(){if(!zt&&Xt>0){var ut=new Date().getTime(),Et=window.sessionStorage.getItem(Jt);ut>=Xt+je&&(!Et||Et!==cr)&&(window.sessionStorage.setItem(Jt,cr),Pt(!0))}},je),Object(y.useEffect)(function(){xt(bt)},[Ye,bt]),Object(y.useEffect)(function(){Ye&&(vt&&Ye.focus())},[Ye,vt]),Object(y.useEffect)(function(){if(Mt&&Ye){var ut=Ye.getScrollerElement();function Et(pt){var wt=pt.target;if(dn.current){var kt=wt.scrollTop/wt.scrollHeight;dn.current.scrollTop=dn.current.scrollHeight*kt}}return ut.addEventListener("scroll",Et),function(){ut.removeEventListener("scroll",Et)}}},[Ye,Mt]),Object(y.useEffect)(function(){if(Ye&&rr){function ut(Et,pt){rr(Et,pt)}return Ye.on("beforeChange",ut),function(){Ye.off("beforeChange",ut)}}},[Ye,rr]),Object(y.useEffect)(function(){if(Ye&&St){function ut(){St(Ye.getValue())}return Ye.on("blur",ut),function(){Ye.off("blur",ut)}}},[Ye,St]),Object(y.useEffect)(function(){if(Ye){function ut(Et){var pt=Et.getValue();yr(pt),Sn(new Date().getTime()),Et.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Je&&Je(pt)}return Ye.on("change",ut),function(){Ye.off("change",ut)}}},[Ye,Je]),Object(y.useEffect)(function(){Ye&&(Ke==null?(Ye.setValue(""),yr("")):Ke!==Ye.getValue()&&(Ye.setValue(Ke),yr(Ke),Ye.setCursor(Ye.lineCount(),0)))},[Ye,Ke]);var vn=Object(y.useCallback)(function(ut){var Et=Ye.getCursor(),pt=Ye.getSelection(),wt=pt.split(`
|
|
`);switch(ut){case"bold":return Ye.replaceSelection("**"+pt+"**"),pt===""&&Ye.setCursor(Et.line,Et.ch+2),Ye.focus();case"italic":return Ye.replaceSelection("*"+pt+"*"),pt===""&&Ye.setCursor(Et.line,Et.ch+1),Ye.focus();case"code":return Ye.replaceSelection("`"+pt+"`"),pt===""&&Ye.setCursor(Et.line,Et.ch+1),Ye.focus();case"inline-latex":return Ye.replaceSelection("`$$"+pt+"$$`"),pt===""&&Ye.setCursor(Et.line,Et.ch+3),Ye.focus();case"latex":return Ye.replaceSelection("```latex\n"+pt+"\n```"),Ye.setCursor(Et.line+1,pt.length+1),Ye.focus();case"line-break":return Ye.replaceSelection(`<br/>
|
|
`),Ye.focus();case"list-ul":return pt===""?Ye.replaceSelection("- "+pt):Ye.replaceSelection(wt.map(function(kt){return kt===""?"":"- ".concat(kt)}).join(`
|
|
`)),Ye.focus();case"list-ol":return pt===""?Ye.replaceSelection("1. "+pt):Ye.replaceSelection(wt.map(function(kt,Ht){return kt===""?"":"".concat(Ht+1,". ").concat(kt)}).join(`
|
|
`)),Ye.focus();case"add-null-ch":return pt===""&&Ye.setCursor(Et.line,Et.ch+1),Ye.replaceSelection(we),Ye.focus();case"inster-template-1":return pt===""&&Ye.setCursor(Et.line,Et.ch),Ye.replaceSelection(Ie),Ye.focus();case"eraser":return Ye.setValue(""),Ye.focus();case"trigger-watch":return xt(!Mt),Ye.focus();case"trigger-full-screen":return Sr(!Kt),Ye.focus();case Me:Ft(Me);return;case Ve:Ft(Ve);return;case ke:Ft(ke);return;case Se:Ft(Se);return;default:throw new Error}},[Ye,Mt,Kt]),yn=Object(y.useCallback)(function(ut){Ft("");switch(Vt){case Me:var Et=ut.title,pt=ut.link;return Ye.replaceSelection("[".concat(Et,"](").concat(pt,")")),Ye.focus();case Ve:var wt=ut.language,kt=ut.content;return Ye.replaceSelection(["```"+wt,kt,"```"].join(`
|
|
`)),Ye.focus();case ke:var Ht=ut.src,Ot=ut.alt;return Ot?Ye.replaceSelection(".concat(Ht,' "').concat(Ot,'" )')):Ye.replaceSelection("")),Ye.focus();case Se:for(var mr=ut.row,zr=ut.col,Dt=ut.align,Dn=`
|
|
`,It=0;It<mr;It++){for(var Vr=[],Pr=[],gn=0;gn<zr;gn++)It===1&&Pr.push(_e[Dt]),Vr.push(" ");It===1&&(Dn+="| ".concat(Pr.join(" | "),` |
|
|
`)),Dn+="| ".concat(Vr.join(zr===1?"":" | "),` |
|
|
`)}return Ye.replaceSelection(Dn+`
|
|
`),Ye.focus();default:throw new Error}},[Ye,Vt]),tn=Object(y.useMemo)(function(){switch(Vt){case Me:return C.a.createElement(ue,{callback:yn,onCancel:rn});case Ve:return C.a.createElement(de.b,{callback:yn,onCancel:rn});case ke:return C.a.createElement(J,{callback:yn,onCancel:rn});case Se:return C.a.createElement(De,{callback:yn,onCancel:rn});default:return null}},[Vt]);function rn(){Ft("")}Object(y.useEffect)(function(){if(jr.current){var ut=jr.current,Et=!1,pt=0;function wt(Ot){Et=!0,pt=Ot.pageY}function kt(){Et=!1}function Ht(Ot){if(Et){var mr=Ot.pageY-pt;mr<0&&(mr=0),mr>300&&(mr=300);var zr=st+mr+"px";Lt(zr)}}return ut.addEventListener("mousedown",wt),document.addEventListener("mousemove",Ht),document.addEventListener("mouseup",kt),function(){ut.removeEventListener("mousedown",wt),document.removeEventListener("mousemove",Ht),document.removeEventListener("mouseup",kt)}}},[Ye,jr]),Object(y.useEffect)(function(){Lt(st)},[st]);var bn=ge(Qe),cn=ge(Jn),nn={width:bn,height:cn},pa=Object(y.useMemo)(function(){if(Xt){var ut=new Date(Xt),Et=ut.getHours(),pt=ut.getMinutes(),wt=ut.getSeconds();return Et=Et<10?"0"+Et:Et,pt=pt<10?"0"+pt:pt,wt=wt<10?"0"+wt:wt,"".concat(Et,":").concat(pt,":").concat(wt)}return 0},[Xt]);function ja(){window.sessionStorage.removeItem(Jt),Pt(!1),Sn(0)}function Bn(){Pt(!1),Sn(0),Ye.setValue(window.sessionStorage.getItem(Jt))}function ui(ut,Et){var pt=Ye.getValue();pt=pt.replace(ut,Et),yr(pt),Ye==null||Ye.setValue(pt)}return C.a.createElement(y.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:Br},C.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(Mt?"on-preview":""," ").concat(Tt?"mini":""," ").concat(Kt?"full-screen":""),style:nn},C.a.createElement(E,{insertTemp:ft,watch:Mt,fullScreen:Kt,showNullButton:_t,onActionCallback:vn,hidetoolBar:Yt,uuid:hr.current,setOpenPhones:function(){en.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:Gr,placeholder:qr})),Mt?C.a.createElement("div",{ref:dn,className:"preview-container"},Ut==="stex"&&C.a.createElement(S,{value:cr}),Ut!=="stex"&&C.a.createElement(h.a,{edit:!0,value:cr,replaces:ui})):null))),Lr?C.a.createElement("a",{ref:jr,className:"editor-resize"}):null,C.a.createElement(D.a,null,se[Vt]?C.a.createElement(H.a,{centered:!0,title:se[Vt],visible:!0,onCancel:rn,footer:null,className:"markdown-popup-form"},tn):null))}},RxwV:function(ot,Xe,te){"use strict";var oe=te("cDcd"),H=te("uciX"),L=te("2W6z"),z=te.n(L),I=te("4IlW"),P=te("uK0f"),B=te.n(P);function N($,re){if($===re)return!0;if(!$||!re)return!1;var J=$.length;if(re.length!==J)return!1;for(var ie=0;ie<J;ie++)if($[ie]!==re[ie])return!1;return!0}function _($){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(J){return typeof J}:_=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},_($)}function O($,re){if(!($ instanceof re))throw new TypeError("Cannot call a class as a function")}function y($,re){for(var J=0;J<re.length;J++){var ie=re[J];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty($,ie.key,ie)}}function C($,re,J){return re&&y($.prototype,re),J&&y($,J),$}function R($,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(re&&re.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),re&&A($,re)}function A($,re){return A=Object.setPrototypeOf||function(ie,V){return ie.__proto__=V,ie},A($,re)}function b($){var re=o();return function(){var J=u($),ie;if(re){var V=u(this).constructor;ie=Reflect.construct(J,arguments,V)}else ie=J.apply(this,arguments);return g(this,ie)}}function g($,re){return re&&(_(re)==="object"||typeof re=="function")?re:c($)}function c($){if($===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $}function o(){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($){return!1}}function u($){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(J){return J.__proto__||Object.getPrototypeOf(J)},u($)}var d=function(){var $=function(re){R(ie,re);var J=b(ie);function ie(){var V;return O(this,ie),V=J.apply(this,arguments),V.menuItems={},V.saveMenuItem=function(Y){return function(Z){V.menuItems[Y]=Z}},V}return C(ie,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(Y){!Y.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(Y){var Z=this.props,le=Z.fieldNames,xe=Z.defaultFieldNames;return le[Y]||xe[Y]}},{key:"getOption",value:function(Y,Z){var le=this.props,xe=le.prefixCls,he=le.expandTrigger,Te=le.expandIcon,De=le.loadingIcon,Pe=this.props.onSelect.bind(this,Y,Z),Be=this.props.onItemDoubleClick.bind(this,Y,Z),Me={onClick:Pe,onDoubleClick:Be},ke="".concat(xe,"-menu-item"),Ve=null,Se=Y[this.getFieldName("children")]&&Y[this.getFieldName("children")].length>0;(Se||Y.isLeaf===!1)&&(ke+=" ".concat(xe,"-menu-item-expand"),Y.loading||(Ve=oe.createElement("span",{className:"".concat(xe,"-menu-item-expand-icon")},Te))),he==="hover"&&(Se||Y.isLeaf===!1)&&(Me={onMouseEnter:this.delayOnSelect.bind(this,Pe),onMouseLeave:this.delayOnSelect.bind(this),onClick:Pe}),this.isActiveOption(Y,Z)&&(ke+=" ".concat(xe,"-menu-item-active"),Me.ref=this.saveMenuItem(Z)),Y.disabled&&(ke+=" ".concat(xe,"-menu-item-disabled"));var Re=null;Y.loading&&(ke+=" ".concat(xe,"-menu-item-loading"),Re=De||null);var _e="";return"title"in Y?_e=Y.title:typeof Y[this.getFieldName("label")]=="string"&&(_e=Y[this.getFieldName("label")]),oe.createElement("li",Object.assign({key:Y[this.getFieldName("value")],className:ke,title:_e},Me,{role:"menuitem",onMouseDown:function(Fe){return Fe.preventDefault()}}),Y[this.getFieldName("label")],Ve,Re)}},{key:"getActiveOptions",value:function(Y){var Z=this,le=this.props.options,xe=Y||this.props.activeValue;return B()(le,function(he,Te){return he[Z.getFieldName("value")]===xe[Te]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var Y=this,Z=this.props.options,le=this.getActiveOptions().map(function(xe){return xe[Y.getFieldName("children")]}).filter(function(xe){return!!xe});return le.unshift(Z),le}},{key:"delayOnSelect",value:function(Y){for(var Z=this,le=arguments.length,xe=new Array(le>1?le-1:0),he=1;he<le;he++)xe[he-1]=arguments[he];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof Y=="function"&&(this.delayTimer=window.setTimeout(function(){Y(xe),Z.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var Y=this.getShowOptions().length,Z=0;Z<Y;Z++){var le=this.menuItems[Z];le&&le.parentElement&&(le.parentElement.scrollTop=le.offsetTop)}}},{key:"isActiveOption",value:function(Y,Z){var le=this.props.activeValue,xe=le===void 0?[]:le;return xe[Z]===Y[this.getFieldName("value")]}},{key:"render",value:function(){var Y=this,Z=this.props,le=Z.prefixCls,xe=Z.dropdownMenuColumnStyle;return oe.createElement("div",null,this.getShowOptions().map(function(he,Te){return oe.createElement("ul",{className:"".concat(le,"-menu"),key:Te,style:xe},he.map(function(De){return Y.getOption(De,Te)}))}))}}]),ie}(oe.Component);return $.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},$}(),T=d,p={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},h=p;function S($){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?S=function(J){return typeof J}:S=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},S($)}function v($,re){if($==null)return{};var J=l($,re),ie,V;if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols($);for(V=0;V<Y.length;V++){if(ie=Y[V],re.indexOf(ie)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call($,ie))continue;J[ie]=$[ie]}}return J}function l($,re){if($==null)return{};var J={},ie=Object.keys($),V,Y;for(Y=0;Y<ie.length;Y++){if(V=ie[Y],re.indexOf(V)>=0)continue;J[V]=$[V]}return J}function f($){return m($)||x($)||i($)||s()}function s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i($,re){if(!$)return;if(typeof $=="string")return E($,re);var J=Object.prototype.toString.call($).slice(8,-1);if(J==="Object"&&$.constructor&&(J=$.constructor.name),J==="Map"||J==="Set")return Array.from($);if(J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J))return E($,re)}function x($){if(typeof Symbol!="undefined"&&Symbol.iterator in Object($))return Array.from($)}function m($){if(Array.isArray($))return E($)}function E($,re){(re==null||re>$.length)&&(re=$.length);for(var J=0,ie=new Array(re);J<re;J++)ie[J]=$[J];return ie}function D($,re){if(!($ instanceof re))throw new TypeError("Cannot call a class as a function")}function U($,re){for(var J=0;J<re.length;J++){var ie=re[J];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty($,ie.key,ie)}}function j($,re,J){return re&&U($.prototype,re),J&&U($,J),$}function K($,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(re&&re.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),re&&k($,re)}function k($,re){return k=Object.setPrototypeOf||function(ie,V){return ie.__proto__=V,ie},k($,re)}function M($){var re=ue();return function(){var J=de($),ie;if(re){var V=de(this).constructor;ie=Reflect.construct(J,arguments,V)}else ie=J.apply(this,arguments);return G(this,ie)}}function G($,re){return re&&(S(re)==="object"||typeof re=="function")?re:ee($)}function ee($){if($===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $}function ue(){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($){return!1}}function de($){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(J){return J.__proto__||Object.getPrototypeOf(J)},de($)}var be=function(){var $=function(re){K(ie,re);var J=M(ie);function ie(V){var Y;D(this,ie),Y=J.call(this,V),Y.setPopupVisible=function(le){var xe=Y.state.value;"popupVisible"in Y.props||Y.setState({popupVisible:le}),le&&!Y.state.popupVisible&&Y.setState({activeValue:xe}),Y.props.onPopupVisibleChange(le)},Y.handleChange=function(le,xe,he){var Te=xe.visible;(he.type!=="keydown"||he.keyCode===I.a.ENTER)&&(Y.props.onChange(le.map(function(De){return De[Y.getFieldName("value")]}),le),Y.setPopupVisible(Te))},Y.handlePopupVisibleChange=function(le){Y.setPopupVisible(le)},Y.handleMenuSelect=function(le,xe,he){var Te=Y.trigger.getRootDomNode();Te&&Te.focus&&Te.focus();var De=Y.props,Pe=De.changeOnSelect,Be=De.loadData,Me=De.expandTrigger;if(!le||le.disabled)return;var ke=Y.state.activeValue;ke=ke.slice(0,xe+1),ke[xe]=le[Y.getFieldName("value")];var Ve=Y.getActiveOptions(ke);if(le.isLeaf===!1&&!le[Y.getFieldName("children")]&&Be){Pe&&Y.handleChange(Ve,{visible:!0},he),Y.setState({activeValue:ke}),Be(Ve);return}var Se={};!le[Y.getFieldName("children")]||!le[Y.getFieldName("children")].length?(Y.handleChange(Ve,{visible:!1},he),Se.value=ke):Pe&&(he.type==="click"||he.type==="keydown")&&(Me==="hover"?Y.handleChange(Ve,{visible:!1},he):Y.handleChange(Ve,{visible:!0},he),Se.value=ke),Se.activeValue=ke,("value"in Y.props||he.type==="keydown"&&he.keyCode!==I.a.ENTER)&&delete Se.value,Y.setState(Se)},Y.handleItemDoubleClick=function(){var le=Y.props.changeOnSelect;le&&Y.setPopupVisible(!1)},Y.handleKeyDown=function(le){var xe=Y.props.children;if(xe&&xe.props.onKeyDown){xe.props.onKeyDown(le);return}var he=f(Y.state.activeValue),Te=he.length-1<0?0:he.length-1,De=Y.getCurrentLevelOptions(),Pe=De.map(function(Ve){return Ve[Y.getFieldName("value")]}).indexOf(he[Te]);if(le.keyCode!==I.a.DOWN&&le.keyCode!==I.a.UP&&le.keyCode!==I.a.LEFT&&le.keyCode!==I.a.RIGHT&&le.keyCode!==I.a.ENTER&&le.keyCode!==I.a.SPACE&&le.keyCode!==I.a.BACKSPACE&&le.keyCode!==I.a.ESC&&le.keyCode!==I.a.TAB)return;if(!Y.state.popupVisible&&le.keyCode!==I.a.BACKSPACE&&le.keyCode!==I.a.LEFT&&le.keyCode!==I.a.RIGHT&&le.keyCode!==I.a.ESC&&le.keyCode!==I.a.TAB){Y.setPopupVisible(!0);return}if(le.keyCode===I.a.DOWN||le.keyCode===I.a.UP){le.preventDefault();var Be=Pe;Be!==-1?le.keyCode===I.a.DOWN?(Be+=1,Be=Be>=De.length?0:Be):(Be-=1,Be=Be<0?De.length-1:Be):Be=0,he[Te]=De[Be][Y.getFieldName("value")]}else if(le.keyCode===I.a.LEFT||le.keyCode===I.a.BACKSPACE)le.preventDefault(),he.splice(he.length-1,1);else if(le.keyCode===I.a.RIGHT)le.preventDefault(),De[Pe]&&De[Pe][Y.getFieldName("children")]&&he.push(De[Pe][Y.getFieldName("children")][0][Y.getFieldName("value")]);else if(le.keyCode===I.a.ESC||le.keyCode===I.a.TAB){Y.setPopupVisible(!1);return}(!he||he.length===0)&&Y.setPopupVisible(!1);var Me=Y.getActiveOptions(he),ke=Me[Me.length-1];Y.handleMenuSelect(ke,Me.length-1,le),Y.props.onKeyDown&&Y.props.onKeyDown(le)},Y.saveTrigger=function(le){Y.trigger=le};var Z=[];return"value"in V?Z=V.value||[]:"defaultValue"in V&&(Z=V.defaultValue||[]),z()(!("filedNames"in V),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),Y.state={popupVisible:V.popupVisible,activeValue:Z,value:Z,prevProps:V},Y.defaultFieldNames={label:"label",value:"value",children:"children"},Y}return j(ie,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(Y){var Z=this.defaultFieldNames,le=this.props,xe=le.fieldNames,he=le.filedNames;return"filedNames"in this.props?he[Y]||Z[Y]:xe[Y]||Z[Y]}},{key:"getFieldNames",value:function(){var Y=this.props,Z=Y.fieldNames,le=Y.filedNames;return"filedNames"in this.props?le:Z}},{key:"getCurrentLevelOptions",value:function(){var Y=this,Z=this.props.options,le=Z===void 0?[]:Z,xe=this.state.activeValue,he=xe===void 0?[]:xe,Te=B()(le,function(De,Pe){return De[Y.getFieldName("value")]===he[Pe]},{childrenKeyName:this.getFieldName("children")});return Te[Te.length-2]?Te[Te.length-2][this.getFieldName("children")]:f(le).filter(function(De){return!De.disabled})}},{key:"getActiveOptions",value:function(Y){var Z=this;return B()(this.props.options||[],function(le,xe){return le[Z.getFieldName("value")]===Y[xe]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var Y=this.props,Z=Y.prefixCls,le=Y.transitionName,xe=Y.popupClassName,he=Y.options,Te=he===void 0?[]:he,De=Y.disabled,Pe=Y.builtinPlacements,Be=Y.popupPlacement,Me=Y.children,ke=Y.dropdownRender,Ve=v(Y,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Se=oe.createElement("div",null),Re="";Te&&Te.length>0?Se=oe.createElement(T,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Re=" ".concat(Z,"-menus-empty");var _e=Se;return ke&&(_e=ke(Se)),oe.createElement(H.a,Object.assign({ref:this.saveTrigger},Ve,{popupPlacement:Be,builtinPlacements:Pe,popupTransitionName:le,action:De?[]:["click"],popupVisible:De?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(Z,"-menus"),popupClassName:xe+Re,popup:_e}),oe.cloneElement(Me,{onKeyDown:this.handleKeyDown,tabIndex:De?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(Y,Z){var le=Z.prevProps,xe=le===void 0?{}:le,he={prevProps:Y};return"value"in Y&&!N(xe.value,Y.value)&&(he.value=Y.value||[],"loadData"in Y||(he.activeValue=Y.value||[])),"popupVisible"in Y&&(he.popupVisible=Y.popupVisible),he}}]),ie}(oe.Component);return $.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:h,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},$}(),Ee=be,ae=Xe.a=Ee},SJMd:function(ot,Xe){/**
|
|
* @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 te,oe,H,L=!1,z,I;window.PR_SHOULD_USE_CONTINUATION=!0;var P,B;(function(){var N=window,_=["break,continue,do,else,for,if,return,while"],O=[_,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],y=[O,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[y,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],R=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],A=[y,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],b="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",g=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="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",o=[_,"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"],u=[_,"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"],d=[_,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[C,A,R,g,c,o,u,d],p=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",S="kwd",v="com",l="typ",f="lit",s="pun",i="pln",x="tag",m="dec",E="src",D="atn",U="atv",j="nocode",K="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(he){for(var Te=0,De=!1,Pe=!1,Be=0,Me=he.length;Be<Me;++Be){var ke=he[Be];if(ke.ignoreCase)Pe=!0;else if(/[a-z]/i.test(ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){De=!0,Pe=!1;break}}var Ve={b:8,t:9,n:10,v:11,f:12,r:13};function Se(Ue){var Ce=Ue.charCodeAt(0);if(Ce!==92)return Ce;var He=Ue.charAt(1);return Ce=Ve[He],Ce||("0"<=He&&He<="7"?parseInt(Ue.substring(1),8):He==="u"||He==="x"?parseInt(Ue.substring(2),16):Ue.charCodeAt(1))}function Re(Ue){if(Ue<32)return(Ue<16?"\\x0":"\\x")+Ue.toString(16);var Ce=String.fromCharCode(Ue);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function _e(Ue){var Ce=Ue.substring(1,Ue.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")),He=[],je=Ce[0]==="^",we=["["];je&&we.push("^");for(var Ie=je?1:0,ge=Ce.length;Ie<ge;++Ie){var ce=Ce[Ie];if(/\\[bdsw]/i.test(ce))we.push(ce);else{var me=Se(ce),q;Ie+2<ge&&Ce[Ie+1]==="-"?(q=Se(Ce[Ie+2]),Ie+=2):q=me,He.push([me,q]),q<65||me>122||(q<65||me>90||He.push([Math.max(65,me)|32,Math.min(q,90)|32]),q<97||me>122||He.push([Math.max(97,me)&~32,Math.min(q,122)&~32]))}}He.sort(function(ye,Le){return ye[0]-Le[0]||Le[1]-ye[1]});for(var ne=[],se=[],Ie=0;Ie<He.length;++Ie){var pe=He[Ie];pe[0]<=se[1]+1?se[1]=Math.max(se[1],pe[1]):ne.push(se=pe)}for(var Ie=0;Ie<ne.length;++Ie){var pe=ne[Ie];we.push(Re(pe[0])),pe[1]>pe[0]&&(pe[1]+1>pe[0]&&we.push("-"),we.push(Re(pe[1])))}return we.push("]"),we.join("")}function Ne(Ue){for(var Ce=Ue.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")),He=Ce.length,je=[],we=0,Ie=0;we<He;++we){var ge=Ce[we];if(ge==="(")++Ie;else if(ge.charAt(0)==="\\"){var ce=+ge.substring(1);ce&&(ce<=Ie?je[ce]=-1:Ce[we]=Re(ce))}}for(var we=1;we<je.length;++we)je[we]===-1&&(je[we]=++Te);for(var we=0,Ie=0;we<He;++we){var ge=Ce[we];if(ge==="(")++Ie,je[Ie]||(Ce[we]="(?:");else if(ge.charAt(0)==="\\"){var ce=+ge.substring(1);ce&&ce<=Ie&&(Ce[we]="\\"+je[ce])}}for(var we=0;we<He;++we)Ce[we]==="^"&&Ce[we+1]!=="^"&&(Ce[we]="");if(Ue.ignoreCase&&De)for(var we=0;we<He;++we){var ge=Ce[we],me=ge.charAt(0);ge.length>=2&&me==="["?Ce[we]=_e(ge):me!=="\\"&&(Ce[we]=ge.replace(/[a-zA-Z]/g,function(se){var pe=se.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Ce.join("")}for(var Fe=[],Be=0,Me=he.length;Be<Me;++Be){var ke=he[Be];if(ke.global||ke.multiline)throw new Error(""+ke);Fe.push("(?:"+Ne(ke)+")")}return new RegExp(Fe.join("|"),Pe?"gi":"g")}function M(he,Te){var De=/(?:^|\s)nocode(?:\s|$)/,Pe=[],Be=0,Me=[],ke=0;function Ve(Se){var Re=Se.nodeType;if(Re==1){if(De.test(Se.className))return;for(var _e=Se.firstChild;_e;_e=_e.nextSibling)Ve(_e);var Ne=Se.nodeName.toLowerCase();(Ne==="br"||Ne==="li")&&(Pe[ke]=`
|
|
`,Me[ke<<1]=Be++,Me[ke++<<1|1]=Se)}else if(Re==3||Re==4){var Fe=Se.nodeValue;Fe.length&&(Te?Fe=Fe.replace(/\r\n?/g,`
|
|
`):Fe=Fe.replace(/[ \t\r\n]+/g," "),Pe[ke]=Fe,Me[ke<<1]=Be,Be+=Fe.length,Me[ke++<<1|1]=Se)}}return Ve(he),{sourceCode:Pe.join("").replace(/\n$/,""),spans:Me}}function G(he,Te,De,Pe,Be){if(!De)return;var Me={sourceNode:he,pre:1,langExtension:null,numberLines:null,sourceCode:De,spans:null,basePos:Te,decorations:null};Pe(Me),Be.push.apply(Be,Me.decorations)}var ee=/\S/;function ue(he){for(var Te=void 0,De=he.firstChild;De;De=De.nextSibling){var Pe=De.nodeType;Te=Pe===1?Te?he:De:Pe===3&&ee.test(De.nodeValue)?he:Te}return Te===he?void 0:Te}function de(he,Te){var De={},Pe;(function(){for(var ke=he.concat(Te),Ve=[],Se={},Re=0,_e=ke.length;Re<_e;++Re){var Ne=ke[Re],Fe=Ne[3];if(Fe)for(var Ue=Fe.length;--Ue>=0;)De[Fe.charAt(Ue)]=Ne;var Ce=Ne[1],He=""+Ce;Se.hasOwnProperty(He)||(Ve.push(Ce),Se[He]=null)}Ve.push(/[\0-\uffff]/),Pe=k(Ve)})();var Be=Te.length,Me=function(ke){for(var Ve=ke.sourceCode,Se=ke.basePos,Re=ke.sourceNode,_e=[Se,i],Ne=0,Fe=Ve.match(Pe)||[],Ue={},Ce=0,He=Fe.length;Ce<He;++Ce){var je=Fe[Ce],we=Ue[je],Ie=void 0,ge;if(typeof we=="string")ge=!1;else{var ce=De[je.charAt(0)];if(ce)Ie=je.match(ce[1]),we=ce[0];else{for(var me=0;me<Be;++me)if(ce=Te[me],Ie=je.match(ce[1]),Ie){we=ce[0];break}Ie||(we=i)}ge=we.length>=5&&we.substring(0,5)==="lang-",ge&&!(Ie&&typeof Ie[1]=="string")&&(ge=!1,we=E),ge||(Ue[je]=we)}var q=Ne;if(Ne+=je.length,!ge)_e.push(Se+q,we);else{var ne=Ie[1],se=je.indexOf(ne),pe=se+ne.length;Ie[2]&&(pe=je.length-Ie[2].length,se=pe-ne.length);var ye=we.substring(5);G(Re,Se+q,je.substring(0,se),Me,_e),G(Re,Se+q+se,ne,ie(ye,ne),_e),G(Re,Se+q+pe,je.substring(pe),Me,_e)}}ke.decorations=_e};return Me}function be(he){var Te=[],De=[];he.tripleQuotedStrings?Te.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):he.multiLineStrings?Te.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Te.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),he.verbatimStrings&&De.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Pe=he.hashComments;Pe&&(he.cStyleComments?(Pe>1?Te.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Te.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),De.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Te.push([v,/^#[^\r\n]*/,null,"#"])),he.cStyleComments&&(De.push([v,/^\/\/[^\r\n]*/,null]),De.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Be=he.regexLiterals;if(Be){var Me=Be>1?"":`
|
|
\r`,ke=Me?".":"[\\S\\s]",Ve="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+ke+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+ke+")*(?:\\x5D|$))+/";De.push(["lang-regex",RegExp("^"+K+"("+Ve+")")])}var Se=he.types;Se&&De.push([l,Se]);var Re=(""+he.keywords).replace(/^ | $/g,"");Re.length&&De.push([S,new RegExp("^(?:"+Re.replace(/[\s,]+/g,"|")+")\\b"),null]),Te.push([i,/^\s+/,null,` \r
|
|
\xA0`]);var _e="^.[^\\s\\w.$@'\"`/\\\\]*";return he.regexLiterals&&(_e+="(?!s*/)"),De.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[l,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[i,/^[a-z_$][a-z_$@0-9]*/i,null],[f,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[i,/^\\[\s\S]?/,null],[s,new RegExp(_e),null]),de(Te,De)}var Ee=be({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ae(he,Te,De){for(var Pe=/(?:^|\s)nocode(?:\s|$)/,Be=/\r\n?|\n/,Me=he.ownerDocument,ke=Me.createElement("li");he.firstChild;)ke.appendChild(he.firstChild);var Ve=[ke];function Se(Ce){var He=Ce.nodeType;if(He==1&&!Pe.test(Ce.className))if(Ce.nodeName==="br")Re(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var je=Ce.firstChild;je;je=je.nextSibling)Se(je);else if((He==3||He==4)&&De){var we=Ce.nodeValue,Ie=we.match(Be);if(Ie){var ge=we.substring(0,Ie.index);Ce.nodeValue=ge;var ce=we.substring(Ie.index+Ie[0].length);if(ce){var me=Ce.parentNode;me.insertBefore(Me.createTextNode(ce),Ce.nextSibling)}Re(Ce),ge||Ce.parentNode.removeChild(Ce)}}}function Re(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function He(Ie,ge){var ce=ge?Ie.cloneNode(!1):Ie,me=Ie.parentNode;if(me){var q=He(me,1),ne=Ie.nextSibling;q.appendChild(ce);for(var se=ne;se;se=ne)ne=se.nextSibling,q.appendChild(se)}return ce}for(var je=He(Ce.nextSibling,0),we;(we=je.parentNode)&&we.nodeType===1;)je=we;Ve.push(je)}for(var _e=0;_e<Ve.length;++_e)Se(Ve[_e]);Te===(Te|0)&&Ve[0].setAttribute("value",Te);var Ne=Me.createElement("ol");Ne.className="linenums";for(var Fe=Math.max(0,Te-1|0)||0,_e=0,Ue=Ve.length;_e<Ue;++_e)ke=Ve[_e],ke.className="L"+(_e+Fe)%10,ke.firstChild||ke.appendChild(Me.createTextNode("\xA0")),Ne.appendChild(ke);he.appendChild(Ne)}function $(he){var Te=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Te=Te&&+Te[1]<=8;var De=/\n/g,Pe=he.sourceCode,Be=Pe.length,Me=0,ke=he.spans,Ve=ke.length,Se=0,Re=he.decorations,_e=Re.length,Ne=0;Re[_e]=Be;var Fe,Ue;for(Ue=Fe=0;Ue<_e;)Re[Ue]!==Re[Ue+2]?(Re[Fe++]=Re[Ue++],Re[Fe++]=Re[Ue++]):Ue+=2;for(_e=Fe,Ue=Fe=0;Ue<_e;){for(var Ce=Re[Ue],He=Re[Ue+1],je=Ue+2;je+2<=_e&&Re[je+1]===He;)je+=2;Re[Fe++]=Ce,Re[Fe++]=He,Ue=je}_e=Re.length=Fe;var we=he.sourceNode,Ie="";we&&(Ie=we.style.display,we.style.display="none");try{for(var ge=null;Se<Ve;){var ce=ke[Se],me=ke[Se+2]||Be,q=Re[Ne+2]||Be,je=Math.min(me,q),ne=ke[Se+1],se;if(ne.nodeType!==1&&(se=Pe.substring(Me,je))){Te&&(se=se.replace(De,"\r")),ne.nodeValue=se;var pe=ne.ownerDocument,ye=pe.createElement("span");ye.className=Re[Ne+1];var Le=ne.parentNode;Le.replaceChild(ye,ne),ye.appendChild(ne),Me<me&&(ke[Se+1]=ne=pe.createTextNode(Pe.substring(je,me)),Le.insertBefore(ne,ye.nextSibling))}Me=je,Me>=me&&(Se+=2),Me>=q&&(Ne+=2)}}finally{we&&(we.style.display=Ie)}}var re={};function J(he,Te){for(var De=Te.length;--De>=0;){var Pe=Te[De];re.hasOwnProperty(Pe)?N.console&&console.warn("cannot override language handler %s",Pe):re[Pe]=he}}function ie(he,Te){return he&&re.hasOwnProperty(he)||(he=/^\s*</.test(Te)?"default-markup":"default-code"),re[he]}J(Ee,["default-code"]),J(de([],[[i,/^[^<?]+/],[m,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["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"]),J(de([[i,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["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"]),J(de([],[[U,/^[\s\S]+/]]),["uq.val"]),J(be({keywords:C,hashComments:!0,cStyleComments:!0,types:p}),["c","cc","cpp","cxx","cyc","m"]),J(be({keywords:"null,true,false"}),["json"]),J(be({keywords:A,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:p}),["cs"]),J(be({keywords:R,cStyleComments:!0}),["java"]),J(be({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),J(be({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),J(be({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),J(be({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),J(be({keywords:g,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),J(be({keywords:b,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),J(de([],[[h,/^[\s\S]+/]]),["regex"]);function V(he){var Te=he.langExtension;try{var De=M(he.sourceNode,he.pre),Pe=De.sourceCode;he.sourceCode=Pe,he.spans=De.spans,he.basePos=0,ie(Te,Pe)(he),$(he)}catch(Be){N.console&&console.log(Be&&Be.stack||Be)}}function Y(he,Te,De){var Pe=De||!1,Be=Te||null,Me=document.createElement("div");Me.innerHTML="<pre>"+he+"</pre>",Me=Me.firstChild,Pe&&ae(Me,Pe,!0);var ke={langExtension:Be,numberLines:Pe,sourceNode:Me,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return V(ke),Me.innerHTML}function Z(he,Te){var De=Te||document.body,Pe=De.ownerDocument||document;function Be(ce){return De.getElementsByTagName(ce)}for(var Me=[Be("pre"),Be("code"),Be("xmp")],ke=[],Ve=0;Ve<Me.length;++Ve)for(var Se=0,Re=Me[Ve].length;Se<Re;++Se)ke.push(Me[Ve][Se]);Me=null;var _e=Date;_e.now||(_e={now:function(){return+new Date}});var Ne=0,Fe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ue=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,He=/pre|xmp/i,je=/^code$/i,we=/^(?:pre|code|xmp)$/i,Ie={};function ge(){for(var ce=N.PR_SHOULD_USE_CONTINUATION?_e.now()+250:Infinity;Ne<ke.length&&_e.now()<ce;Ne++){for(var me=ke[Ne],q=Ie,ne=me;ne=ne.previousSibling;){var se=ne.nodeType,pe=(se===7||se===8)&&ne.nodeValue;if(pe?!/^\??prettify\b/.test(pe):se!==3||/\S/.test(ne.nodeValue))break;if(pe){q={},pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(bt,ft,At){q[ft]=At});break}}var ye=me.className;if((q!==Ie||Ue.test(ye))&&!Ce.test(ye)){for(var Le=!1,Ke=me.parentNode;Ke;Ke=Ke.parentNode){var Je=Ke.tagName;if(we.test(Je)&&Ke.className&&Ue.test(Ke.className)){Le=!0;break}}if(!Le){me.className+=" prettyprinted";var et=q.lang;if(!et){et=ye.match(Fe);var Qe;!et&&(Qe=ue(me))&&je.test(Qe.tagName)&&(et=Qe.className.match(Fe)),et&&(et=et[1])}var yt;if(He.test(me.tagName))yt=1;else{var st=me.currentStyle,rt=Pe.defaultView,Tt=st?st.whiteSpace:rt&&rt.getComputedStyle?rt.getComputedStyle(me,null).getPropertyValue("white-space"):0;yt=Tt&&Tt.substring(0,3)==="pre"}var mt=q.linenums;(mt=mt==="true"||+mt)||(mt=ye.match(/\blinenums\b(?::(\d+))?/),mt=mt?mt[1]&&mt[1].length?+mt[1]:!0:!1),mt&&ae(me,mt,yt);var vt={langExtension:et,sourceNode:me,numberLines:mt,pre:yt,sourceCode:null,basePos:null,spans:null,decorations:null};V(vt)}}}Ne<ke.length?N.setTimeout(ge,250):typeof he=="function"&&he()}ge()}var le=N.PR={createSimpleLexer:de,registerLangHandler:J,sourceDecorator:be,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:U,PR_COMMENT:v,PR_DECLARATION:m,PR_KEYWORD:S,PR_LITERAL:f,PR_NOCODE:j,PR_PLAIN:i,PR_PUNCTUATION:s,PR_SOURCE:E,PR_STRING:h,PR_TAG:x,PR_TYPE:l,prettyPrintOne:L?N.prettyPrintOne=Y:P=Y,prettyPrint:B=L?N.prettyPrint=Z:B=Z},xe=N.define;typeof xe=="function"&&xe.amd&&xe("google-code-prettify",[],function(){return le})})()},"VrN/":function(ot,Xe,te){(function(oe,H){ot.exports=H()})(this,function(){"use strict";var oe=navigator.userAgent,H=navigator.platform,L=/gecko\/\d/i.test(oe),z=/MSIE \d/.test(oe),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oe),P=/Edge\/(\d+)/.exec(oe),B=z||I||P,N=B&&(z?document.documentMode||6:+(P||I)[1]),_=!P&&/WebKit\//.test(oe),O=_&&/Qt\/\d+\.\d+/.test(oe),y=!P&&/Chrome\//.test(oe),C=/Opera\//.test(oe),R=/Apple Computer/.test(navigator.vendor),A=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oe),b=/PhantomJS/.test(oe),g=!P&&/AppleWebKit/.test(oe)&&/Mobile\/\w+/.test(oe),c=/Android/.test(oe),o=g||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oe),u=g||/Mac/.test(H),d=/\bCrOS\b/.test(oe),T=/win/i.test(H),p=C&&oe.match(/Version\/(\d*\.\d*)/);p&&(p=Number(p[1])),p&&p>=15&&(C=!1,_=!0);var h=u&&(O||C&&(p==null||p<12.11)),S=L||B&&N>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var l=function(e,t){var n=e.className,r=v(t).exec(n);if(r){var a=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(a?r[1]+a:"")}};function f(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return f(e).appendChild(t)}function i(e,t,n,r){var a=document.createElement(e);if(n&&(a.className=n),r&&(a.style.cssText=r),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var w=0;w<t.length;++w)a.appendChild(t[w]);return a}function x(e,t,n,r){var a=i(e,t,n,r);return a.setAttribute("role","presentation"),a}var m;document.createRange?m=function(e,t,n,r){var a=document.createRange();return a.setEnd(r||e,n),a.setStart(e,t),a}:m=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(a){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function E(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 D(){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 n=e.className;v(t).test(n)||(e.className+=(n?" ":"")+t)}function j(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!v(n[r]).test(t)&&(t+=" "+n[r]);return t}var K=function(e){e.select()};g?K=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:B&&(K=function(e){try{e.select()}catch(t){}});function k(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function M(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function G(e,t,n,r,a){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var w=r||0,F=a||0;;){var W=e.indexOf(" ",w);if(W<0||W>=t)return F+(t-w);F+=W-w,F+=n-F%n,w=W+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=k(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ue(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var de=50,be={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},ae={origin:"*mouse"},$={origin:"+move"};function re(e,t,n){for(var r=0,a=0;;){var w=e.indexOf(" ",r);w==-1&&(w=e.length);var F=w-r;if(w==e.length||a+F>=t)return r+Math.min(F,t-a);if(a+=w-r,a+=n-a%n,r=w+1,a>=t)return r}}var J=[""];function ie(e){for(;J.length<=e;)J.push(V(J)+" ");return J[e]}function V(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Z(e,t,n){for(var r=0,a=n(t);r<e.length&&n(e[r])<=a;)r++;e.splice(r,0,t)}function le(){}function xe(e,t){var n;return Object.create?n=Object.create(e):(le.prototype=e,n=new le),t&&M(t,n),n}var he=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Te(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||he.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&Te(e)?!0:t.test(e):Te(e)}function Pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\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 Me(e){return e.charCodeAt(0)>=768&&Be.test(e)}function ke(e,t,n){for(;(n<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=n;return t}function Ve(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var a=(t+n)/2,w=r<0?Math.ceil(a):Math.floor(a);if(w==t)return e(w)?t:n;e(w)?n=w:t=w+r}}function Se(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var a=!1,w=0;w<e.length;++w){var F=e[w];(F.from<n&&F.to>t||t==n&&F.to==t)&&(r(Math.max(F.from,t),Math.min(F.to,n),F.level==1?"rtl":"ltr",w),a=!0)}a||r(t,n,"ltr")}var Re=null;function _e(e,t,n){var r;Re=null;for(var a=0;a<e.length;++a){var w=e[a];if(w.from<t&&w.to>t)return a;w.to==t&&(w.from!=w.to&&n=="before"?r=a:Re=a),w.from==t&&(w.from!=w.to&&n!="before"?r=a:Re=a)}return r!=null?r:Re}var Ne=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(Q){return Q<=247?e.charAt(Q):1424<=Q&&Q<=1524?"R":1536<=Q&&Q<=1785?t.charAt(Q-1536):1774<=Q&&Q<=2220?"r":8192<=Q&&Q<=8203?"w":Q==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,w=/[LRr]/,F=/[Lb1n]/,W=/[1n]/;function X(Q,fe,ve){this.level=Q,this.from=fe,this.to=ve}return function(Q,fe){var ve=fe=="ltr"?"L":"R";if(Q.length==0||fe=="ltr"&&!r.test(Q))return!1;for(var Oe=Q.length,Ae=[],We=0;We<Oe;++We)Ae.push(n(Q.charCodeAt(We)));for(var ze=0,$e=ve;ze<Oe;++ze){var Ze=Ae[ze];Ze=="m"?Ae[ze]=$e:$e=Ze}for(var at=0,qe=ve;at<Oe;++at){var it=Ae[at];it=="1"&&qe=="r"?Ae[at]="n":w.test(it)&&(qe=it,it=="r"&&(Ae[at]="R"))}for(var gt=1,dt=Ae[0];gt<Oe-1;++gt){var Ct=Ae[gt];Ct=="+"&&dt=="1"&&Ae[gt+1]=="1"?Ae[gt]="1":Ct==","&&dt==Ae[gt+1]&&(dt=="1"||dt=="n")&&(Ae[gt]=dt),dt=Ct}for(var Gt=0;Gt<Oe;++Gt){var xr=Ae[Gt];if(xr==",")Ae[Gt]="N";else if(xr=="%"){var tr=void 0;for(tr=Gt+1;tr<Oe&&Ae[tr]=="%";++tr);for(var on=Gt&&Ae[Gt-1]=="!"||tr<Oe&&Ae[tr]=="1"?"1":"N",$r=Gt;$r<tr;++$r)Ae[$r]=on;Gt=tr-1}}for(var lr=0,Jr=ve;lr<Oe;++lr){var Dr=Ae[lr];Jr=="L"&&Dr=="1"?Ae[lr]="L":w.test(Dr)&&(Jr=Dr)}for(var vr=0;vr<Oe;++vr)if(a.test(Ae[vr])){var ur=void 0;for(ur=vr+1;ur<Oe&&a.test(Ae[ur]);++ur);for(var ar=(vr?Ae[vr-1]:ve)=="L",Qr=(ur<Oe?Ae[ur]:ve)=="L",fa=ar==Qr?ar?"L":"R":ve,Fn=vr;Fn<ur;++Fn)Ae[Fn]=fa;vr=ur-1}for(var Ir=[],An,Tr=0;Tr<Oe;)if(F.test(Ae[Tr])){var Vi=Tr;for(++Tr;Tr<Oe&&F.test(Ae[Tr]);++Tr);Ir.push(new X(0,Vi,Tr))}else{var Rn=Tr,Yn=Ir.length,$n=fe=="rtl"?1:0;for(++Tr;Tr<Oe&&Ae[Tr]!="L";++Tr);for(var Wr=Rn;Wr<Tr;)if(W.test(Ae[Wr])){Rn<Wr&&(Ir.splice(Yn,0,new X(1,Rn,Wr)),Yn+=$n);var ha=Wr;for(++Wr;Wr<Tr&&W.test(Ae[Wr]);++Wr);Ir.splice(Yn,0,new X(2,ha,Wr)),Yn+=$n,Rn=Wr}else++Wr;Rn<Tr&&Ir.splice(Yn,0,new X(1,Rn,Tr))}return fe=="ltr"&&(Ir[0].level==1&&(An=Q.match(/^\s+/))&&(Ir[0].from=An[0].length,Ir.unshift(new X(0,0,An[0].length))),V(Ir).level==1&&(An=Q.match(/\s+$/))&&(V(Ir).to-=An[0].length,Ir.push(new X(0,Oe-An[0].length,Oe)))),fe=="rtl"?Ir.reverse():Ir}}();function Fe(e,t){var n=e.order;return n==null&&(n=e.order=Ne(e.text,t)),n}var Ue=[],Ce=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ue).concat(n)}};function He(e,t){return e._handlers&&e._handlers[t]||Ue}function je(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,a=r&&r[t];if(a){var w=ue(a,n);w>-1&&(r[t]=a.slice(0,w).concat(a.slice(w+1)))}}}function we(e,t){var n=He(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),a=0;a<n.length;++a)n[a].apply(null,r)}function Ie(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),we(e,n||t.type,e,t),se(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ue(n,t[r])==-1&&n.push(t[r])}function ce(e,t){return He(e,t).length>0}function me(e){e.prototype.on=function(t,n){Ce(this,t,n)},e.prototype.off=function(t,n){je(this,t,n)}}function q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ne(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function se(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){q(e),ne(e)}function ye(e){return e.target||e.srcElement}function Le(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),u&&e.ctrlKey&&t==1&&(t=3),t}var Ke=function(){if(B&&N<9)return!1;var e=i("div");return"draggable"in e||"dragDrop"in e}(),Je;function et(e){if(Je==null){var t=i("span","\u200B");s(e,i("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Je=t.offsetWidth<=1&&t.offsetHeight>2&&!(B&&N<8))}var n=Je?i("span","\u200B"):i("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Qe;function yt(e){if(Qe!=null)return Qe;var t=s(e,document.createTextNode("A\u062EA")),n=m(t,0,1).getBoundingClientRect(),r=m(t,1,2).getBoundingClientRect();return f(e),!n||n.left==n.right?!1:Qe=r.right-n.right<3}var st=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var a=e.indexOf(`
|
|
`,t);a==-1&&(a=e.length);var w=e.slice(t,e.charAt(a-1)=="\r"?a-1:a),F=w.indexOf("\r");F!=-1?(n.push(w.slice(0,F)),t+=F+1):(n.push(w),t=a+1)}return n}:function(e){return e.split(/\r\n?|\n/)},rt=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(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Tt=function(){var e=i("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),mt=null;function vt(e){if(mt!=null)return mt;var t=s(e,i("span","x")),n=t.getBoundingClientRect(),r=m(t,0,1).getBoundingClientRect();return mt=Math.abs(n.left-r.left)>1}var bt={},ft={};function At(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),bt[e]=t}function Ut(e,t){ft[e]=t}function Wt(e){if(typeof e=="string"&&ft.hasOwnProperty(e))e=ft[e];else if(e&&typeof e.name=="string"&&ft.hasOwnProperty(e.name)){var t=ft[e.name];typeof t=="string"&&(t={name:t}),e=xe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Wt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Wt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Jt(e,t){t=Wt(t);var n=bt[t.name];if(!n)return Jt(e,"text/plain");var r=n(e,t);if(Rt.hasOwnProperty(t.name)){var a=Rt[t.name];for(var w in a){if(!a.hasOwnProperty(w))continue;r.hasOwnProperty(w)&&(r["_"+w]=r[w]),r[w]=a[w]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var F in t.modeProps)r[F]=t.modeProps[F];return r}var Rt={};function Lr(e,t){var n=Rt.hasOwnProperty(e)?Rt[e]:Rt[e]={};M(t,n)}function Qt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var a=t[r];a instanceof Array&&(a=a.concat([])),n[r]=a}return n}function zt(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function dr(e,t,n){return e.startState?e.startState(t,n):!0}var _t=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};_t.prototype.eol=function(){return this.pos>=this.string.length},_t.prototype.sol=function(){return this.pos==this.lineStart},_t.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},_t.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},_t.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},_t.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},_t.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},_t.prototype.skipToEnd=function(){this.pos=this.string.length},_t.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},_t.prototype.backUp=function(e){this.pos-=e},_t.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=G(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},_t.prototype.indentation=function(){return G(this.string,null,this.tabSize)-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},_t.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(F){return n?F.toLowerCase():F},a=this.string.substr(this.pos,e.length);if(r(a)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var w=this.string.slice(this.pos).match(e);return w&&w.index>0?null:(w&&t!==!1&&(this.pos+=w[0].length),w)}},_t.prototype.current=function(){return this.string.slice(this.start,this.pos)},_t.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},_t.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},_t.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function nt(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 n=e;!n.lines;)for(var r=0;;++r){var a=n.children[r],w=a.chunkSize();if(t<w){n=a;break}t-=w}return n.lines[t]}function Yt(e,t,n){var r=[],a=t.line;return e.iter(t.line,n.line+1,function(w){var F=w.text;a==n.line&&(F=F.slice(0,n.ch)),a==t.line&&(F=F.slice(t.ch)),r.push(F),++a}),r}function gr(e,t,n){var r=[];return e.iter(t,n,function(a){r.push(a.text)}),r}function er(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function St(e){if(e.parent==null)return null;for(var t=e.parent,n=ue(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var a=0;!(r.children[a]==t);++a)n+=r.children[a].chunkSize();return n+t.first}function rr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var a=e.children[r],w=a.height;if(t<w){e=a;continue e}t-=w,n+=a.chunkSize()}return n}while(!e.lines);for(var F=0;F<e.lines.length;++F){var W=e.lines[F],X=W.height;if(t<X)break;t-=X}return n+F}function $t(e,t){return t>=e.first&&t<e.first+e.size}function sn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ge(e,t,n){if(n===void 0&&(n=null),!(this instanceof Ge))return new Ge(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ct(e,t){return e.line-t.line||e.ch-t.ch}function Zr(e,t){return e.sticky==t.sticky&&ct(e,t)==0}function Or(e){return Ge(e.line,e.ch)}function qr(e,t){return ct(e,t)<0?t:e}function Rr(e,t){return ct(e,t)<0?e:t}function ln(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ht(e,t){if(t.line<e.first)return Ge(e.first,0);var n=e.first+e.size-1;return t.line>n?Ge(n,nt(e,n).text.length):Nr(t,nt(e,t.line).text.length)}function Nr(e,t){var n=e.ch;return n==null||n>t?Ge(e.line,t):n<0?Ge(e.line,0):e}function Ye(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ht(e,t[r]);return n}var Hr=function(e,t){this.state=e,this.lookAhead=t},ir=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};ir.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ir.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}},ir.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ir.fromSaved=function(e,t,n){return t instanceof Hr?new ir(e,Qt(e.mode,t.state),n,t.lookAhead):new ir(e,Qt(e.mode,t),n)},ir.prototype.save=function(e){var t=e!==!1?Qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hr(t,this.maxLookAhead):t};function pn(e,t,n,r){var a=[e.state.modeGen],w={};Kt(e,t.text,e.doc.mode,n,function(Q,fe){return a.push(Q,fe)},w,r);for(var F=n.state,W=function(Q){n.baseTokens=a;var fe=e.state.overlays[Q],ve=1,Oe=0;n.state=!0,Kt(e,t.text,fe.mode,n,function(Ae,We){for(var ze=ve;Oe<Ae;){var $e=a[ve];$e>Ae&&a.splice(ve,1,Ae,a[ve+1],$e),ve+=2,Oe=Math.min(Ae,$e)}if(!We)return;if(fe.opaque)a.splice(ze,ve-ze,Ae,"overlay "+We),ve=ze+2;else for(;ze<ve;ze+=2){var Ze=a[ze+1];a[ze+1]=(Ze?Ze+" ":"")+"overlay "+We}},w),n.state=F,n.baseTokens=null,n.baseTokenPos=1},X=0;X<e.state.overlays.length;++X)W(X);return{styles:a,classes:w.bgClass||w.textClass?w:null}}function cr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=yr(e,St(t)),a=t.text.length>e.options.maxHighlightLength&&Qt(e.doc.mode,r.state),w=pn(e,t,r);a&&(r.state=a),t.stateAfter=r.save(!a),t.styles=w.styles,w.classes?t.styleClasses=w.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function yr(e,t,n){var r=e.doc,a=e.display;if(!r.mode.startState)return new ir(r,!0,t);var w=Sr(e,t,n),F=w>r.first&&nt(r,w-1).stateAfter,W=F?ir.fromSaved(r,F,w):new ir(r,dr(r.mode),w);return r.iter(w,t,function(X){Zt(e,X.text,W);var Q=W.line;X.stateAfter=Q==t-1||Q%5==0||Q>=a.viewFrom&&Q<a.viewTo?W.save():null,W.nextLine()}),n&&(r.modeFrontier=W.line),W}function Zt(e,t,n,r){var a=e.doc.mode,w=new _t(t,e.options.tabSize,n);for(w.start=w.pos=r||0,t==""&&jt(a,n.state);!w.eol();)Mt(a,w,n.state),w.start=w.pos}function jt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=zt(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Mt(e,t,n,r){for(var a=0;a<10;a++){r&&(r[0]=zt(e,n).mode);var w=e.token(t,n);if(t.pos>t.start)return w}throw new Error("Mode "+e.name+" failed to advance stream.")}var xt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function nr(e,t,n,r){var a=e.doc,w=a.mode,F;t=ht(a,t);var W=nt(a,t.line),X=yr(e,t.line,n),Q=new _t(W.text,e.options.tabSize,X),fe;for(r&&(fe=[]);(r||Q.pos<t.ch)&&!Q.eol();)Q.start=Q.pos,F=Mt(w,Q,X.state),r&&fe.push(new xt(Q,F,Qt(a.mode,X.state)));return r?fe:new xt(Q,F,X.state)}function fr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Kt(e,t,n,r,a,w,F){var W=n.flattenSpans;W==null&&(W=e.options.flattenSpans);var X=0,Q=null,fe=new _t(t,e.options.tabSize,r),ve,Oe=e.options.addModeClass&&[null];for(t==""&&fr(jt(n,r.state),w);!fe.eol();){if(fe.pos>e.options.maxHighlightLength?(W=!1,F&&Zt(e,t,r,fe.pos),fe.pos=t.length,ve=null):ve=fr(Mt(n,fe,r.state,Oe),w),Oe){var Ae=Oe[0].name;Ae&&(ve="m-"+(ve?Ae+" "+ve:Ae))}if(!W||Q!=ve){for(;X<fe.start;)X=Math.min(fe.start,X+5e3),a(X,Q);Q=ve}fe.start=fe.pos}for(;X<fe.pos;){var We=Math.min(fe.pos,X+5e3);a(We,Q),X=We}}function Sr(e,t,n){for(var r,a,w=e.doc,F=n?-1:t-(e.doc.mode.innerMode?1e3:100),W=t;W>F;--W){if(W<=w.first)return w.first;var X=nt(w,W-1),Q=X.stateAfter;if(Q&&(!n||W+(Q instanceof Hr?Q.lookAhead:0)<=w.modeFrontier))return W;var fe=G(X.text,null,e.options.tabSize);(a==null||r>fe)&&(a=W-1,r=fe)}return a}function Ur(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var a=nt(e,r).stateAfter;if(a&&(!(a instanceof Hr)||r+a.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var kr=!1,Vt=!1;function Ft(){kr=!0}function _r(){Vt=!0}function Fr(e,t,n){this.marker=e,this.from=t,this.to=n}function Xt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Sn(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Cr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function wr(e,t,n){var r;if(e)for(var a=0;a<e.length;++a){var w=e[a],F=w.marker,W=w.from==null||(F.inclusiveLeft?w.from<=t:w.from<t);if(W||w.from==t&&F.type=="bookmark"&&(!n||!w.marker.insertLeft)){var X=w.to==null||(F.inclusiveRight?w.to>=t:w.to>t);(r||(r=[])).push(new Fr(F,w.from,X?null:w.to))}}return r}function Jn(e,t,n){var r;if(e)for(var a=0;a<e.length;++a){var w=e[a],F=w.marker,W=w.to==null||(F.inclusiveRight?w.to>=t:w.to>t);if(W||w.from==t&&F.type=="bookmark"&&(!n||w.marker.insertLeft)){var X=w.from==null||(F.inclusiveLeft?w.from<=t:w.from<t);(r||(r=[])).push(new Fr(F,X?null:w.from-t,w.to==null?null:w.to-t))}}return r}function Lt(e,t){if(t.full)return null;var n=$t(e,t.from.line)&&nt(e,t.from.line).markedSpans,r=$t(e,t.to.line)&&nt(e,t.to.line).markedSpans;if(!n&&!r)return null;var a=t.from.ch,w=t.to.ch,F=ct(t.from,t.to)==0,W=wr(n,a,F),X=Jn(r,w,F),Q=t.text.length==1,fe=V(t.text).length+(Q?a:0);if(W)for(var ve=0;ve<W.length;++ve){var Oe=W[ve];if(Oe.to==null){var Ae=Xt(X,Oe.marker);Ae?Q&&(Oe.to=Ae.to==null?null:Ae.to+fe):Oe.to=a}}if(X)for(var We=0;We<X.length;++We){var ze=X[We];if(ze.to!=null&&(ze.to+=fe),ze.from==null){var $e=Xt(W,ze.marker);$e||(ze.from=fe,Q&&(W||(W=[])).push(ze))}else ze.from+=fe,Q&&(W||(W=[])).push(ze)}W&&(W=lt(W)),X&&X!=W&&(X=lt(X));var Ze=[W];if(!Q){var at=t.text.length-2,qe;if(at>0&&W)for(var it=0;it<W.length;++it)W[it].to==null&&(qe||(qe=[])).push(new Fr(W[it].marker,null,null));for(var gt=0;gt<at;++gt)Ze.push(qe);Ze.push(X)}return Ze}function lt(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function tt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(Ae){if(Ae.markedSpans)for(var We=0;We<Ae.markedSpans.length;++We){var ze=Ae.markedSpans[We].marker;ze.readOnly&&(!r||ue(r,ze)==-1)&&(r||(r=[])).push(ze)}}),!r)return null;for(var a=[{from:t,to:n}],w=0;w<r.length;++w)for(var F=r[w],W=F.find(0),X=0;X<a.length;++X){var Q=a[X];if(ct(Q.to,W.from)<0||ct(Q.from,W.to)>0)continue;var fe=[X,1],ve=ct(Q.from,W.from),Oe=ct(Q.to,W.to);(ve<0||!F.inclusiveLeft&&!ve)&&fe.push({from:Q.from,to:W.from}),(Oe>0||!F.inclusiveRight&&!Oe)&&fe.push({from:W.to,to:Q.to}),a.splice.apply(a,fe),X+=fe.length-3}return a}function or(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function Pt(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function hr(e){return e.inclusiveLeft?-1:0}function en(e){return e.inclusiveRight?1:0}function un(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),a=t.find(),w=ct(r.from,a.from)||hr(e)-hr(t);if(w)return-w;var F=ct(r.to,a.to)||en(e)-en(t);return F||t.id-e.id}function Gr(e,t){var n=Vt&&e.markedSpans,r;if(n)for(var a=void 0,w=0;w<n.length;++w)a=n[w],a.marker.collapsed&&(t?a.from:a.to)==null&&(!r||un(r,a.marker)<0)&&(r=a.marker);return r}function Br(e){return Gr(e,!0)}function jr(e){return Gr(e,!1)}function dn(e,t){var n=Vt&&e.markedSpans,r;if(n)for(var a=0;a<n.length;++a){var w=n[a];w.marker.collapsed&&(w.from==null||w.from<t)&&(w.to==null||w.to>t)&&(!r||un(r,w.marker)<0)&&(r=w.marker)}return r}function mn(e,t,n,r,a){var w=nt(e,t),F=Vt&&w.markedSpans;if(F)for(var W=0;W<F.length;++W){var X=F[W];if(!X.marker.collapsed)continue;var Q=X.marker.find(0),fe=ct(Q.from,n)||hr(X.marker)-hr(a),ve=ct(Q.to,r)||en(X.marker)-en(a);if(fe>=0&&ve<=0||fe<=0&&ve>=0)continue;if(fe<=0&&(X.marker.inclusiveRight&&a.inclusiveLeft?ct(Q.to,n)>=0:ct(Q.to,n)>0)||fe>=0&&(X.marker.inclusiveRight&&a.inclusiveLeft?ct(Q.from,r)<=0:ct(Q.from,r)<0))return!0}}function pr(e){for(var t;t=Br(e);)e=t.find(-1,!0).line;return e}function vn(e){for(var t;t=jr(e);)e=t.find(1,!0).line;return e}function yn(e){for(var t,n;t=jr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=nt(e,t),r=pr(n);return n==r?t:St(r)}function rn(e,t){if(t>e.lastLine())return t;var n=nt(e,t),r;if(!bn(e,n))return t;for(;r=jr(n);)n=r.find(1,!0).line;return St(n)+1}function bn(e,t){var n=Vt&&t.markedSpans;if(n)for(var r=void 0,a=0;a<n.length;++a){if(r=n[a],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&cn(e,t,r))return!0}}function cn(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return cn(e,r.line,Xt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var a=void 0,w=0;w<t.markedSpans.length;++w)if(a=t.markedSpans[w],a.marker.collapsed&&!a.marker.widgetNode&&a.from==n.to&&(a.to==null||a.to!=n.from)&&(a.marker.inclusiveLeft||n.marker.inclusiveRight)&&cn(e,t,a))return!0}function nn(e){e=pr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var a=n.lines[r];if(a==e)break;t+=a.height}for(var w=n.parent;w;n=w,w=n.parent)for(var F=0;F<w.children.length;++F){var W=w.children[F];if(W==n)break;t+=W.height}return t}function pa(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Br(r);){var a=n.find(0,!0);r=a.from.line,t+=a.from.ch-a.to.ch}for(r=e;n=jr(r);){var w=n.find(0,!0);t-=r.text.length-w.from.ch,r=w.to.line,t+=r.text.length-w.to.ch}return t}function ja(e){var t=e.display,n=e.doc;t.maxLine=nt(n,n.first),t.maxLineLength=pa(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var a=pa(r);a>t.maxLineLength&&(t.maxLineLength=a,t.maxLine=r)})}var Bn=function(e,t,n){this.text=e,Pt(this,t),this.height=n?n(this):1};Bn.prototype.lineNo=function(){return St(this)},me(Bn);function ui(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),or(e),Pt(e,n);var a=r?r(e):1;a!=e.height&&er(e,a)}function ut(e){e.parent=null,or(e)}var Et={},pt={};function wt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?pt:Et;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function kt(e,t){var n=x("span",null,null,_?"padding-right: .1px":null),r={pre:x("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var w=a?t.rest[a-1]:t.line,F=void 0;r.pos=0,r.addToken=Ot,yt(e.display.measure)&&(F=Fe(w,e.doc.direction))&&(r.addToken=zr(r.addToken,F)),r.map=[];var W=t!=e.display.externalMeasured&&St(w);Dn(w,r,cr(e,w,W)),w.styleClasses&&(w.styleClasses.bgClass&&(r.bgClass=j(w.styleClasses.bgClass,r.bgClass||"")),w.styleClasses.textClass&&(r.textClass=j(w.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(et(e.display.measure))),a==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var X=r.content.lastChild;(/\bcm-tab\b/.test(X.className)||X.querySelector&&X.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return we(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function Ht(e){var t=i("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ot(e,t,n,r,a,w,F){if(!t)return;var W=e.splitSpaces?mr(t,e.trailingSpace):t,X=e.cm.state.specialChars,Q=!1,fe;if(!X.test(t))e.col+=t.length,fe=document.createTextNode(W),e.map.push(e.pos,e.pos+t.length,fe),B&&N<9&&(Q=!0),e.pos+=t.length;else{fe=document.createDocumentFragment();for(var ve=0;;){X.lastIndex=ve;var Oe=X.exec(t),Ae=Oe?Oe.index-ve:t.length-ve;if(Ae){var We=document.createTextNode(W.slice(ve,ve+Ae));B&&N<9?fe.appendChild(i("span",[We])):fe.appendChild(We),e.map.push(e.pos,e.pos+Ae,We),e.col+=Ae,e.pos+=Ae}if(!Oe)break;ve+=Ae+1;var ze=void 0;if(Oe[0]==" "){var $e=e.cm.options.tabSize,Ze=$e-e.col%$e;ze=fe.appendChild(i("span",ie(Ze),"cm-tab")),ze.setAttribute("role","presentation"),ze.setAttribute("cm-text"," "),e.col+=Ze}else Oe[0]=="\r"||Oe[0]==`
|
|
`?(ze=fe.appendChild(i("span",Oe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ze.setAttribute("cm-text",Oe[0]),e.col+=1):(ze=e.cm.options.specialCharPlaceholder(Oe[0]),ze.setAttribute("cm-text",Oe[0]),B&&N<9?fe.appendChild(i("span",[ze])):fe.appendChild(ze),e.col+=1);e.map.push(e.pos,e.pos+1,ze),e.pos++}}if(e.trailingSpace=W.charCodeAt(t.length-1)==32,n||r||a||Q||w||F){var at=n||"";r&&(at+=r),a&&(at+=a);var qe=i("span",[fe],at,w);if(F)for(var it in F)F.hasOwnProperty(it)&&it!="style"&&it!="class"&&qe.setAttribute(it,F[it]);return e.content.appendChild(qe)}e.content.appendChild(fe)}function mr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",a=0;a<e.length;a++){var w=e.charAt(a);w==" "&&n&&(a==e.length-1||e.charCodeAt(a+1)==32)&&(w="\xA0"),r+=w,n=w==" "}return r}function zr(e,t){return function(n,r,a,w,F,W,X){a=a?a+" cm-force-border":"cm-force-border";for(var Q=n.pos,fe=Q+r.length;;){for(var ve=void 0,Oe=0;Oe<t.length&&!(ve=t[Oe],ve.to>Q&&ve.from<=Q);Oe++);if(ve.to>=fe)return e(n,r,a,w,F,W,X);e(n,r.slice(0,ve.to-Q),a,w,null,W,X),w=null,r=r.slice(ve.to-Q),Q=ve.to}}}function Dt(e,t,n,r){var a=!r&&n.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!r&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",n.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function Dn(e,t,n){var r=e.markedSpans,a=e.text,w=0;if(!r){for(var F=1;F<n.length;F+=2)t.addToken(t,a.slice(w,w=n[F]),wt(n[F+1],t.cm.options));return}for(var W=a.length,X=0,Q=1,fe="",ve,Oe,Ae=0,We,ze,$e,Ze,at;;){if(Ae==X){We=ze=$e=Oe="",at=null,Ze=null,Ae=Infinity;for(var qe=[],it=void 0,gt=0;gt<r.length;++gt){var dt=r[gt],Ct=dt.marker;if(Ct.type=="bookmark"&&dt.from==X&&Ct.widgetNode)qe.push(Ct);else if(dt.from<=X&&(dt.to==null||dt.to>X||Ct.collapsed&&dt.to==X&&dt.from==X)){if(dt.to!=null&&dt.to!=X&&Ae>dt.to&&(Ae=dt.to,ze=""),Ct.className&&(We+=" "+Ct.className),Ct.css&&(Oe=(Oe?Oe+";":"")+Ct.css),Ct.startStyle&&dt.from==X&&($e+=" "+Ct.startStyle),Ct.endStyle&&dt.to==Ae&&(it||(it=[])).push(Ct.endStyle,dt.to),Ct.title&&((at||(at={})).title=Ct.title),Ct.attributes)for(var Gt in Ct.attributes)(at||(at={}))[Gt]=Ct.attributes[Gt];Ct.collapsed&&(!Ze||un(Ze.marker,Ct)<0)&&(Ze=dt)}else dt.from>X&&Ae>dt.from&&(Ae=dt.from)}if(it)for(var xr=0;xr<it.length;xr+=2)it[xr+1]==Ae&&(ze+=" "+it[xr]);if(!Ze||Ze.from==X)for(var tr=0;tr<qe.length;++tr)Dt(t,0,qe[tr]);if(Ze&&(Ze.from||0)==X){if(Dt(t,(Ze.to==null?W+1:Ze.to)-X,Ze.marker,Ze.from==null),Ze.to==null)return;Ze.to==X&&(Ze=!1)}}if(X>=W)break;for(var on=Math.min(W,Ae);;){if(fe){var $r=X+fe.length;if(!Ze){var lr=$r>on?fe.slice(0,on-X):fe;t.addToken(t,lr,ve?ve+We:We,$e,X+lr.length==Ae?ze:"",Oe,at)}if($r>=on){fe=fe.slice(on-X),X=on;break}X=$r,$e=""}fe=a.slice(w,w=n[Q++]),ve=wt(n[Q++],t.cm.options)}}}function It(e,t,n){this.line=t,this.rest=yn(t),this.size=this.rest?St(V(this.rest))-n+1:1,this.node=this.text=null,this.hidden=bn(e,t)}function Vr(e,t,n){for(var r=[],a,w=t;w<n;w=a){var F=new It(e.doc,nt(e.doc,w),w);a=w+F.size,r.push(F)}return r}var Pr=null;function gn(e){Pr?Pr.ops.push(e):e.ownsGroup=Pr={ops:[e],delayedCallbacks:[]}}function Rs(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var a=e.ops[r];if(a.cursorActivityHandlers)for(;a.cursorActivityCalled<a.cursorActivityHandlers.length;)a.cursorActivityHandlers[a.cursorActivityCalled++].call(null,a.cm)}}while(n<t.length)}function ks(e,t){var n=e.ownsGroup;if(!n)return;try{Rs(n)}finally{Pr=null,t(n)}}var ma=null;function Ar(e,t){var n=He(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),a;Pr?a=Pr.delayedCallbacks:ma?a=ma:(a=ma=[],setTimeout(_s,0));for(var w=function(W){a.push(function(){return n[W].apply(null,r)})},F=0;F<n.length;++F)w(F)}function _s(){var e=ma;ma=null;for(var t=0;t<e.length;++t)e[t]()}function Yi(e,t,n,r){for(var a=0;a<t.changes.length;a++){var w=t.changes[a];w=="text"?Ms(e,t):w=="gutter"?Ji(e,t,n,r):w=="class"?di(e,t):w=="widget"&&Is(e,t,r)}t.changes=null}function va(e){return e.node==e.text&&(e.node=i("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),B&&N<8&&(e.node.style.zIndex=2)),e.node}function Ps(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=va(t);t.background=r.insertBefore(i("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function $i(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):kt(e,t)}function Ms(e,t){var n=t.text.className,r=$i(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,di(e,t)):n&&(t.text.className=n)}function di(e,t){Ps(e,t),t.line.wrapClass?va(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ji(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=va(t);t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),a.insertBefore(t.gutterBackground,t.text)}var w=t.line.gutterMarkers;if(e.options.lineNumbers||w){var F=va(t),W=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(W),F.insertBefore(W,t.text),t.line.gutterClass&&(W.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!w||!w["CodeMirror-linenumbers"])&&(t.lineNumber=W.appendChild(i("div",sn(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),w)for(var X=0;X<e.display.gutterSpecs.length;++X){var Q=e.display.gutterSpecs[X].className,fe=w.hasOwnProperty(Q)&&w[Q];fe&&W.appendChild(i("div",[fe],"CodeMirror-gutter-elt","left: "+r.gutterLeft[Q]+"px; width: "+r.gutterWidth[Q]+"px"))}}}function Is(e,t,n){t.alignable&&(t.alignable=null);for(var r=v("CodeMirror-linewidget"),a=t.node.firstChild,w=void 0;a;a=w)w=a.nextSibling,r.test(a.className)&&t.node.removeChild(a);Qi(e,t,n)}function Ns(e,t,n,r){var a=$i(e,t);return t.text=t.node=a.pre,a.bgClass&&(t.bgClass=a.bgClass),a.textClass&&(t.textClass=a.textClass),di(e,t),Ji(e,t,n,r),Qi(e,t,r),t.node}function Qi(e,t,n){if(Zi(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Zi(e,t.rest[r],t,n,!1)}function Zi(e,t,n,r,a){if(!t.widgets)return;for(var w=va(n),F=0,W=t.widgets;F<W.length;++F){var X=W[F],Q=i("div",[X.node],"CodeMirror-linewidget"+(X.className?" "+X.className:""));X.handleMouseEvents||Q.setAttribute("cm-ignore-events","true"),Us(X,Q,n,r),e.display.input.setUneditable(Q),a&&X.above?w.insertBefore(Q,n.gutter||n.text):w.appendChild(Q),Ar(X,"redraw")}}function Us(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var a=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(a-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=a+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ga(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,i("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Ln(e,t){for(var n=ye(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Ka(e){return e.lineSpace.offsetTop}function ci(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qi(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,i("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Cn(e){return de-e.display.nativeBarWidth}function jn(e){return e.display.scroller.clientWidth-Cn(e)-e.display.barWidth}function fi(e){return e.display.scroller.clientHeight-Cn(e)-e.display.barHeight}function Fs(e,t,n){var r=e.options.lineWrapping,a=r&&jn(e);if(!t.measure.heights||r&&t.measure.width!=a){var w=t.measure.heights=[];if(r){t.measure.width=a;for(var F=t.text.firstChild.getClientRects(),W=0;W<F.length-1;W++){var X=F[W],Q=F[W+1];Math.abs(X.bottom-Q.bottom)>2&&w.push((X.bottom+Q.top)/2-n.top)}}w.push(n.bottom-n.top)}}function eo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var a=0;a<e.rest.length;a++)if(St(e.rest[a])>n)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}function Bs(e,t){t=pr(t);var n=St(t),r=e.display.externalMeasured=new It(e.doc,t,n);r.lineN=n;var a=r.built=kt(e,r);return r.text=a.pre,s(e.display.lineMeasure,a.pre),r}function to(e,t,n,r){return wn(e,Qn(e,t),n,r)}function hi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Hn(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Qn(e,t){var n=St(t),r=hi(e,n);r&&!r.text?r=null:r&&r.changes&&(Yi(e,r,n,bi(e)),e.curOp.forceUpdate=!0),r||(r=Bs(e,t));var a=eo(r,t,n);return{line:t,view:r,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function wn(e,t,n,r,a){t.before&&(n=-1);var w=n+(r||""),F;return t.cache.hasOwnProperty(w)?F=t.cache[w]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Fs(e,t.view,t.rect),t.hasHeights=!0),F=Ks(e,t,n,r),F.bogus||(t.cache[w]=F)),{left:F.left,right:F.right,top:a?F.rtop:F.top,bottom:a?F.rbottom:F.bottom}}var ro={left:0,right:0,top:0,bottom:0};function no(e,t,n){for(var r,a,w,F,W,X,Q=0;Q<e.length;Q+=3)if(W=e[Q],X=e[Q+1],t<W?(a=0,w=1,F="left"):t<X?(a=t-W,w=a+1):(Q==e.length-3||t==X&&e[Q+3]>t)&&(w=X-W,a=w-1,t>=X&&(F="right")),a!=null){if(r=e[Q+2],W==X&&n==(r.insertLeft?"left":"right")&&(F=n),n=="left"&&a==0)for(;Q&&e[Q-2]==e[Q-3]&&e[Q-1].insertLeft;)r=e[(Q-=3)+2],F="left";if(n=="right"&&a==X-W)for(;Q<e.length-3&&e[Q+3]==e[Q+4]&&!e[Q+5].insertLeft;)r=e[(Q+=3)+2],F="right";break}return{node:r,start:a,end:w,collapse:F,coverStart:W,coverEnd:X}}function js(e,t){var n=ro;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var a=e.length-1;a>=0&&!((n=e[a]).left!=n.right);a--);return n}function Ks(e,t,n,r){var a=no(t.map,n,r),w=a.node,F=a.start,W=a.end,X=a.collapse,Q;if(w.nodeType==3){for(var fe=0;fe<4;fe++){for(;F&&Me(t.line.text.charAt(a.coverStart+F));)--F;for(;a.coverStart+W<a.coverEnd&&Me(t.line.text.charAt(a.coverStart+W));)++W;if(B&&N<9&&F==0&&W==a.coverEnd-a.coverStart?Q=w.parentNode.getBoundingClientRect():Q=js(m(w,F,W).getClientRects(),r),Q.left||Q.right||F==0)break;W=F,F=F-1,X="right"}B&&N<11&&(Q=Ws(e.display.measure,Q))}else{F>0&&(X=r="right");var ve;e.options.lineWrapping&&(ve=w.getClientRects()).length>1?Q=ve[r=="right"?ve.length-1:0]:Q=w.getBoundingClientRect()}if(B&&N<9&&!F&&(!Q||!Q.left&&!Q.right)){var Oe=w.parentNode.getClientRects()[0];Oe?Q={left:Oe.left,right:Oe.left+qn(e.display),top:Oe.top,bottom:Oe.bottom}:Q=ro}for(var Ae=Q.top-t.rect.top,We=Q.bottom-t.rect.top,ze=(Ae+We)/2,$e=t.view.measure.heights,Ze=0;Ze<$e.length-1&&!(ze<$e[Ze]);Ze++);var at=Ze?$e[Ze-1]:0,qe=$e[Ze],it={left:(X=="right"?Q.right:Q.left)-t.rect.left,right:(X=="left"?Q.left:Q.right)-t.rect.left,top:at,bottom:qe};return!Q.left&&!Q.right&&(it.bogus=!0),e.options.singleCursorHeightPerLine||(it.rtop=Ae,it.rbottom=We),it}function Ws(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!vt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ao(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 io(e){e.display.externalMeasure=null,f(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ao(e.display.view[t])}function ya(e){io(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return y&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return y&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pi(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=ga(e.widgets[n]));return t}function Wa(e,t,n,r,a){if(!a){var w=pi(t);n.top+=w,n.bottom+=w}if(r=="line")return n;r||(r="local");var F=nn(t);if(r=="local"?F+=Ka(e.display):F-=e.display.viewOffset,r=="page"||r=="window"){var W=e.display.lineSpace.getBoundingClientRect();F+=W.top+(r=="window"?0:so());var X=W.left+(r=="window"?0:oo());n.left+=X,n.right+=X}return n.top+=F,n.bottom+=F,n}function lo(e,t,n){if(n=="div")return t;var r=t.left,a=t.top;if(n=="page")r-=oo(),a-=so();else if(n=="local"||!n){var w=e.display.sizer.getBoundingClientRect();r+=w.left,a+=w.top}var F=e.display.lineSpace.getBoundingClientRect();return{left:r-F.left,top:a-F.top}}function mi(e,t,n,r,a){return r||(r=nt(e.doc,t.line)),Wa(e,r,to(e,r,t.ch,a),n)}function En(e,t,n,r,a,w){r=r||nt(e.doc,t.line),a||(a=Qn(e,r));function F(We,ze){var $e=wn(e,a,We,ze?"right":"left",w);return ze?$e.left=$e.right:$e.right=$e.left,Wa(e,r,$e,n)}var W=Fe(r,e.doc.direction),X=t.ch,Q=t.sticky;if(X>=r.text.length?(X=r.text.length,Q="before"):X<=0&&(X=0,Q="after"),!W)return F(Q=="before"?X-1:X,Q=="before");function fe(We,ze,$e){var Ze=W[ze],at=Ze.level==1;return F($e?We-1:We,at!=$e)}var ve=_e(W,X,Q),Oe=Re,Ae=fe(X,ve,Q=="before");return Oe!=null&&(Ae.other=fe(X,Oe,Q!="before")),Ae}function uo(e,t){var n=0;t=ht(e.doc,t),e.options.lineWrapping||(n=qn(e.display)*t.ch);var r=nt(e.doc,t.line),a=nn(r)+Ka(e.display);return{left:n,right:n,top:a,bottom:a+r.height}}function vi(e,t,n,r,a){var w=Ge(e,t,n);return w.xRel=a,r&&(w.outside=r),w}function gi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return vi(r.first,0,null,-1,-1);var a=rr(r,n),w=r.first+r.size-1;if(a>w)return vi(r.first+r.size-1,nt(r,w).text.length,null,1,1);t<0&&(t=0);for(var F=nt(r,a);;){var W=Hs(e,F,a,t,n),X=dn(F,W.ch+(W.xRel>0||W.outside>0?1:0));if(!X)return W;var Q=X.find(1);if(Q.line==a)return Q;F=nt(r,a=Q.line)}}function co(e,t,n,r){r-=pi(t);var a=t.text.length,w=Ve(function(F){return wn(e,n,F-1).bottom<=r},a,0);return a=Ve(function(F){return wn(e,n,F).top>r},w,a),{begin:w,end:a}}function fo(e,t,n,r){n||(n=Qn(e,t));var a=Wa(e,t,wn(e,n,r),"line").top;return co(e,t,n,a)}function yi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Hs(e,t,n,r,a){a-=nn(t);var w=Qn(e,t),F=pi(t),W=0,X=t.text.length,Q=!0,fe=Fe(t,e.doc.direction);if(fe){var ve=(e.options.lineWrapping?zs:Gs)(e,t,n,w,fe,r,a);Q=ve.level!=1,W=Q?ve.from:ve.to-1,X=Q?ve.to:ve.from-1}var Oe=null,Ae=null,We=Ve(function(gt){var dt=wn(e,w,gt);return dt.top+=F,dt.bottom+=F,yi(dt,r,a,!1)?(dt.top<=a&&dt.left<=r&&(Oe=gt,Ae=dt),!0):!1},W,X),ze,$e,Ze=!1;if(Ae){var at=r-Ae.left<Ae.right-r,qe=at==Q;We=Oe+(qe?0:1),$e=qe?"after":"before",ze=at?Ae.left:Ae.right}else{!Q&&(We==X||We==W)&&We++,$e=We==0?"after":We==t.text.length?"before":wn(e,w,We-(Q?1:0)).bottom+F<=a==Q?"after":"before";var it=En(e,Ge(n,We,$e),"line",t,w);ze=it.left,Ze=a<it.top?-1:a>=it.bottom?1:0}return We=ke(t.text,We,1),vi(n,We,$e,Ze,r-ze)}function Gs(e,t,n,r,a,w,F){var W=Ve(function(ve){var Oe=a[ve],Ae=Oe.level!=1;return yi(En(e,Ge(n,Ae?Oe.to:Oe.from,Ae?"before":"after"),"line",t,r),w,F,!0)},0,a.length-1),X=a[W];if(W>0){var Q=X.level!=1,fe=En(e,Ge(n,Q?X.from:X.to,Q?"after":"before"),"line",t,r);yi(fe,w,F,!0)&&fe.top>F&&(X=a[W-1])}return X}function zs(e,t,n,r,a,w,F){var W=co(e,t,r,F),X=W.begin,Q=W.end;/\s/.test(t.text.charAt(Q-1))&&Q--;for(var fe=null,ve=null,Oe=0;Oe<a.length;Oe++){var Ae=a[Oe];if(Ae.from>=Q||Ae.to<=X)continue;var We=Ae.level!=1,ze=wn(e,r,We?Math.min(Q,Ae.to)-1:Math.max(X,Ae.from)).right,$e=ze<w?w-ze+1e9:ze-w;(!fe||ve>$e)&&(fe=Ae,ve=$e)}return fe||(fe=a[a.length-1]),fe.from<X&&(fe={from:X,to:fe.to,level:fe.level}),fe.to>Q&&(fe={from:fe.from,to:Q,level:fe.level}),fe}var Kn;function Zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Kn==null){Kn=i("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Kn.appendChild(document.createTextNode("x")),Kn.appendChild(i("br"));Kn.appendChild(document.createTextNode("x"))}s(e.measure,Kn);var n=Kn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),f(e.measure),n||1}function qn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=i("span","xxxxxxxxxx"),n=i("pre",[t],"CodeMirror-line-like");s(e.measure,n);var r=t.getBoundingClientRect(),a=(r.right-r.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function bi(e){for(var t=e.display,n={},r={},a=t.gutters.clientLeft,w=t.gutters.firstChild,F=0;w;w=w.nextSibling,++F){var W=e.display.gutterSpecs[F].className;n[W]=w.offsetLeft+w.clientLeft+a,r[W]=w.clientWidth}return{fixedPos:Ei(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ei(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ho(e){var t=Zn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/qn(e.display)-3);return function(a){if(bn(e.doc,a))return 0;var w=0;if(a.widgets)for(var F=0;F<a.widgets.length;F++)a.widgets[F].height&&(w+=a.widgets[F].height);return n?w+(Math.ceil(a.text.length/r)||1)*t:w+t}}function xi(e){var t=e.doc,n=ho(e);t.iter(function(r){var a=n(r);a!=r.height&&er(r,a)})}function Wn(e,t,n,r){var a=e.display;if(!n&&ye(t).getAttribute("cm-not-content")=="true")return null;var w,F,W=a.lineSpace.getBoundingClientRect();try{w=t.clientX-W.left,F=t.clientY-W.top}catch(ve){return null}var X=gi(e,w,F),Q;if(r&&X.xRel>0&&(Q=nt(e.doc,X.line).text).length==X.ch){var fe=G(Q,Q.length,e.options.tabSize)-Q.length;X=Ge(X.line,Math.max(0,Math.round((w-qi(e.display).left)/qn(e.display))-fe))}return X}function Hn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Xr(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var a=e.display;if(r&&n<a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>t)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)Vt&&tn(e.doc,t)<a.viewTo&&_n(e);else if(n<=a.viewFrom)Vt&&rn(e.doc,n+r)>a.viewFrom?_n(e):(a.viewFrom+=r,a.viewTo+=r);else if(t<=a.viewFrom&&n>=a.viewTo)_n(e);else if(t<=a.viewFrom){var w=Ha(e,n,n+r,1);w?(a.view=a.view.slice(w.index),a.viewFrom=w.lineN,a.viewTo+=r):_n(e)}else if(n>=a.viewTo){var F=Ha(e,t,t,-1);F?(a.view=a.view.slice(0,F.index),a.viewTo=F.lineN):_n(e)}else{var W=Ha(e,t,t,-1),X=Ha(e,n,n+r,1);W&&X?(a.view=a.view.slice(0,W.index).concat(Vr(e,W.lineN,X.lineN)).concat(a.view.slice(X.index)),a.viewTo+=r):_n(e)}var Q=a.externalMeasured;Q&&(n<Q.lineN?Q.lineN+=r:t<Q.lineN+Q.size&&(a.externalMeasured=null))}function kn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var w=r.view[Hn(e,t)];if(w.node==null)return;var F=w.changes||(w.changes=[]);ue(F,n)==-1&&F.push(n)}function _n(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ha(e,t,n,r){var a=Hn(e,t),w,F=e.display.view;if(!Vt||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(var W=e.display.viewFrom,X=0;X<a;X++)W+=F[X].size;if(W!=t){if(r>0){if(a==F.length-1)return null;w=W+F[a].size-t,a++}else w=W-t;t+=w,n+=w}for(;tn(e.doc,n)!=n;){if(a==(r<0?0:F.length-1))return null;n+=r*F[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function Vs(e,t,n){var r=e.display,a=r.view;a.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Vr(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Vr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Hn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Vr(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Hn(e,n)))),r.viewTo=n}function po(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var a=t[r];!a.hidden&&(!a.node||a.changes)&&++n}return n}function ba(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mo(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},a=r.cursors=document.createDocumentFragment(),w=r.selection=document.createDocumentFragment(),F=0;F<n.sel.ranges.length;F++){if(!t&&F==n.sel.primIndex)continue;var W=n.sel.ranges[F];if(W.from().line>=e.display.viewTo||W.to().line<e.display.viewFrom)continue;var X=W.empty();(X||e.options.showCursorWhenSelecting)&&vo(e,W.head,a),X||Xs(e,W,w)}return r}function vo(e,t,n){var r=En(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),a=n.appendChild(i("div","\xA0","CodeMirror-cursor"));if(a.style.left=r.left+"px",a.style.top=r.top+"px",a.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var w=n.appendChild(i("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));w.style.display="",w.style.left=r.other.left+"px",w.style.top=r.other.top+"px",w.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Ga(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,n){var r=e.display,a=e.doc,w=document.createDocumentFragment(),F=qi(e.display),W=F.left,X=Math.max(r.sizerWidth,jn(e)-r.sizer.offsetLeft)-F.right,Q=a.direction=="ltr";function fe(qe,it,gt,dt){it<0&&(it=0),it=Math.round(it),dt=Math.round(dt),w.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+qe+`px;
|
|
top: `+it+"px; width: "+(gt==null?X-qe:gt)+`px;
|
|
height: `+(dt-it)+"px"))}function ve(qe,it,gt){var dt=nt(a,qe),Ct=dt.text.length,Gt,xr;function tr(lr,Jr){return mi(e,Ge(qe,lr),"div",dt,Jr)}function on(lr,Jr,Dr){var vr=fo(e,dt,null,lr),ur=Jr=="ltr"==(Dr=="after")?"left":"right",ar=Dr=="after"?vr.begin:vr.end-(/\s/.test(dt.text.charAt(vr.end-1))?2:1);return tr(ar,ur)[ur]}var $r=Fe(dt,a.direction);return Se($r,it||0,gt==null?Ct:gt,function(lr,Jr,Dr,vr){var ur=Dr=="ltr",ar=tr(lr,ur?"left":"right"),Qr=tr(Jr-1,ur?"right":"left"),fa=it==null&&lr==0,Fn=gt==null&&Jr==Ct,Ir=vr==0,An=!$r||vr==$r.length-1;if(Qr.top-ar.top<=3){var Tr=(Q?fa:Fn)&&Ir,Vi=(Q?Fn:fa)&&An,Rn=Tr?W:(ur?ar:Qr).left,Yn=Vi?X:(ur?Qr:ar).right;fe(Rn,ar.top,Yn-Rn,ar.bottom)}else{var $n,Wr,ha,Xi;ur?($n=Q&&fa&&Ir?W:ar.left,Wr=Q?X:on(lr,Dr,"before"),ha=Q?W:on(Jr,Dr,"after"),Xi=Q&&Fn&&An?X:Qr.right):($n=Q?on(lr,Dr,"before"):W,Wr=!Q&&fa&&Ir?X:ar.right,ha=!Q&&Fn&&An?W:Qr.left,Xi=Q?on(Jr,Dr,"after"):X),fe($n,ar.top,Wr-$n,ar.bottom),ar.bottom<Qr.top&&fe(W,ar.bottom,null,Qr.top),fe(ha,Qr.top,Xi-ha,Qr.bottom)}(!Gt||Ga(ar,Gt)<0)&&(Gt=ar),Ga(Qr,Gt)<0&&(Gt=Qr),(!xr||Ga(ar,xr)<0)&&(xr=ar),Ga(Qr,xr)<0&&(xr=Qr)}),{start:Gt,end:xr}}var Oe=t.from(),Ae=t.to();if(Oe.line==Ae.line)ve(Oe.line,Oe.ch,Ae.ch);else{var We=nt(a,Oe.line),ze=nt(a,Ae.line),$e=pr(We)==pr(ze),Ze=ve(Oe.line,Oe.ch,$e?We.text.length+1:null).end,at=ve(Ae.line,$e?0:null,Ae.ch).start;$e&&(Ze.top<at.top-2?(fe(Ze.right,Ze.top,null,Ze.bottom),fe(W,at.top,at.left,at.bottom)):fe(Ze.right,Ze.top,at.left-Ze.right,Ze.bottom)),Ze.bottom<at.top&&fe(W,Ze.bottom,null,at.top)}n.appendChild(w)}function Ti(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ea(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function go(e){e.state.focused||(e.display.input.focus(),Si(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ea(e))},100)}function Si(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(we(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(),_&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ti(e)}function ea(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,l(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function za(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var a=t.view[r],w=e.options.lineWrapping,F=void 0,W=0;if(a.hidden)continue;if(B&&N<8){var X=a.node.offsetTop+a.node.offsetHeight;F=X-n,n=X}else{var Q=a.node.getBoundingClientRect();F=Q.bottom-Q.top,!w&&a.text.firstChild&&(W=a.text.firstChild.getBoundingClientRect().right-Q.left-1)}var fe=a.line.height-F;if((fe>.005||fe<-.005)&&(er(a.line,F),bo(a.line),a.rest))for(var ve=0;ve<a.rest.length;ve++)bo(a.rest[ve]);if(W>e.display.sizerWidth){var Oe=Math.ceil(W/qn(e.display));Oe>e.display.maxLineLength&&(e.display.maxLineLength=Oe,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}function bo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Va(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Ka(e));var a=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,w=rr(t,r),F=rr(t,a);if(n&&n.ensure){var W=n.ensure.from.line,X=n.ensure.to.line;W<w?(w=W,F=rr(t,nn(nt(t,W))+e.wrapper.clientHeight)):Math.min(X,t.lastLine())>=F&&(w=rr(t,nn(nt(t,X))-e.wrapper.clientHeight),F=X)}return{from:w,to:Math.max(F,w+1)}}function Ys(e,t){if(Ie(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),a=null;if(t.top+r.top<0?a=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),a!=null&&!b){var w=i("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Ka(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Cn(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(w),w.scrollIntoView(a),e.display.lineSpace.removeChild(w)}}function $s(e,t,n,r){r==null&&(r=0);var a;!e.options.lineWrapping&&t==n&&(t=t.ch?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?Ge(t.line,t.ch+1,"before"):t);for(var w=0;w<5;w++){var F=!1,W=En(e,t),X=!n||n==t?W:En(e,n);a={left:Math.min(W.left,X.left),top:Math.min(W.top,X.top)-r,right:Math.max(W.left,X.left),bottom:Math.max(W.bottom,X.bottom)+r};var Q=Ci(e,a),fe=e.doc.scrollTop,ve=e.doc.scrollLeft;if(Q.scrollTop!=null&&(xa(e,Q.scrollTop),Math.abs(e.doc.scrollTop-fe)>1&&(F=!0)),Q.scrollLeft!=null&&(Gn(e,Q.scrollLeft),Math.abs(e.doc.scrollLeft-ve)>1&&(F=!0)),!F)break}return a}function Js(e,t){var n=Ci(e,t);n.scrollTop!=null&&xa(e,n.scrollTop),n.scrollLeft!=null&&Gn(e,n.scrollLeft)}function Ci(e,t){var n=e.display,r=Zn(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,w=fi(e),F={};t.bottom-t.top>w&&(t.bottom=t.top+w);var W=e.doc.height+ci(n),X=t.top<r,Q=t.bottom>W-r;if(t.top<a)F.scrollTop=X?0:t.top;else if(t.bottom>a+w){var fe=Math.min(t.top,(Q?W:t.bottom)-w);fe!=a&&(F.scrollTop=fe)}var ve=e.options.fixedGutter?0:n.gutters.offsetWidth,Oe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ve,Ae=jn(e)-n.gutters.offsetWidth,We=t.right-t.left>Ae;return We&&(t.right=t.left+Ae),t.left<10?F.scrollLeft=0:t.left<Oe?F.scrollLeft=Math.max(0,t.left+ve-(We?0:10)):t.right>Ae+Oe-3&&(F.scrollLeft=t.right+(We?0:10)-Ae),F}function wi(e,t){if(t==null)return;Xa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ta(e){Xa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ea(e,t,n){(t!=null||n!=null)&&Xa(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Qs(e,t){Xa(e),e.curOp.scrollToPos=t}function Xa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=uo(e,t.from),r=uo(e,t.to);Eo(e,n,r,t.margin)}}function Eo(e,t,n,r){var a=Ci(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Ea(e,a.scrollLeft,a.scrollTop)}function xa(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;L||Di(e,{top:t}),xo(e,t,!0),L&&Di(e),Ca(e,100)}function xo(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Gn(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Ao(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Ta(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ci(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?n:0,docHeight:r,scrollHeight:r+Cn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zn=function(e,t,n){this.cm=n;var r=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=a.tabIndex=-1,e(r),e(a),Ce(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ce(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,B&&N<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var a=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var w=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+w)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},zn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zn.prototype.zeroWidthHack=function(){var e=u&&!A?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},zn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var a=e.getBoundingClientRect(),w=n=="vert"?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1);w!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},zn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function ra(e,t){t||(t=Ta(e));var n=e.display.barWidth,r=e.display.barHeight;To(e,t);for(var a=0;a<4&&n!=e.display.barWidth||r!=e.display.barHeight;a++)n!=e.display.barWidth&&e.options.lineWrapping&&za(e),To(e,Ta(e)),n=e.display.barWidth,r=e.display.barHeight}function To(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var So={native:zn,null:Sa};function Co(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&l(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new So[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ce(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Gn(e,t):xa(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function Vn(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:++Zs},gn(e.curOp)}function Xn(e){var t=e.curOp;t&&ks(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;qs(n)})}function qs(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var a=0;a<t.length;a++)rl(t[a]);for(var w=0;w<t.length;w++)nl(t[w]);for(var F=0;F<t.length;F++)al(t[F])}function el(e){var t=e.cm,n=t.display;ol(t),e.updateMaxLine&&ja(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ya(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ai(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&za(t),e.barMeasure=Ta(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Cn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-jn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.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&&Gn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ra(t,e.barMeasure),e.updatedDisplay&&Oi(t,e.barMeasure),e.selectionChanged&&Ti(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&go(e.cm)}function al(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&wo(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Gn(t,e.scrollLeft,!0,!0),e.scrollToPos){var a=$s(t,ht(r,e.scrollToPos.from),ht(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,a)}var w=e.maybeHiddenMarkers,F=e.maybeUnhiddenMarkers;if(w)for(var W=0;W<w.length;++W)w[W].lines.length||we(w[W],"hide");if(F)for(var X=0;X<F.length;++X)F[X].lines.length&&we(F[X],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&we(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function an(e,t){if(e.curOp)return t();Vn(e);try{return t()}finally{Xn(e)}}function br(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vn(e);try{return t.apply(e,arguments)}finally{Xn(e)}}}function Kr(e){return function(){if(this.curOp)return e.apply(this,arguments);Vn(this);try{return e.apply(this,arguments)}finally{Xn(this)}}}function Er(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vn(t);try{return e.apply(this,arguments)}finally{Xn(t)}}}function Ca(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,k(il,e))}function il(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=yr(e,t.highlightFrontier),a=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(w){if(r.line>=e.display.viewFrom){var F=w.styles,W=w.text.length>e.options.maxHighlightLength?Qt(t.mode,r.state):null,X=pn(e,w,r,!0);W&&(r.state=W),w.styles=X.styles;var Q=w.styleClasses,fe=X.classes;fe?w.styleClasses=fe:Q&&(w.styleClasses=null);for(var ve=!F||F.length!=w.styles.length||Q!=fe&&(!Q||!fe||Q.bgClass!=fe.bgClass||Q.textClass!=fe.textClass),Oe=0;!ve&&Oe<F.length;++Oe)ve=F[Oe]!=w.styles[Oe];ve&&a.push(r.line),w.stateAfter=r.save(),r.nextLine()}else w.text.length<=e.options.maxHighlightLength&&Zt(e,w.text,r),w.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Ca(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),a.length&&an(e,function(){for(var w=0;w<a.length;w++)kn(e,a[w],"text")})}var Ya=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Va(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=jn(e),this.force=n,this.dims=bi(e),this.events=[]};Ya.prototype.signal=function(e,t){ce(e,t)&&this.events.push(arguments)},Ya.prototype.finish=function(){for(var e=0;e<this.events.length;e++)we.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Cn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Cn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=D();if(!t||!E(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==D())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Ai(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return _n(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&po(e)==0)return!1;Do(e)&&(_n(e),t.dims=bi(e));var a=r.first+r.size,w=Math.max(t.visible.from-e.options.viewportMargin,r.first),F=Math.min(a,t.visible.to+e.options.viewportMargin);n.viewFrom<w&&w-n.viewFrom<20&&(w=Math.max(r.first,n.viewFrom)),n.viewTo>F&&n.viewTo-F<20&&(F=Math.min(a,n.viewTo)),Vt&&(w=tn(e.doc,w),F=rn(e.doc,F));var W=w!=n.viewFrom||F!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,w,F),n.viewOffset=nn(nt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var X=po(e);if(!W&&X==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var Q=sl(e);return X>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),X>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(Q),f(n.cursorDiv),f(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,W&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ca(e,400)),n.updateLineNumbers=null,!0}function wo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==jn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ci(e.display)-fi(e),n.top)}),t.visible=Va(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Va(e.display,e.doc,n));if(!Ai(e,t))break;za(e);var a=Ta(e);ba(e),ra(e,a),Oi(e,a),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 Di(e,t){var n=new Ya(e,t);if(Ai(e,n)){za(e),wo(e,n);var r=Ta(e);ba(e),ra(e,r),Oi(e,r),n.finish()}}function ul(e,t,n){var r=e.display,a=e.options.lineNumbers,w=r.lineDiv,F=w.firstChild;function W(We){var ze=We.nextSibling;return _&&u&&e.display.currentWheelTarget==We?We.style.display="none":We.parentNode.removeChild(We),ze}for(var X=r.view,Q=r.viewFrom,fe=0;fe<X.length;fe++){var ve=X[fe];if(!ve.hidden)if(!ve.node||ve.node.parentNode!=w){var Oe=Ns(e,ve,Q,n);w.insertBefore(Oe,F)}else{for(;F!=ve.node;)F=W(F);var Ae=a&&t!=null&&t<=Q&&ve.lineNumber;ve.changes&&(ue(ve.changes,"gutter")>-1&&(Ae=!1),Yi(e,ve,Q,n)),Ae&&(f(ve.lineNumber),ve.lineNumber.appendChild(document.createTextNode(sn(e.options,Q)))),F=ve.node.nextSibling}Q+=ve.size}for(;F;)F=W(F)}function Li(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oi(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+Cn(e)+"px"}function Ao(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ei(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,w=r+"px",F=0;F<n.length;F++)if(!n[F].hidden){e.options.fixedGutter&&(n[F].gutter&&(n[F].gutter.style.left=w),n[F].gutterBackground&&(n[F].gutterBackground.style.left=w));var W=n[F].alignable;if(W)for(var X=0;X<W.length;X++)W[X].style.left=w}e.options.fixedGutter&&(t.gutters.style.left=r+a+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=sn(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var a=r.measure.appendChild(i("div",[i("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),w=a.firstChild.offsetWidth,F=a.offsetWidth-w;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(w,r.lineGutter.offsetWidth-F)+1,r.lineNumWidth=r.lineNumInnerWidth+F,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Li(e.display),!0}return!1}function Ri(e,t){for(var n=[],r=!1,a=0;a<e.length;a++){var w=e[a],F=null;if(typeof w!="string"&&(F=w.style,w=w.className),w=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:w,style:F})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Lo(e){var t=e.gutters,n=e.gutterSpecs;f(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var a=n[r],w=a.className,F=a.style,W=t.appendChild(i("div",null,"CodeMirror-gutter "+w));F&&(W.style.cssText=F),w=="CodeMirror-linenumbers"&&(e.lineGutter=W,W.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Li(e)}function wa(e){Lo(e.display),Xr(e),Ao(e)}function dl(e,t,n,r){var a=this;this.input=n,a.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=i("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=x("div",null,"CodeMirror-code"),a.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=i("div",null,"CodeMirror-cursors"),a.measure=i("div",null,"CodeMirror-measure"),a.lineMeasure=i("div",null,"CodeMirror-measure"),a.lineSpace=x("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var w=x("div",[a.lineSpace],"CodeMirror-lines");a.mover=i("div",[w],null,"position: relative"),a.sizer=i("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=i("div",null,null,"position: absolute; height: "+de+"px; width: 1px;"),a.gutters=i("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=i("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=i("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),B&&N<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!_&&!(L&&o)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=Ri(r.gutters,r.lineNumbers),Lo(a),n.init(a)}var $a=0,fn=null;B?fn=-.53:L?fn=15:y?fn=-.7:R&&(fn=-1/3);function Oo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=Oo(e);return t.x*=fn,t.y*=fn,t}function Ro(e,t){var n=Oo(t),r=n.x,a=n.y,w=e.display,F=w.scroller,W=F.scrollWidth>F.clientWidth,X=F.scrollHeight>F.clientHeight;if(!(r&&W||a&&X))return;if(a&&u&&_){e:for(var Q=t.target,fe=w.view;Q!=F;Q=Q.parentNode)for(var ve=0;ve<fe.length;ve++)if(fe[ve].node==Q){e.display.currentWheelTarget=Q;break e}}if(r&&!L&&!C&&fn!=null){a&&X&&xa(e,Math.max(0,F.scrollTop+a*fn)),Gn(e,Math.max(0,F.scrollLeft+r*fn)),(!a||a&&X)&&q(t),w.wheelStartX=null;return}if(a&&fn!=null){var Oe=a*fn,Ae=e.doc.scrollTop,We=Ae+w.wrapper.clientHeight;Oe<0?Ae=Math.max(0,Ae+Oe-50):We=Math.min(e.doc.height,We+Oe+50),Di(e,{top:Ae,bottom:We})}$a<20&&(w.wheelStartX==null?(w.wheelStartX=F.scrollLeft,w.wheelStartY=F.scrollTop,w.wheelDX=r,w.wheelDY=a,setTimeout(function(){if(w.wheelStartX==null)return;var ze=F.scrollLeft-w.wheelStartX,$e=F.scrollTop-w.wheelStartY,Ze=$e&&w.wheelDY&&$e/w.wheelDY||ze&&w.wheelDX&&ze/w.wheelDX;if(w.wheelStartX=w.wheelStartY=null,!Ze)return;fn=(fn*$a+Ze)/($a+1),++$a},200)):(w.wheelDX+=r,w.wheelDY+=a))}var hn=function(e,t){this.ranges=e,this.primIndex=t};hn.prototype.primary=function(){return this.ranges[this.primIndex]},hn.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 n=this.ranges[t],r=e.ranges[t];if(!Zr(n.anchor,r.anchor)||!Zr(n.head,r.head))return!1}return!0},hn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Nt(Or(this.ranges[t].anchor),Or(this.ranges[t].head));return new hn(e,this.primIndex)},hn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},hn.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ct(t,r.from())>=0&&ct(e,r.to())<=0)return n}return-1};var Nt=function(e,t){this.anchor=e,this.head=t};Nt.prototype.from=function(){return Rr(this.anchor,this.head)},Nt.prototype.to=function(){return qr(this.anchor,this.head)},Nt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function xn(e,t,n){var r=e&&e.options.selectionsMayTouch,a=t[n];t.sort(function(Oe,Ae){return ct(Oe.from(),Ae.from())}),n=ue(t,a);for(var w=1;w<t.length;w++){var F=t[w],W=t[w-1],X=ct(W.to(),F.from());if(r&&!F.empty()?X>0:X>=0){var Q=Rr(W.from(),F.from()),fe=qr(W.to(),F.to()),ve=W.empty()?F.from()==F.head:W.from()==W.head;w<=n&&--n,t.splice(--w,2,new Nt(ve?fe:Q,ve?Q:fe))}}return new hn(t,n)}function Pn(e,t){return new hn([new Nt(e,t||e)],0)}function Mn(e){return e.text?Ge(e.from.line+e.text.length-1,V(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ko(e,t){if(ct(e,t.from)<0)return e;if(ct(e,t.to)<=0)return Mn(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Mn(t).ch-t.to.ch),Ge(n,r)}function ki(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var a=e.sel.ranges[r];n.push(new Nt(ko(a.anchor,t),ko(a.head,t)))}return xn(e.cm,n,e.sel.primIndex)}function _o(e,t,n){return e.line==t.line?Ge(n.line,e.ch-t.ch+n.ch):Ge(n.line+(e.line-t.line),e.ch)}function fl(e,t,n){for(var r=[],a=Ge(e.first,0),w=a,F=0;F<t.length;F++){var W=t[F],X=_o(W.from,a,w),Q=_o(Mn(W),a,w);if(a=W.to,w=Q,n=="around"){var fe=e.sel.ranges[F],ve=ct(fe.head,fe.anchor)<0;r[F]=new Nt(ve?Q:X,ve?X:Q)}else r[F]=new Nt(X,X)}return new hn(r,e.sel.primIndex)}function _i(e){e.doc.mode=Jt(e.options,e.doc.modeOption),Aa(e)}function Aa(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,Ca(e,100),e.state.modeGen++,e.curOp&&Xr(e)}function Po(e,t){return t.from.ch==0&&t.to.ch==0&&V(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Pi(e,t,n,r){function a(at){return n?n[at]:null}function w(at,qe,it){ui(at,qe,it,r),Ar(at,"change",at,t)}function F(at,qe){for(var it=[],gt=at;gt<qe;++gt)it.push(new Bn(Q[gt],a(gt),r));return it}var W=t.from,X=t.to,Q=t.text,fe=nt(e,W.line),ve=nt(e,X.line),Oe=V(Q),Ae=a(Q.length-1),We=X.line-W.line;if(t.full)e.insert(0,F(0,Q.length)),e.remove(Q.length,e.size-Q.length);else if(Po(e,t)){var ze=F(0,Q.length-1);w(ve,ve.text,Ae),We&&e.remove(W.line,We),ze.length&&e.insert(W.line,ze)}else if(fe==ve)if(Q.length==1)w(fe,fe.text.slice(0,W.ch)+Oe+fe.text.slice(X.ch),Ae);else{var $e=F(1,Q.length-1);$e.push(new Bn(Oe+fe.text.slice(X.ch),Ae,r)),w(fe,fe.text.slice(0,W.ch)+Q[0],a(0)),e.insert(W.line+1,$e)}else if(Q.length==1)w(fe,fe.text.slice(0,W.ch)+Q[0]+ve.text.slice(X.ch),a(0)),e.remove(W.line+1,We);else{w(fe,fe.text.slice(0,W.ch)+Q[0],a(0)),w(ve,Oe+ve.text.slice(X.ch),Ae);var Ze=F(1,Q.length-1);We>1&&e.remove(W.line+1,We-1),e.insert(W.line+1,Ze)}Ar(e,"change",e,t)}function In(e,t,n){function r(a,w,F){if(a.linked)for(var W=0;W<a.linked.length;++W){var X=a.linked[W];if(X.doc==w)continue;var Q=F&&X.sharedHist;if(n&&!Q)continue;t(X.doc,Q),r(X.doc,a,Q)}}r(e,null,!0)}function Mo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xi(e),_i(e),Io(e),e.options.lineWrapping||ja(e),e.options.mode=t.modeOption,Xr(e)}function Io(e){(e.doc.direction=="rtl"?U:l)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){an(e,function(){Io(e),Xr(e)})}function Ja(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 Mi(e,t){var n={from:Or(t.from),to:Mn(t),text:Yt(e,t.from,t.to)};return Fo(e,n,t.from.line,t.to.line+1),In(e,function(r){return Fo(r,n,t.from.line,t.to.line+1)},!0),n}function No(e){for(;e.length;){var t=V(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return No(e.done),V(e.done);if(e.done.length&&!V(e.done).ranges)return V(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),V(e.done)}function Uo(e,t,n,r){var a=e.history;a.undone.length=0;var w=+new Date,F,W;if((a.lastOp==r||a.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&a.lastModTime>w-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(F=pl(a,a.lastOp==r)))W=V(F.changes),ct(t.from,t.to)==0&&ct(t.from,W.to)==0?W.to=Mn(t):F.changes.push(Mi(e,t));else{var X=V(a.done);for((!X||!X.ranges)&&Qa(e.sel,a.done),F={changes:[Mi(e,t)],generation:a.generation},a.done.push(F);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(n),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=w,a.lastOp=a.lastSelOp=r,a.lastOrigin=a.lastSelOrigin=t.origin,W||we(e,"historyAdded")}function ml(e,t,n,r){var a=t.charAt(0);return a=="*"||a=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,n,r){var a=e.history,w=r&&r.origin;n==a.lastSelOp||w&&a.lastSelOrigin==w&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==w||ml(e,w,V(a.done),t))?a.done[a.done.length-1]=t:Qa(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=w,a.lastSelOp=n,r&&r.clearRedo!==!1&&No(a.undone)}function Qa(e,t){var n=V(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fo(e,t,n,r){var a=t["spans_"+e.id],w=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(F){F.markedSpans&&((a||(a=t["spans_"+e.id]={}))[w]=F.markedSpans),++w})}function gl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],a=0;a<t.text.length;++a)r.push(gl(n[a]));return r}function Bo(e,t){var n=yl(e,t),r=Lt(e,t);if(!n)return r;if(!r)return n;for(var a=0;a<n.length;++a){var w=n[a],F=r[a];if(w&&F){e:for(var W=0;W<F.length;++W){for(var X=F[W],Q=0;Q<w.length;++Q)if(w[Q].marker==X.marker)continue e;w.push(X)}}else F&&(n[a]=F)}return n}function na(e,t,n){for(var r=[],a=0;a<e.length;++a){var w=e[a];if(w.ranges){r.push(n?hn.prototype.deepCopy.call(w):w);continue}var F=w.changes,W=[];r.push({changes:W});for(var X=0;X<F.length;++X){var Q=F[X],fe=void 0;if(W.push({from:Q.from,to:Q.to,text:Q.text}),t)for(var ve in Q)(fe=ve.match(/^spans_(\d+)$/))&&(ue(t,Number(fe[1]))>-1&&(V(W)[ve]=Q[ve],delete Q[ve]))}}return r}function Ii(e,t,n,r){if(r){var a=e.anchor;if(n){var w=ct(t,a)<0;w!=ct(n,a)<0?(a=t,t=n):w!=ct(t,n)<0&&(t=n)}return new Nt(a,t)}else return new Nt(n||t,t)}function Za(e,t,n,r,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),Mr(e,new hn([Ii(e.sel.primary(),t,n,a)],0),r)}function jo(e,t,n){for(var r=[],a=e.cm&&(e.cm.display.shift||e.extend),w=0;w<e.sel.ranges.length;w++)r[w]=Ii(e.sel.ranges[w],t[w],null,a);var F=xn(e.cm,r,e.sel.primIndex);Mr(e,F,n)}function Ni(e,t,n,r){var a=e.sel.ranges.slice(0);a[t]=n,Mr(e,xn(e.cm,a,e.sel.primIndex),r)}function Ko(e,t,n,r){Mr(e,Pn(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(a){this.ranges=[];for(var w=0;w<a.length;w++)this.ranges[w]=new Nt(ht(e,a[w].anchor),ht(e,a[w].head))},origin:n&&n.origin};return we(e,"beforeSelectionChange",e,r),e.cm&&we(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?xn(e.cm,r.ranges,r.ranges.length-1):t}function Wo(e,t,n){var r=e.history.done,a=V(r);a&&a.ranges?(r[r.length-1]=t,qa(e,t,n)):Mr(e,t,n)}function Mr(e,t,n){qa(e,t,n),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function qa(e,t,n){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ho(e,zo(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&ta(e.cm)}function Ho(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),Ar(e,"cursorActivity",e)}function Go(e){Ho(e,zo(e,e.sel,null,!1))}function zo(e,t,n,r){for(var a,w=0;w<t.ranges.length;w++){var F=t.ranges[w],W=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[w],X=ei(e,F.anchor,W&&W.anchor,n,r),Q=ei(e,F.head,W&&W.head,n,r);(a||X!=F.anchor||Q!=F.head)&&(a||(a=t.ranges.slice(0,w)),a[w]=new Nt(X,Q))}return a?xn(e.cm,a,t.primIndex):t}function aa(e,t,n,r,a){var w=nt(e,t.line);if(w.markedSpans)for(var F=0;F<w.markedSpans.length;++F){var W=w.markedSpans[F],X=W.marker,Q="selectLeft"in X?!X.selectLeft:X.inclusiveLeft,fe="selectRight"in X?!X.selectRight:X.inclusiveRight;if((W.from==null||(Q?W.from<=t.ch:W.from<t.ch))&&(W.to==null||(fe?W.to>=t.ch:W.to>t.ch))){if(a&&(we(X,"beforeCursorEnter"),X.explicitlyCleared))if(w.markedSpans){--F;continue}else break;if(!X.atomic)continue;if(n){var ve=X.find(r<0?1:-1),Oe=void 0;if((r<0?fe:Q)&&(ve=Vo(e,ve,-r,ve&&ve.line==t.line?w:null)),ve&&ve.line==t.line&&(Oe=ct(ve,n))&&(r<0?Oe<0:Oe>0))return aa(e,ve,t,r,a)}var Ae=X.find(r<0?-1:1);return(r<0?Q:fe)&&(Ae=Vo(e,Ae,r,Ae.line==t.line?w:null)),Ae?aa(e,Ae,t,r,a):null}}return t}function ei(e,t,n,r,a){var w=r||1,F=aa(e,t,n,w,a)||!a&&aa(e,t,n,w,!0)||aa(e,t,n,-w,a)||!a&&aa(e,t,n,-w,!0);return F||(e.cantEdit=!0,Ge(e.first,0))}function Vo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ht(e,Ge(t.line-1)):null:n>0&&t.ch==(r||nt(e,t.line)).text.length?t.line<e.first+e.size-1?Ge(t.line+1,0):null:new Ge(t.line,t.ch+n)}function Xo(e){e.setSelection(Ge(e.firstLine(),0),Ge(e.lastLine()),Ee)}function Yo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(a,w,F,W){a&&(r.from=ht(e,a)),w&&(r.to=ht(e,w)),F&&(r.text=F),W!==void 0&&(r.origin=W)}),we(e,"beforeChange",e,r),e.cm&&we(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ia(e,t,n){if(e.cm){if(!e.cm.curOp)return br(e.cm,ia)(e,t,n);if(e.cm.state.suppressEdits)return}if((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var r=kr&&!n&&tt(e,t.from,t.to);if(r)for(var a=r.length-1;a>=0;--a)$o(e,{from:r[a].from,to:r[a].to,text:a?[""]:t.text,origin:t.origin});else $o(e,t)}function $o(e,t){if(t.text.length==1&&t.text[0]==""&&ct(t.from,t.to)==0)return;var n=ki(e,t);Uo(e,t,n,e.cm?e.cm.curOp.id:NaN),Da(e,t,n,Lt(e,t));var r=[];In(e,function(a,w){!w&&ue(r,a.history)==-1&&(qo(a.history,t),r.push(a.history)),Da(a,t,null,Lt(a,t))})}function ti(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var a=e.history,w,F=e.sel,W=t=="undo"?a.done:a.undone,X=t=="undo"?a.undone:a.done,Q=0;Q<W.length&&!(w=W[Q],n?w.ranges&&!w.equals(e.sel):!w.ranges);Q++);if(Q==W.length)return;for(a.lastOrigin=a.lastSelOrigin=null;;)if(w=W.pop(),w.ranges){if(Qa(w,X),n&&!w.equals(e.sel)){Mr(e,w,{clearRedo:!1});return}F=w}else if(r){W.push(w);return}else break;var fe=[];Qa(F,X),X.push({changes:fe,generation:a.generation}),a.generation=w.generation||++a.maxGeneration;for(var ve=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),Oe=function(ze){var $e=w.changes[ze];if($e.origin=t,ve&&!Yo(e,$e,!1))return W.length=0,{};fe.push(Mi(e,$e));var Ze=ze?ki(e,$e):V(W);Da(e,$e,Ze,Bo(e,$e)),!ze&&e.cm&&e.cm.scrollIntoView({from:$e.from,to:Mn($e)});var at=[];In(e,function(qe,it){!it&&ue(at,qe.history)==-1&&(qo(qe.history,$e),at.push(qe.history)),Da(qe,$e,null,Bo(qe,$e))})},Ae=w.changes.length-1;Ae>=0;--Ae){var We=Oe(Ae);if(We)return We.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new hn(Y(e.sel.ranges,function(a){return new Nt(Ge(a.anchor.line+t,a.anchor.ch),Ge(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm){Xr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)kn(e.cm,r,"gutter")}}function Da(e,t,n,r){if(e.cm&&!e.cm.curOp)return br(e.cm,Da)(e,t,n,r);if(t.to.line<e.first){Jo(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 a=t.text.length-1-(e.first-t.from.line);Jo(e,a),t={from:Ge(e.first,0),to:Ge(t.to.line+a,t.to.ch),text:[V(t.text)],origin:t.origin}}var w=e.lastLine();t.to.line>w&&(t={from:t.from,to:Ge(w,nt(e,w).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Yt(e,t.from,t.to),n||(n=ki(e,t)),e.cm?El(e.cm,t,r):Pi(e,t,r),qa(e,n,Ee),e.cantEdit&&ei(e,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,n){var r=e.doc,a=e.display,w=t.from,F=t.to,W=!1,X=w.line;e.options.lineWrapping||(X=St(pr(nt(r,w.line))),r.iter(X,F.line+1,function(Ae){if(Ae==a.maxLine)return W=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ge(e),Pi(r,t,n,ho(e)),e.options.lineWrapping||(r.iter(X,w.line+t.text.length,function(Ae){var We=pa(Ae);We>a.maxLineLength&&(a.maxLine=Ae,a.maxLineLength=We,a.maxLineChanged=!0,W=!1)}),W&&(e.curOp.updateMaxLine=!0)),Ur(r,w.line),Ca(e,400);var Q=t.text.length-(F.line-w.line)-1;t.full?Xr(e):w.line==F.line&&t.text.length==1&&!Po(e.doc,t)?kn(e,w.line,"text"):Xr(e,w.line,F.line+1,Q);var fe=ce(e,"changes"),ve=ce(e,"change");if(ve||fe){var Oe={from:w,to:F,text:t.text,removed:t.removed,origin:t.origin};ve&&Ar(e,"change",e,Oe),fe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Oe)}e.display.selForContextMenu=null}function oa(e,t,n,r,a){var w;r||(r=n),ct(r,n)<0&&(w=[r,n],n=w[0],r=w[1]),typeof t=="string"&&(t=e.splitLines(t)),ia(e,{from:n,to:r,text:t,origin:a})}function Qo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Zo(e,t,n,r){for(var a=0;a<e.length;++a){var w=e[a],F=!0;if(w.ranges){w.copied||(w=e[a]=w.deepCopy(),w.copied=!0);for(var W=0;W<w.ranges.length;W++)Qo(w.ranges[W].anchor,t,n,r),Qo(w.ranges[W].head,t,n,r);continue}for(var X=0;X<w.changes.length;++X){var Q=w.changes[X];if(n<Q.from.line)Q.from=Ge(Q.from.line+r,Q.from.ch),Q.to=Ge(Q.to.line+r,Q.to.ch);else if(t<=Q.to.line){F=!1;break}}F||(e.splice(0,a+1),a=0)}}function qo(e,t){var n=t.from.line,r=t.to.line,a=t.text.length-(r-n)-1;Zo(e.done,n,r,a),Zo(e.undone,n,r,a)}function La(e,t,n,r){var a=t,w=t;return typeof t=="number"?w=nt(e,ln(e,t)):a=St(t),a==null?null:(r(w,a)&&e.cm&&kn(e.cm,a,n),w)}function Oa(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Oa.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var a=this.lines[n];this.height-=a.height,ut(a),Ar(a,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Ra(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var a=e[r];t+=a.chunkSize(),n+=a.height,a.parent=this}this.size=t,this.height=n,this.parent=null}Ra.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],a=r.chunkSize();if(e<a){var w=Math.min(t,a-e),F=r.height;if(r.removeInner(e,w),this.height-=F-r.height,a==w&&(this.children.splice(n--,1),r.parent=null),(t-=w)==0)break;e=0}else e-=a}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Oa))){var W=[];this.collapse(W),this.children=[new Oa(W)],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,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var a=this.children[r],w=a.chunkSize();if(e<=w){if(a.insertInner(e,t,n),a.lines&&a.lines.length>50){for(var F=a.lines.length%25+25,W=F;W<a.lines.length;){var X=new Oa(a.lines.slice(W,W+=25));a.height-=X.height,this.children.splice(++r,0,X),X.parent=this}a.lines=a.lines.slice(0,F),this.maybeSpill()}break}e-=w}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Ra(t);if(e.parent){e.size-=n.size,e.height-=n.height;var a=ue(e.parent.children,e);e.parent.children.splice(a+1,0,n)}else{var r=new Ra(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var a=this.children[r],w=a.chunkSize();if(e<w){var F=Math.min(t,w-e);if(a.iterN(e,F,n))return!0;if((t-=F)==0)break;e=0}else e-=w}}};var ka=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};ka.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=St(n);if(r==null||!t)return;for(var a=0;a<t.length;++a)t[a]==this&&t.splice(a--,1);t.length||(n.widgets=null);var w=ga(this);er(n,Math.max(0,n.height-w)),e&&(an(e,function(){es(e,n,-w),kn(e,r,"widget")}),Ar(e,"lineWidgetCleared",e,this,r))},ka.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var a=ga(this)-t;if(!a)return;bn(this.doc,r)||er(r,r.height+a),n&&an(n,function(){n.curOp.forceUpdate=!0,es(n,r,a),Ar(n,"lineWidgetChanged",n,e,St(r))})},me(ka);function es(e,t,n){nn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&wi(e,n)}function xl(e,t,n,r){var a=new ka(e,n,r),w=e.cm;return w&&a.noHScroll&&(w.display.alignWidgets=!0),La(e,t,"widget",function(F){var W=F.widgets||(F.widgets=[]);if(a.insertAt==null?W.push(a):W.splice(Math.min(W.length-1,Math.max(0,a.insertAt)),0,a),a.line=F,w&&!bn(e,F)){var X=nn(F)<e.scrollTop;er(F,F.height+ga(a)),X&&wi(w,a.height),w.curOp.forceUpdate=!0}return!0}),w&&Ar(w,"lineWidgetAdded",w,a,typeof t=="number"?t:St(t)),a}var ts=0,Nn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};Nn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vn(e),ce(this,"clear")){var n=this.find();n&&Ar(this,"clear",n.from,n.to)}for(var r=null,a=null,w=0;w<this.lines.length;++w){var F=this.lines[w],W=Xt(F.markedSpans,this);e&&!this.collapsed?kn(e,St(F),"text"):e&&(W.to!=null&&(a=St(F)),W.from!=null&&(r=St(F))),F.markedSpans=Sn(F.markedSpans,W),W.from==null&&this.collapsed&&!bn(this.doc,F)&&e&&er(F,Zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var X=0;X<this.lines.length;++X){var Q=pr(this.lines[X]),fe=pa(Q);fe>e.display.maxLineLength&&(e.display.maxLine=Q,e.display.maxLineLength=fe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Xr(e,r,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Go(e.doc)),e&&Ar(e,"markerCleared",e,this,r,a),t&&Xn(e),this.parent&&this.parent.clear()},Nn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,a=0;a<this.lines.length;++a){var w=this.lines[a],F=Xt(w.markedSpans,this);if(F.from!=null&&(n=Ge(t?w:St(w),F.from),e==-1))return n;if(F.to!=null&&(r=Ge(t?w:St(w),F.to),e==1))return r}return n&&{from:n,to:r}},Nn.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;an(r,function(){var a=t.line,w=St(t.line),F=hi(r,w);if(F&&(ao(F),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!bn(n.doc,a)&&n.height!=null){var W=n.height;n.height=null;var X=ga(n)-W;X&&er(a,a.height+X)}Ar(r,"markerChanged",r,e)})},Nn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ue(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Nn.prototype.detachLine=function(e){if(this.lines.splice(ue(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},me(Nn);function sa(e,t,n,r,a){if(r&&r.shared)return Tl(e,t,n,r,a);if(e.cm&&!e.cm.curOp)return br(e.cm,sa)(e,t,n,r,a);var w=new Nn(e,a),F=ct(t,n);if(r&&M(r,w,!1),F>0||F==0&&w.clearWhenEmpty!==!1)return w;if(w.replacedWith&&(w.collapsed=!0,w.widgetNode=x("span",[w.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||w.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(w.widgetNode.insertLeft=!0)),w.collapsed){if(mn(e,t.line,t,n,w)||t.line!=n.line&&mn(e,n.line,t,n,w))throw new Error("Inserting collapsed marker partially overlapping an existing one");_r()}w.addToHistory&&Uo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var W=t.line,X=e.cm,Q;if(e.iter(W,n.line+1,function(ve){X&&w.collapsed&&!X.options.lineWrapping&&pr(ve)==X.display.maxLine&&(Q=!0),w.collapsed&&W!=t.line&&er(ve,0),Cr(ve,new Fr(w,W==t.line?t.ch:null,W==n.line?n.ch:null)),++W}),w.collapsed&&e.iter(t.line,n.line+1,function(ve){bn(e,ve)&&er(ve,0)}),w.clearOnEnter&&Ce(w,"beforeCursorEnter",function(){return w.clear()}),w.readOnly&&(Ft(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),w.collapsed&&(w.id=++ts,w.atomic=!0),X){if(Q&&(X.curOp.updateMaxLine=!0),w.collapsed)Xr(X,t.line,n.line+1);else if(w.className||w.startStyle||w.endStyle||w.css||w.attributes||w.title)for(var fe=t.line;fe<=n.line;fe++)kn(X,fe,"text");w.atomic&&Go(X.doc),Ar(X,"markerAdded",X,w)}return w}var _a=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};_a.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ar(this,"clear")},_a.prototype.find=function(e,t){return this.primary.find(e,t)},me(_a);function Tl(e,t,n,r,a){r=M(r),r.shared=!1;var w=[sa(e,t,n,r,a)],F=w[0],W=r.widgetNode;return In(e,function(X){W&&(r.widgetNode=W.cloneNode(!0)),w.push(sa(X,ht(X,t),ht(X,n),r,a));for(var Q=0;Q<X.linked.length;++Q)if(X.linked[Q].isParent)return;F=V(w)}),new _a(w,F)}function rs(e){return e.findMarks(Ge(e.first,0),e.clipPos(Ge(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n],a=r.find(),w=e.clipPos(a.from),F=e.clipPos(a.to);if(ct(w,F)){var W=sa(e,w,F,r.primary,r.primary.type);r.markers.push(W),W.parent=r}}}function Cl(e){for(var t=function(r){var a=e[r],w=[a.primary.doc];In(a.primary.doc,function(X){return w.push(X)});for(var F=0;F<a.markers.length;F++){var W=a.markers[F];ue(w,W.doc)==-1&&(W.parent=null,a.markers.splice(F--,1))}},n=0;n<e.length;n++)t(n)}var wl=0,Yr=function(e,t,n,r,a){if(!(this instanceof Yr))return new Yr(e,t,n,r,a);n==null&&(n=0),Ra.call(this,[new Oa([new Bn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var w=Ge(n,0);this.sel=Pn(w),this.history=new Ja(null),this.id=++wl,this.modeOption=t,this.lineSep=r,this.direction=a=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Pi(this,{from:w,to:w,text:e}),Mr(this,Pn(w),Ee)};Yr.prototype=xe(Ra.prototype,{constructor:Yr,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=gr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Er(function(e){var t=Ge(this.first,0),n=this.first+this.size-1;ia(this,{from:t,to:Ge(n,nt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ea(this.cm,0,0),Mr(this,Pn(t),Ee)}),replaceRange:function(e,t,n,r){t=ht(this,t),n=n?ht(this,n):t,oa(this,e,t,n,r)},getRange:function(e,t,n){var r=Yt(this,ht(this,e),ht(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if($t(this,e))return nt(this,e)},getLineNumber:function(e){return St(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=nt(this,e)),pr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ht(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Er(function(e,t,n){Ko(this,ht(this,typeof e=="number"?Ge(e,t||0):e),null,n)}),setSelection:Er(function(e,t,n){Ko(this,ht(this,e),ht(this,t||e),n)}),extendSelection:Er(function(e,t,n){Za(this,ht(this,e),t&&ht(this,t),n)}),extendSelections:Er(function(e,t){jo(this,Ye(this,e),t)}),extendSelectionsBy:Er(function(e,t){var n=Y(this.sel.ranges,e);jo(this,Ye(this,n),t)}),setSelections:Er(function(e,t,n){if(!e.length)return;for(var r=[],a=0;a<e.length;a++)r[a]=new Nt(ht(this,e[a].anchor),ht(this,e[a].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Mr(this,xn(this.cm,r,t),n)}),addSelection:Er(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Nt(ht(this,e),ht(this,t||e))),Mr(this,xn(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var a=Yt(this,t[r].from(),t[r].to());n=n?n.concat(a):a}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var a=Yt(this,n[r].from(),n[r].to());e!==!1&&(a=a.join(e||this.lineSeparator())),t[r]=a}return t},replaceSelection:function(e,t,n){for(var r=[],a=0;a<this.sel.ranges.length;a++)r[a]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Er(function(e,t,n){for(var r=[],a=this.sel,w=0;w<a.ranges.length;w++){var F=a.ranges[w];r[w]={from:F.from(),to:F.to(),text:this.splitLines(e[w]),origin:n}}for(var W=t&&t!="end"&&fl(this,r,t),X=r.length-1;X>=0;X--)ia(this,r[X]);W?Wo(this,W):this.cm&&ta(this.cm)}),undo:Er(function(){ti(this,"undo")}),redo:Er(function(){ti(this,"redo")}),undoSelection:Er(function(){ti(this,"undo",!0)}),redoSelection:Er(function(){ti(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var a=0;a<e.undone.length;a++)e.undone[a].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ja(this.history.maxGeneration),In(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:na(this.history.done),undone:na(this.history.undone)}},setHistory:function(e){var t=this.history=new Ja(this.history.maxGeneration);t.done=na(e.done.slice(0),null,!0),t.undone=na(e.undone.slice(0),null,!0)},setGutterMarker:Er(function(e,t,n){return La(this,e,"gutter",function(r){var a=r.gutterMarkers||(r.gutterMarkers={});return a[t]=n,!n&&Pe(a)&&(r.gutterMarkers=null),!0})}),clearGutter:Er(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&La(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Pe(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!$t(this,e))return null;if(t=e,e=nt(this,e),!e)return null}else if(t=St(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Er(function(e,t,n){return La(this,e,t=="gutter"?"gutter":"class",function(r){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[a])r[a]=n;else{if(v(n).test(r[a]))return!1;r[a]+=" "+n}return!0})}),removeLineClass:Er(function(e,t,n){return La(this,e,t=="gutter"?"gutter":"class",function(r){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",w=r[a];if(w)if(n==null)r[a]=null;else{var F=w.match(v(n));if(!F)return!1;var W=F.index+F[0].length;r[a]=w.slice(0,F.index)+(!F.index||W==w.length?"":" ")+w.slice(W)||null}else return!1;return!0})}),addLineWidget:Er(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return sa(this,ht(this,e),ht(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ht(this,e),sa(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ht(this,e);var t=[],n=nt(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var a=n[r];(a.from==null||a.from<=e.ch)&&(a.to==null||a.to>=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,n){e=ht(this,e),t=ht(this,t);var r=[],a=e.line;return this.iter(e.line,t.line+1,function(w){var F=w.markedSpans;if(F)for(var W=0;W<F.length;W++){var X=F[W];!(X.to!=null&&a==e.line&&e.ch>=X.to||X.from==null&&a!=e.line||X.from!=null&&a==t.line&&X.from>=t.ch)&&(!n||n(X.marker))&&r.push(X.marker.parent||X.marker)}++a}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(a){var w=a.text.length+r;if(w>e)return t=e,!0;e-=w,++n}),ht(this,Ge(n,t))},indexFromPos:function(e){e=ht(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new Yr(gr(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,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Yr(gr(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(r,rs(this)),r},unlinkDoc:function(e){if(e instanceof qt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(rs(this));break}if(e.history==this.history){var r=[e.id];In(e,function(a){return r.push(a.id)},!0),e.history=new Ja(null),e.history.done=na(this.history.done,r),e.history.undone=na(this.history.undone,r)}},iterLinkedDocs:function(e){In(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):st(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Er(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),Yr.prototype.eachLine=Yr.prototype.iter;var ns=0;function Al(e){var t=this;if(as(t),Ie(t,e)||Ln(t.display,e))return;q(e),B&&(ns=+new Date);var n=Wn(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var a=r.length,w=Array(a),F=0,W=function(){++F==a&&br(t,function(){n=ht(t.doc,n);var Ae={from:n,to:n,text:t.doc.splitLines(w.filter(function(We){return We!=null}).join(t.doc.lineSeparator())),origin:"paste"};ia(t.doc,Ae),Wo(t.doc,Pn(ht(t.doc,n),ht(t.doc,Mn(Ae))))})()},X=function(Ae,We){if(t.options.allowDropFileTypes&&ue(t.options.allowDropFileTypes,Ae.type)==-1){W();return}var ze=new FileReader;ze.onerror=function(){return W()},ze.onload=function(){var $e=ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test($e)){W();return}w[We]=$e,W()},ze.readAsText(Ae)},Q=0;Q<r.length;Q++)X(r[Q],Q);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var fe=e.dataTransfer.getData("Text");if(fe){var ve;if(t.state.draggingText&&!t.state.draggingText.copy&&(ve=t.listSelections()),qa(t.doc,Pn(n,n)),ve)for(var Oe=0;Oe<ve.length;++Oe)oa(t.doc,"",ve[Oe].anchor,ve[Oe].head,"drag");t.replaceSelection(fe,"around","paste"),t.display.input.focus()}}catch(Ae){}}}function Dl(e,t){if(B&&(!e.state.draggingText||+new Date-ns<100)){pe(t);return}if(Ie(e,t)||Ln(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!R){var n=i("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),C&&n.parentNode.removeChild(n)}}function Ll(e,t){var n=Wn(e,t);if(!n)return;var r=document.createDocumentFragment();vo(e,n,r),e.display.dragCursor||(e.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,r)}function as(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function is(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var a=t[r].CodeMirror;a&&n.push(a)}n.length&&n[0].operation(function(){for(var w=0;w<n.length;w++)e(n[w])})}var os=!1;function Ol(){if(os)return;Rl(),os=!0}function Rl(){var e;Ce(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,is(kl)},100))}),Ce(window,"blur",function(){return is(ea)})}function kl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Un={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Pa=0;Pa<10;Pa++)Un[Pa+48]=Un[Pa+96]=String(Pa);for(var ri=65;ri<=90;ri++)Un[ri]=String.fromCharCode(ri);for(var Ma=1;Ma<=12;Ma++)Un[Ma+111]=Un[Ma+63235]="F"+Ma;var On={};On.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"},On.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"},On.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"},On.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"]},On.default=u?On.macDefault:On.pcDefault;function _l(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,a,w,F=0;F<t.length-1;F++){var W=t[F];if(/^(cmd|meta|m)$/i.test(W))w=!0;else if(/^a(lt)?$/i.test(W))n=!0;else if(/^(c|ctrl|control)$/i.test(W))r=!0;else if(/^s(hift)?$/i.test(W))a=!0;else throw new Error("Unrecognized modifier name: "+W)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),w&&(e="Cmd-"+e),a&&(e="Shift-"+e),e}function Pl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var a=Y(n.split(" "),_l),w=0;w<a.length;w++){var F=void 0,W=void 0;w==a.length-1?(W=a.join(" "),F=r):(W=a.slice(0,w+1).join(" "),F="...");var X=t[W];if(!X)t[W]=F;else if(X!=F)throw new Error("Inconsistent bindings for "+W)}delete e[n]}for(var Q in t)e[Q]=t[Q];return e}function la(e,t,n,r){t=ni(t);var a=t.call?t.call(e,r):t[e];if(a===!1)return"nothing";if(a==="...")return"multi";if(a!=null&&n(a))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return la(e,t.fallthrough,n,r);for(var w=0;w<t.fallthrough.length;w++){var F=la(e,t.fallthrough[w],n,r);if(F)return F}}}function ss(e){var t=typeof e=="string"?e:Un[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(h?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(h?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(C&&e.keyCode==34&&e.char)return!1;var n=Un[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),ls(n,e,t))}function ni(e){return typeof e=="string"?On[e]:e}function ua(e,t){for(var n=e.doc.sel.ranges,r=[],a=0;a<n.length;a++){for(var w=t(n[a]);r.length&&ct(w.from,V(r).to)<=0;){var F=r.pop();if(ct(F.from,w.from)<0){w.from=F.from;break}}r.push(w)}an(e,function(){for(var W=r.length-1;W>=0;W--)oa(e.doc,"",r[W].from,r[W].to,"+delete");ta(e)})}function Ui(e,t,n){var r=ke(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Fi(e,t,n){var r=Ui(e,t.ch,n);return r==null?null:new Ge(t.line,r,n<0?"after":"before")}function Bi(e,t,n,r,a){if(e){t.doc.direction=="rtl"&&(a=-a);var w=Fe(n,t.doc.direction);if(w){var F=a<0?V(w):w[0],W=a<0==(F.level==1),X=W?"after":"before",Q;if(F.level>0||t.doc.direction=="rtl"){var fe=Qn(t,n);Q=a<0?n.text.length-1:0;var ve=wn(t,fe,Q).top;Q=Ve(function(Oe){return wn(t,fe,Oe).top==ve},a<0==(F.level==1)?F.from:F.to-1,Q),X=="before"&&(Q=Ui(n,Q,1))}else Q=a<0?F.to:F.from;return new Ge(r,Q,X)}}return new Ge(r,a<0?n.text.length:0,a<0?"before":"after")}function Ml(e,t,n,r){var a=Fe(t,e.doc.direction);if(!a)return Fi(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var w=_e(a,n.ch,n.sticky),F=a[w];if(e.doc.direction=="ltr"&&F.level%2==0&&(r>0?F.to>n.ch:F.from<n.ch))return Fi(t,n,r);var W=function(Ze,at){return Ui(t,Ze instanceof Ge?Ze.ch:Ze,at)},X,Q=function(Ze){return e.options.lineWrapping?(X=X||Qn(e,t),fo(e,t,X,Ze)):{begin:0,end:t.text.length}},fe=Q(n.sticky=="before"?W(n,-1):n.ch);if(e.doc.direction=="rtl"||F.level==1){var ve=F.level==1==r<0,Oe=W(n,ve?1:-1);if(Oe!=null&&(ve?Oe<=F.to&&Oe<=fe.end:Oe>=F.from&&Oe>=fe.begin)){var Ae=ve?"before":"after";return new Ge(n.line,Oe,Ae)}}var We=function(Ze,at,qe){for(var it=function(Gt,xr){return xr?new Ge(n.line,W(Gt,1),"before"):new Ge(n.line,Gt,"after")};Ze>=0&&Ze<a.length;Ze+=at){var gt=a[Ze],dt=at>0==(gt.level!=1),Ct=dt?qe.begin:W(qe.end,-1);if(gt.from<=Ct&&Ct<gt.to)return it(Ct,dt);if(Ct=dt?gt.from:W(gt.to,-1),qe.begin<=Ct&&Ct<qe.end)return it(Ct,dt)}},ze=We(w+r,r,fe);if(ze)return ze;var $e=r>0?fe.end:W(fe.begin,-1);return $e!=null&&!(r>0&&$e==t.text.length)&&(ze=We(r>0?0:a.length-1,r,Q($e)),ze)?ze:null}var Ia={selectAll:Xo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return ua(e,function(t){if(t.empty()){var n=nt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Ge(t.head.line+1,0)}:{from:t.head,to:Ge(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ua(e,function(t){return{from:Ge(t.from().line,0),to:ht(e.doc,Ge(t.to().line+1,0))}})},delLineLeft:function(e){return ua(e,function(t){return{from:Ge(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ua(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return ua(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return cs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},$)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},$)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?cs(e,t.head):r},$)},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=[],n=e.listSelections(),r=e.options.tabSize,a=0;a<n.length;a++){var w=n[a].from(),F=G(e.getLine(w.line),w.ch,r);t.push(ie(r-F%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return an(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var a=t[r].head,w=nt(e.doc,a.line).text;if(w){if(a.ch==w.length&&(a=new Ge(a.line,a.ch-1)),a.ch>0)a=new Ge(a.line,a.ch+1),e.replaceRange(w.charAt(a.ch-1)+w.charAt(a.ch-2),Ge(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var F=nt(e.doc,a.line-1).text;F&&(a=new Ge(a.line,1),e.replaceRange(w.charAt(0)+e.doc.lineSeparator()+F.charAt(F.length-1),Ge(a.line-1,F.length-1),a,"+transpose"))}}n.push(new Nt(a,a))}e.setSelections(n)})},newlineAndIndent:function(e){return an(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);ta(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var n=nt(e.doc,t),r=pr(n);return r!=n&&(t=St(r)),Bi(!0,e,r,t,1)}function Il(e,t){var n=nt(e.doc,t),r=vn(n);return r!=n&&(t=St(r)),Bi(!0,e,n,t,-1)}function cs(e,t){var n=ds(e,t.line),r=nt(e.doc,n.line),a=Fe(r,e.doc.direction);if(!a||a[0].level==0){var w=Math.max(n.ch,r.text.search(/\S/)),F=t.line==n.line&&t.ch<=w&&t.ch;return Ge(n.line,F?0:w,n.sticky)}return n}function ai(e,t,n){if(typeof t=="string"&&(t=Ia[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),a=t(e)!=be}finally{e.display.shift=r,e.state.suppressEdits=!1}return a}function Nl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var a=la(t,e.state.keyMaps[r],n,e);if(a)return a}return e.options.extraKeys&&la(t,e.options.extraKeys,n,e)||la(t,e.options.keyMap,n,e)}var Ul=new ee;function Na(e,t,n,r){var a=e.state.keySeq;if(a){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==a&&(e.state.keySeq=null,e.display.input.reset())}),fs(e,a+" "+t,n,r))return!0}return fs(e,t,n,r)}function fs(e,t,n,r){var a=Nl(e,t,r);return a=="multi"&&(e.state.keySeq=t),a=="handled"&&Ar(e,"keyHandled",e,t,n),(a=="handled"||a=="multi")&&(q(n),Ti(e)),!!a}function hs(e,t){var n=us(t,!0);return n?t.shiftKey&&!e.state.keySeq?Na(e,"Shift-"+n,t,function(r){return ai(e,r,!0)})||Na(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ai(e,r)}):Na(e,n,t,function(r){return ai(e,r)}):!1}function Fl(e,t,n){return Na(e,"'"+n+"'",t,function(r){return ai(e,r,!0)})}var ji=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=D(),Ie(t,e))return;B&&N<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=hs(t,e);C&&(ji=r?n:null,!r&&n==88&&!Tt&&(u?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),L&&!u&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(l(t,"CodeMirror-crosshair"),je(document,"keyup",n),je(document,"mouseover",n))}Ce(document,"keyup",n),Ce(document,"mouseover",n)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ie(this,e)}function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ln(t.display,e)||Ie(t,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(C&&n==ji){ji=null,q(e);return}if(C&&(!e.which||e.which<10)&&hs(t,e))return;var a=String.fromCharCode(r==null?n:r);if(a=="\b")return;if(Fl(t,e,a))return;t.display.input.onKeyPress(e)}var jl=400,Ki=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ki.prototype.compare=function(e,t,n){return this.time+jl>e&&ct(t,this.pos)==0&&n==this.button};var Ua,Fa;function Kl(e,t){var n=+new Date;return Fa&&Fa.compare(n,e,t)?(Ua=Fa=null,"triple"):Ua&&Ua.compare(n,e,t)?(Fa=new Ki(n,e,t),Ua=null,"double"):(Ua=new Ki(n,e,t),Fa=null,"single")}function gs(e){var t=this,n=t.display;if(Ie(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Ln(n,e)){_||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Wi(t,e))return;var r=Wn(t,e),a=Le(e),w=r?Kl(r,a):"single";if(window.focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),r&&Wl(t,a,r,w,e))return;a==1?r?Gl(t,r,w,e):ye(e)==n.scroller&&q(e):a==2?(r&&Za(t.doc,r),setTimeout(function(){return n.input.focus()},20)):a==3&&(S?t.display.input.onContextMenu(e):yo(t))}function Wl(e,t,n,r,a){var w="Click";return r=="double"?w="Double"+w:r=="triple"&&(w="Triple"+w),w=(t==1?"Left":t==2?"Middle":"Right")+w,Na(e,ls(w,a),a,function(F){if(typeof F=="string"&&(F=Ia[F]),!F)return!1;var W=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),W=F(e,n)!=be}finally{e.state.suppressEdits=!1}return W})}function Hl(e,t,n){var r=e.getOption("configureMouse"),a=r?r(e,t,n):{};if(a.unit==null){var w=d?n.shiftKey&&n.metaKey:n.altKey;a.unit=w?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(a.extend==null||e.doc.extend)&&(a.extend=e.doc.extend||n.shiftKey),a.addNew==null&&(a.addNew=u?n.metaKey:n.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(u?n.altKey:n.ctrlKey)),a}function Gl(e,t,n,r){B?setTimeout(k(go,e),0):e.curOp.focus=D();var a=Hl(e,n,r),w=e.doc.sel,F;e.options.dragDrop&&Ke&&!e.isReadOnly()&&n=="single"&&(F=w.contains(t))>-1&&(ct((F=w.ranges[F]).from(),t)<0||t.xRel>0)&&(ct(F.to(),t)>0||t.xRel<0)?zl(e,r,t,a):Vl(e,r,t,a)}function zl(e,t,n,r){var a=e.display,w=!1,F=br(e,function(Q){_&&(a.scroller.draggable=!1),e.state.draggingText=!1,je(a.wrapper.ownerDocument,"mouseup",F),je(a.wrapper.ownerDocument,"mousemove",W),je(a.scroller,"dragstart",X),je(a.scroller,"drop",F),w||(q(Q),r.addNew||Za(e.doc,n,null,null,r.extend),_&&!R||B&&N==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),W=function(Q){w=w||Math.abs(t.clientX-Q.clientX)+Math.abs(t.clientY-Q.clientY)>=10},X=function(){return w=!0};_&&(a.scroller.draggable=!0),e.state.draggingText=F,F.copy=!r.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop(),Ce(a.wrapper.ownerDocument,"mouseup",F),Ce(a.wrapper.ownerDocument,"mousemove",W),Ce(a.scroller,"dragstart",X),Ce(a.scroller,"drop",F),yo(e),setTimeout(function(){return a.input.focus()},20)}function ys(e,t,n){if(n=="char")return new Nt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Nt(Ge(t.line,0),ht(e.doc,Ge(t.line+1,0)));var r=n(e,t);return new Nt(r.from,r.to)}function Vl(e,t,n,r){var a=e.display,w=e.doc;q(t);var F,W,X=w.sel,Q=X.ranges;if(r.addNew&&!r.extend?(W=w.sel.contains(n),W>-1?F=Q[W]:F=new Nt(n,n)):(F=w.sel.primary(),W=w.sel.primIndex),r.unit=="rectangle")r.addNew||(F=new Nt(n,n)),n=Wn(e,t,!0,!0),W=-1;else{var fe=ys(e,n,r.unit);r.extend?F=Ii(F,fe.anchor,fe.head,r.extend):F=fe}r.addNew?W==-1?(W=Q.length,Mr(w,xn(e,Q.concat([F]),W),{scroll:!1,origin:"*mouse"})):Q.length>1&&Q[W].empty()&&r.unit=="char"&&!r.extend?(Mr(w,xn(e,Q.slice(0,W).concat(Q.slice(W+1)),0),{scroll:!1,origin:"*mouse"}),X=w.sel):Ni(w,W,F,ae):(W=0,Mr(w,new hn([F],0),ae),X=w.sel);var ve=n;function Oe(qe){if(ct(ve,qe)==0)return;if(ve=qe,r.unit=="rectangle"){for(var it=[],gt=e.options.tabSize,dt=G(nt(w,n.line).text,n.ch,gt),Ct=G(nt(w,qe.line).text,qe.ch,gt),Gt=Math.min(dt,Ct),xr=Math.max(dt,Ct),tr=Math.min(n.line,qe.line),on=Math.min(e.lastLine(),Math.max(n.line,qe.line));tr<=on;tr++){var $r=nt(w,tr).text,lr=re($r,Gt,gt);Gt==xr?it.push(new Nt(Ge(tr,lr),Ge(tr,lr))):$r.length>lr&&it.push(new Nt(Ge(tr,lr),Ge(tr,re($r,xr,gt))))}it.length||it.push(new Nt(n,n)),Mr(w,xn(e,X.ranges.slice(0,W).concat(it),W),{origin:"*mouse",scroll:!1}),e.scrollIntoView(qe)}else{var Jr=F,Dr=ys(e,qe,r.unit),vr=Jr.anchor,ur;ct(Dr.anchor,vr)>0?(ur=Dr.head,vr=Rr(Jr.from(),Dr.anchor)):(ur=Dr.anchor,vr=qr(Jr.to(),Dr.head));var ar=X.ranges.slice(0);ar[W]=Xl(e,new Nt(ht(w,vr),ur)),Mr(w,xn(e,ar,W),ae)}}var Ae=a.wrapper.getBoundingClientRect(),We=0;function ze(qe){var it=++We,gt=Wn(e,qe,!0,r.unit=="rectangle");if(!gt)return;if(ct(gt,ve)!=0){e.curOp.focus=D(),Oe(gt);var dt=Va(a,w);(gt.line>=dt.to||gt.line<dt.from)&&setTimeout(br(e,function(){We==it&&ze(qe)}),150)}else{var Ct=qe.clientY<Ae.top?-20:qe.clientY>Ae.bottom?20:0;Ct&&setTimeout(br(e,function(){if(We!=it)return;a.scroller.scrollTop+=Ct,ze(qe)}),50)}}function $e(qe){e.state.selectingText=!1,We=Infinity,qe&&(q(qe),a.input.focus()),je(a.wrapper.ownerDocument,"mousemove",Ze),je(a.wrapper.ownerDocument,"mouseup",at),w.history.lastSelOrigin=null}var Ze=br(e,function(qe){qe.buttons===0||!Le(qe)?$e(qe):ze(qe)}),at=br(e,$e);e.state.selectingText=at,Ce(a.wrapper.ownerDocument,"mousemove",Ze),Ce(a.wrapper.ownerDocument,"mouseup",at)}function Xl(e,t){var n=t.anchor,r=t.head,a=nt(e.doc,n.line);if(ct(n,r)==0&&n.sticky==r.sticky)return t;var w=Fe(a);if(!w)return t;var F=_e(w,n.ch,n.sticky),W=w[F];if(W.from!=n.ch&&W.to!=n.ch)return t;var X=F+(W.from==n.ch==(W.level!=1)?0:1);if(X==0||X==w.length)return t;var Q;if(r.line!=n.line)Q=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var fe=_e(w,r.ch,r.sticky),ve=fe-F||(r.ch-n.ch)*(W.level==1?-1:1);fe==X-1||fe==X?Q=ve<0:Q=ve>0}var Oe=w[X+(Q?-1:0)],Ae=Q==(Oe.level==1),We=Ae?Oe.from:Oe.to,ze=Ae?"after":"before";return n.ch==We&&n.sticky==ze?t:new Nt(new Ge(n.line,We,ze),r)}function bs(e,t,n,r){var a,w;if(t.touches)a=t.touches[0].clientX,w=t.touches[0].clientY;else try{a=t.clientX,w=t.clientY}catch(Oe){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&q(t);var F=e.display,W=F.lineDiv.getBoundingClientRect();if(w>W.bottom||!ce(e,n))return se(t);w-=W.top-F.viewOffset;for(var X=0;X<e.display.gutterSpecs.length;++X){var Q=F.gutters.childNodes[X];if(Q&&Q.getBoundingClientRect().right>=a){var fe=rr(e.doc,w),ve=e.display.gutterSpecs[X];return we(e,n,e,fe,ve.className,t),se(t)}}}function Wi(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(Ln(e.display,t)||Yl(e,t))return;if(Ie(e,t,"contextmenu"))return;S||e.display.input.onContextMenu(t)}function Yl(e,t){return ce(e,"gutterContextMenu")?bs(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ya(e)}var da={toString:function(){return"CodeMirror.Init"}},Ts={},ii={};function $l(e){var t=e.optionHandlers;function n(r,a,w,F){e.defaults[r]=a,w&&(t[r]=F?function(W,X,Q){Q!=da&&w(W,X,Q)}:w)}e.defineOption=n,e.Init=da,n("value","",function(r,a){return r.setValue(a)},!0),n("mode",null,function(r,a){r.doc.modeOption=a,_i(r)},!0),n("indentUnit",2,_i,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Aa(r),ya(r),Xr(r)},!0),n("lineSeparator",null,function(r,a){if(r.doc.lineSep=a,!a)return;var w=[],F=r.doc.first;r.doc.iter(function(X){for(var Q=0;;){var fe=X.text.indexOf(a,Q);if(fe==-1)break;Q=fe+a.length,w.push(Ge(F,fe))}F++});for(var W=w.length-1;W>=0;W--)oa(r.doc,a,w[W],Ge(w[W].line,w[W].ch+a.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,a,w){r.state.specialChars=new RegExp(a.source+(a.test(" ")?"":"| "),"g"),w!=da&&r.refresh()}),n("specialCharPlaceholder",Ht,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,a){return r.getInputField().spellcheck=a},!0),n("autocorrect",!1,function(r,a){return r.getInputField().autocorrect=a},!0),n("autocapitalize",!1,function(r,a){return r.getInputField().autocapitalize=a},!0),n("rtlMoveVisually",!T),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){xs(r),wa(r)},!0),n("keyMap","default",function(r,a,w){var F=ni(a),W=w!=da&&ni(w);W&&W.detach&&W.detach(r,F),F.attach&&F.attach(r,W||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ql,!0),n("gutters",[],function(r,a){r.display.gutterSpecs=Ri(a,r.options.lineNumbers),wa(r)},!0),n("fixedGutter",!0,function(r,a){r.display.gutters.style.left=a?Ei(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return ra(r)},!0),n("scrollbarStyle","native",function(r){Co(r),ra(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,a){r.display.gutterSpecs=Ri(r.options.gutters,a),wa(r)},!0),n("firstLineNumber",1,wa,!0),n("lineNumberFormatter",function(r){return r},wa,!0),n("showCursorWhenSelecting",!1,ba,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,a){a=="nocursor"&&(ea(r),r.display.input.blur()),r.display.input.readOnlyChanged(a)}),n("screenReaderLabel",null,function(r,a){a=a===""?null:a,r.display.input.screenReaderLabelChanged(a)}),n("disableInput",!1,function(r,a){a||r.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ba,!0),n("singleCursorHeightPerLine",!0,ba,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Aa,!0),n("addModeClass",!1,Aa,!0),n("pollInterval",100),n("undoDepth",200,function(r,a){return r.doc.history.undoDepth=a}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Aa,!0),n("moveInputWithCursor",!0,function(r,a){a||r.display.input.resetPosition()}),n("tabindex",null,function(r,a){return r.display.input.getField().tabIndex=a||""}),n("autofocus",null),n("direction","ltr",function(r,a){return r.doc.setDirection(a)},!0),n("phrases",null)}function Jl(e,t,n){var r=n&&n!=da;if(!t!=!r){var a=e.display.dragFunctions,w=t?Ce:je;w(e.display.scroller,"dragstart",a.start),w(e.display.scroller,"dragenter",a.enter),w(e.display.scroller,"dragover",a.over),w(e.display.scroller,"dragleave",a.leave),w(e.display.scroller,"drop",a.drop)}}function Ql(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(l(e.display.wrapper,"CodeMirror-wrap"),ja(e)),xi(e),Xr(e),ya(e),setTimeout(function(){return ra(e)},100)}function qt(e,t){var n=this;if(!(this instanceof qt))return new qt(e,t);this.options=t=t?M(t):{},M(Ts,t,!1);var r=t.value;typeof r=="string"?r=new Yr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var a=new qt.inputStyles[t.inputStyle](this),w=this.display=new dl(e,r,a,t);w.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Co(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 ee,keySeq:null,specialChars:null},t.autofocus&&!o&&w.input.focus(),B&&N<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Zl(this),Ol(),Vn(this),this.curOp.forceUpdate=!0,Mo(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Si(n)},20):ea(this);for(var F in ii)ii.hasOwnProperty(F)&&ii[F](this,t[F],da);Do(this),t.finishInit&&t.finishInit(this);for(var W=0;W<Hi.length;++W)Hi[W](this);Xn(this),_&&t.lineWrapping&&getComputedStyle(w.lineDiv).textRendering=="optimizelegibility"&&(w.lineDiv.style.textRendering="auto")}qt.defaults=Ts,qt.optionHandlers=ii;function Zl(e){var t=e.display;Ce(t.scroller,"mousedown",br(e,gs)),B&&N<11?Ce(t.scroller,"dblclick",br(e,function(X){if(Ie(e,X))return;var Q=Wn(e,X);if(!Q||Wi(e,X)||Ln(e.display,X))return;q(X);var fe=e.findWordAt(Q);Za(e.doc,fe.anchor,fe.head)})):Ce(t.scroller,"dblclick",function(X){return Ie(e,X)||q(X)}),Ce(t.scroller,"contextmenu",function(X){return Es(e,X)}),Ce(t.input.getField(),"contextmenu",function(X){t.scroller.contains(X.target)||Es(e,X)});var n,r={end:0};function a(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function w(X){if(X.touches.length!=1)return!1;var Q=X.touches[0];return Q.radiusX<=1&&Q.radiusY<=1}function F(X,Q){if(Q.left==null)return!0;var fe=Q.left-X.left,ve=Q.top-X.top;return fe*fe+ve*ve>20*20}Ce(t.scroller,"touchstart",function(X){if(!Ie(e,X)&&!w(X)&&!Wi(e,X)){t.input.ensurePolled(),clearTimeout(n);var Q=+new Date;t.activeTouch={start:Q,moved:!1,prev:Q-r.end<=300?r:null},X.touches.length==1&&(t.activeTouch.left=X.touches[0].pageX,t.activeTouch.top=X.touches[0].pageY)}}),Ce(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ce(t.scroller,"touchend",function(X){var Q=t.activeTouch;if(Q&&!Ln(t,X)&&Q.left!=null&&!Q.moved&&new Date-Q.start<300){var fe=e.coordsChar(t.activeTouch,"page"),ve;!Q.prev||F(Q,Q.prev)?ve=new Nt(fe,fe):!Q.prev.prev||F(Q,Q.prev.prev)?ve=e.findWordAt(fe):ve=new Nt(Ge(fe.line,0),ht(e.doc,Ge(fe.line+1,0))),e.setSelection(ve.anchor,ve.head),e.focus(),q(X)}a()}),Ce(t.scroller,"touchcancel",a),Ce(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xa(e,t.scroller.scrollTop),Gn(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))}),Ce(t.scroller,"mousewheel",function(X){return Ro(e,X)}),Ce(t.scroller,"DOMMouseScroll",function(X){return Ro(e,X)}),Ce(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){Ie(e,X)||pe(X)},over:function(X){Ie(e,X)||(Ll(e,X),pe(X))},start:function(X){return Dl(e,X)},drop:br(e,Al),leave:function(X){Ie(e,X)||as(e)}};var W=t.input.getField();Ce(W,"keyup",function(X){return ms.call(e,X)}),Ce(W,"keydown",br(e,ps)),Ce(W,"keypress",br(e,vs)),Ce(W,"focus",function(X){return Si(e,X)}),Ce(W,"blur",function(X){return ea(e,X)})}var Hi=[];qt.defineInitHook=function(e){return Hi.push(e)};function Ba(e,t,n,r){var a=e.doc,w;n==null&&(n="add"),n=="smart"&&(a.mode.indent?w=yr(e,t).state:n="prev");var F=e.options.tabSize,W=nt(a,t),X=G(W.text,null,F);W.stateAfter&&(W.stateAfter=null);var Q=W.text.match(/^\s*/)[0],fe;if(!r&&!/\S/.test(W.text))fe=0,n="not";else if(n=="smart"&&(fe=a.mode.indent(w,W.text.slice(Q.length),W.text),fe==be||fe>150)){if(!r)return;n="prev"}n=="prev"?t>a.first?fe=G(nt(a,t-1).text,null,F):fe=0:n=="add"?fe=X+e.options.indentUnit:n=="subtract"?fe=X-e.options.indentUnit:typeof n=="number"&&(fe=X+n),fe=Math.max(0,fe);var ve="",Oe=0;if(e.options.indentWithTabs)for(var Ae=Math.floor(fe/F);Ae;--Ae)Oe+=F,ve+=" ";if(Oe<fe&&(ve+=ie(fe-Oe)),ve!=Q)return oa(a,ve,Ge(t,0),Ge(t,Q.length),"+input"),W.stateAfter=null,!0;for(var We=0;We<a.sel.ranges.length;We++){var ze=a.sel.ranges[We];if(ze.head.line==t&&ze.head.ch<Q.length){var $e=Ge(t,Q.length);Ni(a,We,new Nt($e,$e));break}}}var Tn=null;function oi(e){Tn=e}function Gi(e,t,n,r,a){var w=e.doc;e.display.shift=!1,r||(r=w.sel);var F=+new Date-200,W=a=="paste"||e.state.pasteIncoming>F,X=st(t),Q=null;if(W&&r.ranges.length>1)if(Tn&&Tn.text.join(`
|
|
`)==t){if(r.ranges.length%Tn.text.length==0){Q=[];for(var fe=0;fe<Tn.text.length;fe++)Q.push(w.splitLines(Tn.text[fe]))}}else X.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(Q=Y(X,function(Ze){return[Ze]}));for(var ve=e.curOp.updateInput,Oe=r.ranges.length-1;Oe>=0;Oe--){var Ae=r.ranges[Oe],We=Ae.from(),ze=Ae.to();Ae.empty()&&(n&&n>0?We=Ge(We.line,We.ch-n):e.state.overwrite&&!W?ze=Ge(ze.line,Math.min(nt(w,ze.line).text.length,ze.ch+V(X).length)):W&&Tn&&Tn.lineWise&&Tn.text.join(`
|
|
`)==X.join(`
|
|
`)&&(We=ze=Ge(We.line,0)));var $e={from:We,to:ze,text:Q?Q[Oe%Q.length]:X,origin:a||(W?"paste":e.state.cutIncoming>F?"cut":"+input")};ia(e.doc,$e),Ar(e,"inputRead",e,$e)}t&&!W&&Cs(e,t),ta(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ve),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ss(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&an(t,function(){return Gi(t,n,0,null,"paste")}),!0}function Cs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var a=n.ranges[r];if(a.head.ch>100||r&&n.ranges[r-1].head.line==a.head.line)continue;var w=e.getModeAt(a.head),F=!1;if(w.electricChars){for(var W=0;W<w.electricChars.length;W++)if(t.indexOf(w.electricChars.charAt(W))>-1){F=Ba(e,a.head.line,"smart");break}}else w.electricInput&&(w.electricInput.test(nt(e.doc,a.head.line).text.slice(0,a.head.ch))&&(F=Ba(e,a.head.line,"smart")));F&&Ar(e,"electricInput",e,a.head.line)}}function ws(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var a=e.doc.sel.ranges[r].head.line,w={anchor:Ge(a,0),head:Ge(a+1,0)};n.push(w),t.push(e.getRange(w.anchor,w.head))}return{text:t,ranges:n}}function As(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ds(){var e=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=i("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return _?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),As(e),t}function ql(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,a){var w=this.options,F=w[r];if(w[r]==a&&r!="mode")return;w[r]=a,t.hasOwnProperty(r)&&br(this,t[r])(this,a,F),we(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,a){this.state.keyMaps[a?"push":"unshift"](ni(r))},removeKeyMap:function(r){for(var a=this.state.keyMaps,w=0;w<a.length;++w)if(a[w]==r||a[w].name==r)return a.splice(w,1),!0},addOverlay:Kr(function(r,a){var w=r.token?r:e.getMode(this.options,r);if(w.startState)throw new Error("Overlays may not be stateful.");Z(this.state.overlays,{mode:w,modeSpec:r,opaque:a&&a.opaque,priority:a&&a.priority||0},function(F){return F.priority}),this.state.modeGen++,Xr(this)}),removeOverlay:Kr(function(r){for(var a=this.state.overlays,w=0;w<a.length;++w){var F=a[w].modeSpec;if(F==r||typeof r=="string"&&F.name==r){a.splice(w,1),this.state.modeGen++,Xr(this);return}}}),indentLine:Kr(function(r,a,w){typeof a!="string"&&typeof a!="number"&&(a==null?a=this.options.smartIndent?"smart":"prev":a=a?"add":"subtract"),$t(this.doc,r)&&Ba(this,r,a,w)}),indentSelection:Kr(function(r){for(var a=this.doc.sel.ranges,w=-1,F=0;F<a.length;F++){var W=a[F];if(W.empty())W.head.line>w&&(Ba(this,W.head.line,r,!0),w=W.head.line,F==this.doc.sel.primIndex&&ta(this));else{var X=W.from(),Q=W.to(),fe=Math.max(w,X.line);w=Math.min(this.lastLine(),Q.line-(Q.ch?0:1))+1;for(var ve=fe;ve<w;++ve)Ba(this,ve,r);var Oe=this.doc.sel.ranges;X.ch==0&&a.length==Oe.length&&Oe[F].from().ch>0&&Ni(this.doc,F,new Nt(X,Oe[F].to()),Ee)}}}),getTokenAt:function(r,a){return nr(this,r,a)},getLineTokens:function(r,a){return nr(this,Ge(r),a,!0)},getTokenTypeAt:function(r){r=ht(this.doc,r);var a=cr(this,nt(this.doc,r.line)),w=0,F=(a.length-1)/2,W=r.ch,X;if(W==0)X=a[2];else for(;;){var Q=w+F>>1;if((Q?a[Q*2-1]:0)>=W)F=Q;else if(a[Q*2+1]<W)w=Q+1;else{X=a[Q*2+2];break}}var fe=X?X.indexOf("overlay "):-1;return fe<0?X:fe==0?null:X.slice(0,fe-1)},getModeAt:function(r){var a=this.doc.mode;return a.innerMode?e.innerMode(a,this.getTokenAt(r).state).mode:a},getHelper:function(r,a){return this.getHelpers(r,a)[0]},getHelpers:function(r,a){var w=[];if(!n.hasOwnProperty(a))return w;var F=n[a],W=this.getModeAt(r);if(typeof W[a]=="string")F[W[a]]&&w.push(F[W[a]]);else if(W[a])for(var X=0;X<W[a].length;X++){var Q=F[W[a][X]];Q&&w.push(Q)}else W.helperType&&F[W.helperType]?w.push(F[W.helperType]):F[W.name]&&w.push(F[W.name]);for(var fe=0;fe<F._global.length;fe++){var ve=F._global[fe];ve.pred(W,this)&&ue(w,ve.val)==-1&&w.push(ve.val)}return w},getStateAfter:function(r,a){var w=this.doc;return r=ln(w,r==null?w.first+w.size-1:r),yr(this,r+1,a).state},cursorCoords:function(r,a){var w,F=this.doc.sel.primary();return r==null?w=F.head:typeof r=="object"?w=ht(this.doc,r):w=r?F.from():F.to(),En(this,w,a||"page")},charCoords:function(r,a){return mi(this,ht(this.doc,r),a||"page")},coordsChar:function(r,a){return r=lo(this,r,a||"page"),gi(this,r.left,r.top)},lineAtHeight:function(r,a){return r=lo(this,{top:r,left:0},a||"page").top,rr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,a,w){var F=!1,W;if(typeof r=="number"){var X=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>X&&(r=X,F=!0),W=nt(this.doc,r)}else W=r;return Wa(this,W,{top:0,left:0},a||"page",w||F).top+(F?this.doc.height-nn(W):0)},defaultTextHeight:function(){return Zn(this.display)},defaultCharWidth:function(){return qn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,a,w,F,W){var X=this.display;r=En(this,ht(this.doc,r));var Q=r.bottom,fe=r.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),X.sizer.appendChild(a),F=="over")Q=r.top;else if(F=="above"||F=="near"){var ve=Math.max(X.wrapper.clientHeight,this.doc.height),Oe=Math.max(X.sizer.clientWidth,X.lineSpace.clientWidth);(F=="above"||r.bottom+a.offsetHeight>ve)&&r.top>a.offsetHeight?Q=r.top-a.offsetHeight:r.bottom+a.offsetHeight<=ve&&(Q=r.bottom),fe+a.offsetWidth>Oe&&(fe=Oe-a.offsetWidth)}a.style.top=Q+"px",a.style.left=a.style.right="",W=="right"?(fe=X.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(W=="left"?fe=0:W=="middle"&&(fe=(X.sizer.clientWidth-a.offsetWidth)/2),a.style.left=fe+"px"),w&&Js(this,{left:fe,top:Q,right:fe+a.offsetWidth,bottom:Q+a.offsetHeight})},triggerOnKeyDown:Kr(ps),triggerOnKeyPress:Kr(vs),triggerOnKeyUp:ms,triggerOnMouseDown:Kr(gs),execCommand:function(r){if(Ia.hasOwnProperty(r))return Ia[r].call(null,this)},triggerElectric:Kr(function(r){Cs(this,r)}),findPosH:function(r,a,w,F){var W=1;a<0&&(W=-1,a=-a);for(var X=ht(this.doc,r),Q=0;Q<a&&!(X=zi(this.doc,X,W,w,F),X.hitSide);++Q);return X},moveH:Kr(function(r,a){var w=this;this.extendSelectionsBy(function(F){return w.display.shift||w.doc.extend||F.empty()?zi(w.doc,F.head,r,a,w.options.rtlMoveVisually):r<0?F.from():F.to()},$)}),deleteH:Kr(function(r,a){var w=this.doc.sel,F=this.doc;w.somethingSelected()?F.replaceSelection("",null,"+delete"):ua(this,function(W){var X=zi(F,W.head,r,a,!1);return r<0?{from:X,to:W.head}:{from:W.head,to:X}})}),findPosV:function(r,a,w,F){var W=1,X=F;a<0&&(W=-1,a=-a);for(var Q=ht(this.doc,r),fe=0;fe<a;++fe){var ve=En(this,Q,"div");if(X==null?X=ve.left:ve.left=X,Q=Ls(this,ve,W,w),Q.hitSide)break}return Q},moveV:Kr(function(r,a){var w=this,F=this.doc,W=[],X=!this.display.shift&&!F.extend&&F.sel.somethingSelected();if(F.extendSelectionsBy(function(fe){if(X)return r<0?fe.from():fe.to();var ve=En(w,fe.head,"div");fe.goalColumn!=null&&(ve.left=fe.goalColumn),W.push(ve.left);var Oe=Ls(w,ve,r,a);return a=="page"&&fe==F.sel.primary()&&wi(w,mi(w,Oe,"div").top-ve.top),Oe},$),W.length)for(var Q=0;Q<F.sel.ranges.length;Q++)F.sel.ranges[Q].goalColumn=W[Q]}),findWordAt:function(r){var a=this.doc,w=nt(a,r.line).text,F=r.ch,W=r.ch;if(w){var X=this.getHelper(r,"wordChars");(r.sticky=="before"||W==w.length)&&F?--F:++W;for(var Q=w.charAt(F),fe=De(Q,X)?function(ve){return De(ve,X)}:/\s/.test(Q)?function(ve){return/\s/.test(ve)}:function(ve){return!/\s/.test(ve)&&!De(ve)};F>0&&fe(w.charAt(F-1));)--F;for(;W<w.length&&fe(w.charAt(W));)++W}return new Nt(Ge(r.line,F),Ge(r.line,W))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):l(this.display.cursorDiv,"CodeMirror-overwrite"),we(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Kr(function(r,a){Ea(this,r,a)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Cn(this)-this.display.barHeight,width:r.scrollWidth-Cn(this)-this.display.barWidth,clientHeight:fi(this),clientWidth:jn(this)}},scrollIntoView:Kr(function(r,a){r==null?(r={from:this.doc.sel.primary().head,to:null},a==null&&(a=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Ge(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=a||0,r.from.line!=null?Qs(this,r):Eo(this,r.from,r.to,r.margin)}),setSize:Kr(function(r,a){var w=this,F=function(X){return typeof X=="number"||/^\d+$/.test(String(X))?X+"px":X};r!=null&&(this.display.wrapper.style.width=F(r)),a!=null&&(this.display.wrapper.style.height=F(a)),this.options.lineWrapping&&io(this);var W=this.display.viewFrom;this.doc.iter(W,this.display.viewTo,function(X){if(X.widgets){for(var Q=0;Q<X.widgets.length;Q++)if(X.widgets[Q].noHScroll){kn(w,W,"widget");break}}++W}),this.curOp.forceUpdate=!0,we(this,"refresh",this)}),operation:function(r){return an(this,r)},startOperation:function(){return Vn(this)},endOperation:function(){return Xn(this)},refresh:Kr(function(){var r=this.display.cachedTextHeight;Xr(this),this.curOp.forceUpdate=!0,ya(this),Ea(this,this.doc.scrollLeft,this.doc.scrollTop),Li(this.display),(r==null||Math.abs(r-Zn(this.display))>.5||this.options.lineWrapping)&&xi(this),we(this,"refresh",this)}),swapDoc:Kr(function(r){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Mo(this,r),ya(this),this.display.input.reset(),Ea(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Ar(this,"swapDoc",this,a),a}),phrase:function(r){var a=this.options.phrases;return a&&Object.prototype.hasOwnProperty.call(a,r)?a[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},me(e),e.registerHelper=function(r,a,w){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][a]=w},e.registerGlobalHelper=function(r,a,w,F){e.registerHelper(r,a,F),n[r]._global.push({pred:w,val:F})}}function zi(e,t,n,r,a){var w=t,F=n,W=nt(e,t.line),X=a&&e.direction=="rtl"?-n:n;function Q(){var at=t.line+X;return at<e.first||at>=e.first+e.size?!1:(t=new Ge(at,t.ch,t.sticky),W=nt(e,at))}function fe(at){var qe;if(r=="codepoint"){var it=W.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(it)?qe=null:qe=new Ge(t.line,Math.max(0,Math.min(W.text.length,t.ch+n*(it>=55296&&it<56320?2:1))),-n)}else a?qe=Ml(e.cm,W,t,n):qe=Fi(W,t,n);if(qe==null)if(!at&&Q())t=Bi(a,e.cm,W,t.line,X);else return!1;else t=qe;return!0}if(r=="char"||r=="codepoint")fe();else if(r=="column")fe(!0);else if(r=="word"||r=="group")for(var ve=null,Oe=r=="group",Ae=e.cm&&e.cm.getHelper(t,"wordChars"),We=!0;!(n<0&&!fe(!We));We=!1){var ze=W.text.charAt(t.ch)||`
|
|
`,$e=De(ze,Ae)?"w":Oe&&ze==`
|
|
`?"n":!Oe||/\s/.test(ze)?null:"p";if(Oe&&!We&&!$e&&($e="s"),ve&&ve!=$e){n<0&&(n=1,fe(),t.sticky="after");break}if($e&&(ve=$e),n>0&&!fe(!We))break}var Ze=ei(e,t,w,F,!0);return Zr(w,Ze)&&(Ze.hitSide=!0),Ze}function Ls(e,t,n,r){var a=e.doc,w=t.left,F;if(r=="page"){var W=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(W-.5*Zn(e.display),3);F=(n>0?t.bottom:t.top)+n*X}else r=="line"&&(F=n>0?t.bottom+3:t.top-3);for(var Q;!(Q=gi(e,w,F),!Q.outside);){if(n<0?F<=0:F>=a.height){Q.hitSide=!0;break}F+=n*5}return Q}var Bt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Bt.prototype.init=function(e){var t=this,n=this,r=n.cm,a=n.div=e.lineDiv;As(a,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function w(W){for(var X=W.target;X;X=X.parentNode){if(X==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(X.className))break}return!1}Ce(a,"paste",function(W){if(!w(W)||Ie(r,W)||Ss(W,r))return;N<=11&&setTimeout(br(r,function(){return t.updateFromDOM()}),20)}),Ce(a,"compositionstart",function(W){t.composing={data:W.data,done:!1}}),Ce(a,"compositionupdate",function(W){t.composing||(t.composing={data:W.data,done:!1})}),Ce(a,"compositionend",function(W){t.composing&&(W.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ce(a,"touchstart",function(){return n.forceCompositionEnd()}),Ce(a,"input",function(){t.composing||t.readFromDOMSoon()});function F(W){if(!w(W)||Ie(r,W))return;if(r.somethingSelected())oi({lineWise:!1,text:r.getSelections()}),W.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var X=ws(r);oi({lineWise:!0,text:X.text}),W.type=="cut"&&r.operation(function(){r.setSelections(X.ranges,0,Ee),r.replaceSelection("",null,"cut")})}else return;if(W.clipboardData){W.clipboardData.clearData();var Q=Tn.text.join(`
|
|
`);if(W.clipboardData.setData("Text",Q),W.clipboardData.getData("Text")==Q){W.preventDefault();return}}var fe=Ds(),ve=fe.firstChild;r.display.lineSpace.insertBefore(fe,r.display.lineSpace.firstChild),ve.value=Tn.text.join(`
|
|
`);var Oe=document.activeElement;K(ve),setTimeout(function(){r.display.lineSpace.removeChild(fe),Oe.focus(),Oe==a&&n.showPrimarySelection()},50)}Ce(a,"copy",F),Ce(a,"cut",F)},Bt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Bt.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Bt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Bt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Bt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),a=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var w=si(t,e.anchorNode,e.anchorOffset),F=si(t,e.focusNode,e.focusOffset);if(w&&!w.bad&&F&&!F.bad&&ct(Rr(w,F),r)==0&&ct(qr(w,F),a)==0)return;var W=t.display.view,X=r.line>=t.display.viewFrom&&Os(t,r)||{node:W[0].measure.map[2],offset:0},Q=a.line<t.display.viewTo&&Os(t,a);if(!Q){var fe=W[W.length-1].measure,ve=fe.maps?fe.maps[fe.maps.length-1]:fe.map;Q={node:ve[ve.length-1],offset:ve[ve.length-2]-ve[ve.length-3]}}if(!X||!Q){e.removeAllRanges();return}var Oe=e.rangeCount&&e.getRangeAt(0),Ae;try{Ae=m(X.node,X.offset,Q.offset,Q.node)}catch(We){}Ae&&(!L&&t.state.focused?(e.collapse(X.node,X.offset),Ae.collapsed||(e.removeAllRanges(),e.addRange(Ae))):(e.removeAllRanges(),e.addRange(Ae)),Oe&&e.anchorNode==null?e.addRange(Oe):L&&this.startGracePeriod()),this.rememberSelection()},Bt.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)},Bt.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},Bt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Bt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Bt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Bt.prototype.blur=function(){this.div.blur()},Bt.prototype.getField=function(){return this.div},Bt.prototype.supportsTouch=function(){return!0},Bt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():an(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)},Bt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Bt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=si(t,e.anchorNode,e.anchorOffset),r=si(t,e.focusNode,e.focusOffset);n&&r&&an(t,function(){Mr(t.doc,Pn(n,r),Ee),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Bt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),a=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Ge(r.line-1,nt(e.doc,r.line-1).length)),a.ch==nt(e.doc,a.line).text.length&&a.line<e.lastLine()&&(a=Ge(a.line+1,0)),r.line<t.viewFrom||a.line>t.viewTo-1)return!1;var w,F,W;r.line==t.viewFrom||(w=Hn(e,r.line))==0?(F=St(t.view[0].line),W=t.view[0].node):(F=St(t.view[w].line),W=t.view[w-1].node.nextSibling);var X=Hn(e,a.line),Q,fe;if(X==t.view.length-1?(Q=t.viewTo-1,fe=t.lineDiv.lastChild):(Q=St(t.view[X+1].line)-1,fe=t.view[X+1].node.previousSibling),!W)return!1;for(var ve=e.doc.splitLines(tu(e,W,fe,F,Q)),Oe=Yt(e.doc,Ge(F,0),Ge(Q,nt(e.doc,Q).text.length));ve.length>1&&Oe.length>1;)if(V(ve)==V(Oe))ve.pop(),Oe.pop(),Q--;else if(ve[0]==Oe[0])ve.shift(),Oe.shift(),F++;else break;for(var Ae=0,We=0,ze=ve[0],$e=Oe[0],Ze=Math.min(ze.length,$e.length);Ae<Ze&&ze.charCodeAt(Ae)==$e.charCodeAt(Ae);)++Ae;for(var at=V(ve),qe=V(Oe),it=Math.min(at.length-(ve.length==1?Ae:0),qe.length-(Oe.length==1?Ae:0));We<it&&at.charCodeAt(at.length-We-1)==qe.charCodeAt(qe.length-We-1);)++We;if(ve.length==1&&Oe.length==1&&F==r.line)for(;Ae&&Ae>r.ch&&at.charCodeAt(at.length-We-1)==qe.charCodeAt(qe.length-We-1);)Ae--,We++;ve[ve.length-1]=at.slice(0,at.length-We).replace(/^\u200b+/,""),ve[0]=ve[0].slice(Ae).replace(/\u200b+$/,"");var gt=Ge(F,Ae),dt=Ge(Q,Oe.length?V(Oe).length-We:0);if(ve.length>1||ve[0]||ct(gt,dt))return oa(e.doc,ve,gt,dt,"+input"),!0},Bt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Bt.prototype.reset=function(){this.forceCompositionEnd()},Bt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Bt.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)},Bt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&an(this.cm,function(){return Xr(e.cm)})},Bt.prototype.setUneditable=function(e){e.contentEditable="false"},Bt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||br(this.cm,Gi)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Bt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Bt.prototype.onContextMenu=function(){},Bt.prototype.resetPosition=function(){},Bt.prototype.needsContentAttribute=!0;function Os(e,t){var n=hi(e,t.line);if(!n||n.hidden)return null;var r=nt(e.doc,t.line),a=eo(n,r,t.line),w=Fe(r,e.doc.direction),F="left";if(w){var W=_e(w,t.ch);F=W%2?"right":"left"}var X=no(a.map,t.ch,F);return X.offset=X.collapse=="right"?X.end:X.start,X}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ca(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,a){var w="",F=!1,W=e.doc.lineSeparator(),X=!1;function Q(Ae){return function(We){return We.id==Ae}}function fe(){F&&(w+=W,X&&(w+=W),F=X=!1)}function ve(Ae){Ae&&(fe(),w+=Ae)}function Oe(Ae){if(Ae.nodeType==1){var We=Ae.getAttribute("cm-text");if(We){ve(We);return}var ze=Ae.getAttribute("cm-marker"),$e;if(ze){var Ze=e.findMarks(Ge(r,0),Ge(a+1,0),Q(+ze));Ze.length&&($e=Ze[0].find(0))&&ve(Yt(e.doc,$e.from,$e.to).join(W));return}if(Ae.getAttribute("contenteditable")=="false")return;var at=/^(pre|div|p|li|table|br)$/i.test(Ae.nodeName);if(!/^br$/i.test(Ae.nodeName)&&Ae.textContent.length==0)return;at&&fe();for(var qe=0;qe<Ae.childNodes.length;qe++)Oe(Ae.childNodes[qe]);/^(pre|p)$/i.test(Ae.nodeName)&&(X=!0),at&&(F=!0)}else Ae.nodeType==3&&ve(Ae.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Oe(t),t==n);)t=t.nextSibling,X=!1;return w}function si(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return ca(e.clipPos(Ge(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var a=0;a<e.display.view.length;a++){var w=e.display.view[a];if(w.node==r)return ru(w,t,n)}}function ru(e,t,n){var r=e.text.firstChild,a=!1;if(!t||!E(r,t))return ca(Ge(St(e.line),0),!0);if(t==r&&(a=!0,t=r.childNodes[n],n=0,!t)){var w=e.rest?V(e.rest):e.line;return ca(Ge(St(w),w.text.length),a)}var F=t.nodeType==3?t:null,W=t;for(!F&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(F=t.firstChild,n&&(n=F.nodeValue.length));W.parentNode!=r;)W=W.parentNode;var X=e.measure,Q=X.maps;function fe($e,Ze,at){for(var qe=-1;qe<(Q?Q.length:0);qe++)for(var it=qe<0?X.map:Q[qe],gt=0;gt<it.length;gt+=3){var dt=it[gt+2];if(dt==$e||dt==Ze){var Ct=St(qe<0?e.line:e.rest[qe]),Gt=it[gt]+at;return(at<0||dt!=$e)&&(Gt=it[gt+(at?1:0)]),Ge(Ct,Gt)}}}var ve=fe(F,W,n);if(ve)return ca(ve,a);for(var Oe=W.nextSibling,Ae=F?F.nodeValue.length-n:0;Oe;Oe=Oe.nextSibling){if(ve=fe(Oe,Oe.firstChild,0),ve)return ca(Ge(ve.line,ve.ch-Ae),a);Ae+=Oe.textContent.length}for(var We=W.previousSibling,ze=n;We;We=We.previousSibling){if(ve=fe(We,We.firstChild,-1),ve)return ca(Ge(ve.line,ve.ch+ze),a);ze+=We.textContent.length}}var sr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};sr.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var a=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(a.style.width="0px"),Ce(a,"input",function(){B&&N>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ce(a,"paste",function(F){if(Ie(r,F)||Ss(F,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function w(F){if(Ie(r,F))return;if(r.somethingSelected())oi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var W=ws(r);oi({lineWise:!0,text:W.text}),F.type=="cut"?r.setSelections(W.ranges,null,Ee):(n.prevInput="",a.value=W.text.join(`
|
|
`),K(a))}else return;F.type=="cut"&&(r.state.cutIncoming=+new Date)}Ce(a,"cut",w),Ce(a,"copy",w),Ce(e.scroller,"paste",function(F){if(Ln(e,F)||Ie(r,F))return;if(!a.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var W=new Event("paste");W.clipboardData=F.clipboardData,a.dispatchEvent(W)}),Ce(e.lineSpace,"selectstart",function(F){Ln(e,F)||q(F)}),Ce(a,"compositionstart",function(){var F=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:F,range:r.markText(F,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ce(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},sr.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},sr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},sr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var a=En(e,n.sel.primary().head,"div"),w=t.wrapper.getBoundingClientRect(),F=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+F.top-w.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+F.left-w.left))}return r},sr.prototype.showSelection=function(e){var t=this.cm,n=t.display;s(n.cursorDiv,e.cursors),s(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},sr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&K(this.textarea),B&&N>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",B&&N>=9&&(this.hasSelection=null))},sr.prototype.getField=function(){return this.textarea},sr.prototype.supportsTouch=function(){return!1},sr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},sr.prototype.blur=function(){this.textarea.blur()},sr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sr.prototype.receivedFocus=function(){this.slowPoll()},sr.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()})},sr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},sr.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||rt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var a=n.value;if(a==r&&!t.somethingSelected())return!1;if(B&&N>=9&&this.hasSelection===a||u&&/[\uf700-\uf7ff]/.test(a))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var w=a.charCodeAt(0);if(w==8203&&!r&&(r="\u200B"),w==8666)return this.reset(),this.cm.execCommand("undo")}for(var F=0,W=Math.min(r.length,a.length);F<W&&r.charCodeAt(F)==a.charCodeAt(F);)++F;return an(t,function(){Gi(t,a.slice(F),r.length-F,null,e.composing?"*compose":null),a.length>1e3||a.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},sr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sr.prototype.onKeyPress=function(){B&&N>=9&&(this.hasSelection=null),this.fastPoll()},sr.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var w=Wn(n,e),F=r.scroller.scrollTop;if(!w||C)return;var W=n.options.resetSelectionOnContextMenu;W&&n.doc.sel.contains(w)==-1&&br(n,Mr)(n.doc,Pn(w),Ee);var X=a.style.cssText,Q=t.wrapper.style.cssText,fe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-fe.top-5)+"px; left: "+(e.clientX-fe.left-5)+`px;
|
|
z-index: 1000; background: `+(B?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ve;_&&(ve=window.scrollY),r.input.focus(),_&&window.scrollTo(null,ve),r.input.reset(),n.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=Ae,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function Oe(){if(a.selectionStart!=null){var ze=n.somethingSelected(),$e="\u200B"+(ze?a.value:"");a.value="\u21DA",a.value=$e,t.prevInput=ze?"":"\u200B",a.selectionStart=1,a.selectionEnd=$e.length,r.selForContextMenu=n.doc.sel}}function Ae(){if(t.contextMenuPending!=Ae)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Q,a.style.cssText=X,B&&N<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=F),a.selectionStart!=null){(!B||B&&N<9)&&Oe();var ze=0,$e=function(){r.selForContextMenu==n.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="\u200B"?br(n,Xo)(n):ze++<10?r.detectingSelectAll=setTimeout($e,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout($e,200)}}if(B&&N>=9&&Oe(),S){pe(e);var We=function(){je(window,"mouseup",We),setTimeout(Ae,20)};Ce(window,"mouseup",We)}else setTimeout(Ae,50)},sr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},sr.prototype.setUneditable=function(){},sr.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?M(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 n=D();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=W.getValue()}var a;if(e.form&&(Ce(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var w=e.form;a=w.submit;try{var F=w.submit=function(){r(),w.submit=a,w.submit(),w.submit=F}}catch(X){}}t.finishInit=function(X){X.save=r,X.getTextArea=function(){return e},X.toTextArea=function(){X.toTextArea=isNaN,r(),e.parentNode.removeChild(X.getWrapperElement()),e.style.display="",e.form&&(je(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var W=qt(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return W}function au(e){e.off=je,e.on=Ce,e.wheelEventPixels=cl,e.Doc=Yr,e.splitLines=st,e.countColumn=G,e.findColumn=re,e.isWordChar=Te,e.Pass=be,e.signal=we,e.Line=Bn,e.changeEnd=Mn,e.scrollbarModel=So,e.Pos=Ge,e.cmpPos=ct,e.modes=bt,e.mimeModes=ft,e.resolveMode=Wt,e.getMode=Jt,e.modeExtensions=Rt,e.extendMode=Lr,e.copyState=Qt,e.startState=dr,e.innerMode=zt,e.commands=Ia,e.keyMap=On,e.keyName=us,e.isModifierKey=ss,e.lookupKey=la,e.normalizeKeyMap=Pl,e.StringStream=_t,e.SharedTextMarker=_a,e.TextMarker=Nn,e.LineWidget=ka,e.e_preventDefault=q,e.e_stopPropagation=ne,e.e_stop=pe,e.addClass=U,e.contains=E,e.rmClass=l,e.keyNames=Un}$l(qt),ql(qt);var iu="iter insert remove copy getEditor constructor".split(" ");for(var li in Yr.prototype)Yr.prototype.hasOwnProperty(li)&&ue(iu,li)<0&&(qt.prototype[li]=function(e){return function(){return e.apply(this.doc,arguments)}}(Yr.prototype[li]));return me(Yr),qt.inputStyles={textarea:sr,contenteditable:Bt},qt.defineMode=function(e){!qt.defaults.mode&&e!="null"&&(qt.defaults.mode=e),At.apply(this,arguments)},qt.defineMIME=Ut,qt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),qt.defineMIME("text/plain","null"),qt.defineExtension=function(e,t){qt.prototype[e]=t},qt.defineDocExtension=function(e,t){Yr.prototype[e]=t},qt.fromTextArea=nu,au(qt),qt.version="5.58.2",qt})},WaYH:function(ot,Xe,te){"use strict";var oe=te("rePB"),H=te("Ff2n"),L=te("VTBJ"),z=te("1OyB"),I=te("vuIU"),P=te("JX7q"),B=te("Ji7U"),N=te("LK+K"),_=te("cDcd"),O=te("TSYQ"),y=te.n(O),C=te("sboe"),R=te("OZM5"),A=function(S){var v=S.prefixCls,l=S.level,f=S.isStart,s=S.isEnd;if(!l)return null;for(var i="".concat(v,"-indent-unit"),x=[],m=0;m<l;m+=1){var E;x.push(_.createElement("span",{key:m,className:y()(i,(E={},Object(oe.a)(E,"".concat(i,"-start"),f[m+1]),Object(oe.a)(E,"".concat(i,"-end"),s[m+1]),Object(oe.a)(E,"".concat(i,"-end-first-level"),!m&&s[0]),E))}))}return _.createElement("span",{"aria-hidden":"true",className:"".concat(v,"-indent")},x)},b=A,g=te("815F"),c="open",o="close",u="---",d=function(h){Object(B.a)(v,h);var S=Object(N.a)(v);function v(){var l;return Object(z.a)(this,v),l=S.apply(this,arguments),l.state={dragNodeHighlight:!1},l.onSelectorClick=function(f){var s=l.props.context.onNodeClick;s(f,Object(g.b)(l.props)),l.isSelectable()?l.onSelect(f):l.onCheck(f)},l.onSelectorDoubleClick=function(f){var s=l.props.context.onNodeDoubleClick;s(f,Object(g.b)(l.props))},l.onSelect=function(f){if(l.isDisabled())return;var s=l.props.context.onNodeSelect;f.preventDefault(),s(f,Object(g.b)(l.props))},l.onCheck=function(f){if(l.isDisabled())return;var s=l.props,i=s.disableCheckbox,x=s.checked,m=l.props.context.onNodeCheck;if(!l.isCheckable()||i)return;f.preventDefault();var E=!x;m(f,Object(g.b)(l.props),E)},l.onMouseEnter=function(f){var s=l.props.context.onNodeMouseEnter;s(f,Object(g.b)(l.props))},l.onMouseLeave=function(f){var s=l.props.context.onNodeMouseLeave;s(f,Object(g.b)(l.props))},l.onContextMenu=function(f){var s=l.props.context.onNodeContextMenu;s(f,Object(g.b)(l.props))},l.onDragStart=function(f){var s=l.props.context.onNodeDragStart;f.stopPropagation(),l.setState({dragNodeHighlight:!0}),s(f,Object(P.a)(l));try{f.dataTransfer.setData("text/plain","")}catch(i){}},l.onDragEnter=function(f){var s=l.props.context.onNodeDragEnter;f.preventDefault(),f.stopPropagation(),s(f,Object(P.a)(l))},l.onDragOver=function(f){var s=l.props.context.onNodeDragOver;f.preventDefault(),f.stopPropagation(),s(f,Object(P.a)(l))},l.onDragLeave=function(f){var s=l.props.context.onNodeDragLeave;f.stopPropagation(),s(f,Object(P.a)(l))},l.onDragEnd=function(f){var s=l.props.context.onNodeDragEnd;f.stopPropagation(),l.setState({dragNodeHighlight:!1}),s(f,Object(P.a)(l))},l.onDrop=function(f){var s=l.props.context.onNodeDrop;f.preventDefault(),f.stopPropagation(),l.setState({dragNodeHighlight:!1}),s(f,Object(P.a)(l))},l.onExpand=function(f){var s=l.props.context.onNodeExpand;s(f,Object(g.b)(l.props))},l.setSelectHandle=function(f){l.selectHandle=f},l.getNodeState=function(){var f=l.props.expanded;return l.isLeaf()?null:f?c:o},l.hasChildren=function(){var f=l.props.eventKey,s=l.props.context.keyEntities,i=s[f]||{},x=i.children;return!!(x||[]).length},l.isLeaf=function(){var f=l.props,s=f.isLeaf,i=f.loaded,x=l.props.context.loadData,m=l.hasChildren();return s===!1?!1:s||!x&&!m||x&&i&&!m},l.isDisabled=function(){var f=l.props.disabled,s=l.props.context.disabled;return!!(s||f)},l.isCheckable=function(){var f=l.props.checkable,s=l.props.context.checkable;return!s||f===!1?!1:s},l.syncLoadData=function(f){var s=f.expanded,i=f.loading,x=f.loaded,m=l.props.context,E=m.loadData,D=m.onNodeLoad;if(i)return;E&&s&&!l.isLeaf()&&(!l.hasChildren()&&!x&&D(Object(g.b)(l.props)))},l.renderSwitcher=function(){var f=l.props,s=f.expanded,i=f.switcherIcon,x=l.props.context,m=x.prefixCls,E=x.switcherIcon,D=i||E;if(l.isLeaf())return _.createElement("span",{className:y()("".concat(m,"-switcher"),"".concat(m,"-switcher-noop"))},typeof D=="function"?D(Object(L.a)(Object(L.a)({},l.props),{},{isLeaf:!0})):D);var U=y()("".concat(m,"-switcher"),"".concat(m,"-switcher_").concat(s?c:o));return _.createElement("span",{onClick:l.onExpand,className:U},typeof D=="function"?D(Object(L.a)(Object(L.a)({},l.props),{},{isLeaf:!1})):D)},l.renderCheckbox=function(){var f=l.props,s=f.checked,i=f.halfChecked,x=f.disableCheckbox,m=l.props.context.prefixCls,E=l.isDisabled(),D=l.isCheckable();if(!D)return null;var U=typeof D!="boolean"?D:null;return _.createElement("span",{className:y()("".concat(m,"-checkbox"),s&&"".concat(m,"-checkbox-checked"),!s&&i&&"".concat(m,"-checkbox-indeterminate"),(E||x)&&"".concat(m,"-checkbox-disabled")),onClick:l.onCheck},U)},l.renderIcon=function(){var f=l.props.loading,s=l.props.context.prefixCls;return _.createElement("span",{className:y()("".concat(s,"-iconEle"),"".concat(s,"-icon__").concat(l.getNodeState()||"docu"),f&&"".concat(s,"-icon_loading"))})},l.renderSelector=function(){var f=l.state.dragNodeHighlight,s=l.props,i=s.title,x=s.selected,m=s.icon,E=s.loading,D=s.data,U=l.props.context,j=U.prefixCls,K=U.showIcon,k=U.icon,M=U.draggable,G=U.loadData,ee=U.titleRender,ue=l.isDisabled(),de="".concat(j,"-node-content-wrapper"),be;if(K){var Ee=m||k;be=Ee?_.createElement("span",{className:y()("".concat(j,"-iconEle"),"".concat(j,"-icon__customize"))},typeof Ee=="function"?Ee(l.props):Ee):l.renderIcon()}else G&&E&&(be=l.renderIcon());var ae;typeof i=="function"?ae=i(D):ee?ae=ee(D):ae=i;var $=_.createElement("span",{className:"".concat(j,"-title")},ae);return _.createElement("span",{ref:l.setSelectHandle,title:typeof i=="string"?i:"",className:y()("".concat(de),"".concat(de,"-").concat(l.getNodeState()||"normal"),!ue&&(x||f)&&"".concat(j,"-node-selected"),!ue&&M&&"draggable"),draggable:!ue&&M||void 0,"aria-grabbed":!ue&&M||void 0,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,onContextMenu:l.onContextMenu,onClick:l.onSelectorClick,onDoubleClick:l.onSelectorDoubleClick,onDragStart:M?l.onDragStart:void 0},be,$)},l}return Object(I.a)(v,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var f=this.props.selectable,s=this.props.context.selectable;return typeof f=="boolean"?f:s}},{key:"render",value:function(){var f,s=this.props,i=s.eventKey,x=s.className,m=s.style,E=s.dragOver,D=s.dragOverGapTop,U=s.dragOverGapBottom,j=s.isLeaf,K=s.isStart,k=s.isEnd,M=s.expanded,G=s.selected,ee=s.checked,ue=s.halfChecked,de=s.loading,be=s.domRef,Ee=s.active,ae=s.onMouseMove,$=Object(H.a)(s,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),re=this.props.context,J=re.prefixCls,ie=re.filterTreeNode,V=re.draggable,Y=re.keyEntities,Z=this.isDisabled(),le=Object(R.f)($),xe=Y[i]||{},he=xe.level,Te=k[k.length-1];return _.createElement("div",Object.assign({ref:be,className:y()(x,"".concat(J,"-treenode"),(f={},Object(oe.a)(f,"".concat(J,"-treenode-disabled"),Z),Object(oe.a)(f,"".concat(J,"-treenode-switcher-").concat(M?"open":"close"),!j),Object(oe.a)(f,"".concat(J,"-treenode-checkbox-checked"),ee),Object(oe.a)(f,"".concat(J,"-treenode-checkbox-indeterminate"),ue),Object(oe.a)(f,"".concat(J,"-treenode-selected"),G),Object(oe.a)(f,"".concat(J,"-treenode-loading"),de),Object(oe.a)(f,"".concat(J,"-treenode-active"),Ee),Object(oe.a)(f,"".concat(J,"-treenode-leaf-last"),Te),Object(oe.a)(f,"drag-over",!Z&&E),Object(oe.a)(f,"drag-over-gap-top",!Z&&D),Object(oe.a)(f,"drag-over-gap-bottom",!Z&&U),Object(oe.a)(f,"filter-node",ie&&ie(Object(g.b)(this.props))),f)),style:m,onDragEnter:V?this.onDragEnter:void 0,onDragOver:V?this.onDragOver:void 0,onDragLeave:V?this.onDragLeave:void 0,onDrop:V?this.onDrop:void 0,onDragEnd:V?this.onDragEnd:void 0,onMouseMove:ae},le),_.createElement(b,{prefixCls:J,level:he,isStart:K,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),v}(_.Component),T=function(S){return _.createElement(C.a.Consumer,null,function(v){return _.createElement(d,Object.assign({},S,{context:v}))})};T.displayName="TreeNode",T.defaultProps={title:u},T.isTreeNode=1;var p=Xe.a=T},X8EC:function(ot,Xe,te){"use strict";te.r(Xe);var oe=te("+L6B"),H=te("2/Rp"),L=te("DZo9"),z=te("8z0m"),I=te("oBTY"),P=te("sRBo"),B=te("kaz8"),N=te("7Kak"),_=te("9yH6"),O=te("BoS7"),y=te("Sdc0"),C=te("14J3"),R=te("BMrR"),A=te("jCWc"),b=te("kPKH"),g=te("O3gP"),c=te("lrIw"),o=te("k1fw"),u=te("miYZ"),d=te("tsqr"),T=te("9og8"),p=te("y8nQ"),h=te("Vl3Y"),S=te("tJVT"),v=te("PpiC"),l=te("nRaC"),f=te("5RzL"),s=te("5NDa"),i=te("5rEg"),x=te("WmNS"),m=te.n(x),E=te("cDcd"),D=te.n(E),U=te("9kvl"),j=te("Ot1p"),K=te("hxT0"),k=te.n(K),M=te("1vsH"),G=te("m3rI"),ee=te("ErOA"),ue=te("jrin"),de=te("R9oj"),be=te("ECub"),Ee=te("YNHc"),ae=te.n(Ee),$=te("4i/N"),re=te("UESt"),J=Object(E.createRef)(),ie=function(je){var we=je.dataSource,Ie=je.placeholder,ge=je.defaultValue,ce=je.onChange,me=Object(E.useState)(!1),q=Object(S.a)(me,2),ne=q[0],se=q[1],pe=Object(E.useState)({data:[],objData:{},ids:[]}),ye=Object(S.a)(pe,2),Le=ye[0],Ke=ye[1],Je=Object(E.useState)({}),et=Object(S.a)(Je,2),Qe=et[0],yt=et[1];Object(E.useEffect)(function(){window.addEventListener("click",function(){se(!1),yt({})})},[]),Object(E.useEffect)(function(){if(ge){var vt={},bt=[];ge.forEach(function(ft){var At=ft.sub_discipline,Ut=Object(v.a)(ft,["sub_discipline"]);At&&(vt[At.id]=Object(o.a)(Object(o.a)({},Ut),{},{sub_disciplines:[At]}),bt.push(At.id))}),Ke({ids:bt,data:Object.values(vt),objData:vt}),ce(bt)}},[ge]);var st=function(){return D.a.createElement("div",{className:ae.a.emptyWrap},D.a.createElement(be.a,{image:be.a.PRESENTED_IMAGE_SIMPLE}))},rt=function(bt){if(Le.ids.includes(bt.id))return!1;var ft=Qe.sub_disciplines,At=Object(v.a)(Qe,["sub_disciplines"]),Ut=Object(o.a)(Object(o.a)({},Le.objData),{},Object(ue.a)({},bt.id,Object(o.a)(Object(o.a)({},At),{},{sub_disciplines:[bt]})));Ke({ids:[].concat(Object(I.a)(Le.ids),[bt.id]),data:Object.values(Ut),objData:Ut}),ce([].concat(Object(I.a)(Le.ids),[bt.id]))},Tt=function(bt){var ft=Le.objData;delete ft[bt];var At=Le.ids.filter(function(Ut){return Ut!==bt});Ke({data:Object.values(ft),objData:ft,ids:At}),ce(At)},mt=45;return J&&J.current&&J.current.clientHeight>45&&(mt=J.current.clientHeight+5),D.a.createElement("div",{className:ae.a.cascaderContainer,onClick:function(bt){bt.stopPropagation()}},D.a.createElement("div",{ref:J,className:ae.a.valueWrap,onClick:function(){return se(!ne)}},Le.data.length===0&&D.a.createElement("span",{className:ae.a.placeholder},Ie||"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B"),Le.data.map(function(vt){return D.a.createElement("div",{className:ae.a.valueItem,key:vt.id},D.a.createElement("span",null,vt.name),D.a.createElement("span",null,"/"),D.a.createElement("span",null,vt.sub_disciplines[0].name),D.a.createElement("span",{onClick:function(ft){ft.stopPropagation(),ft.preventDefault(),Tt(vt.sub_disciplines[0].id)}},D.a.createElement($.a,null)))})),ne&&D.a.createElement("div",{className:ae.a.modalWrap,style:{top:mt}},D.a.createElement("div",{className:ae.a.left},we.length===0&&st(),we.length>0&&we.map(function(vt){return D.a.createElement("div",{key:vt.id,onClick:function(){return yt(vt)}},D.a.createElement("span",null,vt.name),D.a.createElement("span",null,D.a.createElement(re.a,null)))})),Qe.sub_disciplines&&D.a.createElement("div",{className:ae.a.right},Qe.sub_disciplines.length===0&&st(),Qe.sub_disciplines.length>0&&Qe.sub_disciplines.map(function(vt){var bt=Le.ids.includes(vt.id);return D.a.createElement("div",{key:vt.id,className:bt?ae.a.disabled:"",onClick:function(){return rt(vt)}},vt.name)}))))},V=ie,Y=te("2qtc"),Z=te("kLXV"),le=te("6UJt"),xe=te("DFOY"),he=te("wd/R"),Te=te.n(he),De=te("jO45"),Pe=te("jN4g"),Be=te("gJ3r"),Me=te("8pgt"),ke=te.n(Me),Ve=function(je,we){return we.some(function(Ie){return Ie.label.toLowerCase().indexOf(je.toLowerCase())>-1})},Se=i.a.TextArea,Re=function(je){var we=je.newCourse,Ie=je.globalSetting,ge=je.loading,ce=je.dispatch,me=je.schoolName,q=je.onSuccess,ne=q===void 0?function(){}:q,se=Object(v.a)(je,["newCourse","globalSetting","loading","dispatch","schoolName","onSuccess"]),pe=h.a.useForm(),ye=Object(S.a)(pe,1),Le=ye[0];Object(E.useEffect)(function(){Le.setFieldsValue({name:me})},[me]);var Ke=function(){var Je=Object(T.a)(m.a.mark(function et(Qe){var yt,st,rt,Tt,mt,vt,bt;return m.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return yt=Qe||{},st=yt.name,rt=yt.city,Tt=rt===void 0?[]:rt,mt=yt.address,vt=yt.remarks,At.next=3,ce({type:"newCourse/appplySchool",payload:{name:st,province:Tt[0],city:Tt[1],address:mt,remarks:vt}});case 3:bt=At.sent,ce({type:"newCourse/setActionTabs",payload:{}}),bt&&(d.b.success("\u65B0\u589E\u53D1\u5E03\u5355\u4F4D\u6210\u529F\uFF01"),ne(st));case 6:case"end":return At.stop()}},et)}));return function(Qe){return Je.apply(this,arguments)}}();return D.a.createElement(Z.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:we.actionTabs.key==="NewCourse-AppplySchool",title:"\u7533\u8BF7\u53D1\u5E03\u5355\u4F4D",width:"600px",footer:null},D.a.createElement(h.a,{className:ke.a.formWrap,form:Le,labelCol:{span:4},wrapperCol:{span:20},onFinish:Ke},D.a.createElement(h.a.Item,{label:"\u53D1\u5E03\u5355\u4F4D\uFF1A",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B66\u6821\u6216\u5DE5\u4F5C\u5355\u4F4D"}]},D.a.createElement(i.a,{placeholder:"\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D"})),D.a.createElement("div",{className:"".concat(ke.a.flexRow," ").concat(ke.a.example)},D.a.createElement("div",null,"\u793A\u4F8B\uFF1A"),D.a.createElement("div",{className:ke.a.flexColumn},D.a.createElement("div",null,D.a.createElement(De.a,{style:{color:"rgb(82, 196, 26)"}}),D.a.createElement("span",{className:"font14 ml5"},"\u6B63\u786E\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u6784")),D.a.createElement("div",null,D.a.createElement(Pe.a,{style:{color:"red"}}),D.a.createElement("span",{className:"font14 ml5"},"\u9519\u8BEF\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u6784",Te()().format("YYYY"),"\u6625")))),D.a.createElement(h.a.Item,{label:"\u5730\u533A\uFF1A",name:"city"},D.a.createElement(xe.a,{allowClear:!0,size:"large",options:Be.a,placeholder:"\u8BF7\u9009\u62E9\u6240\u5728\u5730",showSearch:{matchInputWidth:!0,filter:Ve}})),D.a.createElement(h.a.Item,{label:"\u8BE6\u7EC6\u5730\u5740\uFF1A",name:"address"},D.a.createElement(i.a,{placeholder:"\u8BF7\u586B\u5199\u5B8C\u6574\u7684\u5730\u5740\u4FE1\u606F"})),D.a.createElement(h.a.Item,{label:"\u8BF4\u660E\uFF1A",name:"remarks"},D.a.createElement(Se,{placeholder:"\u518D\u6B21\u8BF4\u660E\u7279\u522B\u60C5\u51B5\uFF08\u9009\u586B\uFF09"})),D.a.createElement("div",{className:ke.a.footerWrap},D.a.createElement(h.a.Item,null,D.a.createElement(H.a,{className:"mr5",size:"large",onClick:function(){ce({type:"newCourse/setActionTabs",payload:{}})}},"\u53D6\u6D88"),D.a.createElement(H.a,{size:"large",type:"primary",htmlType:"submit",loading:ge["newCourse/appplySchool"]},"\u4FDD\u5B58")))))},_e=Object(U.a)(function(He){var je=He.newCourse,we=He.loading,Ie=He.globalSetting;return{newCourse:je,globalSetting:Ie,loading:we.effects}})(Re),Ne=i.a.TextArea,Fe=f.a.TreeNode,Ue=function(je){var we,Ie,ge=je.user,ce=je.newCourse,me=je.globalSetting,q=je.loading,ne=je.dispatch,se=Object(v.a)(je,["user","newCourse","globalSetting","loading","dispatch"]),pe=h.a.useForm(),ye=Object(S.a)(pe,1),Le=ye[0],Ke=Object(E.useState)({}),Je=Object(S.a)(Ke,2),et=Je[0],Qe=Je[1],yt=Object(E.useState)(),st=Object(S.a)(yt,2),rt=st[0],Tt=st[1],mt=Object(E.useRef)(),vt=Object(E.useState)(!0),bt=Object(S.a)(vt,2),ft=bt[0],At=bt[1],Ut=Object(E.useState)(!1),Wt=Object(S.a)(Ut,2),Jt=Wt[0],Rt=Wt[1],Lr=Object(E.useState)(),Qt=Object(S.a)(Lr,2),zt=Qt[0],dr=Qt[1],_t=Object(E.useState)(!0),nt=Object(S.a)(_t,2),Yt=nt[0],gr=nt[1],er=Object(E.useState)(!1),St=Object(S.a)(er,2),rr=St[0],$t=St[1],sn=Object(E.useState)(!1),Ge=Object(S.a)(sn,2),ct=Ge[0],Zr=Ge[1],Or=Object(E.useState)(-1),qr=Object(S.a)(Or,2),Rr=qr[0],ln=qr[1],ht=Object(E.useState)(!0),Nr=Object(S.a)(ht,2),Ye=Nr[0],Hr=Nr[1],ir=Object(E.useState)([]),pn=Object(S.a)(ir,2),cr=pn[0],yr=pn[1],Zt=Object(E.useState)([]),jt=Object(S.a)(Zt,2),Mt=jt[0],xt=jt[1],nr=Object(E.useState)([]),fr=Object(S.a)(nr,2),Kt=fr[0],Sr=fr[1],Ur=Object(E.useState)([]),kr=Object(S.a)(Ur,2),Vt=kr[0],Ft=kr[1];Object(E.useEffect)(function(){var Lt,lt;_r(),Fr(),mt.current=(Lt=se.match.params)===null||Lt===void 0?void 0:Lt.pathId,Tt(!!mt.current),Object(M.Z)(me==null||((lt=me.setting)===null||lt===void 0)?void 0:lt.name),Le.setFieldsValue({learning_notes_title:"\u8BFE\u7A0B\u987B\u77E5"}),mt.current&&Sn()},[]);var _r=function(){var Lt=Object(T.a)(m.a.mark(function lt(){var tt;return m.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(ee.a)("/api/disciplines.json",{method:"get",params:{source:"subject"}});case 2:tt=Pt.sent,Sr(tt.disciplines);case 4:case"end":return Pt.stop()}},lt)}));return function(){return Lt.apply(this,arguments)}}(),Fr=function(){var Lt=Object(T.a)(m.a.mark(function lt(){var tt;return m.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Hr(!0),Pt.next=3,ne({type:"newCourse/getSchoolOption"});case 3:tt=Pt.sent,Hr(!1),yr(tt==null?void 0:tt.schools),xt(tt==null?void 0:tt.schools);case 7:case"end":return Pt.stop()}},lt)}));return function(){return Lt.apply(this,arguments)}}(),Xt=function(){var lt,tt;if(se!=null&&(lt=se.location)!==null&<!==void 0&&(tt=lt.query)!==null&&tt!==void 0&&tt.username){var or,Pt;U.d.push("/users/".concat(se==null||((or=se.location)===null||or===void 0||((Pt=or.query)===null||Pt===void 0))?void 0:Pt.username,"/paths"));return}U.d.push(rt?"/paths/".concat(mt.current):"/paths")},Sn=function(){var Lt=Object(T.a)(m.a.mark(function lt(){var tt,or,Pt,hr,en,un,Gr,Br,jr,dn,mn,pr,vn;return m.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,ne({type:"newCourse/getEditCourseData",payload:{id:mt.current}});case 2:tt=tn.sent,tt&&(Gr={name:tt.name,name_en:tt.name_en,intro:tt.description,content:tt==null||((or=tt.toast)===null||or===void 0)?void 0:or.content,notice:tt.learning_notes,school_id:tt==null?void 0:tt.school,learning_notes_title:tt.learning_notes_title||"\u8BFE\u7A0B\u987B\u77E5"},tt.disciplines&&tt.disciplines.length>0&&Ft(tt.disciplines),Le.setFieldsValue(Gr),Zr(tt==null||((Pt=tt.toast)===null||Pt===void 0)?void 0:Pt.is_open),ln(tt==null||((hr=tt.toast)===null||hr===void 0)?void 0:hr.open_num),At(tt==null?void 0:tt.cust_seq),Rt(tt==null?void 0:tt.show_spoc),$t(tt==null?void 0:tt.show_history),gr(tt==null?void 0:tt.show_tag),(tt==null||((en=tt.attachments)===null||en===void 0)?void 0:en.length)>0&&dr([{uid:tt==null||((Br=tt.attachments)===null||Br===void 0||((jr=Br[0])===null||jr===void 0))?void 0:jr.id,name:tt==null||((dn=tt.attachments)===null||dn===void 0||((mn=dn[0])===null||mn===void 0))?void 0:mn.title,response:{id:tt==null||((pr=tt.attachments)===null||pr===void 0||((vn=pr[0])===null||vn===void 0))?void 0:vn.id}}]),Qe({name:tt.name,intro:tt.description,notice:tt.learning_notes,content:tt==null||((un=tt.toast)===null||un===void 0)?void 0:un.content}));case 4:case"end":return tn.stop()}},lt)}));return function(){return Lt.apply(this,arguments)}}(),Cr=function(){var Lt=Object(T.a)(m.a.mark(function lt(tt){var or,Pt,hr,en,un,Gr,Br,jr,dn,mn,pr,vn,yn,tn,rn;return m.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(hr=tt||{},en=hr.name,un=hr.intro,Gr=hr.notice,Br=hr.name_en,jr=hr.learning_notes_title,dn=hr.sub_discipline_ids,mn=hr.school_id,pr=rt?"newCourse/editCourse":"newCourse/submitCourse",vn=!1,yn=null,cr.map(function(nn){mn===nn.name&&(vn=!0,yn=nn.id)}),vn){cn.next=7;break}return cn.abrupt("return",d.b.error("\u672A\u627E\u5230\u5305\u542B'".concat(mn,"'\u7684\u53D1\u5E03\u5355\u4F4D")));case 7:return tn={id:mt.current,name:en,name_en:Br,description:un,learning_notes:Gr,cust_seq:ft,show_spoc:Jt,school_id:yn,show_tag:Yt,show_history:rr,learning_notes_title:jr,attachment_ids:[zt==null||((or=zt[0])===null||or===void 0||((Pt=or.response)===null||Pt===void 0))?void 0:Pt.id],sub_discipline_ids:dn,subject_toast_attributes:{is_open:ct,open_num:Rr,content:tt.content}},cn.next=10,ne({type:pr,payload:Object(o.a)({},tn)});case 10:rn=cn.sent,(rn==null?void 0:rn.subject_id)&&U.d.push("/paths/".concat(rn.subject_id));case 12:case"end":return cn.stop()}},lt)}));return function(tt){return Lt.apply(this,arguments)}}(),wr=function(){ne({type:"newCourse/setActionTabs",payload:{key:"NewCourse-AppplySchool"}})},Jn=function(lt){Fr(),Qe(Object(o.a)({},Le.getFieldsValue()))};return D.a.createElement("div",{className:k.a.wrap},D.a.createElement("div",{className:k.a.bg},D.a.createElement("div",{className:k.a.crumbs},D.a.createElement("span",null,"\u5B9E\u8DF5\u8BFE\u7A0B"),D.a.createElement("i",{className:"iconfont icon-zhankai1"}),D.a.createElement("b",null,rt?"\u7F16\u8F91":"\u521B\u5EFA","\u5B9E\u8DF5\u8BFE\u7A0B")),D.a.createElement("div",{className:k.a.titleWrap},D.a.createElement("span",null,rt?"\u7F16\u8F91":"\u521B\u5EFA","\u5B9E\u8DF5\u8BFE\u7A0B"),D.a.createElement("b",{onClick:Xt},"\u8FD4\u56DE")),D.a.createElement(h.a,{form:Le,className:k.a.formWrap,scrollToFirstError:!0,layout:"vertical",colon:!1,onValuesChange:function(){var lt=Le.getFieldsValue();"school_id"in lt&&xt(cr.filter(function(tt){return tt.name.includes(lt.school_id)})),Qe(Object(o.a)({},lt))},onFinish:Cr},D.a.createElement("div",{className:k.a.fieldWrap},D.a.createElement(h.a.Item,{extra:D.a.createElement("div",{className:"tr c-grey-333 font12 mt3"},"".concat(((we=et.name)===null||we===void 0?void 0:we.length)||0,"/60")),name:"name",label:"\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0"}]},D.a.createElement(Ne,{maxLength:60,placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"})),D.a.createElement(h.a.Item,{name:"name_en",label:"\u82F1\u6587\u8BFE\u7A0B\u540D\u79F0",rules:[{message:"\u8BF7\u8F93\u5165\u82F1\u6587\u8BFE\u7A0B\u540D\u79F0"}]},D.a.createElement(i.a,{maxLength:200,placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A",addonAfter:"".concat(((Ie=et.name_en)===null||Ie===void 0?void 0:Ie.length)||0,"/200")})),D.a.createElement(h.a.Item,{name:"sub_discipline_ids",label:"\u65B9\u5411&\u8BFE\u7A0B"},D.a.createElement(V,{defaultValue:Vt,dataSource:Kt,onChange:function(lt){return Le.setFieldsValue({sub_discipline_ids:lt})}})),D.a.createElement(h.a.Item,{label:"\u53D1\u5E03\u5355\u4F4D",name:"school_id",wrapperCol:{span:24},extra:!Ye&&et.school_id&&!(cr!=null&&cr.find(function(Lt){return Lt.name===et.school_id}))&&D.a.createElement("div",{className:k.a.schoolHintWrap},D.a.createElement("span",{className:k.a.colorCDCDCD},"\u672A\u627E\u5230\u5305\u542B\u201C",et.school_id,"\u201D\u7684\u53D1\u5E03\u5355\u4F4D\uFF0C"),D.a.createElement("span",{className:"".concat(k.a.color0152d9),onClick:wr},"\u7533\u8BF7\u65B0\u589E")),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D"}]},D.a.createElement(c.a,{placeholder:"\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D",showSearch:!0,size:"large",options:Mt==null?void 0:Mt.map(function(Lt){return{value:Lt.name}})}))),D.a.createElement("div",{className:k.a.mdWrap},D.a.createElement(h.a.Item,{name:"intro",label:"\u7B80\u4ECB",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u7B80\u4ECB"},{max:8e3,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u7B80\u4ECB\u6700\u5927\u9650\u52368000\u4E2A\u5B57\u7B26"}]},D.a.createElement(j.a,{watch:!0,defaultValue:et.intro}))),D.a.createElement("div",{className:k.a.mdWrap},D.a.createElement(R.a,{align:"top",className:"mb10 mt10"},D.a.createElement(b.a,null,D.a.createElement("span",{className:"c-red mr10"},"*")),D.a.createElement(b.a,{flex:"1"},D.a.createElement(h.a.Item,{name:"learning_notes_title",label:"",style:{marginBottom:0},rules:[{required:!0,message:"\u8BF7\u8F93\u8BFE\u7A0B\u987B\u77E5\u6807\u9898"},{max:15,message:"\u8BF7\u8F93\u8BFE\u7A0B\u987B\u77E5\u6807\u9898\u6700\u5927\u9650\u523615\u4E2A\u5B57\u7B26"}]},D.a.createElement(i.a,{style:{height:38},placeholder:"\u8BF7\u8F93\u5165"})))),D.a.createElement(h.a.Item,{name:"notice",label:"",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u987B\u77E5"},{max:1e4,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u987B\u77E5\u6700\u5927\u9650\u523610000\u4E2A\u5B57\u7B26"}]},D.a.createElement(j.a,{insertTemp:"1",watch:!0,defaultValue:et.notice}))),D.a.createElement("div",{className:k.a.mdWrap},D.a.createElement("div",{style:{display:"flex",alignItems:"center"}},D.a.createElement(y.a,{checked:ct,style:{marginRight:11,minWidth:32},onChange:function(lt){Zr(lt)}}),D.a.createElement("span",{className:k.a.spanText},"\u8BFE\u7A0B\u63D0\u793A",D.a.createElement("span",null,"\uFF08\u8FDB\u5165\u8BFE\u7A0B\u8BE6\u60C5\u9875\uFF0C\u63D0\u793A\u5185\u5BB9\u4EE5\u5F39\u7A97\u7684\u5F62\u5F0F\u8FDB\u884C\u5C55\u793A\uFF09"))),ct&&D.a.createElement(h.a.Item,{style:{marginTop:10},name:"content",label:"",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u63D0\u793A"},{max:1e4,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u63D0\u793A\u6700\u5927\u9650\u523610000\u4E2A\u5B57\u7B26"}]},D.a.createElement(j.a,{insertTemp:"1",watch:!0,defaultValue:et.content})),ct&&D.a.createElement("div",{style:{marginTop:20,borderBottom:"1px solid #DBDCE0",paddingBottom:7}},D.a.createElement("label",{style:{color:"#000",marginRight:10}},"\u63D0\u793A\u6B21\u6570"),D.a.createElement(_.a.Group,{value:Rr,onChange:function(lt){ln(lt.target.value)}},D.a.createElement(_.a,{className:"c-black",value:-1},"\u6BCF\u6B21"),D.a.createElement(_.a,{className:"ml20 c-black",value:1},"\u4E00\u6B21")))),D.a.createElement("div",{className:k.a.mdWrap,style:{marginTop:25}},D.a.createElement(B.a,{checked:ft,onChange:function(lt){At(lt==null?void 0:lt.target.checked)}},D.a.createElement("span",{className:k.a.spanText},"\u5C55\u793A\u9ED8\u8BA4\u7AE0\u8282\u5E8F\u53F7",D.a.createElement("span",null,"\uFF08\u9009\u4E2D\u5219\u6309\u5E8F\u5C55\u793A\u6240\u7AE0\u8282\u5E8F\u53F7\uFF0C\u4E0D\u9009\u4E2D\u5219\u9690\u85CF\u9ED8\u8BA4\u6392\u5E8F\uFF09"))),D.a.createElement("br",null),D.a.createElement(B.a,{style:{marginTop:"10px"},checked:Jt,onChange:function(lt){return Rt(lt==null?void 0:lt.target.checked)}},D.a.createElement("span",{className:k.a.spanText},"\u81EA\u9009\u5E76\u5C55\u793ASPOC\u8BFE\u5802",D.a.createElement("span",null,"\uFF08\u9009\u4E2D\u5219\u7ED9\u51FASPOC\u8BFE\u5802\u5C55\u793A\u533A\u57DF\uFF0C\u8BFE\u7A0B\u521B\u5EFA\u8005/\u5408\u4F5C\u8005\u53EF\u4EE5\u81EA\u4E3B\u6DFB\u52A0\u9700\u8981\u5C55\u793A\u7684\u8BFE\u5802\uFF09"))),D.a.createElement("br",null),D.a.createElement(B.a,{style:{marginTop:"10px"},checked:Yt,onChange:function(lt){return gr(lt==null?void 0:lt.target.checked)}},D.a.createElement("span",{className:k.a.spanText},"\u5C55\u793A\u6280\u672F\u6807\u7B7E\u6A21\u5757",D.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u5C55\u793A\u8BFE\u7A0B\u7684\u6280\u80FD\u6807\u7B7E\uFF0C\u4E0D\u9009\u4E2D\u5219\u4E0D\u5C55\u793A\u8BE5\u6A21\u5757\uFF09"))),D.a.createElement("br",null),D.a.createElement(B.a,{style:{marginTop:"10px"},checked:rr,onChange:function(lt){return $t(lt==null?void 0:lt.target.checked)}},D.a.createElement("span",{className:k.a.spanText},"\u5C55\u793A\u5386\u53F2\u8BFE\u5802\u6A21\u5757",D.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u5C55\u793A\u8BFE\u7A0B\u7684\u5386\u53F2\u8BFE\u5802\uFF0C\u4E0D\u9009\u4E2D\u5219\u4E0D\u5C55\u793A\u8BE5\u6A21\u5757\uFF09"))),D.a.createElement("br",null),D.a.createElement("div",{className:"mt10"},D.a.createElement("div",{className:"c-black mb10"},"\u81EA\u5B9A\u4E49\u9876\u90E8\u80CC\u666F\u56FE"),D.a.createElement(z.a,{action:G.a.API_SERVER+"/api/attachments.json",withCredentials:!0,fileList:zt,onChange:function(lt){var tt,or=(lt==null?void 0:lt.file.size)/1024/1024<2;if(!((tt=lt.fileList)!==null&&tt!==void 0&&tt.length))return!1;if(!or)dr(Object(I.a)(zt));else{var Pt;dr(lt==null||((Pt=lt.fileList)===null||Pt===void 0)?void 0:Pt.slice(-1))}},beforeUpload:function(lt){var tt=lt.type==="image/jpeg"||lt.type==="image/png";if(!tt)return d.b.error("\u53EA\u80FD\u4E0A\u4F20jpg \u6216\u8005png\u56FE\u7247"),!1;var or=lt.size/1024/1024<2;return or?tt&&or:(d.b.error("\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u5927\u4E8E2m"),!1)},onRemove:function(lt){dr([])}},D.a.createElement("div",{className:k.a.aBtn},"\u4E0A\u4F20\u56FE\u7247"),D.a.createElement("span",{style:{color:"#5F6367",pointerEvents:"none"}},"\uFF08\u672C\u9879\u975E\u5FC5\u9700\u3002\u5982\u4E0D\u4E0A\u4F20\uFF0C\u5219\u4F7F\u7528\u7CFB\u7EDF\u9ED8\u8BA4\u56FE\u7247\uFF1B\u5982\u4E0A\u4F20\uFF0C\u8BF7\u9009\u62E9jpg\u3001png\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC72M\uFF0C\u5EFA\u8BAE\u5C3A\u5BF81920*240\u50CF\u7D20\uFF09")))),D.a.createElement("div",{className:k.a.backgroundFa},D.a.createElement("div",{className:k.a.bBtn,onClick:Xt},"\u53D6\u6D88"),D.a.createElement(H.a,{className:k.a.cBtn,onClick:function(){return Le.submit()},loading:q["newCourse/editCourse"]||q["newCourse/submitCourse"]},"\u63D0\u4EA4 "))),D.a.createElement(_e,{schoolName:et.school_id,onSuccess:Jn})))},Ce=Xe.default=Object(U.a)(function(He){var je=He.user,we=He.newCourse,Ie=He.loading,ge=He.globalSetting;return{user:je,newCourse:we,globalSetting:ge,loading:Ie.effects}})(Ue)},XIdC:function(ot,Xe,te){"use strict";var oe=te("rePB"),H=te("ODXe"),L=te("Ff2n"),z=te("cDcd"),I=te.n(z),P=te("TSYQ"),B=te.n(P),N=te("6cGi"),_=te("4IlW"),O=z.forwardRef(function(y,C){var R,A=y.prefixCls,b=A===void 0?"rc-switch":A,g=y.className,c=y.checked,o=y.defaultChecked,u=y.disabled,d=y.loadingIcon,T=y.checkedChildren,p=y.unCheckedChildren,h=y.onClick,S=y.onChange,v=y.onKeyDown,l=Object(L.a)(y,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),f=Object(N.a)(!1,{value:c,defaultValue:o}),s=Object(H.a)(f,2),i=s[0],x=s[1];function m(j,K){var k=i;return u||(k=j,x(k),S==null||S(k,K)),k}function E(j){j.which===_.a.LEFT?m(!1,j):j.which===_.a.RIGHT&&m(!0,j),v==null||v(j)}function D(j){var K=m(!i,j);h==null||h(K,j)}var U=B()(b,g,(R={},Object(oe.a)(R,"".concat(b,"-checked"),i),Object(oe.a)(R,"".concat(b,"-disabled"),u),R));return z.createElement("button",Object.assign({},l,{type:"button",role:"switch","aria-checked":i,disabled:u,className:U,ref:C,onKeyDown:E,onClick:D}),d,z.createElement("span",{className:"".concat(b,"-inner")},i?T:p))});O.displayName="Switch",Xe.a=O},Y1PL:function(ot,Xe,te){"use strict";te.r(Xe),te.d(Xe,"ResizableTextArea",function(){return ue});var oe=te("wx14"),H=te("1OyB"),L=te("vuIU"),z=te("Ji7U"),I=te("LK+K"),P=te("cDcd"),B=te("VTBJ"),N=te("rePB"),_=te("Zm9Q"),O=te("Kwbf"),y=te("c+Xe"),C=te("m+aA"),R=te("bdgK"),A=new Map;function b(Ee){Ee.forEach(function(ae){var $,re=ae.target;($=A.get(re))===null||$===void 0||$.forEach(function(J){return J(re)})})}var g=new R.default(b),c=null,o=null;function u(Ee,ae){A.has(Ee)||(A.set(Ee,new Set),g.observe(Ee)),A.get(Ee).add(ae)}function d(Ee,ae){A.has(Ee)&&(A.get(Ee).delete(ae),A.get(Ee).size||(g.unobserve(Ee),A.delete(Ee)))}var T=function(Ee){Object(z.a)($,Ee);var ae=Object(I.a)($);function $(){return Object(H.a)(this,$),ae.apply(this,arguments)}return Object(L.a)($,[{key:"render",value:function(){return this.props.children}}]),$}(P.Component),p=P.createContext(null);function h(Ee){var ae=Ee.children,$=Ee.onBatchResize,re=P.useRef(0),J=P.useRef([]),ie=P.useContext(p),V=P.useCallback(function(Y,Z,le){re.current+=1;var xe=re.current;J.current.push({size:Y,element:Z,data:le}),Promise.resolve().then(function(){xe===re.current&&($==null||$(J.current),J.current=[])}),ie==null||ie(Y,Z,le)},[$,ie]);return P.createElement(p.Provider,{value:V},ae)}function S(Ee){var ae=Ee.children,$=Ee.disabled,re=P.useRef(null),J=P.useRef(null),ie=P.useContext(p),V=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Y=P.isValidElement(ae)&&Object(y.c)(ae),Z=Y?ae.ref:null,le=P.useMemo(function(){return Object(y.a)(Z,re)},[Z,re]),xe=P.useRef(Ee);xe.current=Ee;var he=P.useCallback(function(Te){var De=xe.current,Pe=De.onResize,Be=De.data,Me=Te.getBoundingClientRect(),ke=Me.width,Ve=Me.height,Se=Te.offsetWidth,Re=Te.offsetHeight,_e=Math.floor(ke),Ne=Math.floor(Ve);if(V.current.width!==_e||V.current.height!==Ne||V.current.offsetWidth!==Se||V.current.offsetHeight!==Re){var Fe={width:_e,height:Ne,offsetWidth:Se,offsetHeight:Re};V.current=Fe;var Ue=Se===Math.round(ke)?ke:Se,Ce=Re===Math.round(Ve)?Ve:Re,He=Object(B.a)(Object(B.a)({},Fe),{},{offsetWidth:Ue,offsetHeight:Ce});ie==null||ie(He,Te,Be),Pe&&Promise.resolve().then(function(){Pe(He,Te)})}},[]);return P.useEffect(function(){var Te=Object(C.a)(re.current)||Object(C.a)(J.current);return Te&&!$&&u(Te,he),function(){return d(Te,he)}},[re.current,$]),P.createElement(T,{ref:J},Y?P.cloneElement(ae,{ref:le}):ae)}var v="rc-observer-key";function l(Ee){var ae=Ee.children,$=Object(_.a)(ae);return $.map(function(re,J){var ie=(re==null?void 0:re.key)||"".concat(v,"-").concat(J);return P.createElement(S,Object(oe.a)({},Ee,{key:ie}),re)})}l.Collection=h;var f=l,s=te("bT9E"),i=te("TSYQ"),x=te.n(i),m=`
|
|
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
|
|
`,E=["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"],D={},U;function j(Ee){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(ae&&D[$])return D[$];var re=window.getComputedStyle(Ee),J=re.getPropertyValue("box-sizing")||re.getPropertyValue("-moz-box-sizing")||re.getPropertyValue("-webkit-box-sizing"),ie=parseFloat(re.getPropertyValue("padding-bottom"))+parseFloat(re.getPropertyValue("padding-top")),V=parseFloat(re.getPropertyValue("border-bottom-width"))+parseFloat(re.getPropertyValue("border-top-width")),Y=E.map(function(le){return"".concat(le,":").concat(re.getPropertyValue(le))}).join(";"),Z={sizingStyle:Y,paddingSize:ie,borderSize:V,boxSizing:J};return ae&&$&&(D[$]=Z),Z}function K(Ee){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,re=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 J=j(Ee,ae),ie=J.paddingSize,V=J.borderSize,Y=J.boxSizing,Z=J.sizingStyle;U.setAttribute("style","".concat(Z,";").concat(m)),U.value=Ee.value||Ee.placeholder||"";var le=Number.MIN_SAFE_INTEGER,xe=Number.MAX_SAFE_INTEGER,he=U.scrollHeight,Te;if(Y==="border-box"?he+=V:Y==="content-box"&&(he-=ie),$!==null||re!==null){U.value=" ";var De=U.scrollHeight-ie;$!==null&&(le=De*$,Y==="border-box"&&(le=le+ie+V),he=Math.max(le,he)),re!==null&&(xe=De*re,Y==="border-box"&&(xe=xe+ie+V),Te=he>xe?"":"hidden",he=Math.min(xe,he))}return{height:he,minHeight:le,maxHeight:xe,overflowY:Te,resize:"none"}}var k=te("Gytx"),M=te.n(k),G;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(G||(G={}));var ee=function(Ee){Object(z.a)($,Ee);var ae=Object(I.a)($);function $(re){var J;return Object(H.a)(this,$),J=ae.call(this,re),J.nextFrameActionId=void 0,J.resizeFrameId=void 0,J.textArea=void 0,J.saveTextArea=function(ie){J.textArea=ie},J.handleResize=function(ie){var V=J.state.resizeStatus,Y=J.props,Z=Y.autoSize,le=Y.onResize;if(V!==G.NONE)return;typeof le=="function"&&le(ie),Z&&J.resizeOnNextFrame()},J.resizeOnNextFrame=function(){cancelAnimationFrame(J.nextFrameActionId),J.nextFrameActionId=requestAnimationFrame(J.resizeTextarea)},J.resizeTextarea=function(){var ie=J.props.autoSize;if(!ie||!J.textArea)return;var V=ie.minRows,Y=ie.maxRows,Z=K(J.textArea,!1,V,Y);J.setState({textareaStyles:Z,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(J.resizeFrameId),J.resizeFrameId=requestAnimationFrame(function(){J.setState({resizeStatus:G.RESIZED},function(){J.resizeFrameId=requestAnimationFrame(function(){J.setState({resizeStatus:G.NONE}),J.fixFirefoxAutoScroll()})})})})},J.renderTextArea=function(){var ie=J.props,V=ie.prefixCls,Y=V===void 0?"rc-textarea":V,Z=ie.autoSize,le=ie.onResize,xe=ie.className,he=ie.disabled,Te=J.state,De=Te.textareaStyles,Pe=Te.resizeStatus,Be=Object(s.a)(J.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Me=x()(Y,xe,Object(N.a)({},"".concat(Y,"-disabled"),he));"value"in Be&&(Be.value=Be.value||"");var ke=Object(B.a)(Object(B.a)(Object(B.a)({},J.props.style),De),Pe===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(f,{onResize:J.handleResize,disabled:!(Z||le)},P.createElement("textarea",Object(oe.a)({},Be,{className:Me,style:ke,ref:J.saveTextArea})))},J.state={textareaStyles:{},resizeStatus:G.NONE},J}return Object(L.a)($,[{key:"componentDidUpdate",value:function(J){(J.value!==this.props.value||!M()(J.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 J=this.textArea.selectionStart,ie=this.textArea.selectionEnd;this.textArea.setSelectionRange(J,ie)}}catch(V){}}},{key:"render",value:function(){return this.renderTextArea()}}]),$}(P.Component),ue=ee,de=function(Ee){Object(z.a)($,Ee);var ae=Object(I.a)($);function $(re){var J;Object(H.a)(this,$),J=ae.call(this,re),J.resizableTextArea=void 0,J.focus=function(){J.resizableTextArea.textArea.focus()},J.saveTextArea=function(V){J.resizableTextArea=V},J.handleChange=function(V){var Y=J.props.onChange;J.setValue(V.target.value,function(){J.resizableTextArea.resizeTextarea()}),Y&&Y(V)},J.handleKeyDown=function(V){var Y=J.props,Z=Y.onPressEnter,le=Y.onKeyDown;V.keyCode===13&&Z&&Z(V),le&&le(V)};var ie=typeof re.value=="undefined"||re.value===null?re.defaultValue:re.value;return J.state={value:ie},J}return Object(L.a)($,[{key:"setValue",value:function(J,ie){"value"in this.props||this.setState({value:J},ie)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(ue,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(J){return"value"in J?{value:J.value}:null}}]),$}(P.Component),be=Xe.default=de},YNHc:function(ot,Xe,te){ot.exports={cascaderContainer:"cascaderContainer___3XtEo",valueWrap:"valueWrap___3ID8a",valueItem:"valueItem___yKIZs",placeholder:"placeholder___MxiA7",modalWrap:"modalWrap___1ge9B",left:"left___10iyZ",right:"right___KVnmg",disabled:"disabled___2c8qt",emptyWrap:"emptyWrap___dYSJ0"}},ZpRC:function(ot,Xe,te){"use strict";function oe(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function H(y,C){return(!C||y!=="hidden")&&y!=="visible"&&y!=="clip"}function L(y,C){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var R=getComputedStyle(y,null);return H(R.overflowY,C)||H(R.overflowX,C)||function(A){var b=function(g){if(!g.ownerDocument||!g.ownerDocument.defaultView)return null;try{return g.ownerDocument.defaultView.frameElement}catch(c){return null}}(A);return!!b&&(b.clientHeight<A.scrollHeight||b.clientWidth<A.scrollWidth)}(y)}return!1}function z(y,C,R,A,b,g,c,o){return g<y&&c>C||g>y&&c<C?0:g<=y&&o<=R||c>=C&&o>=R?g-y-A:c>C&&o<R||g<y&&o>R?c-C+b:0}var I=function(y,C){var R=window,A=C.scrollMode,b=C.block,g=C.inline,c=C.boundary,o=C.skipOverflowHiddenElements,u=typeof c=="function"?c:function(De){return De!==c};if(!oe(y))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,T=[],p=y;oe(p)&&u(p);){if((p=p.parentElement)===d){T.push(p);break}p!=null&&p===document.body&&L(p)&&!L(document.documentElement)||p!=null&&L(p,o)&&T.push(p)}for(var h=R.visualViewport?R.visualViewport.width:innerWidth,S=R.visualViewport?R.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,l=window.scrollY||pageYOffset,f=y.getBoundingClientRect(),s=f.height,i=f.width,x=f.top,m=f.right,E=f.bottom,D=f.left,U=b==="start"||b==="nearest"?x:b==="end"?E:x+s/2,j=g==="center"?D+i/2:g==="end"?m:D,K=[],k=0;k<T.length;k++){var M=T[k],G=M.getBoundingClientRect(),ee=G.height,ue=G.width,de=G.top,be=G.right,Ee=G.bottom,ae=G.left;if(A==="if-needed"&&x>=0&&D>=0&&E<=S&&m<=h&&x>=de&&E<=Ee&&D>=ae&&m<=be)return K;var $=getComputedStyle(M),re=parseInt($.borderLeftWidth,10),J=parseInt($.borderTopWidth,10),ie=parseInt($.borderRightWidth,10),V=parseInt($.borderBottomWidth,10),Y=0,Z=0,le="offsetWidth"in M?M.offsetWidth-M.clientWidth-re-ie:0,xe="offsetHeight"in M?M.offsetHeight-M.clientHeight-J-V:0;if(d===M)Y=b==="start"?U:b==="end"?U-S:b==="nearest"?z(l,l+S,S,J,V,l+U,l+U+s,s):U-S/2,Z=g==="start"?j:g==="center"?j-h/2:g==="end"?j-h:z(v,v+h,h,re,ie,v+j,v+j+i,i),Y=Math.max(0,Y+l),Z=Math.max(0,Z+v);else{Y=b==="start"?U-de-J:b==="end"?U-Ee+V+xe:b==="nearest"?z(de,Ee,ee,J,V+xe,U,U+s,s):U-(de+ee/2)+xe/2,Z=g==="start"?j-ae-re:g==="center"?j-(ae+ue/2)+le/2:g==="end"?j-be+ie+le:z(ae,be,ue,re,ie+le,j,j+i,i);var he=M.scrollLeft,Te=M.scrollTop;U+=Te-(Y=Math.max(0,Math.min(Te+Y,M.scrollHeight-ee+xe))),j+=he-(Z=Math.max(0,Math.min(he+Z,M.scrollWidth-ue+le)))}K.push({el:M,top:Y,left:Z})}return K};function P(y){return y===Object(y)&&Object.keys(y).length!==0}function B(y,C){C===void 0&&(C="auto");var R="scrollBehavior"in document.body.style;y.forEach(function(A){var b=A.el,g=A.top,c=A.left;b.scroll&&R?b.scroll({top:g,left:c,behavior:C}):(b.scrollTop=g,b.scrollLeft=c)})}function N(y){return y===!1?{block:"end",inline:"nearest"}:P(y)?y:{block:"start",inline:"nearest"}}function _(y,C){var R=!y.ownerDocument.documentElement.contains(y);if(P(C)&&typeof C.behavior=="function")return C.behavior(R?[]:I(y,C));if(R)return;var A=N(C);return B(I(y,A),A.behavior)}var O=Xe.a=_},Zss7:function(ot,Xe,te){var oe;(function(H){var L=/^\s+/,z=/\s+$/,I=0,P=H.round,B=H.min,N=H.max,_=H.random;function O(V,Y){if(V=V||"",Y=Y||{},V instanceof O)return V;if(!(this instanceof O))return new O(V,Y);var Z=y(V);this._originalInput=V,this._r=Z.r,this._g=Z.g,this._b=Z.b,this._a=Z.a,this._roundA=P(100*this._a)/100,this._format=Y.format||Z.format,this._gradientType=Y.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=Z.ok,this._tc_id=I++}O.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 V=this.toRgb();return(V.r*299+V.g*587+V.b*114)/1e3},getLuminance:function(){var V=this.toRgb(),Y,Z,le,xe,he,Te;return Y=V.r/255,Z=V.g/255,le=V.b/255,Y<=.03928?xe=Y/12.92:xe=H.pow((Y+.055)/1.055,2.4),Z<=.03928?he=Z/12.92:he=H.pow((Z+.055)/1.055,2.4),le<=.03928?Te=le/12.92:Te=H.pow((le+.055)/1.055,2.4),.2126*xe+.7152*he+.0722*Te},setAlpha:function(V){return this._a=K(V),this._roundA=P(100*this._a)/100,this},toHsv:function(){var V=b(this._r,this._g,this._b);return{h:V.h*360,s:V.s,v:V.v,a:this._a}},toHsvString:function(){var V=b(this._r,this._g,this._b),Y=P(V.h*360),Z=P(V.s*100),le=P(V.v*100);return this._a==1?"hsv("+Y+", "+Z+"%, "+le+"%)":"hsva("+Y+", "+Z+"%, "+le+"%, "+this._roundA+")"},toHsl:function(){var V=R(this._r,this._g,this._b);return{h:V.h*360,s:V.s,l:V.l,a:this._a}},toHslString:function(){var V=R(this._r,this._g,this._b),Y=P(V.h*360),Z=P(V.s*100),le=P(V.l*100);return this._a==1?"hsl("+Y+", "+Z+"%, "+le+"%)":"hsla("+Y+", "+Z+"%, "+le+"%, "+this._roundA+")"},toHex:function(V){return c(this._r,this._g,this._b,V)},toHexString:function(V){return"#"+this.toHex(V)},toHex8:function(V){return o(this._r,this._g,this._b,this._a,V)},toHex8String:function(V){return"#"+this.toHex8(V)},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(k(this._r,255)*100)+"%",g:P(k(this._g,255)*100)+"%",b:P(k(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+P(k(this._r,255)*100)+"%, "+P(k(this._g,255)*100)+"%, "+P(k(this._b,255)*100)+"%)":"rgba("+P(k(this._r,255)*100)+"%, "+P(k(this._g,255)*100)+"%, "+P(k(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(V){var Y="#"+u(this._r,this._g,this._b,this._a),Z=Y,le=this._gradientType?"GradientType = 1, ":"";if(V){var xe=O(V);Z="#"+u(xe._r,xe._g,xe._b,xe._a)}return"progid:DXImageTransform.Microsoft.gradient("+le+"startColorstr="+Y+",endColorstr="+Z+")"},toString:function(V){var Y=!!V;V=V||this._format;var Z=!1,le=this._a<1&&this._a>=0,xe=!Y&&le&&(V==="hex"||V==="hex6"||V==="hex3"||V==="hex4"||V==="hex8"||V==="name");return xe?V==="name"&&this._a===0?this.toName():this.toRgbString():(V==="rgb"&&(Z=this.toRgbString()),V==="prgb"&&(Z=this.toPercentageRgbString()),(V==="hex"||V==="hex6")&&(Z=this.toHexString()),V==="hex3"&&(Z=this.toHexString(!0)),V==="hex4"&&(Z=this.toHex8String(!0)),V==="hex8"&&(Z=this.toHex8String()),V==="name"&&(Z=this.toName()),V==="hsl"&&(Z=this.toHslString()),V==="hsv"&&(Z=this.toHsvString()),Z||this.toHexString())},clone:function(){return O(this.toString())},_applyModification:function(V,Y){var Z=V.apply(null,[this].concat([].slice.call(Y)));return this._r=Z._r,this._g=Z._g,this._b=Z._b,this.setAlpha(Z._a),this},lighten:function(){return this._applyModification(h,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(T,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(l,arguments)},_applyCombination:function(V,Y){return V.apply(null,[this].concat([].slice.call(Y)))},analogous:function(){return this._applyCombination(m,arguments)},complement:function(){return this._applyCombination(f,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(s,arguments)},tetrad:function(){return this._applyCombination(i,arguments)}},O.fromRatio=function(V,Y){if(typeof V=="object"){var Z={};for(var le in V)V.hasOwnProperty(le)&&(le==="a"?Z[le]=V[le]:Z[le]=be(V[le]));V=Z}return O(V,Y)};function y(V){var Y={r:0,g:0,b:0},Z=1,le=null,xe=null,he=null,Te=!1,De=!1;return typeof V=="string"&&(V=J(V)),typeof V=="object"&&(re(V.r)&&re(V.g)&&re(V.b)?(Y=C(V.r,V.g,V.b),Te=!0,De=String(V.r).substr(-1)==="%"?"prgb":"rgb"):re(V.h)&&re(V.s)&&re(V.v)?(le=be(V.s),xe=be(V.v),Y=g(V.h,le,xe),Te=!0,De="hsv"):re(V.h)&&re(V.s)&&re(V.l)&&(le=be(V.s),he=be(V.l),Y=A(V.h,le,he),Te=!0,De="hsl"),V.hasOwnProperty("a")&&(Z=V.a)),Z=K(Z),{ok:Te,format:V.format||De,r:B(255,N(Y.r,0)),g:B(255,N(Y.g,0)),b:B(255,N(Y.b,0)),a:Z}}function C(V,Y,Z){return{r:k(V,255)*255,g:k(Y,255)*255,b:k(Z,255)*255}}function R(V,Y,Z){V=k(V,255),Y=k(Y,255),Z=k(Z,255);var le=N(V,Y,Z),xe=B(V,Y,Z),he,Te,De=(le+xe)/2;if(le==xe)he=Te=0;else{var Pe=le-xe;Te=De>.5?Pe/(2-le-xe):Pe/(le+xe);switch(le){case V:he=(Y-Z)/Pe+(Y<Z?6:0);break;case Y:he=(Z-V)/Pe+2;break;case Z:he=(V-Y)/Pe+4;break}he/=6}return{h:he,s:Te,l:De}}function A(V,Y,Z){var le,xe,he;V=k(V,360),Y=k(Y,100),Z=k(Z,100);function Te(Be,Me,ke){return ke<0&&(ke+=1),ke>1&&(ke-=1),ke<1/6?Be+(Me-Be)*6*ke:ke<1/2?Me:ke<2/3?Be+(Me-Be)*(2/3-ke)*6:Be}if(Y===0)le=xe=he=Z;else{var De=Z<.5?Z*(1+Y):Z+Y-Z*Y,Pe=2*Z-De;le=Te(Pe,De,V+1/3),xe=Te(Pe,De,V),he=Te(Pe,De,V-1/3)}return{r:le*255,g:xe*255,b:he*255}}function b(V,Y,Z){V=k(V,255),Y=k(Y,255),Z=k(Z,255);var le=N(V,Y,Z),xe=B(V,Y,Z),he,Te,De=le,Pe=le-xe;if(Te=le===0?0:Pe/le,le==xe)he=0;else{switch(le){case V:he=(Y-Z)/Pe+(Y<Z?6:0);break;case Y:he=(Z-V)/Pe+2;break;case Z:he=(V-Y)/Pe+4;break}he/=6}return{h:he,s:Te,v:De}}function g(V,Y,Z){V=k(V,360)*6,Y=k(Y,100),Z=k(Z,100);var le=H.floor(V),xe=V-le,he=Z*(1-Y),Te=Z*(1-xe*Y),De=Z*(1-(1-xe)*Y),Pe=le%6,Be=[Z,Te,he,he,De,Z][Pe],Me=[De,Z,Z,Te,he,he][Pe],ke=[he,he,De,Z,Z,Te][Pe];return{r:Be*255,g:Me*255,b:ke*255}}function c(V,Y,Z,le){var xe=[de(P(V).toString(16)),de(P(Y).toString(16)),de(P(Z).toString(16))];return le&&xe[0].charAt(0)==xe[0].charAt(1)&&xe[1].charAt(0)==xe[1].charAt(1)&&xe[2].charAt(0)==xe[2].charAt(1)?xe[0].charAt(0)+xe[1].charAt(0)+xe[2].charAt(0):xe.join("")}function o(V,Y,Z,le,xe){var he=[de(P(V).toString(16)),de(P(Y).toString(16)),de(P(Z).toString(16)),de(Ee(le))];return xe&&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 u(V,Y,Z,le){var xe=[de(Ee(le)),de(P(V).toString(16)),de(P(Y).toString(16)),de(P(Z).toString(16))];return xe.join("")}O.equals=function(V,Y){return!V||!Y?!1:O(V).toRgbString()==O(Y).toRgbString()},O.random=function(){return O.fromRatio({r:_(),g:_(),b:_()})};function d(V,Y){Y=Y===0?0:Y||10;var Z=O(V).toHsl();return Z.s-=Y/100,Z.s=M(Z.s),O(Z)}function T(V,Y){Y=Y===0?0:Y||10;var Z=O(V).toHsl();return Z.s+=Y/100,Z.s=M(Z.s),O(Z)}function p(V){return O(V).desaturate(100)}function h(V,Y){Y=Y===0?0:Y||10;var Z=O(V).toHsl();return Z.l+=Y/100,Z.l=M(Z.l),O(Z)}function S(V,Y){Y=Y===0?0:Y||10;var Z=O(V).toRgb();return Z.r=N(0,B(255,Z.r-P(255*-(Y/100)))),Z.g=N(0,B(255,Z.g-P(255*-(Y/100)))),Z.b=N(0,B(255,Z.b-P(255*-(Y/100)))),O(Z)}function v(V,Y){Y=Y===0?0:Y||10;var Z=O(V).toHsl();return Z.l-=Y/100,Z.l=M(Z.l),O(Z)}function l(V,Y){var Z=O(V).toHsl(),le=(Z.h+Y)%360;return Z.h=le<0?360+le:le,O(Z)}function f(V){var Y=O(V).toHsl();return Y.h=(Y.h+180)%360,O(Y)}function s(V){var Y=O(V).toHsl(),Z=Y.h;return[O(V),O({h:(Z+120)%360,s:Y.s,l:Y.l}),O({h:(Z+240)%360,s:Y.s,l:Y.l})]}function i(V){var Y=O(V).toHsl(),Z=Y.h;return[O(V),O({h:(Z+90)%360,s:Y.s,l:Y.l}),O({h:(Z+180)%360,s:Y.s,l:Y.l}),O({h:(Z+270)%360,s:Y.s,l:Y.l})]}function x(V){var Y=O(V).toHsl(),Z=Y.h;return[O(V),O({h:(Z+72)%360,s:Y.s,l:Y.l}),O({h:(Z+216)%360,s:Y.s,l:Y.l})]}function m(V,Y,Z){Y=Y||6,Z=Z||30;var le=O(V).toHsl(),xe=360/Z,he=[O(V)];for(le.h=(le.h-(xe*Y>>1)+720)%360;--Y;)le.h=(le.h+xe)%360,he.push(O(le));return he}function E(V,Y){Y=Y||6;for(var Z=O(V).toHsv(),le=Z.h,xe=Z.s,he=Z.v,Te=[],De=1/Y;Y--;)Te.push(O({h:le,s:xe,v:he})),he=(he+De)%1;return Te}O.mix=function(V,Y,Z){Z=Z===0?0:Z||50;var le=O(V).toRgb(),xe=O(Y).toRgb(),he=Z/100,Te={r:(xe.r-le.r)*he+le.r,g:(xe.g-le.g)*he+le.g,b:(xe.b-le.b)*he+le.b,a:(xe.a-le.a)*he+le.a};return O(Te)},O.readability=function(V,Y){var Z=O(V),le=O(Y);return(H.max(Z.getLuminance(),le.getLuminance())+.05)/(H.min(Z.getLuminance(),le.getLuminance())+.05)},O.isReadable=function(V,Y,Z){var le=O.readability(V,Y),xe,he;he=!1,xe=ie(Z);switch(xe.level+xe.size){case"AAsmall":case"AAAlarge":he=le>=4.5;break;case"AAlarge":he=le>=3;break;case"AAAsmall":he=le>=7;break}return he},O.mostReadable=function(V,Y,Z){var le=null,xe=0,he,Te,De,Pe;Z=Z||{},Te=Z.includeFallbackColors,De=Z.level,Pe=Z.size;for(var Be=0;Be<Y.length;Be++)he=O.readability(V,Y[Be]),he>xe&&(xe=he,le=O(Y[Be]));return O.isReadable(V,le,{level:De,size:Pe})||!Te?le:(Z.includeFallbackColors=!1,O.mostReadable(V,["#fff","#000"],Z))};var D=O.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=O.hexNames=j(D);function j(V){var Y={};for(var Z in V)V.hasOwnProperty(Z)&&(Y[V[Z]]=Z);return Y}function K(V){return V=parseFloat(V),(isNaN(V)||V<0||V>1)&&(V=1),V}function k(V,Y){ee(V)&&(V="100%");var Z=ue(V);return V=B(Y,N(0,parseFloat(V))),Z&&(V=parseInt(V*Y,10)/100),H.abs(V-Y)<1e-6?1:V%Y/parseFloat(Y)}function M(V){return B(1,N(0,V))}function G(V){return parseInt(V,16)}function ee(V){return typeof V=="string"&&V.indexOf(".")!=-1&&parseFloat(V)===1}function ue(V){return typeof V=="string"&&V.indexOf("%")!=-1}function de(V){return V.length==1?"0"+V:""+V}function be(V){return V<=1&&(V=V*100+"%"),V}function Ee(V){return H.round(parseFloat(V)*255).toString(16)}function ae(V){return G(V)/255}var $=function(){var V="[-\\+]?\\d+%?",Y="[-\\+]?\\d*\\.\\d+%?",Z="(?:"+Y+")|(?:"+V+")",le="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?",xe="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?";return{CSS_UNIT:new RegExp(Z),rgb:new RegExp("rgb"+le),rgba:new RegExp("rgba"+xe),hsl:new RegExp("hsl"+le),hsla:new RegExp("hsla"+xe),hsv:new RegExp("hsv"+le),hsva:new RegExp("hsva"+xe),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 re(V){return!!$.CSS_UNIT.exec(V)}function J(V){V=V.replace(L,"").replace(z,"").toLowerCase();var Y=!1;if(D[V])V=D[V],Y=!0;else if(V=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Z;return(Z=$.rgb.exec(V))?{r:Z[1],g:Z[2],b:Z[3]}:(Z=$.rgba.exec(V))?{r:Z[1],g:Z[2],b:Z[3],a:Z[4]}:(Z=$.hsl.exec(V))?{h:Z[1],s:Z[2],l:Z[3]}:(Z=$.hsla.exec(V))?{h:Z[1],s:Z[2],l:Z[3],a:Z[4]}:(Z=$.hsv.exec(V))?{h:Z[1],s:Z[2],v:Z[3]}:(Z=$.hsva.exec(V))?{h:Z[1],s:Z[2],v:Z[3],a:Z[4]}:(Z=$.hex8.exec(V))?{r:G(Z[1]),g:G(Z[2]),b:G(Z[3]),a:ae(Z[4]),format:Y?"name":"hex8"}:(Z=$.hex6.exec(V))?{r:G(Z[1]),g:G(Z[2]),b:G(Z[3]),format:Y?"name":"hex"}:(Z=$.hex4.exec(V))?{r:G(Z[1]+""+Z[1]),g:G(Z[2]+""+Z[2]),b:G(Z[3]+""+Z[3]),a:ae(Z[4]+""+Z[4]),format:Y?"name":"hex8"}:(Z=$.hex3.exec(V))?{r:G(Z[1]+""+Z[1]),g:G(Z[2]+""+Z[2]),b:G(Z[3]+""+Z[3]),format:Y?"name":"hex"}:!1}function ie(V){var Y,Z;return V=V||{level:"AA",size:"small"},Y=(V.level||"AA").toUpperCase(),Z=(V.size||"small").toLowerCase(),Y!=="AA"&&Y!=="AAA"&&(Y="AA"),Z!=="small"&&Z!=="large"&&(Z="small"),{level:Y,size:Z}}ot.exports?ot.exports=O:!(oe=function(){return O}.call(Xe,te,Xe,ot),oe!==void 0&&(ot.exports=oe))})(Math)},bT9E:function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return H});var oe=te("VTBJ");function H(L,z){var I=Object(oe.a)({},L);return Array.isArray(z)&&z.forEach(function(P){delete I[P]}),I}},c5Ni:function(ot,Xe,te){},dejd:function(ot,Xe,te){},dmUQ:function(ot,Xe,te){"use strict";var oe=te("Ff2n"),H=te("rePB"),L=te("1OyB"),z=te("vuIU"),I=te("Ji7U"),P=te("md7G"),B=te("foSv"),N=te("cDcd"),_=te.n(N),O=te("TSYQ"),y=te.n(O),C=te("4IlW");function R(s,i){var x=Object.keys(s);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(s);i&&(m=m.filter(function(E){return Object.getOwnPropertyDescriptor(s,E).enumerable})),x.push.apply(x,m)}return x}function A(s){for(var i=1;i<arguments.length;i++){var x=arguments[i]!=null?arguments[i]:{};i%2?R(Object(x),!0).forEach(function(m){Object(H.a)(s,m,x[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(x)):R(Object(x)).forEach(function(m){Object.defineProperty(s,m,Object.getOwnPropertyDescriptor(x,m))})}return s}function b(s){var i=g();return function(){var m=Object(B.a)(s),E;if(i){var D=Object(B.a)(this).constructor;E=Reflect.construct(m,arguments,D)}else E=m.apply(this,arguments);return Object(P.a)(this,E)}}function g(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function c(){}function o(s){s.preventDefault()}var u=function(i){return i.replace(/[^\w.-]+/g,"")},d=200,T=600,p=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,h=function(i){return i!=null},S=function(i,x){return x===i||typeof x=="number"&&typeof i=="number"&&isNaN(x)&&isNaN(i)},v=function(s){Object(I.a)(x,s);var i=b(x);function x(m){var E;Object(L.a)(this,x),E=i.call(this,m),E.onKeyDown=function(j){var K=E.props,k=K.onKeyDown,M=K.onPressEnter;if(j.keyCode===C.a.UP){var G=E.getRatio(j);E.up(j,G,null),E.stop()}else if(j.keyCode===C.a.DOWN){var ee=E.getRatio(j);E.down(j,ee,null),E.stop()}else j.keyCode===C.a.ENTER&&M&&M(j);if(E.recordCursorPosition(),E.lastKeyCode=j.keyCode,k){for(var ue=arguments.length,de=new Array(ue>1?ue-1:0),be=1;be<ue;be++)de[be-1]=arguments[be];k.apply(void 0,[j].concat(de))}},E.onKeyUp=function(j){var K=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),K){for(var k=arguments.length,M=new Array(k>1?k-1:0),G=1;G<k;G++)M[G-1]=arguments[G];K.apply(void 0,[j].concat(M))}},E.onChange=function(j){var K=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(j)),E.setState({inputValue:E.rawInput}),K(E.toNumber(E.rawInput))},E.onMouseUp=function(){var j=E.props.onMouseUp;E.recordCursorPosition(),j&&j.apply(void 0,arguments)},E.onFocus=function(){var j;E.setState({focused:!0}),(j=E.props).onFocus.apply(j,arguments)},E.onBlur=function(){var j=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var K=E.getCurrentValidValue(E.state.inputValue),k=E.setValue(K,c);if(j){var M=E.input.value,G=E.getInputDisplayValue({focus:!1,value:k});E.input.value=G&&Number(G),j.apply(void 0,arguments),E.input.value=M}},E.getRatio=function(j){var K=1;return j.metaKey||j.ctrlKey?K=.1:j.shiftKey&&(K=10),K},E.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},E.getPrecision=function(j){if(h(E.props.precision))return E.props.precision;var K=String(j);if(K.indexOf("e-")>=0)return parseInt(K.slice(K.indexOf("e-")+2),10);var k=0;return K.indexOf(".")>=0&&(k=K.length-K.indexOf(".")-1),k},E.getInputDisplayValue=function(j){var K=j||E.state,k=K.focused,M=K.inputValue,G=K.value,ee;k?ee=M:ee=E.toPrecisionAsStep(G),ee==null&&(ee="");var ue=E.formatWrapper(ee);return h(E.props.decimalSeparator)&&(ue=ue.toString().replace(".",E.props.decimalSeparator)),ue},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(j){}},E.restoreByAfter=function(j){if(j===void 0)return!1;var K=E.input.value,k=K.lastIndexOf(j);if(k===-1)return!1;var M=E.cursorBefore.length;return E.lastKeyCode===C.a.DELETE&&E.cursorBefore.charAt(M-1)===j[0]?(E.fixCaret(M,M),!0):k+j.length===K.length?(E.fixCaret(k,k),!0):!1},E.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(K,k){var M=j.substring(k);return E.restoreByAfter(M)})},E.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(j,K,k){E.pressingUpOrDown=!0,E.step("down",j,K,k)},E.up=function(j,K,k){E.pressingUpOrDown=!0,E.step("up",j,K,k)},E.saveInput=function(j){E.input=j};var D=m.value;D===void 0&&(D=m.defaultValue),E.state={focused:m.autoFocus};var U=E.getValidValue(E.toNumber(D));return E.state=A(A({},E.state),{},{inputValue:E.toPrecisionAsStep(U),value:U}),E}return Object(z.a)(x,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var D=this.props,U=D.value,j=D.onChange,K=D.max,k=D.min,M=this.state.focused;if(E){if(!S(E.value,U)||!S(E.max,K)||!S(E.min,k)){var G=M?U:this.getValidValue(U),ee;this.pressingUpOrDown?ee=G:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:ee})}var ue="value"in this.props?U:this.state.value;"max"in this.props&&E.max!==K&&typeof ue=="number"&&ue>K&&j&&j(K),"min"in this.props&&E.min!==k&&typeof ue=="number"&&ue<k&&j&&j(k)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var de=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===C.a.BACKSPACE?de=this.cursorStart-1:this.lastKeyCode===C.a.DELETE&&(de=this.cursorStart):de=this.input.value.length,this.fixCaret(de,de)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case C.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case C.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(be){}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(E){var D=E;return D===""?D="":this.isNotCompleteNumber(parseFloat(D))?D=this.state.value:D=this.getValidValue(D),this.toNumber(D)}},{key:"getValueFromEvent",value:function(E){var D=E.target.value.trim().replace(/。/g,".");return h(this.props.decimalSeparator)&&(D=D.replace(this.props.decimalSeparator,".")),D}},{key:"getValidValue",value:function(E){var D=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,j=parseFloat(E);return isNaN(j)?E:(j<D&&(j=D),j>U&&(j=U),j)}},{key:"setValue",value:function(E,D){var U=this.props.precision,j=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),K=this.state.value,k=K===void 0?null:K,M=this.state.inputValue,G=M===void 0?null:M,ee=typeof j=="number"?j.toFixed(U):"".concat(j),ue=j!==k||ee!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},D)):this.setState({value:j,inputValue:this.toPrecisionAsStep(E)},D),ue&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(E){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,j=U.precision,K=U.step;if(h(j))return j;var k=this.getPrecision(D),M=this.getPrecision(K),G=this.getPrecision(E);return E?Math.max(G,k+M):k+M}},{key:"getPrecisionFactor",value:function(E){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(E,D);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(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var D=Math.abs(this.getMaxPrecision(E));return isNaN(D)?E.toString():Number(E).toFixed(D)}},{key:"toNumber",value:function(E){var D=this.props.precision,U=this.state.focused,j=E&&E.length>16&&U;return this.isNotCompleteNumber(E)||j?E:h(D)?Math.round(E*Math.pow(10,D))/Math.pow(10,D):Number(E)}},{key:"upStep",value:function(E,D){var U=this.props.step,j=this.getPrecisionFactor(E,D),K=Math.abs(this.getMaxPrecision(E,D)),k=((j*E+j*U*D)/j).toFixed(K);return this.toNumber(k)}},{key:"downStep",value:function(E,D){var U=this.props.step,j=this.getPrecisionFactor(E,D),K=Math.abs(this.getMaxPrecision(E,D)),k=((j*E-j*U*D)/j).toFixed(K);return this.toNumber(k)}},{key:"step",value:function(E,D){var U=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,K=arguments.length>3?arguments[3]:void 0;this.stop(),D&&(D.persist(),D.preventDefault());var k=this.props;if(k.disabled)return;var M=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(M))return;var G=this["".concat(E,"Step")](M,j),ee=G>k.max||G<k.min;if(G>k.max?G=k.max:G<k.min&&(G=k.min),this.setValue(G,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){U[E](D,j,!0)},K?d:T)}},{key:"fixCaret",value:function(E,D){if(E===void 0||D===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,j=this.input.selectionEnd;(E!==U||D!==j)&&this.input.setSelectionRange(E,D)}catch(K){}}},{key:"render",value:function(){var E,D=this.props,U=D.prefixCls,j=D.disabled,K=D.readOnly,k=D.useTouch,M=D.autoComplete,G=D.upHandler,ee=D.downHandler,ue=D.className,de=D.max,be=D.min,Ee=D.style,ae=D.title,$=D.onMouseEnter,re=D.onMouseLeave,J=D.onMouseOver,ie=D.onMouseOut,V=D.required,Y=D.onClick,Z=D.tabIndex,le=D.type,xe=D.placeholder,he=D.id,Te=D.inputMode,De=D.pattern,Pe=D.step,Be=D.maxLength,Me=D.autoFocus,ke=D.name,Ve=D.onPaste,Se=D.onInput,Re=Object(oe.a)(D,["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"]),_e=this.state,Ne=_e.value,Fe=_e.focused,Ue=y()(U,(E={},Object(H.a)(E,ue,!!ue),Object(H.a)(E,"".concat(U,"-disabled"),j),Object(H.a)(E,"".concat(U,"-focused"),Fe),E)),Ce={};Object.keys(Re).forEach(function(pe){(pe.substr(0,5)==="data-"||pe.substr(0,5)==="aria-"||pe==="role")&&(Ce[pe]=Re[pe])});var He=!K&&!j,je=this.getInputDisplayValue(null),we=(Ne||Ne===0)&&(isNaN(Ne)||Number(Ne)>=de),Ie=(Ne||Ne===0)&&(isNaN(Ne)||Number(Ne)<=be),ge=we||j||K,ce=Ie||j||K,me=y()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(H.a)({},"".concat(U,"-handler-up-disabled"),ge)),q=y()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(H.a)({},"".concat(U,"-handler-down-disabled"),ce)),ne=k?{onTouchStart:ge?c:this.up,onTouchEnd:this.stop}:{onMouseDown:ge?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},se=k?{onTouchStart:ce?c:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return _.a.createElement("div",{className:Ue,style:Ee,title:ae,onMouseEnter:$,onMouseLeave:re,onMouseOver:J,onMouseOut:ie,onFocus:function(){return null},onBlur:function(){return null}},_.a.createElement("div",{className:"".concat(U,"-handler-wrap")},_.a.createElement("span",Object.assign({unselectable:"on"},ne,{role:"button","aria-label":"Increase Value","aria-disabled":ge,className:me}),G||_.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:o})),_.a.createElement("span",Object.assign({unselectable:"on"},se,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:q}),ee||_.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:o}))),_.a.createElement("div",{className:"".concat(U,"-input-wrap")},_.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":be,"aria-valuemax":de,"aria-valuenow":Ne,required:V,type:le,placeholder:xe,onPaste:Ve,onClick:Y,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:Z,autoComplete:M,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:He?this.onKeyDown:c,onKeyUp:He?this.onKeyUp:c,autoFocus:Me,maxLength:Be,readOnly:K,disabled:j,max:de,min:be,step:Pe,name:ke,title:ae,id:he,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(je),pattern:De,inputMode:Te,onInput:Se},Ce))))}}]),x}(_.a.Component);v.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:p,min:-p,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:u,required:!1,autoComplete:"off"};var l=v,f=Xe.a=l},fAei:function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return d.a});var oe=te("rePB"),H=te("VTBJ"),L=te("KQm4"),z=te("1OyB"),I=te("vuIU"),P=te("Ji7U"),B=te("LK+K"),N=te("cDcd"),_=te("4IlW"),O=te("Kwbf"),y=te("TSYQ"),C=te.n(y),R=te("sboe"),A=te("OZM5"),b=te("815F"),g=te("ODXe"),c=te("Ff2n"),o=te("+nKL"),u=te("8XRh"),d=te("WaYH"),T=function(be,Ee){var ae=be.className,$=be.style,re=be.motion,J=be.motionNodes,ie=be.motionType,V=be.onMotionStart,Y=be.onMotionEnd,Z=be.active,le=be.treeNodeRequiredProps,xe=Object(c.a)(be,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),he=N.useState(!0),Te=Object(g.a)(he,2),De=Te[0],Pe=Te[1],Be=N.useContext(R.a),Me=Be.prefixCls,ke=N.useRef(!1),Ve=function(){ke.current||Y(),ke.current=!0};return Object(N.useEffect)(function(){J&&ie==="hide"&&De&&Pe(!1)},[J]),Object(N.useEffect)(function(){return J&&V(),function(){J&&Ve()}},[]),J?N.createElement(u.default,Object.assign({ref:Ee,visible:De},re,{motionAppear:ie==="show",onAppearEnd:Ve,onLeaveEnd:Ve}),function(Se,Re){var _e=Se.className,Ne=Se.style;return N.createElement("div",{ref:Re,className:C()("".concat(Me,"-treenode-motion"),_e),style:Ne},J.map(function(Fe){var Ue=Fe.data,Ce=Ue.key,He=Object(c.a)(Ue,["key"]),je=Fe.isStart,we=Fe.isEnd;delete He.children;var Ie=Object(b.f)(Ce,le);return N.createElement(d.a,Object.assign({},He,Ie,{active:Z,data:Fe.data,key:Ce,isStart:je,isEnd:we}))}))}):N.createElement(d.a,Object.assign({domRef:Ee,className:ae,style:$},xe,{active:Z}))};T.displayName="MotionTreeNode";var p=N.forwardRef(T),h=p;function S(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ee=de.length,ae=be.length;if(Math.abs(Ee-ae)!==1)return{add:!1,key:null};function $(re,J){var ie=new Map;re.forEach(function(Y){ie.set(Y,!0)});var V=J.filter(function(Y){return!ie.has(Y)});return V.length===1?V[0]:null}return Ee<ae?{add:!0,key:$(de,be)}:{add:!1,key:$(be,de)}}function v(de,be,Ee){var ae=de.findIndex(function(ie){var V=ie.data;return V.key===Ee}),$=de[ae+1],re=be.findIndex(function(ie){var V=ie.data;return V.key===Ee});if($){var J=be.findIndex(function(ie){var V=ie.data;return V.key===$.data.key});return be.slice(re+1,J)}return be.slice(re+1)}var l={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},f=function(){},s="RC_TREE_MOTION_".concat(Math.random()),i={key:s},x={key:s,level:0,index:0,pos:"0",node:i},m={parent:null,children:[],pos:x.pos,data:i,isStart:[],isEnd:[]};function E(de,be,Ee,ae){return be===!1||!Ee?de:de.slice(0,Math.ceil(Ee/ae)+1)}function D(de){var be=de.data.key,Ee=de.pos;return Object(b.e)(be,Ee)}function U(de){for(var be=String(de.data.key),Ee=de;Ee.parent;)Ee=Ee.parent,be="".concat(Ee.data.key," > ").concat(be);return be}var j=function(be,Ee){var ae=be.prefixCls,$=be.data,re=be.selectable,J=be.checkable,ie=be.expandedKeys,V=be.selectedKeys,Y=be.checkedKeys,Z=be.loadedKeys,le=be.loadingKeys,xe=be.halfCheckedKeys,he=be.keyEntities,Te=be.disabled,De=be.dragging,Pe=be.dragOverNodeKey,Be=be.dropPosition,Me=be.motion,ke=be.height,Ve=be.itemHeight,Se=be.virtual,Re=be.focusable,_e=be.activeItem,Ne=be.focused,Fe=be.tabIndex,Ue=be.onKeyDown,Ce=be.onFocus,He=be.onBlur,je=be.onActiveChange,we=be.onListChangeStart,Ie=be.onListChangeEnd,ge=Object(c.a)(be,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),ce=N.useRef(null);N.useImperativeHandle(Ee,function(){return{scrollTo:function(Lr){ce.current.scrollTo(Lr)}}});var me=N.useState(ie),q=Object(g.a)(me,2),ne=q[0],se=q[1],pe=N.useState($),ye=Object(g.a)(pe,2),Le=ye[0],Ke=ye[1],Je=N.useState($),et=Object(g.a)(Je,2),Qe=et[0],yt=et[1],st=N.useState([]),rt=Object(g.a)(st,2),Tt=rt[0],mt=rt[1],vt=N.useState(null),bt=Object(g.a)(vt,2),ft=bt[0],At=bt[1];function Ut(){Ke($),yt($),mt([]),At(null),Ie()}N.useEffect(function(){se(ie);var Rt=S(ne,ie);if(Rt.key!==null)if(Rt.add){var Lr=Le.findIndex(function(Yt){var gr=Yt.data.key;return gr===Rt.key}),Qt=E(v(Le,$,Rt.key),Se,ke,Ve),zt=Le.slice();zt.splice(Lr+1,0,m),yt(zt),mt(Qt),At("show")}else{var dr=$.findIndex(function(Yt){var gr=Yt.data.key;return gr===Rt.key}),_t=E(v($,Le,Rt.key),Se,ke,Ve),nt=$.slice();nt.splice(dr+1,0,m),yt(nt),mt(_t),At("hide")}else Le!==$&&(Ke($),yt($))},[ie,$]),N.useEffect(function(){De||Ut()},[De]);var Wt=Me?Qe:$,Jt={expandedKeys:ie,selectedKeys:V,loadedKeys:Z,loadingKeys:le,checkedKeys:Y,halfCheckedKeys:xe,dragOverNodeKey:Pe,dropPosition:Be,keyEntities:he};return N.createElement(N.Fragment,null,Ne&&_e&&N.createElement("span",{style:l,"aria-live":"assertive"},U(_e)),N.createElement("div",{role:"tree"},N.createElement("input",{style:l,disabled:Re===!1||Te,tabIndex:Re!==!1?Fe:null,onKeyDown:Ue,onFocus:Ce,onBlur:He,value:"",onChange:f})),N.createElement(o.a,Object.assign({},ge,{data:Wt,itemKey:D,height:ke,fullHeight:!1,virtual:Se,itemHeight:Ve,prefixCls:"".concat(ae,"-list"),ref:ce}),function(Rt){var Lr=Rt.pos,Qt=Rt.data,zt=Qt.key,dr=Object(c.a)(Qt,["key"]),_t=Rt.isStart,nt=Rt.isEnd,Yt=Object(b.e)(zt,Lr);delete dr.children;var gr=Object(b.f)(Yt,Jt);return N.createElement(h,Object.assign({},dr,gr,{active:_e&&zt===_e.data.key,pos:Lr,data:Rt.data,isStart:_t,isEnd:nt,motion:Me,motionNodes:zt===s?Tt:null,motionType:ft,onMotionStart:we,onMotionEnd:Ut,treeNodeRequiredProps:Jt,onMouseMove:function(){je(null)}}))}))},K=N.forwardRef(j);K.displayName="NodeList";var k=K,M=te("NvD2"),G=function(de){Object(P.a)(Ee,de);var be=Object(B.a)(Ee);function Ee(){var ae;return Object(z.a)(this,Ee),ae=be.apply(this,arguments),ae.destroyed=!1,ae.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ae.listRef=N.createRef(),ae.onNodeDragStart=function($,re){var J=ae.state,ie=J.expandedKeys,V=J.keyEntities,Y=ae.props.onDragStart,Z=re.props.eventKey;ae.dragNode=re;var le=Object(A.b)(ie,Z);ae.setState({dragging:!0,dragNodesKeys:Object(A.g)(Z,V)}),ae.setExpandedKeys(le),Y&&Y({event:$,node:Object(b.b)(re.props)})},ae.onNodeDragEnter=function($,re){var J=ae.state,ie=J.expandedKeys,V=J.keyEntities,Y=J.dragNodesKeys,Z=ae.props.onDragEnter,le=re.props,xe=le.pos,he=le.eventKey;if(!ae.dragNode||Y.indexOf(he)!==-1)return;var Te=Object(A.c)($,re);if(ae.dragNode.props.eventKey===he&&Te===0){ae.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ae.setState({dragOverNodeKey:he,dropPosition:Te}),ae.delayedDragEnterLogic||(ae.delayedDragEnterLogic={}),Object.keys(ae.delayedDragEnterLogic).forEach(function(De){clearTimeout(ae.delayedDragEnterLogic[De])}),ae.delayedDragEnterLogic[xe]=window.setTimeout(function(){if(!ae.state.dragging)return;var De=Object(L.a)(ie),Pe=V[he];Pe&&(Pe.children||[]).length&&(De=Object(A.a)(ie,he)),"expandedKeys"in ae.props||ae.setExpandedKeys(De),Z&&Z({event:$,node:Object(b.b)(re.props),expandedKeys:De})},400)},0)},ae.onNodeDragOver=function($,re){var J=ae.state.dragNodesKeys,ie=ae.props.onDragOver,V=re.props.eventKey;if(J.indexOf(V)!==-1)return;if(ae.dragNode&&V===ae.state.dragOverNodeKey){var Y=Object(A.c)($,re);if(Y===ae.state.dropPosition)return;ae.setState({dropPosition:Y})}ie&&ie({event:$,node:Object(b.b)(re.props)})},ae.onNodeDragLeave=function($,re){var J=ae.props.onDragLeave;ae.setState({dragOverNodeKey:""}),J&&J({event:$,node:Object(b.b)(re.props)})},ae.onNodeDragEnd=function($,re){var J=ae.props.onDragEnd;ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),J&&J({event:$,node:Object(b.b)(re.props)}),ae.dragNode=null},ae.onNodeDrop=function($,re){var J=ae.state,ie=J.dragNodesKeys,V=ie===void 0?[]:ie,Y=J.dropPosition,Z=ae.props.onDrop,le=re.props,xe=le.eventKey,he=le.pos;if(ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),V.indexOf(xe)!==-1){Object(O.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Te=Object(A.k)(he),De={event:$,node:Object(b.b)(re.props),dragNode:ae.dragNode?Object(b.b)(ae.dragNode.props):null,dragNodesKeys:V.slice(),dropPosition:Y+Number(Te[Te.length-1]),dropToGap:!1};Y!==0&&(De.dropToGap=!0),Z&&Z(De),ae.dragNode=null},ae.cleanDragState=function(){var $=ae.state.dragging;$&&ae.setState({dragging:!1})},ae.onNodeClick=function($,re){var J=ae.props.onClick;J&&J($,re)},ae.onNodeDoubleClick=function($,re){var J=ae.props.onDoubleClick;J&&J($,re)},ae.onNodeSelect=function($,re){var J=ae.state.selectedKeys,ie=ae.state.keyEntities,V=ae.props,Y=V.onSelect,Z=V.multiple,le=re.selected,xe=re.key,he=!le;he?Z?J=Object(A.a)(J,xe):J=[xe]:J=Object(A.b)(J,xe);var Te=J.map(function(De){var Pe=ie[De];return Pe?Pe.node:null}).filter(function(De){return De});ae.setUncontrolledState({selectedKeys:J}),Y&&Y(J,{event:"select",selected:he,node:re,selectedNodes:Te,nativeEvent:$.nativeEvent})},ae.onNodeCheck=function($,re,J){var ie=ae.state,V=ie.keyEntities,Y=ie.checkedKeys,Z=ie.halfCheckedKeys,le=ae.props,xe=le.checkStrictly,he=le.onCheck,Te=re.key,De,Pe={event:"check",node:re,checked:J,nativeEvent:$.nativeEvent};if(xe){var Be=J?Object(A.a)(Y,Te):Object(A.b)(Y,Te),Me=Object(A.b)(Z,Te);De={checked:Be,halfChecked:Me},Pe.checkedNodes=Be.map(function(Ne){return V[Ne]}).filter(function(Ne){return Ne}).map(function(Ne){return Ne.node}),ae.setUncontrolledState({checkedKeys:Be})}else{var ke=Object(M.a)([].concat(Object(L.a)(Y),[Te]),!0,V),Ve=ke.checkedKeys,Se=ke.halfCheckedKeys;if(!J){var Re=new Set(Ve);Re.delete(Te);var _e=Object(M.a)(Array.from(Re),{checked:!1,halfCheckedKeys:Se},V);Ve=_e.checkedKeys,Se=_e.halfCheckedKeys}De=Ve,Pe.checkedNodes=[],Pe.checkedNodesPositions=[],Pe.halfCheckedKeys=Se,Ve.forEach(function(Ne){var Fe=V[Ne];if(!Fe)return;var Ue=Fe.node,Ce=Fe.pos;Pe.checkedNodes.push(Ue),Pe.checkedNodesPositions.push({node:Ue,pos:Ce})}),ae.setUncontrolledState({checkedKeys:Ve},!1,{halfCheckedKeys:Se})}he&&he(De,Pe)},ae.onNodeLoad=function($){return new Promise(function(re){ae.setState(function(J){var ie=J.loadedKeys,V=ie===void 0?[]:ie,Y=J.loadingKeys,Z=Y===void 0?[]:Y,le=ae.props,xe=le.loadData,he=le.onLoad,Te=$.key;if(!xe||V.indexOf(Te)!==-1||Z.indexOf(Te)!==-1)return{};var De=xe($);return De.then(function(){var Pe=ae.state,Be=Pe.loadedKeys,Me=Pe.loadingKeys,ke=Object(A.a)(Be,Te),Ve=Object(A.b)(Me,Te);he&&he(ke,{event:"load",node:$}),ae.setUncontrolledState({loadedKeys:ke}),ae.setState({loadingKeys:Ve}),re()}),{loadingKeys:Object(A.a)(Z,Te)}})})},ae.onNodeMouseEnter=function($,re){var J=ae.props.onMouseEnter;J&&J({event:$,node:re})},ae.onNodeMouseLeave=function($,re){var J=ae.props.onMouseLeave;J&&J({event:$,node:re})},ae.onNodeContextMenu=function($,re){var J=ae.props.onRightClick;J&&($.preventDefault(),J({event:$,node:re}))},ae.onFocus=function(){var $=ae.props.onFocus;ae.setState({focused:!0}),$&&$.apply(void 0,arguments)},ae.onBlur=function(){var $=ae.props.onBlur;ae.setState({focused:!1}),ae.onActiveChange(null),$&&$.apply(void 0,arguments)},ae.getTreeNodeRequiredProps=function(){var $=ae.state,re=$.expandedKeys,J=$.selectedKeys,ie=$.loadedKeys,V=$.loadingKeys,Y=$.checkedKeys,Z=$.halfCheckedKeys,le=$.dragOverNodeKey,xe=$.dropPosition,he=$.keyEntities;return{expandedKeys:re||[],selectedKeys:J||[],loadedKeys:ie||[],loadingKeys:V||[],checkedKeys:Y||[],halfCheckedKeys:Z||[],dragOverNodeKey:le,dropPosition:xe,keyEntities:he}},ae.setExpandedKeys=function($){var re=ae.state.treeData,J=Object(b.d)(re,$);ae.setUncontrolledState({expandedKeys:$,flattenNodes:J},!0)},ae.onNodeExpand=function($,re){var J=ae.state.expandedKeys,ie=ae.state.listChanging,V=ae.props,Y=V.onExpand,Z=V.loadData,le=re.key,xe=re.expanded;if(ie)return;var he=J.indexOf(le),Te=!xe;if(Object(O.a)(xe&&he!==-1||!xe&&he===-1,"Expand state not sync with index check"),Te?J=Object(A.a)(J,le):J=Object(A.b)(J,le),ae.setExpandedKeys(J),Y&&Y(J,{node:re,expanded:Te,nativeEvent:$.nativeEvent}),Te&&Z){var De=ae.onNodeLoad(re);De&&De.then(function(){var Pe=Object(b.d)(ae.state.treeData,J);ae.setUncontrolledState({flattenNodes:Pe})})}},ae.onListChangeStart=function(){ae.setUncontrolledState({listChanging:!0})},ae.onListChangeEnd=function(){setTimeout(function(){ae.setUncontrolledState({listChanging:!1})})},ae.onActiveChange=function($){var re=ae.state.activeKey,J=ae.props.onActiveChange;if(re===$)return;ae.setState({activeKey:$}),$!==null&&ae.scrollTo({key:$}),J&&J($)},ae.getActiveItem=function(){var $=ae.state,re=$.activeKey,J=$.flattenNodes;return re===null?null:J.find(function(ie){var V=ie.data.key;return V===re})||null},ae.offsetActiveKey=function($){var re=ae.state,J=re.flattenNodes,ie=re.activeKey,V=J.findIndex(function(le){var xe=le.data.key;return xe===ie});V===-1&&$<0&&(V=J.length),V=(V+$+J.length)%J.length;var Y=J[V];if(Y){var Z=Y.data.key;ae.onActiveChange(Z)}else ae.onActiveChange(null)},ae.onKeyDown=function($){var re=ae.state,J=re.activeKey,ie=re.expandedKeys,V=re.checkedKeys,Y=ae.props,Z=Y.onKeyDown,le=Y.checkable,xe=Y.selectable;switch($.which){case _.a.UP:{ae.offsetActiveKey(-1),$.preventDefault();break}case _.a.DOWN:{ae.offsetActiveKey(1),$.preventDefault();break}}var he=ae.getActiveItem();if(he&&he.data){var Te=ae.getTreeNodeRequiredProps(),De=he.data.isLeaf===!1||!!(he.data.children||[]).length,Pe=Object(b.b)(Object(H.a)(Object(H.a)({},Object(b.f)(J,Te)),{},{data:he.data,active:!0}));switch($.which){case _.a.LEFT:{De&&ie.includes(J)?ae.onNodeExpand({},Pe):he.parent&&ae.onActiveChange(he.parent.data.key),$.preventDefault();break}case _.a.RIGHT:{De&&!ie.includes(J)?ae.onNodeExpand({},Pe):he.children&&he.children.length&&ae.onActiveChange(he.children[0].data.key),$.preventDefault();break}case _.a.ENTER:case _.a.SPACE:{le&&!Pe.disabled&&Pe.checkable!==!1&&!Pe.disableCheckbox?ae.onNodeCheck({},Pe,!V.includes(J)):!le&&xe&&!Pe.disabled&&Pe.selectable!==!1&&ae.onNodeSelect({},Pe);break}}}Z&&Z($)},ae.setUncontrolledState=function($){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ae.destroyed)return;var ie=!1,V=!0,Y={};Object.keys($).forEach(function(Z){if(Z in ae.props){V=!1;return}ie=!0,Y[Z]=$[Z]}),ie&&(!re||V)&&ae.setState(Object(H.a)(Object(H.a)({},Y),J))},ae.scrollTo=function($){ae.listRef.current.scrollTo($)},ae}return Object(I.a)(Ee,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var $,re=this.state,J=re.focused,ie=re.flattenNodes,V=re.keyEntities,Y=re.dragging,Z=re.activeKey,le=this.props,xe=le.prefixCls,he=le.className,Te=le.style,De=le.showLine,Pe=le.focusable,Be=le.tabIndex,Me=Be===void 0?0:Be,ke=le.selectable,Ve=le.showIcon,Se=le.icon,Re=le.switcherIcon,_e=le.draggable,Ne=le.checkable,Fe=le.checkStrictly,Ue=le.disabled,Ce=le.motion,He=le.loadData,je=le.filterTreeNode,we=le.height,Ie=le.itemHeight,ge=le.virtual,ce=le.titleRender,me=le.onContextMenu,q=Object(A.f)(this.props);return N.createElement(R.a.Provider,{value:{prefixCls:xe,selectable:ke,showIcon:Ve,icon:Se,switcherIcon:Re,draggable:_e,checkable:Ne,checkStrictly:Fe,disabled:Ue,keyEntities:V,loadData:He,filterTreeNode:je,titleRender:ce,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},N.createElement("div",{className:C()(xe,he,($={},Object(oe.a)($,"".concat(xe,"-show-line"),De),Object(oe.a)($,"".concat(xe,"-focused"),J),Object(oe.a)($,"".concat(xe,"-active-focused"),Z!==null),$))},N.createElement(k,Object.assign({ref:this.listRef,prefixCls:xe,style:Te,data:ie,disabled:Ue,selectable:ke,checkable:!!Ne,motion:Ce,dragging:Y,height:we,itemHeight:Ie,virtual:ge,focusable:Pe,focused:J,tabIndex:Me,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:me},this.getTreeNodeRequiredProps(),q))))}}],[{key:"getDerivedStateFromProps",value:function($,re){var J=re.prevProps,ie={prevProps:$};function V(Se){return!J&&Se in $||J&&J[Se]!==$[Se]}var Y;if(V("treeData")?Y=$.treeData:V("children")&&(Object(O.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Y=Object(b.c)($.children)),Y){ie.treeData=Y;var Z=Object(b.a)(Y);ie.keyEntities=Object(H.a)(Object(oe.a)({},s,x),Z.keyEntities)}var le=ie.keyEntities||re.keyEntities;if(V("expandedKeys")||J&&V("autoExpandParent"))ie.expandedKeys=$.autoExpandParent||!J&&$.defaultExpandParent?Object(A.e)($.expandedKeys,le):$.expandedKeys;else if(!J&&$.defaultExpandAll){var xe=Object(H.a)({},le);delete xe[s],ie.expandedKeys=Object.keys(xe).map(function(Se){return xe[Se].key})}else!J&&$.defaultExpandedKeys&&(ie.expandedKeys=$.autoExpandParent||$.defaultExpandParent?Object(A.e)($.defaultExpandedKeys,le):$.defaultExpandedKeys);if(ie.expandedKeys||delete ie.expandedKeys,Y||ie.expandedKeys){var he=Object(b.d)(Y||re.treeData,ie.expandedKeys||re.expandedKeys);ie.flattenNodes=he}if($.selectable&&(V("selectedKeys")?ie.selectedKeys=Object(A.d)($.selectedKeys,$):!J&&$.defaultSelectedKeys&&(ie.selectedKeys=Object(A.d)($.defaultSelectedKeys,$))),$.checkable){var Te;if(V("checkedKeys")?Te=Object(A.j)($.checkedKeys)||{}:!J&&$.defaultCheckedKeys?Te=Object(A.j)($.defaultCheckedKeys)||{}:Y&&(Te=Object(A.j)($.checkedKeys)||{checkedKeys:re.checkedKeys,halfCheckedKeys:re.halfCheckedKeys}),Te){var De=Te,Pe=De.checkedKeys,Be=Pe===void 0?[]:Pe,Me=De.halfCheckedKeys,ke=Me===void 0?[]:Me;if(!$.checkStrictly){var Ve=Object(M.a)(Be,!0,le);Be=Ve.checkedKeys,ke=Ve.halfCheckedKeys}ie.checkedKeys=Be,ie.halfCheckedKeys=ke}}return V("loadedKeys")&&(ie.loadedKeys=$.loadedKeys),ie}}]),Ee}(N.Component);G.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},G.TreeNode=d.a;var ee=G,ue=Xe.b=ee},gJ3r:function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return oe});var oe=[{value:"\u5317\u4EAC",label:"\u5317\u4EAC",children:[{value:"\u4E1C\u57CE",label:"\u4E1C\u57CE"},{value:"\u897F\u57CE",label:"\u897F\u57CE"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u4E30\u53F0",label:"\u4E30\u53F0"},{value:"\u77F3\u666F\u5C71",label:"\u77F3\u666F\u5C71"},{value:"\u6D77\u6DC0",label:"\u6D77\u6DC0"},{value:"\u95E8\u5934\u6C9F",label:"\u95E8\u5934\u6C9F"},{value:"\u623F\u5C71",label:"\u623F\u5C71"},{value:"\u901A\u5DDE",label:"\u901A\u5DDE"},{value:"\u987A\u4E49",label:"\u987A\u4E49"},{value:"\u660C\u5E73",label:"\u660C\u5E73"},{value:"\u5927\u5174",label:"\u5927\u5174"},{value:"\u5E73\u8C37",label:"\u5E73\u8C37"},{value:"\u6000\u67D4",label:"\u6000\u67D4"},{value:"\u5BC6\u4E91",label:"\u5BC6\u4E91"},{value:"\u5EF6\u5E86",label:"\u5EF6\u5E86"}]},{value:"\u4E0A\u6D77",label:"\u4E0A\u6D77",children:[{value:"\u5D07\u660E",label:"\u5D07\u660E"},{value:"\u9EC4\u6D66",label:"\u9EC4\u6D66"},{value:"\u5362\u6E7E",label:"\u5362\u6E7E"},{value:"\u5F90\u6C47",label:"\u5F90\u6C47"},{value:"\u957F\u5B81",label:"\u957F\u5B81"},{value:"\u9759\u5B89",label:"\u9759\u5B89"},{value:"\u666E\u9640",label:"\u666E\u9640"},{value:"\u95F8\u5317",label:"\u95F8\u5317"},{value:"\u8679\u53E3",label:"\u8679\u53E3"},{value:"\u6768\u6D66",label:"\u6768\u6D66"},{value:"\u95F5\u884C",label:"\u95F5\u884C"},{value:"\u5B9D\u5C71",label:"\u5B9D\u5C71"},{value:"\u5609\u5B9A",label:"\u5609\u5B9A"},{value:"\u6D66\u4E1C",label:"\u6D66\u4E1C"},{value:"\u91D1\u5C71",label:"\u91D1\u5C71"},{value:"\u677E\u6C5F",label:"\u677E\u6C5F"},{value:"\u9752\u6D66",label:"\u9752\u6D66"},{value:"\u5357\u6C47",label:"\u5357\u6C47"},{value:"\u5949\u8D24",label:"\u5949\u8D24"}]},{value:"\u5E7F\u4E1C",label:"\u5E7F\u4E1C",children:[{value:"\u5E7F\u5DDE",label:"\u5E7F\u5DDE"},{value:"\u6DF1\u5733",label:"\u6DF1\u5733"},{value:"\u73E0\u6D77",label:"\u73E0\u6D77"},{value:"\u4E1C\u839E",label:"\u4E1C\u839E"},{value:"\u4E2D\u5C71",label:"\u4E2D\u5C71"},{value:"\u4F5B\u5C71",label:"\u4F5B\u5C71"},{value:"\u60E0\u5DDE",label:"\u60E0\u5DDE"},{value:"\u6CB3\u6E90",label:"\u6CB3\u6E90"},{value:"\u6F6E\u5DDE",label:"\u6F6E\u5DDE"},{value:"\u6C5F\u95E8",label:"\u6C5F\u95E8"},{value:"\u63ED\u9633",label:"\u63ED\u9633"},{value:"\u8302\u540D",label:"\u8302\u540D"},{value:"\u6885\u5DDE",label:"\u6885\u5DDE"},{value:"\u6E05\u8FDC",label:"\u6E05\u8FDC"},{value:"\u6C55\u5934",label:"\u6C55\u5934"},{value:"\u6C55\u5C3E",label:"\u6C55\u5C3E"},{value:"\u97F6\u5173",label:"\u97F6\u5173"},{value:"\u987A\u5FB7",label:"\u987A\u5FB7"},{value:"\u9633\u6C5F",label:"\u9633\u6C5F"},{value:"\u4E91\u6D6E",label:"\u4E91\u6D6E"},{value:"\u6E5B\u6C5F",label:"\u6E5B\u6C5F"},{value:"\u8087\u5E86",label:"\u8087\u5E86"}]},{value:"\u6C5F\u82CF",label:"\u6C5F\u82CF",children:[{value:"\u5357\u4EAC",label:"\u5357\u4EAC"},{value:"\u5E38\u719F",label:"\u5E38\u719F"},{value:"\u5E38\u5DDE",label:"\u5E38\u5DDE"},{value:"\u6D77\u95E8",label:"\u6D77\u95E8"},{value:"\u6DEE\u5B89",label:"\u6DEE\u5B89"},{value:"\u6C5F\u90FD",label:"\u6C5F\u90FD"},{value:"\u6C5F\u9634",label:"\u6C5F\u9634"},{value:"\u6606\u5C71",label:"\u6606\u5C71"},{value:"\u8FDE\u4E91\u6E2F",label:"\u8FDE\u4E91\u6E2F"},{value:"\u5357\u901A",label:"\u5357\u901A"},{value:"\u542F\u4E1C",label:"\u542F\u4E1C"},{value:"\u6CAD\u9633",label:"\u6CAD\u9633"},{value:"\u5BBF\u8FC1",label:"\u5BBF\u8FC1"},{value:"\u82CF\u5DDE",label:"\u82CF\u5DDE"},{value:"\u592A\u4ED3",label:"\u592A\u4ED3"},{value:"\u6CF0\u5DDE",label:"\u6CF0\u5DDE"},{value:"\u540C\u91CC",label:"\u540C\u91CC"},{value:"\u65E0\u9521",label:"\u65E0\u9521"},{value:"\u5F90\u5DDE",label:"\u5F90\u5DDE"},{value:"\u76D0\u57CE",label:"\u76D0\u57CE"},{value:"\u626C\u5DDE",label:"\u626C\u5DDE"},{value:"\u5B9C\u5174",label:"\u5B9C\u5174"},{value:"\u4EEA\u5F81",label:"\u4EEA\u5F81"},{value:"\u5F20\u5BB6\u6E2F",label:"\u5F20\u5BB6\u6E2F"},{value:"\u9547\u6C5F",label:"\u9547\u6C5F"}]},{value:"\u91CD\u5E86",label:"\u91CD\u5E86",children:[{value:"\u4E07\u5DDE",label:"\u4E07\u5DDE"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u6E1D\u4E2D",label:"\u6E1D\u4E2D"},{value:"\u5927\u6E21\u53E3",label:"\u5927\u6E21\u53E3"},{value:"\u6C5F\u5317",label:"\u6C5F\u5317"},{value:"\u6C99\u576A\u575D",label:"\u6C99\u576A\u575D"},{value:"\u4E5D\u9F99\u5761",label:"\u4E5D\u9F99\u5761"},{value:"\u5357\u5CB8",label:"\u5357\u5CB8"},{value:"\u5317\u789A",label:"\u5317\u789A"},{value:"\u4E07\u76DB",label:"\u4E07\u76DB"},{value:"\u53CC\u6322",label:"\u53CC\u6322"},{value:"\u6E1D\u5317",label:"\u6E1D\u5317"},{value:"\u5DF4\u5357",label:"\u5DF4\u5357"},{value:"\u9ED4\u6C5F",label:"\u9ED4\u6C5F"},{value:"\u957F\u5BFF",label:"\u957F\u5BFF"},{value:"\u7DA6\u6C5F",label:"\u7DA6\u6C5F"},{value:"\u6F7C\u5357",label:"\u6F7C\u5357"},{value:"\u94DC\u6881",label:"\u94DC\u6881"},{value:"\u5927\u8DB3",label:"\u5927\u8DB3"},{value:"\u8363\u660C",label:"\u8363\u660C"},{value:"\u58C1\u5C71",label:"\u58C1\u5C71"},{value:"\u6881\u5E73",label:"\u6881\u5E73"},{value:"\u57CE\u53E3",label:"\u57CE\u53E3"},{value:"\u4E30\u90FD",label:"\u4E30\u90FD"},{value:"\u57AB\u6C5F",label:"\u57AB\u6C5F"},{value:"\u6B66\u9686",label:"\u6B66\u9686"},{value:"\u5FE0\u53BF",label:"\u5FE0\u53BF"},{value:"\u5F00\u53BF",label:"\u5F00\u53BF"},{value:"\u4E91\u9633",label:"\u4E91\u9633"},{value:"\u5949\u8282",label:"\u5949\u8282"},{value:"\u5DEB\u5C71",label:"\u5DEB\u5C71"},{value:"\u5DEB\u6EAA",label:"\u5DEB\u6EAA"},{value:"\u77F3\u67F1",label:"\u77F3\u67F1"},{value:"\u79C0\u5C71",label:"\u79C0\u5C71"},{value:"\u9149\u9633",label:"\u9149\u9633"},{value:"\u5F6D\u6C34",label:"\u5F6D\u6C34"},{value:"\u6C5F\u6D25",label:"\u6C5F\u6D25"},{value:"\u5408\u5DDD",label:"\u5408\u5DDD"},{value:"\u6C38\u5DDD",label:"\u6C38\u5DDD"},{value:"\u5357\u5DDD",label:"\u5357\u5DDD"}]},{value:"\u5B89\u5FBD",label:"\u5B89\u5FBD",children:[{value:"\u5408\u80A5",label:"\u5408\u80A5"},{value:"\u5B89\u5E86",label:"\u5B89\u5E86"},{value:"\u868C\u57E0",label:"\u868C\u57E0"},{value:"\u4EB3\u5DDE",label:"\u4EB3\u5DDE"},{value:"\u5DE2\u6E56",label:"\u5DE2\u6E56"},{value:"\u6EC1\u5DDE",label:"\u6EC1\u5DDE"},{value:"\u961C\u9633",label:"\u961C\u9633"},{value:"\u8D35\u6C60",label:"\u8D35\u6C60"},{value:"\u6DEE\u5317",label:"\u6DEE\u5317"},{value:"\u6DEE\u5316",label:"\u6DEE\u5316"},{value:"\u6DEE\u5357",label:"\u6DEE\u5357"},{value:"\u9EC4\u5C71",label:"\u9EC4\u5C71"},{value:"\u4E5D\u534E\u5C71",label:"\u4E5D\u534E\u5C71"},{value:"\u516D\u5B89",label:"\u516D\u5B89"},{value:"\u9A6C\u978D\u5C71",label:"\u9A6C\u978D\u5C71"},{value:"\u5BBF\u5DDE",label:"\u5BBF\u5DDE"},{value:"\u94DC\u9675",label:"\u94DC\u9675"},{value:"\u5C6F\u6EAA",label:"\u5C6F\u6EAA"},{value:"\u829C\u6E56",label:"\u829C\u6E56"},{value:"\u5BA3\u57CE",label:"\u5BA3\u57CE"}]},{value:"\u798F\u5EFA",label:"\u798F\u5EFA",children:[{value:"\u798F\u5DDE",label:"\u798F\u5DDE"},{value:"\u53A6\u95E8",label:"\u53A6\u95E8"},{value:"\u6CC9\u5DDE",label:"\u6CC9\u5DDE"},{value:"\u6F33\u5DDE",label:"\u6F33\u5DDE"},{value:"\u9F99\u5CA9",label:"\u9F99\u5CA9"},{value:"\u5357\u5E73",label:"\u5357\u5E73"},{value:"\u5B81\u5FB7",label:"\u5B81\u5FB7"},{value:"\u8386\u7530",label:"\u8386\u7530"},{value:"\u4E09\u660E",label:"\u4E09\u660E"}]},{value:"\u7518\u8083",label:"\u7518\u8083",children:[{value:"\u5170\u5DDE",label:"\u5170\u5DDE"},{value:"\u5609\u5CEA\u5173",label:"\u5609\u5CEA\u5173"},{value:"\u767D\u94F6",label:"\u767D\u94F6"},{value:"\u5B9A\u897F",label:"\u5B9A\u897F"},{value:"\u6566\u714C",label:"\u6566\u714C"},{value:"\u7518\u5357",label:"\u7518\u5357"},{value:"\u91D1\u660C",label:"\u91D1\u660C"},{value:"\u9152\u6CC9",label:"\u9152\u6CC9"},{value:"\u4E34\u590F",label:"\u4E34\u590F"},{value:"\u5E73\u51C9",label:"\u5E73\u51C9"},{value:"\u5929\u6C34",label:"\u5929\u6C34"},{value:"\u9647\u5357",label:"\u9647\u5357"},{value:"\u6B66\u5A01",label:"\u6B66\u5A01"},{value:"\u897F\u5CF0",label:"\u897F\u5CF0"},{value:"\u5F20\u6396",label:"\u5F20\u6396"}]},{value:"\u5E7F\u897F",label:"\u5E7F\u897F",children:[{value:"\u5357\u5B81",label:"\u5357\u5B81"},{value:"\u6765\u5BBE",label:"\u6765\u5BBE"},{value:"\u767E\u8272",label:"\u767E\u8272"},{value:"\u5317\u6D77",label:"\u5317\u6D77"},{value:"\u6842\u6797",label:"\u6842\u6797"},{value:"\u9632\u57CE\u6E2F",label:"\u9632\u57CE\u6E2F"},{value:"\u8D35\u6E2F",label:"\u8D35\u6E2F"},{value:"\u6CB3\u6C60",label:"\u6CB3\u6C60"},{value:"\u8D3A\u5DDE",label:"\u8D3A\u5DDE"},{value:"\u67F3\u5DDE",label:"\u67F3\u5DDE"},{value:"\u94A6\u5DDE",label:"\u94A6\u5DDE"},{value:"\u68A7\u5DDE",label:"\u68A7\u5DDE"},{value:"\u7389\u6797",label:"\u7389\u6797"}]},{value:"\u8D35\u5DDE",label:"\u8D35\u5DDE",children:[{value:"\u8D35\u9633",label:"\u8D35\u9633"},{value:"\u5B89\u987A",label:"\u5B89\u987A"},{value:"\u6BD5\u8282",label:"\u6BD5\u8282"},{value:"\u90FD\u5300",label:"\u90FD\u5300"},{value:"\u51EF\u91CC",label:"\u51EF\u91CC"},{value:"\u516D\u76D8\u6C34",label:"\u516D\u76D8\u6C34"},{value:"\u94DC\u4EC1",label:"\u94DC\u4EC1"},{value:"\u5174\u4E49",label:"\u5174\u4E49"},{value:"\u7389\u5C4F",label:"\u7389\u5C4F"},{value:"\u9075\u4E49",label:"\u9075\u4E49"}]},{value:"\u6D77\u5357",label:"\u6D77\u5357",children:[{value:"\u6D77\u53E3",label:"\u6D77\u53E3"},{value:"\u510B\u53BF",label:"\u510B\u53BF"},{value:"\u9675\u6C34",label:"\u9675\u6C34"},{value:"\u743C\u6D77",label:"\u743C\u6D77"},{value:"\u4E09\u4E9A",label:"\u4E09\u4E9A"},{value:"\u901A\u4EC0",label:"\u901A\u4EC0"},{value:"\u4E07\u5B81",label:"\u4E07\u5B81"}]},{value:"\u6CB3\u5317",label:"\u6CB3\u5317",children:[{value:"\u77F3\u5BB6\u5E84",label:"\u77F3\u5BB6\u5E84"},{value:"\u4FDD\u5B9A",label:"\u4FDD\u5B9A"},{value:"\u5317\u6234\u6CB3",label:"\u5317\u6234\u6CB3"},{value:"\u6CA7\u5DDE",label:"\u6CA7\u5DDE"},{value:"\u627F\u5FB7",label:"\u627F\u5FB7"},{value:"\u4E30\u6DA6",label:"\u4E30\u6DA6"},{value:"\u90AF\u90F8",label:"\u90AF\u90F8"},{value:"\u8861\u6C34",label:"\u8861\u6C34"},{value:"\u5ECA\u574A",label:"\u5ECA\u574A"},{value:"\u5357\u6234\u6CB3",label:"\u5357\u6234\u6CB3"},{value:"\u79E6\u7687\u5C9B",label:"\u79E6\u7687\u5C9B"},{value:"\u5510\u5C71",label:"\u5510\u5C71"},{value:"\u65B0\u57CE",label:"\u65B0\u57CE"},{value:"\u90A2\u53F0",label:"\u90A2\u53F0"},{value:"\u5F20\u5BB6\u53E3",label:"\u5F20\u5BB6\u53E3"}]},{value:"\u9ED1\u9F99\u6C5F",label:"\u9ED1\u9F99\u6C5F",children:[{value:"\u54C8\u5C14\u6EE8",label:"\u54C8\u5C14\u6EE8"},{value:"\u5317\u5B89",label:"\u5317\u5B89"},{value:"\u5927\u5E86",label:"\u5927\u5E86"},{value:"\u5927\u5174\u5B89\u5CAD",label:"\u5927\u5174\u5B89\u5CAD"},{value:"\u9E64\u5C97",label:"\u9E64\u5C97"},{value:"\u9ED1\u6CB3",label:"\u9ED1\u6CB3"},{value:"\u4F73\u6728\u65AF",label:"\u4F73\u6728\u65AF"},{value:"\u9E21\u897F",label:"\u9E21\u897F"},{value:"\u7261\u4E39\u6C5F",label:"\u7261\u4E39\u6C5F"},{value:"\u9F50\u9F50\u54C8\u5C14",label:"\u9F50\u9F50\u54C8\u5C14"},{value:"\u4E03\u53F0\u6CB3",label:"\u4E03\u53F0\u6CB3"},{value:"\u53CC\u9E2D\u5C71",label:"\u53CC\u9E2D\u5C71"},{value:"\u7EE5\u5316",label:"\u7EE5\u5316"},{value:"\u4F0A\u6625",label:"\u4F0A\u6625"}]},{value:"\u6CB3\u5357",label:"\u6CB3\u5357",children:[{value:"\u90D1\u5DDE",label:"\u90D1\u5DDE"},{value:"\u5B89\u9633",label:"\u5B89\u9633"},{value:"\u9E64\u58C1",label:"\u9E64\u58C1"},{value:"\u6F62\u5DDD",label:"\u6F62\u5DDD"},{value:"\u7126\u4F5C",label:"\u7126\u4F5C"},{value:"\u6D4E\u6E90",label:"\u6D4E\u6E90"},{value:"\u5F00\u5C01",label:"\u5F00\u5C01"},{value:"\u6F2F\u6CB3",label:"\u6F2F\u6CB3"},{value:"\u6D1B\u9633",label:"\u6D1B\u9633"},{value:"\u5357\u9633",label:"\u5357\u9633"},{value:"\u5E73\u9876\u5C71",label:"\u5E73\u9876\u5C71"},{value:"\u6FEE\u9633",label:"\u6FEE\u9633"},{value:"\u4E09\u95E8\u5CE1",label:"\u4E09\u95E8\u5CE1"},{value:"\u5546\u4E18",label:"\u5546\u4E18"},{value:"\u65B0\u4E61",label:"\u65B0\u4E61"},{value:"\u4FE1\u9633",label:"\u4FE1\u9633"},{value:"\u8BB8\u660C",label:"\u8BB8\u660C"},{value:"\u5468\u53E3",label:"\u5468\u53E3"},{value:"\u9A7B\u9A6C\u5E97",label:"\u9A7B\u9A6C\u5E97"}]},{value:"\u9999\u6E2F",label:"\u9999\u6E2F",children:[{value:"\u9999\u6E2F",label:"\u9999\u6E2F"},{value:"\u4E5D\u9F99",label:"\u4E5D\u9F99"},{value:"\u65B0\u754C",label:"\u65B0\u754C"}]},{value:"\u6E56\u5317",label:"\u6E56\u5317",children:[{value:"\u6B66\u6C49",label:"\u6B66\u6C49"},{value:"\u5929\u95E8",label:"\u5929\u95E8"},{value:"\u6069\u65BD",label:"\u6069\u65BD"},{value:"\u9102\u5DDE",label:"\u9102\u5DDE"},{value:"\u9EC4\u5188",label:"\u9EC4\u5188"},{value:"\u9EC4\u77F3",label:"\u9EC4\u77F3"},{value:"\u8346\u95E8",label:"\u8346\u95E8"},{value:"\u8346\u5DDE",label:"\u8346\u5DDE"},{value:"\u6F5C\u6C5F",label:"\u6F5C\u6C5F"},{value:"\u5341\u5830",label:"\u5341\u5830"},{value:"\u968F\u5DDE",label:"\u968F\u5DDE"},{value:"\u6B66\u7A74",label:"\u6B66\u7A74"},{value:"\u4ED9\u6843",label:"\u4ED9\u6843"},{value:"\u54B8\u5B81",label:"\u54B8\u5B81"},{value:"\u8944\u9633",label:"\u8944\u9633"},{value:"\u8944\u6A0A",label:"\u8944\u6A0A"},{value:"\u5B5D\u611F",label:"\u5B5D\u611F"},{value:"\u5B9C\u660C",label:"\u5B9C\u660C"}]},{value:"\u6E56\u5357",label:"\u6E56\u5357",children:[{value:"\u957F\u6C99",label:"\u957F\u6C99"},{value:"\u5E38\u5FB7",label:"\u5E38\u5FB7"},{value:"\u90F4\u5DDE",label:"\u90F4\u5DDE"},{value:"\u8861\u9633",label:"\u8861\u9633"},{value:"\u6000\u5316",label:"\u6000\u5316"},{value:"\u5409\u9996",label:"\u5409\u9996"},{value:"\u5A04\u5E95",label:"\u5A04\u5E95"},{value:"\u90B5\u9633",label:"\u90B5\u9633"},{value:"\u6E58\u6F6D",label:"\u6E58\u6F6D"},{value:"\u76CA\u9633",label:"\u76CA\u9633"},{value:"\u5CB3\u9633",label:"\u5CB3\u9633"},{value:"\u6C38\u5DDE",label:"\u6C38\u5DDE"},{value:"\u5F20\u5BB6\u754C",label:"\u5F20\u5BB6\u754C"},{value:"\u682A\u6D32",label:"\u682A\u6D32"}]},{value:"\u6C5F\u897F",label:"\u6C5F\u897F",children:[{value:"\u5357\u660C",label:"\u5357\u660C"},{value:"\u629A\u5DDE",label:"\u629A\u5DDE"},{value:"\u8D63\u5DDE",label:"\u8D63\u5DDE"},{value:"\u5409\u5B89",label:"\u5409\u5B89"},{value:"\u666F\u5FB7\u9547",label:"\u666F\u5FB7\u9547"},{value:"\u4E95\u5188\u5C71",label:"\u4E95\u5188\u5C71"},{value:"\u4E5D\u6C5F",label:"\u4E5D\u6C5F"},{value:"\u5E90\u5C71",label:"\u5E90\u5C71"},{value:"\u840D\u4E61",label:"\u840D\u4E61"},{value:"\u4E0A\u9976",label:"\u4E0A\u9976"},{value:"\u65B0\u4F59",label:"\u65B0\u4F59"},{value:"\u5B9C\u6625",label:"\u5B9C\u6625"},{value:"\u9E70\u6F6D",label:"\u9E70\u6F6D"}]},{value:"\u5409\u6797",label:"\u5409\u6797",children:[{value:"\u957F\u6625",label:"\u957F\u6625"},{value:"\u5409\u6797",label:"\u5409\u6797"},{value:"\u767D\u57CE",label:"\u767D\u57CE"},{value:"\u767D\u5C71",label:"\u767D\u5C71"},{value:"\u73F2\u6625",label:"\u73F2\u6625"},{value:"\u8FBD\u6E90",label:"\u8FBD\u6E90"},{value:"\u6885\u6CB3",label:"\u6885\u6CB3"},{value:"\u56DB\u5E73",label:"\u56DB\u5E73"},{value:"\u677E\u539F",label:"\u677E\u539F"},{value:"\u901A\u5316",label:"\u901A\u5316"},{value:"\u5EF6\u5409",label:"\u5EF6\u5409"}]},{value:"\u8FBD\u5B81",label:"\u8FBD\u5B81",children:[{value:"\u6C88\u9633",label:"\u6C88\u9633"},{value:"\u978D\u5C71",label:"\u978D\u5C71"},{value:"\u672C\u6EAA",label:"\u672C\u6EAA"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u5927\u8FDE",label:"\u5927\u8FDE"},{value:"\u4E39\u4E1C",label:"\u4E39\u4E1C"},{value:"\u629A\u987A",label:"\u629A\u987A"},{value:"\u961C\u65B0",label:"\u961C\u65B0"},{value:"\u846B\u82A6\u5C9B",label:"\u846B\u82A6\u5C9B"},{value:"\u9526\u5DDE",label:"\u9526\u5DDE"},{value:"\u8FBD\u9633",label:"\u8FBD\u9633"},{value:"\u76D8\u9526",label:"\u76D8\u9526"},{value:"\u94C1\u5CAD",label:"\u94C1\u5CAD"},{value:"\u8425\u53E3",label:"\u8425\u53E3"}]},{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8",children:[{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8"}]},{value:"\u5185\u8499\u53E4",label:"\u5185\u8499\u53E4",children:[{value:"\u547C\u548C\u6D69\u7279",label:"\u547C\u548C\u6D69\u7279"},{value:"\u963F\u62C9\u5584\u76DF",label:"\u963F\u62C9\u5584\u76DF"},{value:"\u5305\u5934",label:"\u5305\u5934"},{value:"\u8D64\u5CF0",label:"\u8D64\u5CF0"},{value:"\u4E1C\u80DC",label:"\u4E1C\u80DC"},{value:"\u6D77\u62C9\u5C14",label:"\u6D77\u62C9\u5C14"},{value:"\u96C6\u5B81",label:"\u96C6\u5B81"},{value:"\u4E34\u6CB3",label:"\u4E34\u6CB3"},{value:"\u901A\u8FBD",label:"\u901A\u8FBD"},{value:"\u4E4C\u6D77",label:"\u4E4C\u6D77"},{value:"\u4E4C\u5170\u6D69\u7279",label:"\u4E4C\u5170\u6D69\u7279"},{value:"\u9521\u6797\u6D69\u7279",label:"\u9521\u6797\u6D69\u7279"}]},{value:"\u5B81\u590F",label:"\u5B81\u590F",children:[{value:"\u94F6\u5DDD",label:"\u94F6\u5DDD"},{value:"\u56FA\u6E90",label:"\u56FA\u6E90"},{value:"\u77F3\u5634\u5C71",label:"\u77F3\u5634\u5C71"},{value:"\u5434\u5FE0",label:"\u5434\u5FE0"}]},{value:"\u9752\u6D77",label:"\u9752\u6D77",children:[{value:"\u897F\u5B81",label:"\u897F\u5B81"},{value:"\u5FB7\u4EE4\u54C8",label:"\u5FB7\u4EE4\u54C8"},{value:"\u683C\u5C14\u6728",label:"\u683C\u5C14\u6728"},{value:"\u5171\u548C",label:"\u5171\u548C"},{value:"\u6D77\u4E1C",label:"\u6D77\u4E1C"},{value:"\u6D77\u664F",label:"\u6D77\u664F"},{value:"\u739B\u6C81",label:"\u739B\u6C81"},{value:"\u540C\u4EC1",label:"\u540C\u4EC1"},{value:"\u7389\u6811",label:"\u7389\u6811"}]},{value:"\u5C71\u4E1C",label:"\u5C71\u4E1C",children:[{value:"\u6D4E\u5357",label:"\u6D4E\u5357"},{value:"\u6EE8\u5DDE",label:"\u6EE8\u5DDE"},{value:"\u5156\u5DDE",label:"\u5156\u5DDE"},{value:"\u5FB7\u5DDE",label:"\u5FB7\u5DDE"},{value:"\u4E1C\u8425",label:"\u4E1C\u8425"},{value:"\u83CF\u6CFD",label:"\u83CF\u6CFD"},{value:"\u6D4E\u5B81",label:"\u6D4E\u5B81"},{value:"\u83B1\u829C",label:"\u83B1\u829C"},{value:"\u804A\u57CE",label:"\u804A\u57CE"},{value:"\u4E34\u6C82",label:"\u4E34\u6C82"},{value:"\u84EC\u83B1",label:"\u84EC\u83B1"},{value:"\u9752\u5C9B",label:"\u9752\u5C9B"},{value:"\u66F2\u961C",label:"\u66F2\u961C"},{value:"\u65E5\u7167",label:"\u65E5\u7167"},{value:"\u6CF0\u5B89",label:"\u6CF0\u5B89"},{value:"\u6F4D\u574A",label:"\u6F4D\u574A"},{value:"\u5A01\u6D77",label:"\u5A01\u6D77"},{value:"\u70DF\u53F0",label:"\u70DF\u53F0"},{value:"\u67A3\u5E84",label:"\u67A3\u5E84"},{value:"\u6DC4\u535A",label:"\u6DC4\u535A"}]},{value:"\u5C71\u897F",label:"\u5C71\u897F",children:[{value:"\u592A\u539F",label:"\u592A\u539F"},{value:"\u5415\u6881",label:"\u5415\u6881"},{value:"\u957F\u6CBB",label:"\u957F\u6CBB"},{value:"\u5927\u540C",label:"\u5927\u540C"},{value:"\u5019\u9A6C",label:"\u5019\u9A6C"},{value:"\u664B\u57CE",label:"\u664B\u57CE"},{value:"\u79BB\u77F3",label:"\u79BB\u77F3"},{value:"\u4E34\u6C7E",label:"\u4E34\u6C7E"},{value:"\u5B81\u6B66",label:"\u5B81\u6B66"},{value:"\u6714\u5DDE",label:"\u6714\u5DDE"},{value:"\u5FFB\u5DDE",label:"\u5FFB\u5DDE"},{value:"\u9633\u6CC9",label:"\u9633\u6CC9"},{value:"\u6986\u6B21",label:"\u6986\u6B21"},{value:"\u664B\u4E2D",label:"\u664B\u4E2D"},{value:"\u8FD0\u57CE",label:"\u8FD0\u57CE"}]},{value:"\u9655\u897F",label:"\u9655\u897F",children:[{value:"\u897F\u5B89",label:"\u897F\u5B89"},{value:"\u5B89\u5EB7",label:"\u5B89\u5EB7"},{value:"\u5B9D\u9E21",label:"\u5B9D\u9E21"},{value:"\u6C49\u4E2D",label:"\u6C49\u4E2D"},{value:"\u6E2D\u5357",label:"\u6E2D\u5357"},{value:"\u5546\u5DDE",label:"\u5546\u5DDE"},{value:"\u7EE5\u5FB7",label:"\u7EE5\u5FB7"},{value:"\u94DC\u5DDD",label:"\u94DC\u5DDD"},{value:"\u54B8\u9633",label:"\u54B8\u9633"},{value:"\u5EF6\u5B89",label:"\u5EF6\u5B89"},{value:"\u6986\u6797",label:"\u6986\u6797"}]},{value:"\u56DB\u5DDD",label:"\u56DB\u5DDD",children:[{value:"\u6210\u90FD",label:"\u6210\u90FD"},{value:"\u5DF4\u4E2D",label:"\u5DF4\u4E2D"},{value:"\u8FBE\u5DDD",label:"\u8FBE\u5DDD"},{value:"\u5FB7\u9633",label:"\u5FB7\u9633"},{value:"\u90FD\u6C5F\u5830",label:"\u90FD\u6C5F\u5830"},{value:"\u5CE8\u7709\u5C71",label:"\u5CE8\u7709\u5C71"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u5E7F\u5B89",label:"\u5E7F\u5B89"},{value:"\u5E7F\u5143",label:"\u5E7F\u5143"},{value:"\u4E5D\u5BE8\u6C9F",label:"\u4E5D\u5BE8\u6C9F"},{value:"\u5EB7\u5B9A",label:"\u5EB7\u5B9A"},{value:"\u4E50\u5C71",label:"\u4E50\u5C71"},{value:"\u6CF8\u5DDE",label:"\u6CF8\u5DDE"},{value:"\u9A6C\u5C14\u5EB7",label:"\u9A6C\u5C14\u5EB7"},{value:"\u7EF5\u9633",label:"\u7EF5\u9633"},{value:"\u7709\u5C71",label:"\u7709\u5C71"},{value:"\u5357\u5145",label:"\u5357\u5145"},{value:"\u5185\u6C5F",label:"\u5185\u6C5F"},{value:"\u6500\u679D\u82B1",label:"\u6500\u679D\u82B1"},{value:"\u9042\u5B81",label:"\u9042\u5B81"},{value:"\u6C76\u5DDD",label:"\u6C76\u5DDD"},{value:"\u897F\u660C",label:"\u897F\u660C"},{value:"\u96C5\u5B89",label:"\u96C5\u5B89"},{value:"\u5B9C\u5BBE",label:"\u5B9C\u5BBE"},{value:"\u81EA\u8D21",label:"\u81EA\u8D21"},{value:"\u8D44\u9633",label:"\u8D44\u9633"}]},{value:"\u53F0\u6E7E",label:"\u53F0\u6E7E",children:[{value:"\u53F0\u5317",label:"\u53F0\u5317"},{value:"\u57FA\u9686",label:"\u57FA\u9686"},{value:"\u53F0\u5357",label:"\u53F0\u5357"},{value:"\u53F0\u4E2D",label:"\u53F0\u4E2D"},{value:"\u9AD8\u96C4",label:"\u9AD8\u96C4"},{value:"\u5C4F\u4E1C",label:"\u5C4F\u4E1C"},{value:"\u5357\u6295",label:"\u5357\u6295"},{value:"\u4E91\u6797",label:"\u4E91\u6797"},{value:"\u65B0\u7AF9",label:"\u65B0\u7AF9"},{value:"\u5F70\u5316",label:"\u5F70\u5316"},{value:"\u82D7\u6817",label:"\u82D7\u6817"},{value:"\u5609\u4E49",label:"\u5609\u4E49"},{value:"\u6843\u56ED",label:"\u6843\u56ED"},{value:"\u5B9C\u5170",label:"\u5B9C\u5170"},{value:"\u53F0\u4E1C",label:"\u53F0\u4E1C"},{value:"\u91D1\u95E8",label:"\u91D1\u95E8"},{value:"\u9A6C\u7956",label:"\u9A6C\u7956"},{value:"\u6F8E\u6E56",label:"\u6F8E\u6E56"}]},{value:"\u5929\u6D25",label:"\u5929\u6D25",children:[{value:"\u5929\u6D25",label:"\u5929\u6D25"},{value:"\u548C\u5E73",label:"\u548C\u5E73"},{value:"\u4E1C\u4E3D",label:"\u4E1C\u4E3D"},{value:"\u6CB3\u4E1C",label:"\u6CB3\u4E1C"},{value:"\u897F\u9752",label:"\u897F\u9752"},{value:"\u6CB3\u897F",label:"\u6CB3\u897F"},{value:"\u6D25\u5357",label:"\u6D25\u5357"},{value:"\u5357\u5F00",label:"\u5357\u5F00"},{value:"\u5317\u8FB0",label:"\u5317\u8FB0"},{value:"\u6CB3\u5317",label:"\u6CB3\u5317"},{value:"\u6B66\u6E05",label:"\u6B66\u6E05"},{value:"\u7EA2\u6322",label:"\u7EA2\u6322"},{value:"\u5858\u6CBD",label:"\u5858\u6CBD"},{value:"\u6C49\u6CBD",label:"\u6C49\u6CBD"},{value:"\u5927\u6E2F",label:"\u5927\u6E2F"},{value:"\u5B81\u6CB3",label:"\u5B81\u6CB3"},{value:"\u9759\u6D77",label:"\u9759\u6D77"},{value:"\u5B9D\u577B",label:"\u5B9D\u577B"},{value:"\u84DF\u53BF",label:"\u84DF\u53BF"}]},{value:"\u65B0\u7586",label:"\u65B0\u7586",children:[{value:"\u4E4C\u9C81\u6728\u9F50",label:"\u4E4C\u9C81\u6728\u9F50"},{value:"\u963F\u514B\u82CF",label:"\u963F\u514B\u82CF"},{value:"\u963F\u52D2\u6CF0",label:"\u963F\u52D2\u6CF0"},{value:"\u963F\u56FE\u4EC0",label:"\u963F\u56FE\u4EC0"},{value:"\u535A\u4E50",label:"\u535A\u4E50"},{value:"\u660C\u5409",label:"\u660C\u5409"},{value:"\u4E1C\u5C71",label:"\u4E1C\u5C71"},{value:"\u54C8\u5BC6",label:"\u54C8\u5BC6"},{value:"\u548C\u7530",label:"\u548C\u7530"},{value:"\u5580\u4EC0",label:"\u5580\u4EC0"},{value:"\u514B\u62C9\u739B\u4F9D",label:"\u514B\u62C9\u739B\u4F9D"},{value:"\u5E93\u8F66",label:"\u5E93\u8F66"},{value:"\u5E93\u5C14\u52D2",label:"\u5E93\u5C14\u52D2"},{value:"\u594E\u5C6F",label:"\u594E\u5C6F"},{value:"\u77F3\u6CB3\u5B50",label:"\u77F3\u6CB3\u5B50"},{value:"\u5854\u57CE",label:"\u5854\u57CE"},{value:"\u5410\u9C81\u756A",label:"\u5410\u9C81\u756A"},{value:"\u4F0A\u5B81",label:"\u4F0A\u5B81"}]},{value:"\u897F\u85CF",label:"\u897F\u85CF",children:[{value:"\u62C9\u8428",label:"\u62C9\u8428"},{value:"\u963F\u91CC",label:"\u963F\u91CC"},{value:"\u660C\u90FD",label:"\u660C\u90FD"},{value:"\u6797\u829D",label:"\u6797\u829D"},{value:"\u90A3\u66F2",label:"\u90A3\u66F2"},{value:"\u65E5\u5580\u5219",label:"\u65E5\u5580\u5219"},{value:"\u5C71\u5357",label:"\u5C71\u5357"}]},{value:"\u4E91\u5357",label:"\u4E91\u5357",children:[{value:"\u6606\u660E",label:"\u6606\u660E"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4FDD\u5C71",label:"\u4FDD\u5C71"},{value:"\u695A\u96C4",label:"\u695A\u96C4"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4E1C\u5DDD",label:"\u4E1C\u5DDD"},{value:"\u4E2A\u65E7",label:"\u4E2A\u65E7"},{value:"\u666F\u6D2A",label:"\u666F\u6D2A"},{value:"\u5F00\u8FDC",label:"\u5F00\u8FDC"},{value:"\u4E34\u6CA7",label:"\u4E34\u6CA7"},{value:"\u4E3D\u6C5F",label:"\u4E3D\u6C5F"},{value:"\u516D\u5E93",label:"\u516D\u5E93"},{value:"\u6F5E\u897F",label:"\u6F5E\u897F"},{value:"\u66F2\u9756",label:"\u66F2\u9756"},{value:"\u601D\u8305",label:"\u601D\u8305"},{value:"\u6587\u5C71",label:"\u6587\u5C71"},{value:"\u897F\u53CC\u7248\u7EB3",label:"\u897F\u53CC\u7248\u7EB3"},{value:"\u7389\u6EAA",label:"\u7389\u6EAA"},{value:"\u4E2D\u7538",label:"\u4E2D\u7538"},{value:"\u662D\u901A",label:"\u662D\u901A"}]},{value:"\u6D59\u6C5F",label:"\u6D59\u6C5F",children:[{value:"\u676D\u5DDE",label:"\u676D\u5DDE"},{value:"\u6E29\u5DDE",label:"\u6E29\u5DDE"},{value:"\u5B89\u5409",label:"\u5B89\u5409"},{value:"\u6148\u6EAA",label:"\u6148\u6EAA"},{value:"\u5B9A\u6D77",label:"\u5B9A\u6D77"},{value:"\u5949\u5316",label:"\u5949\u5316"},{value:"\u6D77\u76D0",label:"\u6D77\u76D0"},{value:"\u9EC4\u5CA9",label:"\u9EC4\u5CA9"},{value:"\u6E56\u5DDE",label:"\u6E56\u5DDE"},{value:"\u5609\u5174",label:"\u5609\u5174"},{value:"\u91D1\u534E",label:"\u91D1\u534E"},{value:"\u4E34\u5B89",label:"\u4E34\u5B89"},{value:"\u4E34\u6D77",label:"\u4E34\u6D77"},{value:"\u4E3D\u6C34",label:"\u4E3D\u6C34"},{value:"\u5B81\u6CE2",label:"\u5B81\u6CE2"},{value:"\u74EF\u6D77",label:"\u74EF\u6D77"},{value:"\u5E73\u6E56",label:"\u5E73\u6E56"},{value:"\u5343\u5C9B\u6E56",label:"\u5343\u5C9B\u6E56"},{value:"\u8862\u5DDE",label:"\u8862\u5DDE"},{value:"\u6C5F\u5C71",label:"\u6C5F\u5C71"},{value:"\u745E\u5B89",label:"\u745E\u5B89"},{value:"\u7ECD\u5174",label:"\u7ECD\u5174"},{value:"\u5D4A\u5DDE",label:"\u5D4A\u5DDE"},{value:"\u53F0\u5DDE",label:"\u53F0\u5DDE"},{value:"\u6E29\u5CAD",label:"\u6E29\u5CAD"},{value:"\u4F59\u59DA",label:"\u4F59\u59DA"},{value:"\u821F\u5C71",label:"\u821F\u5C71"}]},{value:"\u6D77\u5916",label:"\u6D77\u5916",children:[{value:"\u7F8E\u56FD",label:"\u7F8E\u56FD"},{value:"\u65E5\u672C",label:"\u65E5\u672C"},{value:"\u82F1\u56FD",label:"\u82F1\u56FD"},{value:"\u6CD5\u56FD",label:"\u6CD5\u56FD"},{value:"\u5FB7\u56FD",label:"\u5FB7\u56FD"},{value:"\u5176\u4ED6",label:"\u5176\u4ED6"}]}]},h78n:function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return E});var oe=te("cDcd"),H=te.n(oe),L=te("TSYQ"),z=te.n(L),I={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},P=function(j){var K=j.map(function(){return Object(oe.useRef)()}),k=Object(oe.useRef)();return Object(oe.useEffect)(function(){var M=Date.now(),G=!1;Object.keys(K).forEach(function(ee){var ue=K[ee].current;if(!ue)return;G=!0;var de=ue.style;de.transitionDuration=".3s, .3s, .3s, .06s",k.current&&M-k.current<100&&(de.transitionDuration="0s, 0s")}),G&&(k.current=Date.now())}),[K]};function B(){return B=Object.assign||function(U){for(var j=1;j<arguments.length;j++){var K=arguments[j];for(var k in K)Object.prototype.hasOwnProperty.call(K,k)&&(U[k]=K[k])}return U},B.apply(this,arguments)}function N(U,j){return R(U)||C(U,j)||O(U,j)||_()}function _(){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,j){if(!U)return;if(typeof U=="string")return y(U,j);var K=Object.prototype.toString.call(U).slice(8,-1);if(K==="Object"&&U.constructor&&(K=U.constructor.name),K==="Map"||K==="Set")return Array.from(U);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return y(U,j)}function y(U,j){(j==null||j>U.length)&&(j=U.length);for(var K=0,k=new Array(j);K<j;K++)k[K]=U[K];return k}function C(U,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var K=[],k=!0,M=!1,G=void 0;try{for(var ee=U[Symbol.iterator](),ue;!(k=(ue=ee.next()).done)&&!(K.push(ue.value),j&&K.length===j);k=!0);}catch(de){M=!0,G=de}finally{try{!k&&ee.return!=null&&ee.return()}finally{if(M)throw G}}return K}function R(U){if(Array.isArray(U))return U}function A(U,j){if(U==null)return{};var K=b(U,j),k,M;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(U);for(M=0;M<G.length;M++){if(k=G[M],j.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,k))continue;K[k]=U[k]}}return K}function b(U,j){if(U==null)return{};var K={},k=Object.keys(U),M,G;for(G=0;G<k.length;G++){if(M=k[G],j.indexOf(M)>=0)continue;K[M]=U[M]}return K}var g=function(j){var K=j.className,k=j.percent,M=j.prefixCls,G=j.strokeColor,ee=j.strokeLinecap,ue=j.strokeWidth,de=j.style,be=j.trailColor,Ee=j.trailWidth,ae=j.transition,$=A(j,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete $.gapPosition;var re=Array.isArray(k)?k:[k],J=Array.isArray(G)?G:[G],ie=P(re),V=N(ie,1),Y=V[0],Z=ue/2,le=100-ue/2,xe="M ".concat(ee==="round"?Z:0,",").concat(Z,`
|
|
L `).concat(ee==="round"?le:100,",").concat(Z),he="0 0 100 ".concat(ue),Te=0;return H.a.createElement("svg",B({className:z()("".concat(M,"-line"),K),viewBox:he,preserveAspectRatio:"none",style:de},$),H.a.createElement("path",{className:"".concat(M,"-line-trail"),d:xe,strokeLinecap:ee,stroke:be,strokeWidth:Ee||ue,fillOpacity:"0"}),re.map(function(De,Pe){var Be={strokeDasharray:"".concat(De,"px, 100px"),strokeDashoffset:"-".concat(Te,"px"),transition:ae||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Me=J[Pe]||J[J.length-1];return Te+=De,H.a.createElement("path",{key:Pe,className:"".concat(M,"-line-path"),d:xe,strokeLinecap:ee,stroke:Me,strokeWidth:ue,fillOpacity:"0",ref:Y[Pe],style:Be})}))};g.defaultProps=I;var c=g;function o(){return o=Object.assign||function(U){for(var j=1;j<arguments.length;j++){var K=arguments[j];for(var k in K)Object.prototype.hasOwnProperty.call(K,k)&&(U[k]=K[k])}return U},o.apply(this,arguments)}function u(U,j){return S(U)||h(U,j)||T(U,j)||d()}function d(){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 T(U,j){if(!U)return;if(typeof U=="string")return p(U,j);var K=Object.prototype.toString.call(U).slice(8,-1);if(K==="Object"&&U.constructor&&(K=U.constructor.name),K==="Map"||K==="Set")return Array.from(U);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return p(U,j)}function p(U,j){(j==null||j>U.length)&&(j=U.length);for(var K=0,k=new Array(j);K<j;K++)k[K]=U[K];return k}function h(U,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var K=[],k=!0,M=!1,G=void 0;try{for(var ee=U[Symbol.iterator](),ue;!(k=(ue=ee.next()).done)&&!(K.push(ue.value),j&&K.length===j);k=!0);}catch(de){M=!0,G=de}finally{try{!k&&ee.return!=null&&ee.return()}finally{if(M)throw G}}return K}function S(U){if(Array.isArray(U))return U}function v(U,j){if(U==null)return{};var K=l(U,j),k,M;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(U);for(M=0;M<G.length;M++){if(k=G[M],j.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,k))continue;K[k]=U[k]}}return K}function l(U,j){if(U==null)return{};var K={},k=Object.keys(U),M,G;for(G=0;G<k.length;G++){if(M=k[G],j.indexOf(M)>=0)continue;K[M]=U[M]}return K}var f=0;function s(U){return+U.replace("%","")}function i(U){return Array.isArray(U)?U:[U]}function x(U,j,K,k){var M=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,G=arguments.length>5?arguments[5]:void 0,ee=50-k/2,ue=0,de=-ee,be=0,Ee=-2*ee;switch(G){case"left":ue=-ee,de=0,be=2*ee,Ee=0;break;case"right":ue=ee,de=0,be=-2*ee,Ee=0;break;case"bottom":de=ee,Ee=2*ee;break;default:}var ae="M 50,50 m ".concat(ue,",").concat(de,`
|
|
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(be,",").concat(-Ee,`
|
|
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(-be,",").concat(Ee),$=Math.PI*2*ee,re={stroke:K,strokeDasharray:"".concat(j/100*($-M),"px ").concat($,"px"),strokeDashoffset:"-".concat(M/2+U/100*($-M),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ae,pathStyle:re}}var m=function(j){var K=j.prefixCls,k=j.strokeWidth,M=j.trailWidth,G=j.gapDegree,ee=j.gapPosition,ue=j.trailColor,de=j.strokeLinecap,be=j.style,Ee=j.className,ae=j.strokeColor,$=j.percent,re=v(j,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),J=Object(oe.useMemo)(function(){return f+=1,f},[]),ie=x(0,100,ue,k,G,ee),V=ie.pathString,Y=ie.pathStyle,Z=i($),le=i(ae),xe=le.find(function(Be){return Object.prototype.toString.call(Be)==="[object Object]"}),he=P(Z),Te=u(he,1),De=Te[0],Pe=function(){var Me=0;return Z.map(function(ke,Ve){var Se=le[Ve]||le[le.length-1],Re=Object.prototype.toString.call(Se)==="[object Object]"?"url(#".concat(K,"-gradient-").concat(J,")"):"",_e=x(Me,ke,Se,k,G,ee);return Me+=ke,H.a.createElement("path",{key:Ve,className:"".concat(K,"-circle-path"),d:_e.pathString,stroke:Re,strokeLinecap:de,strokeWidth:k,opacity:ke===0?0:1,fillOpacity:"0",style:_e.pathStyle,ref:De[Ve]})})};return H.a.createElement("svg",o({className:z()("".concat(K,"-circle"),Ee),viewBox:"0 0 100 100",style:be},re),xe&&H.a.createElement("defs",null,H.a.createElement("linearGradient",{id:"".concat(K,"-gradient-").concat(J),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(xe).sort(function(Be,Me){return s(Be)-s(Me)}).map(function(Be,Me){return H.a.createElement("stop",{key:Me,offset:Be,stopColor:xe[Be]})}))),H.a.createElement("path",{className:"".concat(K,"-circle-trail"),d:V,stroke:ue,strokeLinecap:de,strokeWidth:M||k,fillOpacity:"0",style:Y}),Pe().reverse())};m.defaultProps=I;var E=m,D={Line:c,Circle:E}},hxT0:function(ot,Xe,te){ot.exports={bg:"bg___2samk",wrap:"wrap___1kw4T",crumbs:"crumbs___1aICA",titleWrap:"titleWrap___3U2TN",flexRow:"flexRow___2Ocys",flexJustifyCenter:"flexJustifyCenter___14s6l",flexAlignEnd:"flexAlignEnd___1lHt8",flexAlignCenter:"flexAlignCenter___2PtCV",flexColumn:"flexColumn___2Ssa4",formWrap:"formWrap___3Fcg8",fieldWrap:"fieldWrap___3K6pg",mdWrap:"mdWrap___3o_rf",backgroundFa:"backgroundFa___3dwFi",aBtn:"aBtn___12lxK",bBtn:"bBtn___18QB-",cascaderWrap:"cascaderWrap___ETHsj",listItem:"listItem___C62yl",right:"right___1iif8",one:"one___2Qd4F",schoolHintWrap:"schoolHintWrap___34WkA",colorCDCDCD:"colorCDCDCD___HqcpR",color0152d9:"color0152d9___cQ4G4",spanText:"spanText___1YP81"}},kSUc:function(ot,Xe,te){},lZu9:function(ot,Xe,te){(function(oe){oe(te("VrN/"),te("1eCo"),te("8EBN"))})(function(oe){"use strict";oe.defineMode("markdown",function(H,L){var z=oe.getMode(H,"text/html"),I=z.name=="null";function P(k){if(oe.findModeByName){var M=oe.findModeByName(k);M&&(k=M.mime||M.mimes[0])}var G=oe.getMode(H,k);return G.name=="null"?null:G}L.highlightFormatting===void 0&&(L.highlightFormatting=!1),L.maxBlockquoteDepth===void 0&&(L.maxBlockquoteDepth=0),L.taskLists===void 0&&(L.taskLists=!1),L.strikethrough===void 0&&(L.strikethrough=!1),L.emoji===void 0&&(L.emoji=!1),L.fencedCodeBlockHighlighting===void 0&&(L.fencedCodeBlockHighlighting=!0),L.fencedCodeBlockDefaultMode===void 0&&(L.fencedCodeBlockDefaultMode="text/plain"),L.xml===void 0&&(L.xml=!0),L.tokenTypeOverrides===void 0&&(L.tokenTypeOverrides={});var B={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var N in B)B.hasOwnProperty(N)&&L.tokenTypeOverrides[N]&&(B[N]=L.tokenTypeOverrides[N]);var _=/^([*\-_])(?:\s*\1){2,}\s*$/,O=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,C=L.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,R=/^ {0,3}(?:\={1,}|-{2,})\s*$/,A=/^[^#!\[\]*_\\<>` "'(~:]+/,b=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,g=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,o=" ";function u(k,M,G){return M.f=M.inline=G,G(k,M)}function d(k,M,G){return M.f=M.block=G,G(k,M)}function T(k){return!k||!/\S/.test(k.string)}function p(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==S){var M=I;if(!M){var G=oe.innerMode(z,k.htmlState);M=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}M&&(k.f=s,k.block=h,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function h(k,M){var G=k.column()===M.indentation,ee=T(M.prevLine.stream),ue=M.indentedCode,de=M.prevLine.hr,be=M.list!==!1,Ee=(M.listStack[M.listStack.length-1]||0)+3;M.indentedCode=!1;var ae=M.indentation;if(M.indentationDiff===null&&(M.indentationDiff=M.indentation,be)){for(M.list=null;ae<M.listStack[M.listStack.length-1];)M.listStack.pop(),M.listStack.length?M.indentation=M.listStack[M.listStack.length-1]:M.list=!1;M.list!==!1&&(M.indentationDiff=ae-M.listStack[M.listStack.length-1])}var $=!ee&&!de&&!M.prevLine.header&&(!be||!ue)&&!M.prevLine.fencedCodeEnd,re=(M.list===!1||de||ee)&&M.indentation<=Ee&&k.match(_),J=null;if(M.indentationDiff>=4&&(ue||M.prevLine.fencedCodeEnd||M.prevLine.header||ee))return k.skipToEnd(),M.indentedCode=!0,B.code;if(k.eatSpace())return null;if(G&&M.indentation<=Ee&&(J=k.match(C))&&J[1].length<=6)return M.quote=0,M.header=J[1].length,M.thisLine.header=!0,L.highlightFormatting&&(M.formatting="header"),M.f=M.inline,l(M);if(M.indentation<=Ee&&k.eat(">"))return M.quote=G?1:M.quote+1,L.highlightFormatting&&(M.formatting="quote"),k.eatSpace(),l(M);if(!re&&!M.setext&&G&&M.indentation<=Ee&&(J=k.match(O))){var ie=J[1]?"ol":"ul";return M.indentation=ae+k.current().length,M.list=!0,M.quote=0,M.listStack.push(M.indentation),M.em=!1,M.strong=!1,M.code=!1,M.strikethrough=!1,L.taskLists&&k.match(y,!1)&&(M.taskList=!0),M.f=M.inline,L.highlightFormatting&&(M.formatting=["list","list-"+ie]),l(M)}else{if(G&&M.indentation<=Ee&&(J=k.match(b,!0)))return M.quote=0,M.fencedEndRE=new RegExp(J[1]+"+ *$"),M.localMode=L.fencedCodeBlockHighlighting&&P(J[2]||L.fencedCodeBlockDefaultMode),M.localMode&&(M.localState=oe.startState(M.localMode)),M.f=M.block=v,L.highlightFormatting&&(M.formatting="code-block"),M.code=-1,l(M);if(M.setext||(!$||!be)&&!M.quote&&M.list===!1&&!M.code&&!re&&!g.test(k.string)&&(J=k.lookAhead(1))&&(J=J.match(R)))return M.setext?(M.header=M.setext,M.setext=0,k.skipToEnd(),L.highlightFormatting&&(M.formatting="header")):(M.header=J[0].charAt(0)=="="?1:2,M.setext=M.header),M.thisLine.header=!0,M.f=M.inline,l(M);if(re)return k.skipToEnd(),M.hr=!0,M.thisLine.hr=!0,B.hr;if(k.peek()==="[")return u(k,M,D)}return u(k,M,M.inline)}function S(k,M){var G=z.token(k,M.htmlState);if(!I){var ee=oe.innerMode(z,M.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||M.md_inside&&k.current().indexOf(">")>-1)&&(M.f=s,M.block=h,M.htmlState=null)}return G}function v(k,M){var G=M.listStack[M.listStack.length-1]||0,ee=M.indentation<G,ue=G+3;if(M.fencedEndRE&&M.indentation<=ue&&(ee||k.match(M.fencedEndRE))){L.highlightFormatting&&(M.formatting="code-block");var de;return ee||(de=l(M)),M.localMode=M.localState=null,M.block=h,M.f=s,M.fencedEndRE=null,M.code=0,M.thisLine.fencedCodeEnd=!0,ee?d(k,M,M.block):de}else return M.localMode?M.localMode.token(k,M.localState):(k.skipToEnd(),B.code)}function l(k){var M=[];if(k.formatting){M.push(B.formatting),typeof k.formatting=="string"&&(k.formatting=[k.formatting]);for(var G=0;G<k.formatting.length;G++)M.push(B.formatting+"-"+k.formatting[G]),k.formatting[G]==="header"&&M.push(B.formatting+"-"+k.formatting[G]+"-"+k.header),k.formatting[G]==="quote"&&(!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=k.quote?M.push(B.formatting+"-"+k.formatting[G]+"-"+k.quote):M.push("error"))}if(k.taskOpen)return M.push("meta"),M.length?M.join(" "):null;if(k.taskClosed)return M.push("property"),M.length?M.join(" "):null;if(k.linkHref?M.push(B.linkHref,"url"):(k.strong&&M.push(B.strong),k.em&&M.push(B.em),k.strikethrough&&M.push(B.strikethrough),k.emoji&&M.push(B.emoji),k.linkText&&M.push(B.linkText),k.code&&M.push(B.code),k.image&&M.push(B.image),k.imageAltText&&M.push(B.imageAltText,"link"),k.imageMarker&&M.push(B.imageMarker)),k.header&&M.push(B.header,B.header+"-"+k.header),k.quote&&(M.push(B.quote),!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=k.quote?M.push(B.quote+"-"+k.quote):M.push(B.quote+"-"+L.maxBlockquoteDepth)),k.list!==!1){var ee=(k.listStack.length-1)%3;ee?ee===1?M.push(B.list2):M.push(B.list3):M.push(B.list1)}return k.trailingSpaceNewLine?M.push("trailing-space-new-line"):k.trailingSpace&&M.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),M.length?M.join(" "):null}function f(k,M){return k.match(A,!0)?l(M):void 0}function s(k,M){var G=M.text(k,M);if(typeof G!="undefined")return G;if(M.list)return M.list=null,l(M);if(M.taskList){var ee=k.match(y,!0)[1]===" ";return ee?M.taskOpen=!0:M.taskClosed=!0,L.highlightFormatting&&(M.formatting="task"),M.taskList=!1,l(M)}if(M.taskOpen=!1,M.taskClosed=!1,M.header&&k.match(/^#+$/,!0))return L.highlightFormatting&&(M.formatting="header"),l(M);var ue=k.next();if(M.linkTitle){M.linkTitle=!1;var de=ue;ue==="("&&(de=")"),de=(de+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var be="^\\s*(?:[^"+de+"\\\\]+|\\\\\\\\|\\\\.)"+de;if(k.match(new RegExp(be),!0))return B.linkHref}if(ue==="`"){var Ee=M.formatting;L.highlightFormatting&&(M.formatting="code"),k.eatWhile("`");var ae=k.current().length;if(M.code==0&&(!M.quote||ae==1))return M.code=ae,l(M);if(ae==M.code){var $=l(M);return M.code=0,$}else return M.formatting=Ee,l(M)}else if(M.code)return l(M);if(ue==="\\"&&(k.next(),L.highlightFormatting)){var re=l(M),J=B.formatting+"-escape";return re?re+" "+J:J}if(ue==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return M.imageMarker=!0,M.image=!0,L.highlightFormatting&&(M.formatting="image"),l(M);if(ue==="["&&M.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return M.imageMarker=!1,M.imageAltText=!0,L.highlightFormatting&&(M.formatting="image"),l(M);if(ue==="]"&&M.imageAltText){L.highlightFormatting&&(M.formatting="image");var re=l(M);return M.imageAltText=!1,M.image=!1,M.inline=M.f=x,re}if(ue==="["&&!M.image)return M.linkText&&k.match(/^.*?\]/)||(M.linkText=!0,L.highlightFormatting&&(M.formatting="link")),l(M);if(ue==="]"&&M.linkText){L.highlightFormatting&&(M.formatting="link");var re=l(M);return M.linkText=!1,M.inline=M.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?x:s,re}if(ue==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){M.f=M.inline=i,L.highlightFormatting&&(M.formatting="link");var re=l(M);return re?re+=" ":re="",re+B.linkInline}if(ue==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){M.f=M.inline=i,L.highlightFormatting&&(M.formatting="link");var re=l(M);return re?re+=" ":re="",re+B.linkEmail}if(L.xml&&ue==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ie=k.string.indexOf(">",k.pos);if(ie!=-1){var V=k.string.substring(k.start,ie);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(V)&&(M.md_inside=!0)}return k.backUp(1),M.htmlState=oe.startState(z),d(k,M,S)}if(L.xml&&ue==="<"&&k.match(/^\/\w*?>/))return M.md_inside=!1,"tag";if(ue==="*"||ue==="_"){for(var Y=1,Z=k.pos==1?" ":k.string.charAt(k.pos-2);Y<3&&k.eat(ue);)Y++;var le=k.peek()||" ",xe=!/\s/.test(le)&&(!c.test(le)||/\s/.test(Z)||c.test(Z)),he=!/\s/.test(Z)&&(!c.test(Z)||/\s/.test(le)||c.test(le)),Te=null,De=null;if(Y%2&&(!M.em&&xe&&(ue==="*"||!he||c.test(Z))?Te=!0:M.em==ue&&he&&(ue==="*"||!xe||c.test(le))&&(Te=!1)),Y>1&&(!M.strong&&xe&&(ue==="*"||!he||c.test(Z))?De=!0:M.strong==ue&&he&&(ue==="*"||!xe||c.test(le))&&(De=!1)),De!=null||Te!=null){L.highlightFormatting&&(M.formatting=Te==null?"strong":De==null?"em":"strong em"),Te===!0&&(M.em=ue),De===!0&&(M.strong=ue);var $=l(M);return Te===!1&&(M.em=!1),De===!1&&(M.strong=!1),$}}else if(ue===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return l(M);k.backUp(1)}if(L.strikethrough){if(ue==="~"&&k.eatWhile(ue)){if(M.strikethrough){L.highlightFormatting&&(M.formatting="strikethrough");var $=l(M);return M.strikethrough=!1,$}else if(k.match(/^[^\s]/,!1))return M.strikethrough=!0,L.highlightFormatting&&(M.formatting="strikethrough"),l(M)}else if(ue===" "&&k.match(/^~~/,!0)){if(k.peek()===" ")return l(M);k.backUp(2)}}if(L.emoji&&ue===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){M.emoji=!0,L.highlightFormatting&&(M.formatting="emoji");var Pe=l(M);return M.emoji=!1,Pe}return ue===" "&&(k.match(/^ +$/,!1)?M.trailingSpace++:M.trailingSpace&&(M.trailingSpaceNewLine=!0)),l(M)}function i(k,M){var G=k.next();if(G===">"){M.f=M.inline=s,L.highlightFormatting&&(M.formatting="link");var ee=l(M);return ee?ee+=" ":ee="",ee+B.linkInline}return k.match(/^[^>]+/,!0),B.linkInline}function x(k,M){if(k.eatSpace())return null;var G=k.next();return G==="("||G==="["?(M.f=M.inline=E(G==="("?")":"]"),L.highlightFormatting&&(M.formatting="link-string"),M.linkHref=!0,l(M)):"error"}var m={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(k){return function(M,G){var ee=M.next();if(ee===k){G.f=G.inline=s,L.highlightFormatting&&(G.formatting="link-string");var ue=l(G);return G.linkHref=!1,ue}return M.match(m[k]),G.linkHref=!0,l(G)}}function D(k,M){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(M.f=U,k.next(),L.highlightFormatting&&(M.formatting="link"),M.linkText=!0,l(M)):u(k,M,s)}function U(k,M){if(k.match(/^\]:/,!0)){M.f=M.inline=j,L.highlightFormatting&&(M.formatting="link");var G=l(M);return M.linkText=!1,G}return k.match(/^([^\]\\]|\\.)+/,!0),B.linkText}function j(k,M){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?M.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),M.f=M.inline=s,B.linkHref+" url")}var K={startState:function(){return{f:h,prevLine:{stream:null},thisLine:{stream:null},block:h,htmlState:null,indentation:0,inline:s,text:f,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(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&oe.copyState(z,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?oe.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,M){if(M.formatting=!1,k!=M.thisLine.stream){if(M.header=0,M.hr=!1,k.match(/^\s*$/,!0))return p(M),null;if(M.prevLine=M.thisLine,M.thisLine={stream:k},M.taskList=!1,M.trailingSpace=0,M.trailingSpaceNewLine=!1,!M.localState&&(M.f=M.block,M.f!=S)){var G=k.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(M.indentation=G,M.indentationDiff=null,G>0)return null}}return M.f(k,M)},innerMode:function(k){return k.block==S?{state:k.htmlState,mode:z}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:K}},indent:function(k,M,G){return k.block==S&&z.indent?z.indent(k.htmlState,M,G):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,M,G):oe.Pass},blankLine:p,getType:l,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return K},"xml"),oe.defineMIME("text/markdown","markdown"),oe.defineMIME("text/x-markdown","markdown")})},osHv:function(ot,Xe,te){(function(oe){oe(te("VrN/"))})(function(oe){"use strict";var H=oe.Pos;function L(c,o){return c.line-o.line||c.ch-o.ch}var z="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",I=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+z+"]["+I+"]*)","g");function B(c,o,u,d){this.line=o,this.ch=u,this.cm=c,this.text=c.getLine(o),this.min=d?Math.max(d.from,c.firstLine()):c.firstLine(),this.max=d?Math.min(d.to-1,c.lastLine()):c.lastLine()}function N(c,o){var u=c.cm.getTokenTypeAt(H(c.line,o));return u&&/\btag\b/.test(u)}function _(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function O(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function y(c){for(;;){var o=c.text.indexOf(">",c.ch);if(o==-1){if(_(c))continue;return}if(!N(c,o+1)){c.ch=o+1;continue}var u=c.text.lastIndexOf("/",o),d=u>-1&&!/\S/.test(c.text.slice(u+1,o));return c.ch=o+1,d?"selfClose":"regular"}}function C(c){for(;;){var o=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(o==-1){if(O(c))continue;return}if(!N(c,o+1)){c.ch=o;continue}P.lastIndex=o,c.ch=o;var u=P.exec(c.text);if(u&&u.index==o)return u}}function R(c){for(;;){P.lastIndex=c.ch;var o=P.exec(c.text);if(!o){if(_(c))continue;return}if(!N(c,o.index+1)){c.ch=o.index+1;continue}return c.ch=o.index+o[0].length,o}}function A(c){for(;;){var o=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(o==-1){if(O(c))continue;return}if(!N(c,o+1)){c.ch=o;continue}var u=c.text.lastIndexOf("/",o),d=u>-1&&!/\S/.test(c.text.slice(u+1,o));return c.ch=o+1,d?"selfClose":"regular"}}function b(c,o){for(var u=[];;){var d=R(c),T,p=c.line,h=c.ch-(d?d[0].length:0);if(!d||!(T=y(c)))return;if(T=="selfClose")continue;if(d[1]){for(var S=u.length-1;S>=0;--S)if(u[S]==d[2]){u.length=S;break}if(S<0&&(!o||o==d[2]))return{tag:d[2],from:H(p,h),to:H(c.line,c.ch)}}else u.push(d[2])}}function g(c,o){for(var u=[];;){var d=A(c);if(!d)return;if(d=="selfClose"){C(c);continue}var T=c.line,p=c.ch,h=C(c);if(!h)return;if(h[1])u.push(h[2]);else{for(var S=u.length-1;S>=0;--S)if(u[S]==h[2]){u.length=S;break}if(S<0&&(!o||o==h[2]))return{tag:h[2],from:H(c.line,c.ch),to:H(T,p)}}}}oe.registerHelper("fold","xml",function(c,o){for(var u=new B(c,o.line,0);;){var d=R(u);if(!d||u.line!=o.line)return;var T=y(u);if(!T)return;if(!d[1]&&T!="selfClose"){var p=H(u.line,u.ch),h=b(u,d[2]);return h&&L(h.from,p)>0?{from:p,to:h.from}:null}}}),oe.findMatchingTag=function(c,o,u){var d=new B(c,o.line,o.ch,u);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var T=y(d),p=T&&H(d.line,d.ch),h=T&&C(d);if(!T||!h||L(d,o)>0)return;var S={from:H(d.line,d.ch),to:p,tag:h[2]};return T=="selfClose"?{open:S,close:null,at:"open"}:h[1]?{open:g(d,h[2]),close:S,at:"close"}:(d=new B(c,p.line,p.ch,u),{open:S,close:b(d,h[2]),at:"open"})},oe.findEnclosingTag=function(c,o,u,d){for(var T=new B(c,o.line,o.ch,u);;){var p=g(T,d);if(!p)break;var h=new B(c,o.line,o.ch,u),S=b(h,p.tag);if(S)return{open:p,close:S}}},oe.scanForClosingTag=function(c,o,u,d){var T=new B(c,o.line,o.ch,d?{from:0,to:d}:null);return b(T,u)}})},"p77/":function(ot,Xe,te){},rUJ1:function(ot,Xe){const te=/[&<>"']/,oe=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},I=v=>z[v];function P(v,l){if(l){if(te.test(v))return v.replace(oe,I)}else if(H.test(v))return v.replace(L,I);return v}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(v){return v.replace(B,(l,f)=>(f=f.toLowerCase(),f==="colon"?":":f.charAt(0)==="#"?f.charAt(1)==="x"?String.fromCharCode(parseInt(f.substring(2),16)):String.fromCharCode(+f.substring(1)):""))}const _=/(^|[^\[])\^/g;function O(v,l){v=v.source||v,l=l||"";const f={replace:(s,i)=>(i=i.source||i,i=i.replace(_,"$1"),v=v.replace(s,i),f),getRegex:()=>new RegExp(v,l)};return f}const y=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(v,l,f){if(v){let s;try{s=decodeURIComponent(N(f)).replace(y,"").toLowerCase()}catch(i){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}l&&!C.test(f)&&(f=o(l,f));try{f=encodeURI(f).replace(/%25/g,"%")}catch(s){return null}return f}const A={},b=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(v,l){A[" "+v]||(b.test(v)?A[" "+v]=v+"/":A[" "+v]=p(v,"/",!0)),v=A[" "+v];const f=v.indexOf(":")===-1;return l.substring(0,2)==="//"?f?l:v.replace(g,"$1")+l:l.charAt(0)==="/"?f?l:v.replace(c,"$1")+l:v+l}const u={exec:function(){}};function d(v){let l=1,f,s;for(;l<arguments.length;l++){f=arguments[l];for(s in f)Object.prototype.hasOwnProperty.call(f,s)&&(v[s]=f[s])}return v}function T(v,l){const f=v.replace(/\|/g,(x,m,E)=>{let D=!1,U=m;for(;--U>=0&&E[U]==="\\";)D=!D;return D?"|":" |"}),s=f.split(/ \|/);let i=0;if(s.length>l)s.splice(l);else for(;s.length<l;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(/\\\|/g,"|");return s}function p(v,l,f){const s=v.length;if(s===0)return"";let i=0;for(;i<s;){const x=v.charAt(s-i-1);if(x===l&&!f)i++;else if(x!==l&&f)i++;else break}return v.substr(0,s-i)}function h(v,l){if(v.indexOf(l[1])===-1)return-1;const f=v.length;let s=0,i=0;for(;i<f;i++)if(v[i]==="\\")i++;else if(v[i]===l[0])s++;else if(v[i]===l[1]&&(s--,s<0))return i;return-1}function S(v){v&&v.sanitize&&!v.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")}ot.exports={escape:P,unescape:N,edit:O,cleanUrl:R,resolveUrl:o,noopTest:u,merge:d,splitCells:T,rtrim:p,findClosingBracket:h,checkSanitizeDeprecation:S}},sboe:function(ot,Xe,te){"use strict";te.d(Xe,"a",function(){return L});var oe=te("cDcd"),H=te.n(oe),L=oe.createContext(null)},uK0f:function(ot,Xe,te){(function(oe,H){ot.exports=H()})(this,function(){"use strict";function oe(H,L,z){z=z||{},z.childrenKeyName=z.childrenKeyName||"children";var I=H||[],P=[],B=0;do{var N=I.filter(function(_){return L(_,B)})[0];if(!N)break;P.push(N),I=N[z.childrenKeyName]||[],B+=1}while(I.length>0);return P}return oe})},ulZh:function(ot,Xe,te){typeof window!="undefined"&&function(H,L){ot.exports=L()}(this,function(){return function(oe){var H={};function L(z){if(H[z])return H[z].exports;var I=H[z]={i:z,l:!1,exports:{}};return oe[z].call(I.exports,I,I.exports,L),I.l=!0,I.exports}return L.m=oe,L.c=H,L.d=function(z,I,P){L.o(z,I)||Object.defineProperty(z,I,{enumerable:!0,get:P})},L.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},L.t=function(z,I){if(I&1&&(z=L(z)),I&8)return z;if(I&4&&typeof z=="object"&&z&&z.__esModule)return z;var P=Object.create(null);if(L.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:z}),I&2&&typeof z!="string")for(var B in z)L.d(P,B,function(N){return z[N]}.bind(null,B));return P},L.n=function(z){var I=z&&z.__esModule?function(){return z.default}:function(){return z};return L.d(I,"a",I),I},L.o=function(z,I){return Object.prototype.hasOwnProperty.call(z,I)},L.p="/dist/",L(L.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(oe,H,L){"use strict";var z=Object.prototype.hasOwnProperty,I="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(I=!1));function B(y,C,R){this.fn=y,this.context=C,this.once=R||!1}function N(y,C,R,A,b){if(typeof R!="function")throw new TypeError("The listener must be a function");var g=new B(R,A||y,b),c=I?I+C:C;return y._events[c]?y._events[c].fn?y._events[c]=[y._events[c],g]:y._events[c].push(g):(y._events[c]=g,y._eventsCount++),y}function _(y,C){--y._eventsCount===0?y._events=new P:delete y._events[C]}function O(){this._events=new P,this._eventsCount=0}O.prototype.eventNames=function(){var C=[],R,A;if(this._eventsCount===0)return C;for(A in R=this._events)z.call(R,A)&&C.push(I?A.slice(1):A);return Object.getOwnPropertySymbols?C.concat(Object.getOwnPropertySymbols(R)):C},O.prototype.listeners=function(C){var R=I?I+C:C,A=this._events[R];if(!A)return[];if(A.fn)return[A.fn];for(var b=0,g=A.length,c=new Array(g);b<g;b++)c[b]=A[b].fn;return c},O.prototype.listenerCount=function(C){var R=I?I+C:C,A=this._events[R];return A?A.fn?1:A.length:0},O.prototype.emit=function(C,R,A,b,g,c){var o=I?I+C:C;if(!this._events[o])return!1;var u=this._events[o],d=arguments.length,T,p;if(u.fn){u.once&&this.removeListener(C,u.fn,void 0,!0);switch(d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,R),!0;case 3:return u.fn.call(u.context,R,A),!0;case 4:return u.fn.call(u.context,R,A,b),!0;case 5:return u.fn.call(u.context,R,A,b,g),!0;case 6:return u.fn.call(u.context,R,A,b,g,c),!0}for(p=1,T=new Array(d-1);p<d;p++)T[p-1]=arguments[p];u.fn.apply(u.context,T)}else{var h=u.length,S;for(p=0;p<h;p++){u[p].once&&this.removeListener(C,u[p].fn,void 0,!0);switch(d){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,R);break;case 3:u[p].fn.call(u[p].context,R,A);break;case 4:u[p].fn.call(u[p].context,R,A,b);break;default:if(!T)for(S=1,T=new Array(d-1);S<d;S++)T[S-1]=arguments[S];u[p].fn.apply(u[p].context,T)}}}return!0},O.prototype.on=function(C,R,A){return N(this,C,R,A,!1)},O.prototype.once=function(C,R,A){return N(this,C,R,A,!0)},O.prototype.removeListener=function(C,R,A,b){var g=I?I+C:C;if(!this._events[g])return this;if(!R)return _(this,g),this;var c=this._events[g];if(c.fn)c.fn===R&&(!b||c.once)&&(!A||c.context===A)&&_(this,g);else{for(var o=0,u=[],d=c.length;o<d;o++)(c[o].fn!==R||b&&!c[o].once||A&&c[o].context!==A)&&u.push(c[o]);u.length?this._events[g]=u.length===1?u[0]:u:_(this,g)}return this},O.prototype.removeAllListeners=function(C){var R;return C?(R=I?I+C:C,this._events[R]&&_(this,R)):(this._events=new P,this._eventsCount=0),this},O.prototype.off=O.prototype.removeListener,O.prototype.addListener=O.prototype.on,O.prefixed=I,O.EventEmitter=O,oe.exports=O},"./node_modules/url-toolkit/src/url-toolkit.js":function(oe,H,L){(function(z){var I=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,B=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,_={buildAbsoluteURL:function(O,y,C){if(C=C||{},O=O.trim(),y=y.trim(),!y){if(!C.alwaysNormalize)return O;var R=_.parseURL(O);if(!R)throw new Error("Error trying to parse base URL.");return R.path=_.normalizePath(R.path),_.buildURLFromParts(R)}var A=_.parseURL(y);if(!A)throw new Error("Error trying to parse relative URL.");if(A.scheme)return C.alwaysNormalize?(A.path=_.normalizePath(A.path),_.buildURLFromParts(A)):y;var b=_.parseURL(O);if(!b)throw new Error("Error trying to parse base URL.");if(!b.netLoc&&b.path&&b.path[0]!=="/"){var g=P.exec(b.path);b.netLoc=g[1],b.path=g[2]}b.netLoc&&!b.path&&(b.path="/");var c={scheme:b.scheme,netLoc:A.netLoc,path:null,params:A.params,query:A.query,fragment:A.fragment};if(!A.netLoc&&(c.netLoc=b.netLoc,A.path[0]!=="/"))if(!A.path)c.path=b.path,A.params||(c.params=b.params,A.query||(c.query=b.query));else{var o=b.path,u=o.substring(0,o.lastIndexOf("/")+1)+A.path;c.path=_.normalizePath(u)}return c.path===null&&(c.path=C.alwaysNormalize?_.normalizePath(A.path):A.path),_.buildURLFromParts(c)},parseURL:function(O){var y=I.exec(O);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(O){for(O=O.split("").reverse().join("").replace(B,"");O.length!==(O=O.replace(N,"")).length;);return O.split("").reverse().join("")},buildURLFromParts:function(O){return O.scheme+O.netLoc+O.path+O.params+O.query+O.fragment}};oe.exports=_})(this)},"./node_modules/webworkify-webpack/index.js":function(oe,H,L){function z(C){var R={};function A(g){if(R[g])return R[g].exports;var c=R[g]={i:g,l:!1,exports:{}};return C[g].call(c.exports,c,c.exports,A),c.l=!0,c.exports}A.m=C,A.c=R,A.i=function(g){return g},A.d=function(g,c,o){A.o(g,c)||Object.defineProperty(g,c,{configurable:!1,enumerable:!0,get:o})},A.r=function(g){Object.defineProperty(g,"__esModule",{value:!0})},A.n=function(g){var c=g&&g.__esModule?function(){return g.default}:function(){return g};return A.d(c,"a",c),c},A.o=function(g,c){return Object.prototype.hasOwnProperty.call(g,c)},A.p="/",A.oe=function(g){throw console.error(g),g};var b=A(A.s=ENTRY_MODULE);return b.default||b}var I="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+I+").*?\\)";function B(C){return(C+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(C){return!isNaN(1*C)}function _(C,R,A){var b={};b[A]=[];var g=R.toString(),c=g.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return b;for(var o=c[1],u=new RegExp("(\\\\n|\\W)"+B(o)+P,"g"),d;d=u.exec(g);){if(d[3]==="dll-reference")continue;b[A].push(d[3])}for(u=new RegExp("\\("+B(o)+'\\("(dll-reference\\s('+I+'))"\\)\\)'+P,"g");d=u.exec(g);)C[d[2]]||(b[A].push(d[1]),C[d[2]]=L(d[1]).m),b[d[2]]=b[d[2]]||[],b[d[2]].push(d[4]);for(var T=Object.keys(b),p=0;p<T.length;p++)for(var h=0;h<b[T[p]].length;h++)N(b[T[p]][h])&&(b[T[p]][h]=1*b[T[p]][h]);return b}function O(C){var R=Object.keys(C);return R.reduce(function(A,b){return A||C[b].length>0},!1)}function y(C,R){for(var A={main:[R]},b={main:[]},g={main:{}};O(A);)for(var c=Object.keys(A),o=0;o<c.length;o++){var u=c[o],d=A[u],T=d.pop();if(g[u]=g[u]||{},g[u][T]||!C[u][T])continue;g[u][T]=!0,b[u]=b[u]||[],b[u].push(T);for(var p=_(C,C[u][T],u),h=Object.keys(p),S=0;S<h.length;S++)A[h[S]]=A[h[S]]||[],A[h[S]]=A[h[S]].concat(p[h[S]])}return b}oe.exports=function(C,R){R=R||{};var A={main:L.m},b=R.all?{main:Object.keys(A.main)}:y(A,C),g="";Object.keys(b).filter(function(T){return T!=="main"}).forEach(function(T){for(var p=0;b[T][p];)p++;b[T].push(p),A[T][p]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",g=g+"var "+T+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+b[T].map(function(h){return""+JSON.stringify(h)+": "+A[T][h].toString()}).join(",")+`});
|
|
`}),g=g+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+b.main.map(function(T){return""+JSON.stringify(T)+": "+A.main[T].toString()}).join(",")+"}))(self);";var c=new window.Blob([g],{type:"text/javascript"});if(R.bare)return c;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,u=o.createObjectURL(c),d=new window.Worker(u);return d.objectURL=u,d}},"./src/config.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"hlsDefaultConfig",function(){return S}),L.d(H,"mergeConfig",function(){return l}),L.d(H,"enableStreamingMode",function(){return f});var z=L("./src/controller/abr-controller.ts"),I=L("./src/controller/audio-stream-controller.ts"),P=L("./src/controller/audio-track-controller.ts"),B=L("./src/controller/subtitle-stream-controller.ts"),N=L("./src/controller/subtitle-track-controller.ts"),_=L("./src/controller/buffer-controller.ts"),O=L("./src/controller/timeline-controller.ts"),y=L("./src/controller/cap-level-controller.ts"),C=L("./src/controller/fps-controller.ts"),R=L("./src/controller/eme-controller.ts"),A=L("./src/controller/cmcd-controller.ts"),b=L("./src/utils/xhr-loader.ts"),g=L("./src/utils/fetch-loader.ts"),c=L("./src/utils/cues.ts"),o=L("./src/utils/mediakeys-helper.ts"),u=L("./src/utils/logger.ts");function d(){return d=Object.assign||function(s){for(var i=1;i<arguments.length;i++){var x=arguments[i];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(s[m]=x[m])}return s},d.apply(this,arguments)}function T(s,i){var x=Object.keys(s);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(s);i&&(m=m.filter(function(E){return Object.getOwnPropertyDescriptor(s,E).enumerable})),x.push.apply(x,m)}return x}function p(s){for(var i=1;i<arguments.length;i++){var x=arguments[i]!=null?arguments[i]:{};i%2?T(Object(x),!0).forEach(function(m){h(s,m,x[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(x)):T(Object(x)).forEach(function(m){Object.defineProperty(s,m,Object.getOwnPropertyDescriptor(x,m))})}return s}function h(s,i,x){return i in s?Object.defineProperty(s,i,{value:x,enumerable:!0,configurable:!0,writable:!0}):s[i]=x,s}var S=p(p({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:b.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:z.default,bufferController:_.default,capLevelController:y.default,fpsController:C.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:o.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},v()),{},{subtitleStreamController:B.SubtitleStreamController,subtitleTrackController:N.default,timelineController:O.TimelineController,audioStreamController:I.default,audioTrackController:P.default,emeController:R.default,cmcdController:A.default});function v(){return{cueHandler:c.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 l(s,i){if((i.liveSyncDurationCount||i.liveMaxLatencyDurationCount)&&(i.liveSyncDuration||i.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(i.liveMaxLatencyDurationCount!==void 0&&(i.liveSyncDurationCount===void 0||i.liveMaxLatencyDurationCount<=i.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(i.liveMaxLatencyDuration!==void 0&&(i.liveSyncDuration===void 0||i.liveMaxLatencyDuration<=i.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},s,i)}function f(s){var i=s.loader;if(i!==g.default&&i!==b.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var x=Object(g.fetchSupported)();x&&(s.loader=g.default,s.progressive=!0,s.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/polyfills/number.ts"),I=L("./src/utils/ewma-bandwidth-estimator.ts"),P=L("./src/events.ts"),B=L("./src/utils/buffer-helper.ts"),N=L("./src/errors.ts"),_=L("./src/types/loader.ts"),O=L("./src/utils/logger.ts");function y(A,b){for(var g=0;g<b.length;g++){var c=b[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(A,c.key,c)}}function C(A,b,g){return b&&y(A.prototype,b),g&&y(A,g),A}var R=function(){function A(g){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=g;var c=g.config;this.bwEstimator=new I.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var b=A.prototype;return b.registerListeners=function(){var c=this.hls;c.on(P.Events.FRAG_LOADING,this.onFragLoading,this),c.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(P.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){var c=this.hls;c.off(P.Events.FRAG_LOADING,this.onFragLoading,this),c.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(P.Events.ERROR,this.onError,this)},b.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},b.onFragLoading=function(c,o){var u=o.frag;if(u.type===_.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=u,this.partCurrent=(d=o.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},b.onLevelLoaded=function(c,o){var u=this.hls.config;o.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},b._abandonRulesCheck=function(){var c=this.fragCurrent,o=this.partCurrent,u=this.hls,d=u.autoLevelEnabled,T=u.config,p=u.media;if(!c||!p)return;var h=o?o.stats:c.stats,S=o?o.duration:c.duration;if(h.aborted){O.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||p.paused||!p.playbackRate||!p.readyState)return;var v=performance.now()-h.loading.start,l=Math.abs(p.playbackRate);if(v<=500*S/l)return;var f=u.levels,s=u.minAutoLevel,i=f[c.level],x=h.total||Math.max(h.loaded,Math.round(S*i.maxBitrate/8)),m=Math.max(1,h.bwEstimate?h.bwEstimate/8:h.loaded*1e3/v),E=(x-h.loaded)/m,D=p.currentTime,U=(B.BufferHelper.bufferInfo(p,D,T.maxBufferHole).end-D)/l;if(U>=2*S/l||E<=U)return;var j=Number.POSITIVE_INFINITY,K;for(K=c.level-1;K>s;K--){var k=f[K].maxBitrate;if(j=S*k/(8*.8*m),j<U)break}if(j>=E)return;var M=this.bwEstimator.getEstimate();O.logger.warn("Fragment "+c.sn+(o?" part "+o.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+K+`
|
|
Current BW estimate: `+(Object(z.isFiniteNumber)(M)?(M/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+E.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+j.toFixed(3)+` s
|
|
Time to underbuffer: `+U.toFixed(3)+" s"),u.nextLoadLevel=K,this.bwEstimator.sample(v,h.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),u.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:o,stats:h})},b.onFragLoaded=function(c,o){var u=o.frag,d=o.part;if(u.type===_.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(u.sn)){var T=d?d.stats:u.stats,p=d?d.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var h=this.hls.levels[u.level],S=(h.loaded?h.loaded.bytes:0)+T.loaded,v=(h.loaded?h.loaded.duration:0)+p;h.loaded={bytes:S,duration:v},h.realBitrate=Math.round(8*S/v)}if(u.bitrateTest){var l={stats:T,frag:u,part:d,id:u.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,l),u.bitrateTest=!1}}},b.onFragBuffered=function(c,o){var u=o.frag,d=o.part,T=d?d.stats:u.stats;if(T.aborted)return;if(u.type!==_.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var p=T.parsing.end-T.loading.start;this.bwEstimator.sample(p,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=p/1e3:this.bitrateTestDelay=0},b.onError=function(c,o){switch(o.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},b.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},b.getNextABRAutoLevel=function(){var c=this.fragCurrent,o=this.partCurrent,u=this.hls,d=u.maxAutoLevel,T=u.config,p=u.minAutoLevel,h=u.media,S=o?o.duration:c?c.duration:0,v=h?h.currentTime:0,l=h&&h.playbackRate!==0?Math.abs(h.playbackRate):1,f=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,s=(B.BufferHelper.bufferInfo(h,v,T.maxBufferHole).end-v)/l,i=this.findBestLevel(f,p,d,s,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(i>=0)return i;O.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=S?Math.min(S,T.maxStarvationDelay):T.maxStarvationDelay,m=T.abrBandWidthFactor,E=T.abrBandWidthUpFactor;if(!s){var D=this.bitrateTestDelay;if(D){var U=S?Math.min(S,T.maxLoadingDelay):T.maxLoadingDelay;x=U-D,O.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),m=E=1}}return i=this.findBestLevel(f,p,d,s+x,m,E),Math.max(i,0)},b.findBestLevel=function(c,o,u,d,T,p){for(var h,S=this.fragCurrent,v=this.partCurrent,l=this.lastLoadedFragLevel,f=this.hls.levels,s=f[l],i=!!(s!=null&&(h=s.details)!==null&&h!==void 0&&h.live),x=s==null?void 0:s.codecSet,m=v?v.duration:S?S.duration:0,E=u;E>=o;E--){var D=f[E];if(!D||x&&D.codecSet!==x)continue;var U=D.details,j=(v?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||m,K=void 0;E<=l?K=T*c:K=p*c;var k=f[E].maxBitrate,M=k*j/K;if(O.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round(K)+"/"+k+"/"+j+"/"+d+"/"+M),K>k&&(!M||i&&!this.bitrateTestDelay||M<d))return E}return-1},C(A,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,o=this.bwEstimator;if(c!==-1&&(!o||!o.canEstimate()))return c;var u=this.getNextABRAutoLevel();return c!==-1&&(u=Math.min(c,u)),u},set:function(c){this._nextAutoLevel=c}}]),A}();H.default=R},"./src/controller/audio-stream-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/polyfills/number.ts"),I=L("./src/controller/base-stream-controller.ts"),P=L("./src/events.ts"),B=L("./src/utils/buffer-helper.ts"),N=L("./src/controller/fragment-tracker.ts"),_=L("./src/types/level.ts"),O=L("./src/types/loader.ts"),y=L("./src/loader/fragment.ts"),C=L("./src/demux/chunk-cache.ts"),R=L("./src/demux/transmuxer-interface.ts"),A=L("./src/types/transmuxer.ts"),b=L("./src/controller/fragment-finders.ts"),g=L("./src/utils/discontinuities.ts"),c=L("./src/errors.ts"),o=L("./src/utils/logger.ts");function u(){return u=Object.assign||function(S){for(var v=1;v<arguments.length;v++){var l=arguments[v];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(S[f]=l[f])}return S},u.apply(this,arguments)}function d(S,v){S.prototype=Object.create(v.prototype),S.prototype.constructor=S,T(S,v)}function T(S,v){return T=Object.setPrototypeOf||function(f,s){return f.__proto__=s,f},T(S,v)}var p=100,h=function(S){d(v,S);function v(f,s){var i;return i=S.call(this,f,s,"[audio-stream-controller]")||this,i.videoBuffer=null,i.videoTrackCC=-1,i.waitingVideoCC=-1,i.audioSwitch=!1,i.trackId=-1,i.waitingData=null,i.mainDetails=null,i.bufferFlushed=!1,i._registerListeners(),i}var l=v.prototype;return l.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},l._registerListeners=function(){var s=this.hls;s.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(P.Events.ERROR,this.onError,this),s.on(P.Events.BUFFER_RESET,this.onBufferReset,this),s.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},l._unregisterListeners=function(){var s=this.hls;s.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(P.Events.ERROR,this.onError,this),s.off(P.Events.BUFFER_RESET,this.onBufferReset,this),s.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},l.onInitPtsFound=function(s,i){var x=i.frag,m=i.id,E=i.initPTS;if(m==="main"){var D=x.cc;this.initPTS[x.cc]=E,this.log("InitPTS for cc: "+D+" found from main: "+E),this.videoTrackCC=D,this.state===I.State.WAITING_INIT_PTS&&this.tick()}},l.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=I.State.STOPPED;return}var i=this.lastCurrentTime;this.stopLoad(),this.setInterval(p),this.fragLoadError=0,i>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+i.toFixed(3)),this.state=I.State.IDLE):(this.loadedmetadata=!1,this.state=I.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},l.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_TRACK:{var s,i=this.levels,x=this.trackId,m=i==null||((s=i[x])===null||s===void 0)?void 0:s.details;if(m){if(this.waitForCdnTuneIn(m))break;this.state=I.State.WAITING_INIT_PTS}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var E,D=performance.now(),U=this.retryDate;(!U||D>=U||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=I.State.IDLE);break}case I.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var K=j.frag,k=j.part,M=j.cache,G=j.complete;if(this.initPTS[K.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.FRAG_LOADING;var ee=M.flush(),ue={frag:K,part:k,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(ue),G&&S.prototype._handleFragmentLoadComplete.call(this,ue)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+K.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var de=this.getLoadPosition(),be=B.BufferHelper.bufferInfo(this.mediaBuffer,de,this.config.maxBufferHole),Ee=Object(b.fragmentWithinToleranceTest)(be.end,this.config.maxFragLookUpTolerance,K);Ee<0&&(o.logger.log("Waiting fragment cc ("+K.cc+") @ "+K.start+" cancelled because another fragment at "+be.end+" is needed"),this.clearWaitingFragment())}}else this.state=I.State.IDLE}}this.onTickEnd()},l.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.IDLE)},l.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var i=this.mediaBuffer?this.mediaBuffer:s,x=i.buffered;!this.loadedmetadata&&x.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},l.doTickIdle=function(){var s,i,x=this.hls,m=this.levels,E=this.media,D=this.trackId,U=x.config;if(!m||!m[D])return;if(!E&&(this.startFragRequested||!U.startFragPrefetch))return;var j=m[D],K=j.details;if(!K||K.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(K)){this.state=I.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,O.PlaylistLevelType.AUDIO));var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,O.PlaylistLevelType.AUDIO);if(k===null)return;var M=k.len,G=this.getMaxBufferLength(),ee=this.audioSwitch;if(M>=G&&!ee)return;if(!ee&&this._streamEnded(k,K)){x.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=I.State.ENDED;return}var ue=K.fragments,de=ue[0].start,be=k.end;if(ee){var Ee=this.getLoadPosition();be=Ee,K.PTSKnown&&Ee<de&&((k.end>de||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),E.currentTime=de+.05))}var ae=this.getNextFragment(be,K);if(!ae){this.bufferFlushed=!0;return}((s=ae.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((i=ae.decryptdata)!==null&&i!==void 0&&i.key)?this.loadKey(ae,K):this.loadFragment(ae,K,be)},l.getMaxBufferLength=function(){var s=S.prototype.getMaxBufferLength.call(this),i=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,O.PlaylistLevelType.MAIN);return i===null?s:Math.max(s,i.len)},l.onMediaDetaching=function(){this.videoBuffer=null,S.prototype.onMediaDetaching.call(this)},l.onAudioTracksUpdated=function(s,i){var x=i.audioTracks;this.resetTransmuxer(),this.levels=x.map(function(m){return new _.Level(m)})},l.onAudioTrackSwitching=function(s,i){var x=!!i.url;this.trackId=i.id;var m=this.fragCurrent;m!=null&&m.loader&&m.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),x?this.setInterval(p):this.resetTransmuxer(),x?(this.audioSwitch=!0,this.state=I.State.IDLE):this.state=I.State.STOPPED,this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},l.onLevelLoaded=function(s,i){this.mainDetails=i.details},l.onAudioTrackLoaded=function(s,i){var x,m=this.levels,E=i.details,D=i.id;if(!m){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var U=m[D],j=0;if(E.live||(x=U.details)!==null&&x!==void 0&&x.live){var K=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!K)return;!U.details&&E.hasProgramDateTime&&K.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(E,K),j=E.fragments[0].start):j=this.alignPlaylists(E,U.details)}U.details=E,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(U.details,j),this.state===I.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=I.State.IDLE),this.tick()},l._handleFragmentLoadProgress=function(s){var i,x=s.frag,m=s.part,E=s.payload,D=this.config,U=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var K=j[U];console.assert(K,"Audio track is defined on fragment load progress");var k=K.details;console.assert(k,"Audio track details are defined on fragment load progress");var M=D.defaultAudioCodec||K.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new R.default(this.hls,O.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[x.cc],ue=(i=x.initSegment)===null||i===void 0?void 0:i.data;if(ee!==void 0){var de=!1,be=m?m.index:-1,Ee=be!==-1,ae=new A.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,E.byteLength,be,Ee);G.push(E,ue,M,"",x,m,k.totalduration,de,ae,ee)}else{o.logger.log("Unknown video PTS for cc "+x.cc+", waiting for video PTS before demuxing audio frag "+x.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+U);var $=this.waitingData=this.waitingData||{frag:x,part:m,cache:new C.default,complete:!1},re=$.cache;re.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=I.State.WAITING_INIT_PTS}},l._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}S.prototype._handleFragmentLoadComplete.call(this,s)},l.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},l.onBufferCreated=function(s,i){var x=i.tracks.audio;x&&(this.mediaBuffer=x.buffer),i.tracks.video&&(this.videoBuffer=i.tracks.video.buffer)},l.onFragBuffered=function(s,i){var x=i.frag,m=i.part;if(x.type!==O.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(m?" p: "+m.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}x.sn!=="initSegment"&&(this.fragPrevious=x,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(x,m)},l.onError=function(s,i){switch(i.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(O.PlaylistLevelType.AUDIO,i);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==I.State.ERROR&&this.state!==I.State.STOPPED&&(this.state=i.fatal?I.State.ERROR:I.State.IDLE,this.warn(i.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(i.parent==="audio"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var x=!0,m=this.getFwdBufferInfo(this.mediaBuffer,O.PlaylistLevelType.AUDIO);m&&m.len>.5&&(x=!this.reduceMaxBufferLength(m.len)),x&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,S.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},l.onBufferFlushed=function(s,i){var x=i.type;x===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},l._handleTransmuxComplete=function(s){var i,x="audio",m=this.hls,E=s.remuxResult,D=s.chunkMeta,U=this.getCurrentContext(D);if(!U){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var j=U.frag,K=U.part,k=E.audio,M=E.text,G=E.id3,ee=E.initSegment;if(this.fragContextChanged(j))return;if(this.state=I.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,j,D),m.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:x,tracks:ee.tracks})),k){var ue=k.startPTS,de=k.endPTS,be=k.startDTS,Ee=k.endDTS;K&&(K.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:de,startDTS:be,endDTS:Ee}),j.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,ue,de,be,Ee),this.bufferFragmentData(k,j,K,D)}if(G!=null&&(i=G.samples)!==null&&i!==void 0&&i.length){var ae=u({frag:j,id:x},G);m.trigger(P.Events.FRAG_PARSING_METADATA,ae)}if(M){var $=u({frag:j,id:x},M);m.trigger(P.Events.FRAG_PARSING_USERDATA,$)}},l._bufferInitSegment=function(s,i,x){if(this.state!==I.State.PARSING)return;s.video&&delete s.video;var m=s.audio;if(!m)return;m.levelCodec=m.codec,m.id="audio",this.log("Init audio buffer, container:"+m.container+", codecs[parsed]=["+m.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,s);var E=m.initSegment;if(E!=null&&E.byteLength){var D={type:"audio",frag:i,part:null,chunkMeta:x,parent:i.type,data:E};this.hls.trigger(P.Events.BUFFER_APPENDING,D)}this.tick()},l.loadFragment=function(s,i,x){var m=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||m===N.FragmentState.NOT_LOADED||m===N.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):i.live&&!Object(z.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=I.State.WAITING_INIT_PTS):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,s,i,x)))},l.completeAudioSwitch=function(){var s=this.hls,i=this.media,x=this.trackId;i&&(this.log("Switching audio track : flushing all audio"),S.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:x})},v}(I.default);H.default=h},"./src/controller/audio-track-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/events.ts"),I=L("./src/errors.ts"),P=L("./src/controller/base-playlist-controller.ts"),B=L("./src/types/loader.ts");function N(R,A){for(var b=0;b<A.length;b++){var g=A[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(R,g.key,g)}}function _(R,A,b){return A&&N(R.prototype,A),b&&N(R,b),R}function O(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,y(R,A)}function y(R,A){return y=Object.setPrototypeOf||function(g,c){return g.__proto__=c,g},y(R,A)}var C=function(R){O(A,R);function A(g){var c;return c=R.call(this,g,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var b=A.prototype;return b.registerListeners=function(){var c=this.hls;c.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(z.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){var c=this.hls;c.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(z.Events.ERROR,this.onError,this)},b.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,R.prototype.destroy.call(this)},b.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},b.onManifestParsed=function(c,o){this.tracks=o.audioTracks||[]},b.onAudioTrackLoaded=function(c,o){var u=o.id,d=o.details,T=this.tracksInGroup[u];if(!T){this.warn("Invalid audio track id "+u);return}var p=T.details;T.details=o.details,this.log("audioTrack "+u+" loaded ["+d.startSN+"-"+d.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,o,p))},b.onLevelLoading=function(c,o){this.switchLevel(o.level)},b.onLevelSwitching=function(c,o){this.switchLevel(o.level)},b.switchLevel=function(c){var o=this.hls.levels[c];if(!(o!=null&&o.audioGroupIds))return;var u=o.audioGroupIds[o.urlId];if(this.groupId!==u){this.groupId=u;var d=this.tracks.filter(function(p){return!u||p.groupId===u});this.selectDefaultTrack&&!d.some(function(p){return p.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var T={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},b.onError=function(c,o){if(R.prototype.onError.call(this,c,o),o.fatal||!o.context)return;o.context.type===B.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},b.setAudioTrack=function(c){var o=this.tracksInGroup;if(c<0||c>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=o[this.trackId];this.log("Now switching to audio-track index "+c);var d=o[c],T=d.id,p=d.groupId,h=p===void 0?"":p,S=d.name,v=d.type,l=d.url;if(this.trackId=c,this.trackName=S,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:h,name:S,type:v,url:l}),d.details&&!d.details.live)return;var f=this.switchParams(d.url,u==null?void 0:u.details);this.loadPlaylist(f)},b.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,u=this.findTrackId(o)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},b.findTrackId=function(c){for(var o=this.tracksInGroup,u=0;u<o.length;u++){var d=o[u];if((!this.selectDefaultTrack||d.default)&&(!c||c===d.name))return d.id}return-1},b.loadPlaylist=function(c){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var u=o.id,d=o.groupId,T=o.url;if(c)try{T=c.addDirectives(T)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(z.Events.AUDIO_TRACK_LOADING,{url:T,id:u,groupId:d,deliveryDirectives:c||null})}},_(A,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),A}(P.default);H.default=C},"./src/controller/base-playlist-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return _});var z=L("./src/polyfills/number.ts"),I=L("./src/types/level.ts"),P=L("./src/controller/level-helper.ts"),B=L("./src/utils/logger.ts"),N=L("./src/errors.ts"),_=function(){function O(C,R){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=B.logger.log.bind(B.logger,R+":"),this.warn=B.logger.warn.bind(B.logger,R+":"),this.hls=C}var y=O.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(R,A){A.fatal&&A.type===N.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(R,A){var b=A==null?void 0:A.renditionReports;if(b)for(var g=0;g<b.length;g++){var c=b[g],o=""+c.URI;if(o===R.substr(-o.length)){var u=parseInt(c["LAST-MSN"]),d=parseInt(c["LAST-PART"]);if(A&&this.hls.config.lowLatencyMode){var T=Math.min(A.age-A.partTarget,A.targetduration);d!==void 0&&T>A.partTarget&&(d+=1)}if(Object(z.isFiniteNumber)(u))return new I.HlsUrlParameters(u,Object(z.isFiniteNumber)(d)?d:void 0,I.HlsSkip.No)}}},y.loadPlaylist=function(R){},y.shouldLoadTrack=function(R){return this.canLoad&&R&&!!R.url&&(!R.details||R.details.live)},y.playlistLoaded=function(R,A,b){var g=this,c=A.details,o=A.stats,u=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(c.advancedDateTime=Date.now()-u,c.live||b!=null&&b.live){if(c.reloaded(b),b&&this.log("live playlist "+R+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),b&&c.fragments.length>0&&Object(P.mergeDetails)(b,c),!this.canLoad||!c.live)return;var d,T=void 0,p=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var h=this.hls.config.lowLatencyMode,S=c.lastPartSn,v=c.endSN,l=c.lastPartIndex,f=l!==-1,s=S===v,i=h?0:l;f?(T=s?v+1:S,p=s?i:l+1):T=v+1;var x=c.age,m=x+c.ageHeader,E=Math.min(m-c.partTarget,c.targetduration*1.5);if(E>0){if(b&&E>b.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+b.tuneInGoal+" to: "+E+" with playlist age: "+c.age),E=0;else{var D=Math.floor(E/c.targetduration);if(T+=D,p!==void 0){var U=Math.round(E%c.targetduration/c.partTarget);p+=U}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+x.toFixed(2)+"s goal: "+E+" skip sn "+D+" to part "+p)}c.tuneInGoal=E}if(d=this.getDeliveryDirectives(c,A.deliveryDirectives,T,p),h||!s){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(c,A.deliveryDirectives,T,p);var j=Object(P.computeReloadInterval)(c,o);T!==void 0&&c.canBlockReload&&(j-=c.partTarget||1),this.log("reload live playlist "+R+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return g.loadPlaylist(d)},j)}else this.clearTimer()},y.getDeliveryDirectives=function(R,A,b,g){var c=Object(I.getSkipValue)(R,b);return A!=null&&A.skip&&R.deltaUpdateFailed&&(b=A.msn,g=A.part,c=I.HlsSkip.No),new I.HlsUrlParameters(b,g,c)},y.retryLoadingOrFail=function(R){var A=this,b=this.hls.config,g=this.retryCount<b.levelLoadingMaxRetry;if(g){var c;if(this.retryCount++,R.details.indexOf("LoadTimeOut")>-1&&(c=R.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+R.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*b.levelLoadingRetryDelay,b.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return A.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+R.details+'"')}}else this.warn('cannot recover from error "'+R.details+'"'),this.clearTimer(),R.fatal=!0;return g},O}()},"./src/controller/base-stream-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"State",function(){return v}),L.d(H,"default",function(){return l});var z=L("./src/polyfills/number.ts"),I=L("./src/task-loop.ts"),P=L("./src/controller/fragment-tracker.ts"),B=L("./src/utils/buffer-helper.ts"),N=L("./src/utils/logger.ts"),_=L("./src/events.ts"),O=L("./src/errors.ts"),y=L("./src/types/transmuxer.ts"),C=L("./src/utils/mp4-tools.ts"),R=L("./src/utils/discontinuities.ts"),A=L("./src/controller/fragment-finders.ts"),b=L("./src/controller/level-helper.ts"),g=L("./src/loader/fragment-loader.ts"),c=L("./src/crypt/decrypter.ts"),o=L("./src/utils/time-ranges.ts"),u=L("./src/types/loader.ts");function d(f,s){for(var i=0;i<s.length;i++){var x=s[i];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(f,x.key,x)}}function T(f,s,i){return s&&d(f.prototype,s),i&&d(f,i),f}function p(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}function h(f,s){f.prototype=Object.create(s.prototype),f.prototype.constructor=f,S(f,s)}function S(f,s){return S=Object.setPrototypeOf||function(x,m){return x.__proto__=m,x},S(f,s)}var v={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"},l=function(f){h(s,f);function s(x,m,E){var D;return D=f.call(this)||this,D.hls=void 0,D.fragPrevious=null,D.fragCurrent=null,D.fragmentTracker=void 0,D.transmuxer=null,D._state=v.STOPPED,D.media=void 0,D.mediaBuffer=void 0,D.config=void 0,D.bitrateTest=!1,D.lastCurrentTime=0,D.nextLoadPosition=0,D.startPosition=0,D.loadedmetadata=!1,D.fragLoadError=0,D.retryDate=0,D.levels=null,D.fragmentLoader=void 0,D.levelLastLoaded=null,D.startFragRequested=!1,D.decrypter=void 0,D.initPTS=[],D.onvseeking=null,D.onvended=null,D.logPrefix="",D.log=void 0,D.warn=void 0,D.logPrefix=E,D.log=N.logger.log.bind(N.logger,E+":"),D.warn=N.logger.warn.bind(N.logger,E+":"),D.hls=x,D.fragmentLoader=new g.default(x.config),D.fragmentTracker=m,D.config=x.config,D.decrypter=new c.default(x,x.config),x.on(_.Events.KEY_LOADED,D.onKeyLoaded,p(D)),D}var i=s.prototype;return i.doTick=function(){this.onTickEnd()},i.onTickEnd=function(){},i.startLoad=function(m){},i.stopLoad=function(){this.fragmentLoader.abort();var m=this.fragCurrent;m&&this.fragmentTracker.removeFragment(m),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},i._streamEnded=function(m,E){var D=this.fragCurrent,U=this.fragmentTracker;if(!E.live&&D&&D.sn===E.endSN&&!m.nextStart){var j=U.getState(D);return j===P.FragmentState.PARTIAL||j===P.FragmentState.OK}return!1},i.onMediaAttached=function(m,E){var D=this.media=this.mediaBuffer=E.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(U.startPosition)},i.onMediaDetaching=function(){var m=this.media;m!=null&&m.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),m&&(m.removeEventListener("seeking",this.onvseeking),m.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},i.onMediaSeeking=function(){var m=this.config,E=this.fragCurrent,D=this.media,U=this.mediaBuffer,j=this.state,K=D?D.currentTime:0,k=B.BufferHelper.bufferInfo(U||D,K,m.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(K)?K.toFixed(3):K)+", state: "+j),j===v.ENDED)this.resetLoadingState();else if(E&&!k.len){var M=m.maxFragLookUpTolerance,G=E.start-M,ee=E.start+E.duration+M,ue=K>ee;(K<G||ue)&&(ue&&E.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),E.loader.abort()),this.resetLoadingState())}D&&(this.lastCurrentTime=K),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=K),this.tickImmediate()},i.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},i.onKeyLoaded=function(m,E){if(this.state!==v.KEY_LOADING||E.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var D=this.levels[E.frag.level].details;D&&this.loadFragment(E.frag,D,E.frag.start)},i.onHandlerDestroying=function(){this.stopLoad(),f.prototype.onHandlerDestroying.call(this)},i.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(_.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,f.prototype.onHandlerDestroyed.call(this)},i.loadKey=function(m,E){this.log("Loading key for "+m.sn+" of ["+E.startSN+"-"+E.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level),this.state=v.KEY_LOADING,this.fragCurrent=m,this.hls.trigger(_.Events.KEY_LOADING,{frag:m})},i.loadFragment=function(m,E,D){this._loadFragForPlayback(m,E,D)},i._loadFragForPlayback=function(m,E,D){var U=this,j=function(k){if(U.fragContextChanged(m)){U.warn("Fragment "+m.sn+(k.part?" p: "+k.part.index:"")+" of level "+m.level+" was dropped during download."),U.fragmentTracker.removeFragment(m);return}m.stats.chunkCount++,U._handleFragmentLoadProgress(k)};this._doFragLoad(m,E,D,j).then(function(K){if(!K)return;U.fragLoadError=0;var k=U.state;if(U.fragContextChanged(m)){(k===v.FRAG_LOADING||k===v.BACKTRACKING||!U.fragCurrent&&k===v.PARSING)&&(U.fragmentTracker.removeFragment(m),U.state=v.IDLE);return}if("payload"in K&&(U.log("Loaded fragment "+m.sn+" of level "+m.level),U.hls.trigger(_.Events.FRAG_LOADED,K),U.state===v.BACKTRACKING)){U.fragmentTracker.backtrack(m,K),U.resetFragmentLoading(m);return}U._handleFragmentLoadComplete(K)}).catch(function(K){U.warn(K),U.resetFragmentLoading(m)})},i.flushMainBuffer=function(m,E,D){if(D===void 0&&(D=null),!(m-E))return;var U={startOffset:m,endOffset:E,type:D};this.fragLoadError=0,this.hls.trigger(_.Events.BUFFER_FLUSHING,U)},i._loadInitSegment=function(m){var E=this;this._doFragLoad(m).then(function(D){if(!D||E.fragContextChanged(m)||!E.levels)throw new Error("init load aborted");return D}).then(function(D){var U=E.hls,j=D.payload,K=m.decryptdata;if(j&&j.byteLength>0&&K&&K.key&&K.iv&&K.method==="AES-128"){var k=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(j),K.key.buffer,K.iv.buffer).then(function(M){var G=self.performance.now();return U.trigger(_.Events.FRAG_DECRYPTED,{frag:m,payload:M,stats:{tstart:k,tdecrypt:G}}),D.payload=M,D})}return D}).then(function(D){var U=E.fragCurrent,j=E.hls,K=E.levels;if(!K)throw new Error("init load aborted, missing levels");var k=K[m.level].details;console.assert(k,"Level details are defined when init segment is loaded");var M=m.stats;E.state=v.IDLE,E.fragLoadError=0,m.data=new Uint8Array(D.payload),M.parsing.start=M.buffering.start=self.performance.now(),M.parsing.end=M.buffering.end=self.performance.now(),D.frag===U&&j.trigger(_.Events.FRAG_BUFFERED,{stats:M,frag:U,part:null,id:m.type}),E.tick()}).catch(function(D){E.warn(D),E.resetFragmentLoading(m)})},i.fragContextChanged=function(m){var E=this.fragCurrent;return!m||!E||m.level!==E.level||m.sn!==E.sn||m.urlId!==E.urlId},i.fragBufferedComplete=function(m,E){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+m.type+" sn: "+m.sn+(E?" part: "+E.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level+" "+o.default.toString(B.BufferHelper.getBuffered(D))),this.state=v.IDLE,this.tick()},i._handleFragmentLoadComplete=function(m){var E=this.transmuxer;if(!E)return;var D=m.frag,U=m.part,j=m.partsLoaded,K=!j||j.length===0||j.some(function(M){return!M}),k=new y.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,U?U.index:-1,!K);E.flush(k)},i._handleFragmentLoadProgress=function(m){},i._doFragLoad=function(m,E,D,U){var j=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(m.start,D||0),this.config.lowLatencyMode&&E){var K=E.partList;if(K&&U){D>m.end&&E.fragmentHint&&(m=E.fragmentHint);var k=this.getNextPart(K,m,D);if(k>-1){var M=K[k];return this.log("Loading part sn: "+m.sn+" p: "+M.index+" cc: "+m.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+k+"-"+(K.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=M.start+M.duration,this.state=v.FRAG_LOADING,this.hls.trigger(_.Events.FRAG_LOADING,{frag:m,part:K[k],targetBufferTime:D}),this.doFragPartsLoad(m,K,k,U).catch(function(G){return j.handleFragLoadError(G)})}else if(!m.url||this.loadedEndOfParts(K,D))return Promise.resolve(null)}}return this.log("Loading fragment "+m.sn+" cc: "+m.cc+" "+(E?"of ["+E.startSN+"-"+E.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(D.toFixed(3))),Object(z.isFiniteNumber)(m.sn)&&!this.bitrateTest&&(this.nextLoadPosition=m.start+m.duration),this.state=v.FRAG_LOADING,this.hls.trigger(_.Events.FRAG_LOADING,{frag:m,targetBufferTime:D}),this.fragmentLoader.load(m,U).catch(function(G){return j.handleFragLoadError(G)})},i.doFragPartsLoad=function(m,E,D,U){var j=this;return new Promise(function(K,k){var M=[],G=function ee(ue){var de=E[ue];j.fragmentLoader.loadPart(m,de,U).then(function(be){M[de.index]=be;var Ee=be.part;j.hls.trigger(_.Events.FRAG_LOADED,be);var ae=E[ue+1];if(ae&&ae.fragment===m)ee(ue+1);else return K({frag:m,part:Ee,partsLoaded:M})}).catch(k)};G(D)})},i.handleFragLoadError=function(m){var E=m.data;return E&&E.details===O.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(_.Events.ERROR,E),null},i._handleTransmuxerFlush=function(m){var E=this.getCurrentContext(m);if(!E||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var D=E.frag,U=E.part,j=E.level,K=self.performance.now();D.stats.parsing.end=K,U&&(U.stats.parsing.end=K),this.updateLevelTiming(D,U,j,m.partial)},i.getCurrentContext=function(m){var E=this.levels,D=m.level,U=m.sn,j=m.part;if(!E||!E[D])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+D+". The current chunk will not be buffered."),null;var K=E[D],k=j>-1?Object(b.getPartWith)(K,U,j):null,M=k?k.fragment:Object(b.getFragmentWithSN)(K,U,this.fragCurrent);return M?{frag:M,part:k,level:K}:null},i.bufferFragmentData=function(m,E,D,U){if(!m||this.state!==v.PARSING)return;var j=m.data1,K=m.data2,k=j;if(j&&K&&(k=Object(C.appendUint8Array)(j,K)),!k||!k.length)return;var M={type:m.type,frag:E,part:D,chunkMeta:U,parent:E.type,data:k};this.hls.trigger(_.Events.BUFFER_APPENDING,M),m.dropped&&m.independent&&!D&&this.flushBufferGap(E)},i.flushBufferGap=function(m){var E=this.media;if(!E)return;if(!B.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,m.start);return}var D=E.currentTime,U=B.BufferHelper.bufferInfo(E,D,0),j=m.duration,K=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),k=Math.max(Math.min(m.start-K,U.end-K),D+K);m.start-k>K&&this.flushMainBuffer(k,m.start)},i.getFwdBufferInfo=function(m,E){var D=this.config,U=this.getLoadPosition();if(!Object(z.isFiniteNumber)(U))return null;var j=B.BufferHelper.bufferInfo(m,U,D.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var K=this.fragmentTracker.getBufferedFrag(U,E);if(K&&j.nextStart<K.end)return B.BufferHelper.bufferInfo(m,U,Math.max(j.nextStart,D.maxBufferHole))}return j},i.getMaxBufferLength=function(m){var E=this.config,D;return m?D=Math.max(8*E.maxBufferSize/m,E.maxBufferLength):D=E.maxBufferLength,Math.min(D,E.maxMaxBufferLength)},i.reduceMaxBufferLength=function(m){var E=this.config,D=m||E.maxBufferLength;return E.maxMaxBufferLength>=D?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},i.getNextFragment=function(m,E){var D,U,j=E.fragments,K=j.length;if(!K)return null;var k=this.config,M=j[0].start,G;if(E.live){var ee=k.initialLiveManifestSize;if(K<ee)return this.warn("Not enough fragments to start playback (have: "+K+", need: "+ee+")"),null;!E.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(E,j),this.startPosition=G?this.hls.liveSyncPosition||G.start:m)}else m<=M&&(G=j[0]);if(!G){var ue=k.lowLatencyMode?E.partEnd:E.fragmentEnd;G=this.getFragmentAtPosition(m,ue,E)}return(D=G)!==null&&D!==void 0&&D.initSegment&&!((U=G)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},i.getNextPart=function(m,E,D){for(var U=-1,j=!1,K=!0,k=0,M=m.length;k<M;k++){var G=m[k];if(K=K&&!G.independent,U>-1&&D<G.start)break;var ee=G.loaded;!ee&&(j||G.independent||K)&&G.fragment===E&&(U=k),j=ee}return U},i.loadedEndOfParts=function(m,E){var D=m[m.length-1];return D&&E>D.start&&D.loaded},i.getInitialLiveFragment=function(m,E){var D=this.fragPrevious,U=null;if(D){if(m.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),U=Object(A.findFragmentByPDT)(E,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var j=D.sn+1;if(j>=m.startSN&&j<=m.endSN){var K=E[j-m.startSN];D.cc===K.cc&&(U=K,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(A.findFragWithCC)(E,D.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(U=this.getFragmentAtPosition(k,this.bitrateTest?m.fragmentEnd:m.edge,m))}return U},i.getFragmentAtPosition=function(m,E,D){var U=this.config,j=this.fragPrevious,K=D.fragments,k=D.endSN,M=D.fragmentHint,G=U.maxFragLookUpTolerance,ee=!!(U.lowLatencyMode&&D.partList&&M);ee&&M&&!this.bitrateTest&&(K=K.concat(M),k=M.sn);var ue;if(m<E){var de=m>E-G?0:G;ue=Object(A.findFragmentByPTS)(j,K,m,de)}else ue=K[K.length-1];if(ue){var be=ue.sn-D.startSN,Ee=j&&ue.level===j.level,ae=K[be+1],$=this.fragmentTracker.getState(ue);if($===P.FragmentState.BACKTRACKED){ue=null;for(var re=be;K[re]&&this.fragmentTracker.getState(K[re])===P.FragmentState.BACKTRACKED;)j?ue=K[re--]:ue=K[--re];ue||(ue=ae)}else j&&ue.sn===j.sn&&!ee&&(Ee&&(ue.sn<k&&this.fragmentTracker.getState(ae)!==P.FragmentState.OK?(this.log("SN "+ue.sn+" just loaded, load next one: "+ae.sn),ue=ae):ue=null))}return ue},i.synchronizeToLiveEdge=function(m){var E=this.config,D=this.media;if(!D)return;var U=this.hls.liveSyncPosition,j=D.currentTime,K=m.fragments[0].start,k=m.edge,M=j>=K-E.maxFragLookUpTolerance&&j<=k;if(U!==null&&D.duration>U&&(j<U||!M)){var G=E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:E.liveMaxLatencyDurationCount*m.targetduration;(!M&&D.readyState<4||j<k-G)&&(this.loadedmetadata||(this.nextLoadPosition=U),D.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+U.toFixed(3)),D.currentTime=U))}},i.alignPlaylists=function(m,E){var D=this.levels,U=this.levelLastLoaded,j=this.fragPrevious,K=U!==null?D[U]:null,k=m.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var M=m.fragments[0].start,G=!E,ee=m.alignedSliding&&Object(z.isFiniteNumber)(M);if(G||!ee&&!M){Object(R.alignStream)(j,K,m);var ue=m.fragments[0].start;return this.log("Live playlist sliding: "+ue.toFixed(2)+" start-sn: "+(E?E.startSN:"na")+"->"+m.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+k),ue}return M},i.waitForCdnTuneIn=function(m){var E=3;return m.live&&m.canBlockReload&&m.tuneInGoal>Math.max(m.partHoldBack,m.partTarget*E)},i.setStartPosition=function(m,E){var D=this.startPosition;if(D<E&&(D=-1),D===-1||this.lastCurrentTime===-1){var U=m.startTimeOffset;Object(z.isFiniteNumber)(U)?(D=E+U,U<0&&(D+=m.totalduration),D=Math.min(Math.max(E,D),E+m.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+D),this.startPosition=D):m.live?D=this.hls.liveSyncPosition||E:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},i.getLoadPosition=function(){var m=this.media,E=0;return this.loadedmetadata&&m?E=m.currentTime:this.nextLoadPosition&&(E=this.nextLoadPosition),E},i.handleFragLoadAborted=function(m,E){this.transmuxer&&m.sn!=="initSegment"&&m.stats.aborted&&(this.warn("Fragment "+m.sn+(E?" part"+E.index:"")+" of level "+m.level+" was aborted"),this.resetFragmentLoading(m))},i.resetFragmentLoading=function(m){(!this.fragCurrent||!this.fragContextChanged(m))&&(this.state=v.IDLE)},i.onFragmentOrKeyLoadError=function(m,E){if(E.fatal)return;var D=E.frag;if(!D||D.type!==m)return;var U=this.fragCurrent;console.assert(U&&D.sn===U.sn&&D.level===U.level&&D.urlId===U.urlId,"Frag load error must match current frag to retry");var j=this.config;if(this.fragLoadError+1<=j.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(D.level))return;var K=Math.min(Math.pow(2,this.fragLoadError)*j.fragLoadingRetryDelay,j.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+m+" "+D.level+" failed to load, retrying in "+K+"ms"),this.retryDate=self.performance.now()+K,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else E.levelRetry?(m===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(N.logger.error(E.details+" reaches max retry, redispatch as fatal ..."),E.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},i.afterBufferFlushed=function(m,E,D){if(!m)return;var U=B.BufferHelper.getBuffered(m);this.fragmentTracker.detectEvictedFragments(E,U,D),this.state===v.ENDED&&this.resetLoadingState()},i.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},i.resetLiveStartWhenNotLoaded=function(m){if(!this.loadedmetadata){this.startFragRequested=!1;var E=this.levels?this.levels[m].details:null;if(E!=null&&E.live)return this.startPosition=-1,this.setStartPosition(E,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},i.updateLevelTiming=function(m,E,D,U){var j=this,K=D.details;console.assert(!!K,"level.details must be defined");var k=Object.keys(m.elementaryStreams).reduce(function(M,G){var ee=m.elementaryStreams[G];if(ee){var ue=ee.endPTS-ee.startPTS;if(ue<=0)return j.warn("Could not parse fragment "+m.sn+" "+G+" duration reliably ("+ue+") resetting transmuxer to fallback to playlist timing"),j.resetTransmuxer(),M||!1;var de=U?0:Object(b.updateFragPTSDTS)(K,m,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return j.hls.trigger(_.Events.LEVEL_PTS_UPDATED,{details:K,level:D,drift:de,type:G,frag:m,start:ee.startPTS,end:ee.endPTS}),!0}return M},!1);k?(this.state=v.PARSED,this.hls.trigger(_.Events.FRAG_PARSED,{frag:m,part:E})):this.resetLoadingState()},i.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T(s,[{key:"state",get:function(){return this._state},set:function(m){var E=this._state;E!==m&&(this._state=m,this.log(E+"->"+m))}}]),s}(I.default)},"./src/controller/buffer-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return A});var z=L("./src/polyfills/number.ts"),I=L("./src/events.ts"),P=L("./src/utils/logger.ts"),B=L("./src/errors.ts"),N=L("./src/utils/buffer-helper.ts"),_=L("./src/utils/mediasource-helper.ts"),O=L("./src/loader/fragment.ts"),y=L("./src/controller/buffer-operation-queue.ts"),C=Object(_.getMediaSource)(),R=/([ha]vc.)(?:\.[^.,]+)+/,A=function(){function b(c){var o=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 u=o.hls,d=o.media,T=o.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),d&&(o.updateMediaElementDuration(),u.trigger(I.Events.MEDIA_ATTACHED,{media:d})),T&&T.removeEventListener("sourceopen",o._onMediaSourceOpen),o.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=c,this._initSourceBuffer(),this.registerListeners()}var g=b.prototype;return g.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},g.destroy=function(){this.unregisterListeners(),this.details=null},g.registerListeners=function(){var o=this.hls;o.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(I.Events.BUFFER_RESET,this.onBufferReset,this),o.on(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(I.Events.BUFFER_EOS,this.onBufferEos,this),o.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(I.Events.FRAG_PARSED,this.onFragParsed,this),o.on(I.Events.FRAG_CHANGED,this.onFragChanged,this)},g.unregisterListeners=function(){var o=this.hls;o.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(I.Events.BUFFER_RESET,this.onBufferReset,this),o.off(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(I.Events.BUFFER_EOS,this.onBufferEos,this),o.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(I.Events.FRAG_PARSED,this.onFragParsed,this),o.off(I.Events.FRAG_CHANGED,this.onFragChanged,this)},g._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},g.onManifestParsed=function(o,u){var d=2;(u.audio&&!u.video||!u.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},g.onMediaAttaching=function(o,u){var d=this.media=u.media;if(d&&C){var T=this.mediaSource=new C;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(T),this._objectUrl=d.src}},g.onMediaDetaching=function(){var o=this.media,u=this.mediaSource,d=this._objectUrl;if(u){if(P.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(T){P.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(d&&self.URL.revokeObjectURL(d),o.src===d?(o.removeAttribute("src"),o.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(I.Events.MEDIA_DETACHED,void 0)},g.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(u){var d=o.sourceBuffer[u];try{d&&(o.removeBufferListeners(u),o.mediaSource&&o.mediaSource.removeSourceBuffer(d),o.sourceBuffer[u]=void 0)}catch(T){P.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",T)}}),this._initSourceBuffer()},g.onBufferCodecs=function(o,u){var d=this,T=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(p){if(T){var h=d.tracks[p];if(h&&typeof h.buffer.changeType=="function"){var S=u[p],v=S.codec,l=S.levelCodec,f=S.container,s=(h.levelCodec||h.codec).replace(R,"$1"),i=(l||v).replace(R,"$1");if(s!==i){var x=f+";codecs="+(l||v);d.appendChangeType(p,x)}}}else d.pendingTracks[p]=u[p]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},g.appendChangeType=function(o,u){var d=this,T=this.operationQueue,p={execute:function(){var S=d.sourceBuffer[o];S&&(P.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+u),S.changeType(u)),T.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(S){P.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",S)}};T.append(p,o)},g.onBufferAppending=function(o,u){var d=this,T=this.hls,p=this.operationQueue,h=this.tracks,S=u.data,v=u.type,l=u.frag,f=u.part,s=u.chunkMeta,i=s.buffering[v],x=self.performance.now();i.start=x;var m=l.stats.buffering,E=f?f.stats.buffering:null;m.start===0&&(m.start=x),E&&E.start===0&&(E.start=x);var D=h.audio,U=v==="audio"&&s.id===1&&(D==null?void 0:D.container)==="audio/mpeg",j={execute:function(){if(i.executeStart=self.performance.now(),U){var k=d.sourceBuffer[v];if(k){var M=l.start-k.timestampOffset;Math.abs(M)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+l.start+" (delta: "+M+") sn: "+l.sn+")"),k.timestampOffset=l.start)}}d.appendExecutor(S,v)},onStart:function(){},onComplete:function(){var k=self.performance.now();i.executeEnd=i.end=k,m.first===0&&(m.first=k),E&&E.first===0&&(E.first=k);var M=d.sourceBuffer,G={};for(var ee in M)G[ee]=N.BufferHelper.getBuffered(M[ee]);d.appendError=0,d.hls.trigger(I.Events.BUFFER_APPENDED,{type:v,frag:l,part:f,chunkMeta:s,parent:l.type,timeRanges:G})},onError:function(k){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",k);var M={type:B.ErrorTypes.MEDIA_ERROR,parent:l.type,details:B.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?M.details=B.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,M.details=B.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>T.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),M.fatal=!0)),T.trigger(I.Events.ERROR,M)}};p.append(j,v)},g.onBufferFlushing=function(o,u){var d=this,T=this.operationQueue,p=function(S){return{execute:d.removeExecutor.bind(d,S,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(I.Events.BUFFER_FLUSHED,{type:S})},onError:function(l){P.logger.warn("[buffer-controller]: Failed to remove from "+S+" SourceBuffer",l)}}};u.type?T.append(p(u.type),u.type):this.getSourceBufferTypes().forEach(function(h){T.append(p(h),h)})},g.onFragParsed=function(o,u){var d=this,T=u.frag,p=u.part,h=[],S=p?p.elementaryStreams:T.elementaryStreams;S[O.ElementaryStreamTypes.AUDIOVIDEO]?h.push("audiovideo"):(S[O.ElementaryStreamTypes.AUDIO]&&h.push("audio"),S[O.ElementaryStreamTypes.VIDEO]&&h.push("video"));var v=function(){var f=self.performance.now();T.stats.buffering.end=f,p&&(p.stats.buffering.end=f);var s=p?p.stats:T.stats;d.hls.trigger(I.Events.FRAG_BUFFERED,{frag:T,part:p,stats:s,id:T.type})};h.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(v,h)},g.onFragChanged=function(o,u){this.flushBackBuffer()},g.onBufferEos=function(o,u){var d=this,T=this.getSourceBufferTypes().reduce(function(p,h){var S=d.sourceBuffer[h];return(!u.type||u.type===h)&&(S&&!S.ended&&(S.ended=!0,P.logger.log("[buffer-controller]: "+h+" sourceBuffer now EOS"))),p&&!!(!S||S.ended)},!0);T&&this.blockBuffers(function(){var p=d.mediaSource;if(!p||p.readyState!=="open")return;p.endOfStream()})},g.onLevelUpdated=function(o,u){var d=u.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},g.flushBackBuffer=function(){var o=this.hls,u=this.details,d=this.media,T=this.sourceBuffer;if(!d||u===null)return;var p=this.getSourceBufferTypes();if(!p.length)return;var h=u.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(z.isFiniteNumber)(h)||h<0)return;var S=d.currentTime,v=u.levelTargetDuration,l=Math.max(h,v),f=Math.floor(S/v)*v-l;p.forEach(function(s){var i=T[s];if(i){var x=N.BufferHelper.getBuffered(i);x.length>0&&f>x.start(0)&&(o.trigger(I.Events.BACK_BUFFER_REACHED,{bufferEnd:f}),u.live&&o.trigger(I.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:f}),o.trigger(I.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:f,type:s}))}})},g.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,u=this.hls,d=this.media,T=this.mediaSource,p=o.fragments[0].start+o.totalduration,h=d.duration,S=Object(z.isFiniteNumber)(T.duration)?T.duration:0;o.live&&u.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(o)):(p>S&&p>h||!Object(z.isFiniteNumber)(h))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+p.toFixed(3)),T.duration=p)},g.updateSeekableRange=function(o){var u=this.mediaSource,d=o.fragments,T=d.length;if(T&&o.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var p=Math.max(0,d[0].start),h=Math.max(p,p+o.totalduration);u.setLiveSeekableRange(p,h)}},g.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,u=this.operationQueue,d=this.pendingTracks,T=Object.keys(d).length;if(T&&!o||T===2){this.createSourceBuffers(d),this.pendingTracks={};var p=this.getSourceBufferTypes();if(p.length===0){this.hls.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}p.forEach(function(h){u.executeNext(h)})}},g.createSourceBuffers=function(o){var u=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var p in o)if(!u[p]){var h=o[p];if(!h)throw Error("source buffer exists for track "+p+", however track does not");var S=h.levelCodec||h.codec,v=h.container+";codecs="+S;P.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var l=u[p]=d.addSourceBuffer(v),f=p;this.addBufferListener(f,"updatestart",this._onSBUpdateStart),this.addBufferListener(f,"updateend",this._onSBUpdateEnd),this.addBufferListener(f,"error",this._onSBUpdateError),this.tracks[p]={buffer:l,codec:S,container:h.container,levelCodec:h.levelCodec,id:h.id},T++}catch(s){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:v})}}T&&this.hls.trigger(I.Events.BUFFER_CREATED,{tracks:this.tracks})},g._onSBUpdateStart=function(o){var u=this.operationQueue,d=u.current(o);d.onStart()},g._onSBUpdateEnd=function(o){var u=this.operationQueue,d=u.current(o);d.onComplete(),u.shiftAndExecuteNext(o)},g._onSBUpdateError=function(o,u){P.logger.error("[buffer-controller]: "+o+" SourceBuffer error",u),this.hls.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(o);d&&d.onError(u)},g.removeExecutor=function(o,u,d){var T=this.media,p=this.mediaSource,h=this.operationQueue,S=this.sourceBuffer,v=S[o];if(!T||!p||!v){P.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(o);return}var l=Object(z.isFiniteNumber)(T.duration)?T.duration:Infinity,f=Object(z.isFiniteNumber)(p.duration)?p.duration:Infinity,s=Math.max(0,u),i=Math.min(d,l,f);i>s?(P.logger.log("[buffer-controller]: Removing ["+s+","+i+"] from the "+o+" SourceBuffer"),console.assert(!v.updating,o+" sourceBuffer must not be updating"),v.remove(s,i)):h.shiftAndExecuteNext(o)},g.appendExecutor=function(o,u){var d=this.operationQueue,T=this.sourceBuffer,p=T[u];if(!p){P.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(u);return}p.ended=!1,console.assert(!p.updating,u+" sourceBuffer must not be updating"),p.appendBuffer(o)},g.blockBuffers=function(o,u){var d=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var T=this.operationQueue,p=u.map(function(h){return T.appendBlocker(h)});Promise.all(p).then(function(){o(),u.forEach(function(h){var S=d.sourceBuffer[h];(!S||!S.updating)&&T.shiftAndExecuteNext(h)})})},g.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},g.addBufferListener=function(o,u,d){var T=this.sourceBuffer[o];if(!T)return;var p=d.bind(this,o);this.listeners[o].push({event:u,listener:p}),T.addEventListener(u,p)},g.removeBufferListeners=function(o){var u=this.sourceBuffer[o];if(!u)return;this.listeners[o].forEach(function(d){u.removeEventListener(d.event,d.listener)})},b}()},"./src/controller/buffer-operation-queue.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return I});var z=L("./src/utils/logger.ts"),I=function(){function P(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var B=P.prototype;return B.append=function(_,O){var y=this.queues[O];y.push(_),y.length===1&&this.buffers[O]&&this.executeNext(O)},B.insertAbort=function(_,O){var y=this.queues[O];y.unshift(_),this.executeNext(O)},B.appendBlocker=function(_){var O,y=new Promise(function(R){O=R}),C={execute:O,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(C,_),y},B.executeNext=function(_){var O=this.buffers,y=this.queues,C=O[_],R=y[_];if(R.length){var A=R[0];try{A.execute()}catch(b){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),A.onError(b),(!C||!C.updating)&&(R.shift(),this.executeNext(_))}}},B.shiftAndExecuteNext=function(_){this.queues[_].shift(),this.executeNext(_)},B.current=function(_){return this.queues[_][0]},P}()},"./src/controller/cap-level-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/events.ts");function I(N,_){for(var O=0;O<_.length;O++){var y=_[O];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(N,y.key,y)}}function P(N,_,O){return _&&I(N.prototype,_),O&&I(N,O),N}var B=function(){function N(O){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=O,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var _=N.prototype;return _.setStreamController=function(y){this.streamController=y},_.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},_.registerListeners=function(){var y=this.hls;y.on(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},_.unregisterListener=function(){var y=this.hls;y.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},_.onFpsDropLevelCapping=function(y,C){N.isLevelAllowed(C.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(C.droppedLevel)},_.onMediaAttaching=function(y,C){this.media=C.media instanceof HTMLVideoElement?C.media:null},_.onManifestParsed=function(y,C){var R=this.hls;this.restrictedLevels=[],this.firstLevel=C.firstLevel,R.config.capLevelToPlayerSize&&C.video&&this.startCapping()},_.onBufferCodecs=function(y,C){var R=this.hls;R.config.capLevelToPlayerSize&&C.video&&this.startCapping()},_.onMediaDetaching=function(){this.stopCapping()},_.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var C=this.hls;C.autoLevelCapping=this.getMaxLevel(y.length-1),C.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=C.autoLevelCapping}}},_.getMaxLevel=function(y){var C=this,R=this.hls.levels;if(!R.length)return-1;var A=R.filter(function(b,g){return N.isLevelAllowed(g,C.restrictedLevels)&&g<=y});return this.clientRect=null,N.getMaxLevelByMediaSize(A,this.mediaWidth,this.mediaHeight)},_.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()},_.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},_.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,C={width:0,height:0};if(y){var R=y.getBoundingClientRect();C.width=R.width,C.height=R.height,!C.width&&!C.height&&(C.width=R.right-R.left||y.width||0,C.height=R.bottom-R.top||y.height||0)}return this.clientRect=C,C},N.isLevelAllowed=function(y,C){return C===void 0&&(C=[]),C.indexOf(y)===-1},N.getMaxLevelByMediaSize=function(y,C,R){if(!y||!y.length)return-1;for(var A=function(u,d){return d?u.width!==d.width||u.height!==d.height:!0},b=y.length-1,g=0;g<y.length;g+=1){var c=y[g];if((c.width>=C||c.height>=R)&&A(c,y[g+1])){b=g;break}}return b},P(N,[{key:"mediaWidth",get:function(){return this.getDimensions().width*N.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*N.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(C){}return y}}]),N}();H.default=B},"./src/controller/cmcd-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return A});var z=L("./src/events.ts"),I=L("./src/types/cmcd.ts"),P=L("./src/utils/buffer-helper.ts"),B=L("./src/utils/logger.ts");function N(b,g){for(var c=0;c<g.length;c++){var o=g[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(b,o.key,o)}}function _(b,g,c){return g&&N(b.prototype,g),c&&N(b,c),b}function O(b,g){var c=typeof Symbol!="undefined"&&b[Symbol.iterator]||b["@@iterator"];if(c)return(c=c.call(b)).next.bind(c);if(Array.isArray(b)||(c=y(b))||g&&b&&typeof b.length=="number"){c&&(b=c);var o=0;return function(){return o>=b.length?{done:!0}:{done:!1,value:b[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(b,g){if(!b)return;if(typeof b=="string")return C(b,g);var c=Object.prototype.toString.call(b).slice(8,-1);if(c==="Object"&&b.constructor&&(c=b.constructor.name),c==="Map"||c==="Set")return Array.from(b);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return C(b,g)}function C(b,g){(g==null||g>b.length)&&(g=b.length);for(var c=0,o=new Array(g);c<g;c++)o[c]=b[c];return o}function R(){return R=Object.assign||function(b){for(var g=1;g<arguments.length;g++){var c=arguments[g];for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(b[o]=c[o])}return b},R.apply(this,arguments)}var A=function(){function b(c){var o=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(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(T){try{o.apply(T,{ot:I.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(p){B.logger.warn("Could not generate manifest CMCD data.",p)}},this.applyFragmentData=function(T){try{var p=T.frag,h=o.hls.levels[p.level],S=o.getObjectType(p),v={d:p.duration*1e3,ot:S};(S===I.CMCDObjectType.VIDEO||S===I.CMCDObjectType.AUDIO||S==I.CMCDObjectType.MUXED)&&(v.br=h.bitrate/1e3,v.tb=o.getTopBandwidth(S),v.bl=o.getBufferLength(S)),o.apply(T,v)}catch(l){B.logger.warn("Could not generate segment CMCD data.",l)}},this.hls=c;var u=this.config=c.config,d=u.cmcd;d!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||b.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var g=b.prototype;return g.registerListeners=function(){var o=this.hls;o.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},g.unregisterListeners=function(){var o=this.hls;o.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},g.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},g.onMediaAttached=function(o,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},g.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},g.onBufferCreated=function(o,u){var d,T;this.audioBuffer=(d=u.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(T=u.tracks.video)===null||T===void 0?void 0:T.buffer},g.createData=function(){var o;return{v:I.CMCDVersion,sf:I.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(o=this.media)===null||o===void 0?void 0:o.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},g.apply=function(o,u){u===void 0&&(u={}),R(u,this.createData());var d=u.ot===I.CMCDObjectType.INIT||u.ot===I.CMCDObjectType.VIDEO||u.ot===I.CMCDObjectType.MUXED;if(this.starved&&d&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var T=b.toHeaders(u);if(!Object.keys(T).length)return;o.headers||(o.headers={}),R(o.headers,T)}else{var p=b.toQuery(u);if(!p)return;o.url=b.appendQueryToUri(o.url,p)}},g.getObjectType=function(o){var u=o.type;return u==="subtitle"?I.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?I.CMCDObjectType.INIT:u==="audio"?I.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?I.CMCDObjectType.VIDEO:I.CMCDObjectType.MUXED:void 0},g.getTopBandwidth=function(o){for(var u=0,d=o===I.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,T=O(d),p;!(p=T()).done;){var h=p.value;h.bitrate>u&&(u=h.bitrate)}return u>0?u:NaN},g.getBufferLength=function(o){var u=this.hls.media,d=o===I.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!u)return NaN;var T=P.BufferHelper.bufferInfo(d,u.currentTime,this.config.maxBufferHole);return T.len*1e3},g.createPlaylistLoader=function(){var o=this.config.pLoader,u=this.applyPlaylistData,d=o||this.config.loader;return function(){function T(h){this.loader=void 0,this.loader=new d(h)}var p=T.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(S,v,l){u(S),this.loader.load(S,v,l)},_(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},g.createFragmentLoader=function(){var o=this.config.fLoader,u=this.applyFragmentData,d=o||this.config.loader;return function(){function T(h){this.loader=void 0,this.loader=new d(h)}var p=T.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(S,v,l){u(S),this.loader.load(S,v,l)},_(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},b.uuid=function(){var o=URL.createObjectURL(new Blob),u=o.toString();return URL.revokeObjectURL(o),u.substr(u.lastIndexOf("/")+1)},b.serialize=function(o){for(var u=[],d=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},T=function(U){return Math.round(U)},p=function(U){return T(U/100)*100},h=function(U){return encodeURIComponent(U)},S={br:T,d:T,bl:p,dl:p,mtp:p,nor:h,rtp:p,tb:T},v=Object.keys(o||{}).sort(),l=O(v),f;!(f=l()).done;){var s=f.value,i=o[s];if(!d(i))continue;if(s==="v"&&i===1)continue;if(s=="pr"&&i===1)continue;var x=S[s];x&&(i=x(i));var m=typeof i,E=void 0;s==="ot"||s==="sf"||s==="st"?E=s+"="+i:m==="boolean"?E=s:m==="number"?E=s+"="+i:E=s+"="+JSON.stringify(i),u.push(E)}return u.join(",")},b.toHeaders=function(o){for(var u=Object.keys(o),d={},T=["Object","Request","Session","Status"],p=[{},{},{},{}],h={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},S=0,v=u;S<v.length;S++){var l=v[S],f=h[l]!=null?h[l]:1;p[f][l]=o[l]}for(var s=0;s<p.length;s++){var i=b.serialize(p[s]);i&&(d["CMCD-"+T[s]]=i)}return d},b.toQuery=function(o){return"CMCD="+encodeURIComponent(b.serialize(o))},b.appendQueryToUri=function(o,u){if(!u)return o;var d=o.includes("?")?"&":"?";return""+o+d+u},b}()},"./src/controller/eme-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/events.ts"),I=L("./src/errors.ts"),P=L("./src/utils/logger.ts"),B=L("./src/utils/mediakeys-helper.ts");function N(A,b){for(var g=0;g<b.length;g++){var c=b[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(A,c.key,c)}}function _(A,b,g){return b&&N(A.prototype,b),g&&N(A,g),A}var O=3,y=function(b,g,c){var o={audioCapabilities:[],videoCapabilities:[]};return b.forEach(function(u){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:c.audioRobustness||""})}),g.forEach(function(u){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:c.videoRobustness||""})}),[o]},C=function(b,g,c,o){switch(b){case B.KeySystems.WIDEVINE:return y(g,c,o);default:throw new Error("Unknown key-system: "+b)}},R=function(){function A(g){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=g,this._config=g.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 b=A.prototype;return b.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},b._registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},b._unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},b.getLicenseServerUrl=function(c){switch(c){case B.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},b._attemptKeySystemAccess=function(c,o,u){var d=this,T=C(c,o,u,this._drmSystemOptions);P.logger.log("Requesting encrypted media key-system access");var p=this.requestMediaKeySystemAccess(c,T);this.mediaKeysPromise=p.then(function(h){return d._onMediaKeySystemAccessObtained(c,h)}),p.catch(function(h){P.logger.error('Failed to obtain key-system "'+c+'" access:',h)})},b._onMediaKeySystemAccessObtained=function(c,o){var u=this;P.logger.log('Access for key-system "'+c+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:c};this._mediaKeysList.push(d);var T=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(p){return d.mediaKeys=p,P.logger.log('Media-keys created for key-system "'+c+'"'),u._onMediaKeysCreated(),p});return T.catch(function(p){P.logger.error("Failed to create media-keys:",p)}),T},b._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),c._onNewMediaKeySession(o.mediaKeysSession))})},b._onNewMediaKeySession=function(c){var o=this;P.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(u){o._onKeySessionMessage(c,u.message)},!1)},b._onKeySessionMessage=function(c,o){P.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(u){P.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),c.update(u)})},b.onMediaEncrypted=function(c){var o=this;if(P.logger.log('Media is encrypted using "'+c.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(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(T){if(!o._media)return;o._attemptSetMediaKeys(T),o._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(u).catch(u)},b._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},b._generateRequestWithPreferredKeySession=function(c,o){var u=this,d=this._mediaKeysList[0];if(!d){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var T=d.mediaKeysSession;if(!T){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+c+'" init data type'),d.mediaKeysSessionInitialized=!0,T.generateRequest(c,o).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(p){P.logger.error("Error generating key-session request:",p),u.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},b._createLicenseXhr=function(c,o,u){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,c,o,u);var T=this._licenseXhrSetup;if(T)try{T.call(this.hls,d,c),T=void 0}catch(p){P.logger.error(p)}try{d.readyState||d.open("POST",c,!0),T&&T.call(this.hls,d,c)}catch(p){throw new Error("issue setting up KeySystem license XHR "+p)}return d},b._onLicenseRequestReadyStageChange=function(c,o,u,d){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var T=c.response,p=this._licenseResponseCallback;if(p)try{T=p.call(this.hls,c,o)}catch(S){P.logger.error(S)}d(T)}else{if(P.logger.error("License Request XHR failed ("+o+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>O){this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var h=O-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+h+" attempts left"),this._requestLicense(u,d)}break}},b._generateLicenseRequestChallenge=function(c,o){switch(c.mediaKeySystemDomain){case B.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},b._requestLicense=function(c,o){P.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(u.mediaKeySystemDomain),T=this._createLicenseXhr(d,c,o);P.logger.log("Sending license request to URL: "+d);var p=this._generateLicenseRequestChallenge(u,c);T.send(p)}catch(h){P.logger.error("Failure requesting DRM license: "+h),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},b.onMediaAttached=function(c,o){if(!this._emeEnabled)return;var u=o.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},b.onMediaDetached=function(){var c=this._media,o=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},b.onManifestParsed=function(c,o){if(!this._emeEnabled)return;var u=o.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),d=o.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(B.KeySystems.WIDEVINE,u,d)},_(A,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),A}();H.default=R},"./src/controller/fps-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/events.ts"),I=L("./src/utils/logger.ts"),P=function(){function B(_){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=_,this.registerListeners()}var N=B.prototype;return N.setStreamController=function(O){this.streamController=O},N.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(O,y){var C=this.hls.config;if(C.capLevelOnFPSDrop){var R=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=R,R&&typeof R.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),C.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(O,y,C){var R=performance.now();if(y){if(this.lastTime){var A=R-this.lastTime,b=C-this.lastDroppedFrames,g=y-this.lastDecodedFrames,c=1e3*b/A,o=this.hls;if(o.trigger(z.Events.FPS_DROP,{currentDropped:b,currentDecoded:g,totalDroppedFrames:C}),c>0&&b>o.config.fpsDroppedMonitoringThreshold*g){var u=o.currentLevel;I.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=u)&&(u=u-1,o.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:o.currentLevel}),o.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=R,this.lastDroppedFrames=C,this.lastDecodedFrames=y}},N.checkFPSInterval=function(){var O=this.media;if(O)if(this.isVideoPlaybackQualityAvailable){var y=O.getVideoPlaybackQuality();this.checkFPS(O,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(O,O.webkitDecodedFrameCount,O.webkitDroppedFrameCount)},B}();H.default=P},"./src/controller/fragment-finders.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"findFragmentByPDT",function(){return P}),L.d(H,"findFragmentByPTS",function(){return B}),L.d(H,"fragmentWithinToleranceTest",function(){return N}),L.d(H,"pdtWithinToleranceTest",function(){return _}),L.d(H,"findFragWithCC",function(){return O});var z=L("./src/polyfills/number.ts"),I=L("./src/utils/binary-search.ts");function P(y,C,R){if(C===null||!Array.isArray(y)||!y.length||!Object(z.isFiniteNumber)(C))return null;var A=y[0].programDateTime;if(C<(A||0))return null;var b=y[y.length-1].endProgramDateTime;if(C>=(b||0))return null;R=R||0;for(var g=0;g<y.length;++g){var c=y[g];if(_(C,R,c))return c}return null}function B(y,C,R,A){R===void 0&&(R=0),A===void 0&&(A=0);var b=null;if(y?b=C[y.sn-C[0].sn+1]||null:R===0&&C[0].start===0&&(b=C[0]),b&&N(R,A,b)===0)return b;var g=I.default.search(C,N.bind(null,R,A));return g||b}function N(y,C,R){y===void 0&&(y=0),C===void 0&&(C=0);var A=Math.min(C,R.duration+(R.deltaPTS?R.deltaPTS:0));return R.start+R.duration-A<=y?1:R.start-A>y&&R.start?-1:0}function _(y,C,R){var A=Math.min(C,R.duration+(R.deltaPTS?R.deltaPTS:0))*1e3,b=R.endProgramDateTime||0;return b-A>y}function O(y,C){return I.default.search(y,function(R){return R.cc<C?1:R.cc>C?-1:0})}},"./src/controller/fragment-tracker.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"FragmentState",function(){return P}),L.d(H,"FragmentTracker",function(){return B});var z=L("./src/events.ts"),I=L("./src/types/loader.ts"),P;(function(O){O.NOT_LOADED="NOT_LOADED",O.BACKTRACKED="BACKTRACKED",O.APPENDING="APPENDING",O.PARTIAL="PARTIAL",O.OK="OK"})(P||(P={}));var B=function(){function O(C){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=C,this._registerListeners()}var y=O.prototype;return y._registerListeners=function(){var R=this.hls;R.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),R.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),R.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var R=this.hls;R.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),R.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),R.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(R,A){if(A===I.PlaylistLevelType.MAIN){var b=this.activeFragment,g=this.activeParts;if(!b)return null;if(g)for(var c=g.length;c--;){var o=g[c],u=o?o.end:b.appendedPTS;if(o.start<=R&&u!==void 0&&R<=u)return c>9&&(this.activeParts=g.slice(c-9)),o}else if(b.start<=R&&b.appendedPTS!==void 0&&R<=b.appendedPTS)return b}return this.getBufferedFrag(R,A)},y.getBufferedFrag=function(R,A){for(var b=this.fragments,g=Object.keys(b),c=g.length;c--;){var o=b[g[c]];if((o==null?void 0:o.body.type)===A&&o.buffered){var u=o.body;if(u.start<=R&&R<=u.end)return u}}return null},y.detectEvictedFragments=function(R,A,b){var g=this;Object.keys(this.fragments).forEach(function(c){var o=g.fragments[c];if(!o)return;if(!o.buffered){o.body.type===b&&g.removeFragment(o.body);return}var u=o.range[R];if(!u)return;u.time.some(function(d){var T=!g.isTimeBuffered(d.startPTS,d.endPTS,A);return T&&g.removeFragment(o.body),T})})},y.detectPartialFragments=function(R){var A=this,b=this.timeRanges,g=R.frag,c=R.part;if(!b||g.sn==="initSegment")return;var o=_(g),u=this.fragments[o];if(!u)return;Object.keys(b).forEach(function(d){var T=g.elementaryStreams[d];if(!T)return;var p=b[d],h=c!==null||T.partial===!0;u.range[d]=A.getBufferedTimes(g,c,h,p)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},y.fragBuffered=function(R){var A=_(R),b=this.fragments[A];b&&(b.backtrack=b.loaded=null,b.buffered=!0)},y.getBufferedTimes=function(R,A,b,g){for(var c={time:[],partial:b},o=A?A.start:R.start,u=A?A.end:R.end,d=R.minEndPTS||u,T=R.maxStartPTS||o,p=0;p<g.length;p++){var h=g.start(p)-this.bufferPadding,S=g.end(p)+this.bufferPadding;if(T>=h&&d<=S){c.time.push({startPTS:Math.max(o,g.start(p)),endPTS:Math.min(u,g.end(p))});break}else if(o<S&&u>h)c.partial=!0,c.time.push({startPTS:Math.max(o,g.start(p)),endPTS:Math.min(u,g.end(p))});else if(u<=h)break}return c},y.getPartialFragment=function(R){var A=null,b,g,c,o=0,u=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(T){var p=d[T];if(!p)return;N(p)&&(g=p.body.start-u,c=p.body.end+u,R>=g&&R<=c&&(b=Math.min(R-g,c-R),o<=b&&(A=p.body,o=b)))}),A},y.getState=function(R){var A=_(R),b=this.fragments[A];return b?b.buffered?N(b)?P.PARTIAL:P.OK:b.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},y.backtrack=function(R,A){var b=_(R),g=this.fragments[b];if(!g||g.backtrack)return null;var c=g.backtrack=A||g.loaded;return g.loaded=null,c},y.getBacktrackData=function(R){var A=_(R),b=this.fragments[A];if(b){var g,c=b.backtrack;if(c!=null&&(g=c.payload)!==null&&g!==void 0&&g.byteLength)return c;this.removeFragment(R)}return null},y.isTimeBuffered=function(R,A,b){for(var g,c,o=0;o<b.length;o++){if(g=b.start(o)-this.bufferPadding,c=b.end(o)+this.bufferPadding,R>=g&&A<=c)return!0;if(A<=g)return!1}return!1},y.onFragLoaded=function(R,A){var b=A.frag,g=A.part;if(b.sn==="initSegment"||b.bitrateTest||g)return;var c=_(b);this.fragments[c]={body:b,loaded:A,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(R,A){var b=this,g=A.frag,c=A.part,o=A.timeRanges;if(g.type===I.PlaylistLevelType.MAIN)if(this.activeFragment=g,c){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(c)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(d){var T=o[d];if(b.detectEvictedFragments(d,T),!c)for(var p=0;p<T.length;p++)g.appendedPTS=Math.max(T.end(p),g.appendedPTS||0)})},y.onFragBuffered=function(R,A){this.detectPartialFragments(A)},y.hasFragment=function(R){var A=_(R);return!!this.fragments[A]},y.removeFragmentsInRange=function(R,A,b){var g=this;Object.keys(this.fragments).forEach(function(c){var o=g.fragments[c];if(!o)return;if(o.buffered){var u=o.body;u.type===b&&u.start<A&&u.end>R&&g.removeFragment(u)}})},y.removeFragment=function(R){var A=_(R);R.stats.loaded=0,R.clearElementaryStreamInfo(),delete this.fragments[A]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},O}();function N(O){var y,C;return O.buffered&&(((y=O.range.video)===null||y===void 0?void 0:y.partial)||((C=O.range.audio)===null||C===void 0?void 0:C.partial))}function _(O){return O.type+"_"+O.level+"_"+O.urlId+"_"+O.sn}},"./src/controller/gap-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"STALL_MINIMUM_DURATION_MS",function(){return N}),L.d(H,"MAX_START_GAP_JUMP",function(){return _}),L.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return O}),L.d(H,"SKIP_BUFFER_RANGE_START",function(){return y}),L.d(H,"default",function(){return C});var z=L("./src/utils/buffer-helper.ts"),I=L("./src/errors.ts"),P=L("./src/events.ts"),B=L("./src/utils/logger.ts"),N=250,_=2,O=.1,y=.05,C=function(){function R(b,g,c,o){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=b,this.media=g,this.fragmentTracker=c,this.hls=o}var A=R.prototype;return A.destroy=function(){this.hls=this.fragmentTracker=this.media=null},A.poll=function(g){var c=this.config,o=this.media,u=this.stalled,d=o.currentTime,T=o.seeking,p=this.seeking&&!T,h=!this.seeking&&T;if(this.seeking=T,d!==g){if(this.moved=!0,u!==null){if(this.stallReported){var S=self.performance.now()-u;B.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(S)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((h||p)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!z.BufferHelper.getBuffered(o).length)return;var v=z.BufferHelper.bufferInfo(o,d,0),l=v.len>0,f=v.nextStart||0;if(!l&&!f)return;if(T){var s=v.len>_,i=!f||f-d>_&&!this.fragmentTracker.getPartialFragment(d);if(s||i)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var x,m=Math.max(f,v.start||0)-d,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=E==null||((x=E.details)===null||x===void 0)?void 0:x.live,U=D?E.details.targetduration*2:_;if(m>0&&m<=U){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(u===null){this.stalled=j;return}var K=j-u;!T&&K>=N&&this._reportStall(v.len);var k=z.BufferHelper.bufferInfo(o,d,c.maxBufferHole);this._tryFixBufferStall(k,K)},A._tryFixBufferStall=function(g,c){var o=this.config,u=this.fragmentTracker,d=this.media,T=d.currentTime,p=u.getPartialFragment(T);if(p){var h=this._trySkipBufferHole(p);if(h)return}g.len>o.maxBufferHole&&c>o.highBufferWatchdogPeriod*1e3&&(B.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},A._reportStall=function(g){var c=this.hls,o=this.media,u=this.stallReported;u||(this.stallReported=!0,B.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+g+")"),c.trigger(P.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}))},A._trySkipBufferHole=function(g){for(var c=this.config,o=this.hls,u=this.media,d=u.currentTime,T=0,p=z.BufferHelper.getBuffered(u),h=0;h<p.length;h++){var S=p.start(h);if(d+c.maxBufferHole>=T&&d<S){var v=Math.max(S+y,u.currentTime+O);return B.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+v),this.moved=!0,this.stalled=null,u.currentTime=v,g&&o.trigger(P.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+v,frag:g}),v}T=p.end(h)}return 0},A._tryNudgeBuffer=function(){var g=this.config,c=this.hls,o=this.media,u=o.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<g.nudgeMaxRetry){var T=u+d*g.nudgeOffset;B.logger.warn("Nudging 'currentTime' from "+u+" to "+T),o.currentTime=T,c.trigger(P.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else B.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+g.nudgeMaxRetry+" nudges"),c.trigger(P.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},R}()},"./src/controller/id3-track-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/events.ts"),I=L("./src/utils/texttrack-utils.ts"),P=L("./src/demux/id3.ts"),B=.25,N=function(){function _(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var O=_.prototype;return O.destroy=function(){this._unregisterListeners()},O._registerListeners=function(){var C=this.hls;C.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O._unregisterListeners=function(){var C=this.hls;C.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O.onMediaAttached=function(C,R){this.media=R.media},O.onMediaDetaching=function(){if(!this.id3Track)return;Object(I.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},O.getID3Track=function(C){if(!this.media)return;for(var R=0;R<C.length;R++){var A=C[R];if(A.kind==="metadata"&&A.label==="id3")return Object(I.sendAddTrackEvent)(A,this.media),A}return this.media.addTextTrack("metadata","id3")},O.onFragParsingMetadata=function(C,R){if(!this.media)return;var A=R.frag,b=R.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var g=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<b.length;c++){var o=P.getID3Frames(b[c].data);if(o){var u=b[c].pts,d=c<b.length-1?b[c+1].pts:A.end,T=d-u;T<=0&&(d=u+B);for(var p=0;p<o.length;p++){var h=o[p];if(!P.isTimeStampFrame(h)){var S=new g(u,d,"");S.value=h,this.id3Track.addCue(S)}}}}},O.onBufferFlushing=function(C,R){var A=R.startOffset,b=R.endOffset,g=R.type;if(!g||g==="audio"){var c=this.id3Track;c&&Object(I.removeCuesInRange)(c,A,b)}},_}();H.default=N},"./src/controller/latency-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return _});var z=L("./src/errors.ts"),I=L("./src/events.ts"),P=L("./src/utils/logger.ts");function B(O,y){for(var C=0;C<y.length;C++){var R=y[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,R.key,R)}}function N(O,y,C){return y&&B(O.prototype,y),C&&B(O,C),O}var _=function(){function O(C){var R=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 R.timeupdate()},this.hls=C,this.config=C.config,this.registerListeners()}var y=O.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(I.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(I.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(I.Events.ERROR,this.onError)},y.onMediaAttached=function(R,A){this.media=A.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(R,A){var b=A.details;this.levelDetails=b,b.advanced&&this.timeupdate(),!b.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(R,A){if(A.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var R=this.media,A=this.levelDetails;if(!R||!A)return;this.currentTime=R.currentTime;var b=this.computeLatency();if(b===null)return;this._latency=b;var g=this.config,c=g.lowLatencyMode,o=g.maxLiveSyncPlaybackRate;if(!c||o===1)return;var u=this.targetLatency;if(u===null)return;var d=b-u,T=Math.min(this.maxLatency,u+A.targetduration),p=d<T;if(A.live&&p&&d>.05&&this.forwardBufferLength>1){var h=Math.min(2,Math.max(1,o)),S=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;R.playbackRate=Math.min(h,Math.max(1,S))}else R.playbackRate!==1&&R.playbackRate!==0&&(R.playbackRate=1)},y.estimateLiveEdge=function(){var R=this.levelDetails;return R===null?null:R.edge+R.age},y.computeLatency=function(){var R=this.estimateLiveEdge();return R===null?null:R-this.currentTime},N(O,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var R=this.config,A=this.levelDetails;return R.liveMaxLatencyDuration!==void 0?R.liveMaxLatencyDuration:A?R.liveMaxLatencyDurationCount*A.targetduration:0}},{key:"targetLatency",get:function(){var R=this.levelDetails;if(R===null)return null;var A=R.holdBack,b=R.partHoldBack,g=R.targetduration,c=this.config,o=c.liveSyncDuration,u=c.liveSyncDurationCount,d=c.lowLatencyMode,T=this.hls.userConfig,p=d&&b||A;(T.liveSyncDuration||T.liveSyncDurationCount||p===0)&&(p=o!==void 0?o:u*g);var h=g,S=1;return p+Math.min(this.stallCount*S,h)}},{key:"liveSyncPosition",get:function(){var R=this.estimateLiveEdge(),A=this.targetLatency,b=this.levelDetails;if(R===null||A===null||b===null)return null;var g=b.edge,c=R-A-this.edgeStalled,o=g-b.totalduration,u=g-(this.config.lowLatencyMode&&b.partTarget||b.targetduration);return Math.min(Math.max(o,c),u)}},{key:"drift",get:function(){var R=this.levelDetails;return R===null?1:R.drift}},{key:"edgeStalled",get:function(){var R=this.levelDetails;if(R===null)return 0;var A=(this.config.lowLatencyMode&&R.partTarget||R.targetduration)*3;return Math.max(R.age-A,0)}},{key:"forwardBufferLength",get:function(){var R=this.media,A=this.levelDetails;if(!R||!A)return 0;var b=R.buffered.length;return b?R.buffered.end(b-1):A.edge-this.currentTime}}]),O}()},"./src/controller/level-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return c});var z=L("./src/types/level.ts"),I=L("./src/events.ts"),P=L("./src/errors.ts"),B=L("./src/utils/codecs.ts"),N=L("./src/controller/level-helper.ts"),_=L("./src/controller/base-playlist-controller.ts"),O=L("./src/types/loader.ts");function y(){return y=Object.assign||function(o){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var T in d)Object.prototype.hasOwnProperty.call(d,T)&&(o[T]=d[T])}return o},y.apply(this,arguments)}function C(o,u){for(var d=0;d<u.length;d++){var T=u[d];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(o,T.key,T)}}function R(o,u,d){return u&&C(o.prototype,u),d&&C(o,d),o}function A(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,b(o,u)}function b(o,u){return b=Object.setPrototypeOf||function(T,p){return T.__proto__=p,T},b(o,u)}var g=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(o){A(u,o);function u(T){var p;return p=o.call(this,T,"[level-controller]")||this,p._levels=[],p._firstLevel=-1,p._startLevel=void 0,p.currentLevelIndex=-1,p.manualLevelIndex=-1,p.onParsedComplete=void 0,p._registerListeners(),p}var d=u.prototype;return d._registerListeners=function(){var p=this.hls;p.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),p.on(I.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var p=this.hls;p.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),p.off(I.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,o.prototype.destroy.call(this)},d.startLoad=function(){var p=this._levels;p.forEach(function(h){h.loadError=0}),o.prototype.startLoad.call(this)},d.onManifestLoaded=function(p,h){var S=[],v=[],l=[],f,s={},i,x=!1,m=!1,E=!1;if(h.levels.forEach(function(K){var k=K.attrs;x=x||!!(K.width&&K.height),m=m||!!K.videoCodec,E=E||!!K.audioCodec,g&&K.audioCodec&&K.audioCodec.indexOf("mp4a.40.34")!==-1&&(K.audioCodec=void 0);var M=K.bitrate+"-"+K.attrs.RESOLUTION+"-"+K.attrs.CODECS;i=s[M],i?i.url.push(K.url):(i=new z.Level(K),s[M]=i,S.push(i)),k&&(k.AUDIO&&Object(N.addGroupId)(i,"audio",k.AUDIO),k.SUBTITLES&&Object(N.addGroupId)(i,"text",k.SUBTITLES))}),(x||m)&&E&&(S=S.filter(function(K){var k=K.videoCodec,M=K.width,G=K.height;return!!k||!!(M&&G)})),S=S.filter(function(K){var k=K.audioCodec,M=K.videoCodec;return(!k||Object(B.isCodecSupportedInMp4)(k,"audio"))&&(!M||Object(B.isCodecSupportedInMp4)(M,"video"))}),h.audioTracks&&(v=h.audioTracks.filter(function(K){return!K.audioCodec||Object(B.isCodecSupportedInMp4)(K.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(v)),h.subtitles&&(l=h.subtitles,Object(N.assignTrackIdsByGroup)(l)),S.length>0){f=S[0].bitrate,S.sort(function(K,k){return K.bitrate-k.bitrate}),this._levels=S;for(var D=0;D<S.length;D++)if(S[D].bitrate===f){this._firstLevel=D,this.log("manifest loaded, "+S.length+" level(s) found, first bitrate: "+f);break}var U=E&&!m,j={levels:S,audioTracks:v,subtitleTracks:l,firstLevel:this._firstLevel,stats:h.stats,audio:E,video:m,altAudio:!U&&v.some(function(K){return!!K.url})};this.hls.trigger(I.Events.MANIFEST_PARSED,j),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(I.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:h.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(p,h){if(o.prototype.onError.call(this,p,h),h.fatal)return;var S=h.context,v=this._levels[this.currentLevelIndex];if(S&&(S.type===O.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&S.groupId===v.audioGroupIds[v.urlId]||S.type===O.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&S.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var l=!1,f=!0,s;switch(h.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(h.frag){var i=this._levels[h.frag.level];i?(i.fragmentError++,i.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=h.frag.level)):s=h.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:S&&(S.deliveryDirectives&&(f=!1),s=S.level),l=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:s=h.level,l=!0;break}s!==void 0&&this.recoverLevel(h,s,l,f)},d.recoverLevel=function(p,h,S,v){var l=p.details,f=this._levels[h];if(f.loadError++,S){var s=this.retryLoadingOrFail(p);if(s)p.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var i=f.url.length;if(i>1&&f.loadError<i)p.levelRetry=!0,this.redundantFailover(h);else if(this.manualLevelIndex===-1){var x=h===0?this._levels.length-1:h-1;this.currentLevelIndex!==x&&this._levels[x].loadError===0&&(this.warn(l+": switch to "+x),p.levelRetry=!0,this.hls.nextAutoLevel=x)}}},d.redundantFailover=function(p){var h=this._levels[p],S=h.url.length;if(S>1){var v=(h.urlId+1)%S;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(l){l.urlId=v}),this.level=p}},d.onFragLoaded=function(p,h){var S=h.frag;if(S!==void 0&&S.type===O.PlaylistLevelType.MAIN){var v=this._levels[S.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},d.onLevelLoaded=function(p,h){var S,v=h.level,l=h.details,f=this._levels[v];if(!f){var s;this.warn("Invalid level index "+v),(s=h.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(l.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(f.fragmentError===0&&(f.loadError=0,this.retryCount=0),this.playlistLoaded(v,h,f.details)):(S=h.deliveryDirectives)!==null&&S!==void 0&&S.skip&&(l.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(p,h){var S=this.hls.levels[this.currentLevelIndex];if(!S)return;if(S.audioGroupIds){for(var v=-1,l=this.hls.audioTracks[h.id].groupId,f=0;f<S.audioGroupIds.length;f++)if(S.audioGroupIds[f]===l){v=f;break}v!==S.urlId&&(S.urlId=v,this.startLoad())}},d.loadPlaylist=function(p){var h=this.currentLevelIndex,S=this._levels[h];if(this.canLoad&&S&&S.url.length>0){var v=S.urlId,l=S.url[v];if(p)try{l=p.addDirectives(l)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Attempt loading level index "+h+(p?" at sn "+p.msn+" part "+p.part:"")+" with URL-id "+v+" "+l),this.clearTimer(),this.hls.trigger(I.Events.LEVEL_LOADING,{url:l,level:h,id:v,deliveryDirectives:p||null})}},d.removeLevel=function(p,h){var S=function(f,s){return s!==h},v=this._levels.filter(function(l,f){return f!==p?!0:l.url.length>1&&h!==void 0?(l.url=l.url.filter(S),l.audioGroupIds&&(l.audioGroupIds=l.audioGroupIds.filter(S)),l.textGroupIds&&(l.textGroupIds=l.textGroupIds.filter(S)),l.urlId=0,!0):!1}).map(function(l,f){var s=l.details;return s!=null&&s.fragments&&s.fragments.forEach(function(i){i.level=f}),l});this._levels=v,this.hls.trigger(I.Events.LEVELS_UPDATED,{levels:v})},R(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(p){var h,S=this._levels;if(S.length===0)return;if(this.currentLevelIndex===p&&(h=S[p])!==null&&h!==void 0&&h.details)return;if(p<0||p>=S.length){var v=p<0;if(this.hls.trigger(I.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:p,fatal:v,reason:"invalid level idx"}),v)return;p=Math.min(p,S.length-1)}this.clearTimer();var l=this.currentLevelIndex,f=S[l],s=S[p];this.log("switching to level "+p+" from "+l),this.currentLevelIndex=p;var i=y({},s,{level:p,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete i._urlId,this.hls.trigger(I.Events.LEVEL_SWITCHING,i);var x=s.details;if(!x||x.live){var m=this.switchParams(s.uri,f==null?void 0:f.details);this.loadPlaylist(m)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(p){this.manualLevelIndex=p,this._startLevel===void 0&&(this._startLevel=p),p!==-1&&(this.level=p)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(p){this._firstLevel=p}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var p=this.hls.config.startLevel;return p!==void 0?p:this._firstLevel}else return this._startLevel},set:function(p){this._startLevel=p}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(p){this.level=p,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=p)}}]),u}(_.default)},"./src/controller/level-helper.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"addGroupId",function(){return P}),L.d(H,"assignTrackIdsByGroup",function(){return B}),L.d(H,"updatePTS",function(){return N}),L.d(H,"updateFragPTSDTS",function(){return O}),L.d(H,"mergeDetails",function(){return y}),L.d(H,"mapPartIntersection",function(){return C}),L.d(H,"mapFragmentIntersection",function(){return R}),L.d(H,"adjustSliding",function(){return A}),L.d(H,"addSliding",function(){return b}),L.d(H,"computeReloadInterval",function(){return g}),L.d(H,"getFragmentWithSN",function(){return c}),L.d(H,"getPartWith",function(){return o});var z=L("./src/polyfills/number.ts"),I=L("./src/utils/logger.ts");function P(u,d,T){switch(d){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(T);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(T);break}}function B(u){var d={};u.forEach(function(T){var p=T.groupId||"";T.id=d[p]=d[p]||0,d[p]++})}function N(u,d,T){var p=u[d],h=u[T];_(p,h)}function _(u,d){var T=d.startPTS;if(Object(z.isFiniteNumber)(T)){var p=0,h;d.sn>u.sn?(p=T-u.start,h=u):(p=u.start-T,h=d),h.duration!==p&&(h.duration=p)}else if(d.sn>u.sn){var S=u.cc===d.cc;S&&u.minEndPTS?d.start=u.start+(u.minEndPTS-u.start):d.start=u.start+u.duration}else d.start=Math.max(u.start-d.duration,0)}function O(u,d,T,p,h,S){var v=p-T;v<=0&&(I.logger.warn("Fragment should have a positive duration",d),p=T+d.duration,S=h+d.duration);var l=T,f=p,s=d.startPTS,i=d.endPTS;if(Object(z.isFiniteNumber)(s)){var x=Math.abs(s-T);Object(z.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(x,d.deltaPTS):d.deltaPTS=x,l=Math.max(T,s),T=Math.min(T,s),h=Math.min(h,d.startDTS),f=Math.min(p,i),p=Math.max(p,i),S=Math.max(S,d.endDTS)}d.duration=p-T;var m=T-d.start;d.appendedPTS=p,d.start=d.startPTS=T,d.maxStartPTS=l,d.startDTS=h,d.endPTS=p,d.minEndPTS=f,d.endDTS=S;var E=d.sn;if(!u||E<u.startSN||E>u.endSN)return 0;var D,U=E-u.startSN,j=u.fragments;for(j[U]=d,D=U;D>0;D--)_(j[D],j[D-1]);for(D=U;D<j.length-1;D++)_(j[D],j[D+1]);return u.fragmentHint&&_(j[j.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,m}function y(u,d){for(var T=null,p=u.fragments,h=p.length-1;h>=0;h--){var S=p[h].initSegment;if(S){T=S;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var v=0,l;if(R(u,d,function(D,U){D.relurl&&(v=D.cc-U.cc),Object(z.isFiniteNumber)(D.startPTS)&&Object(z.isFiniteNumber)(D.endPTS)&&(U.start=U.startPTS=D.startPTS,U.startDTS=D.startDTS,U.appendedPTS=D.appendedPTS,U.maxStartPTS=D.maxStartPTS,U.endPTS=D.endPTS,U.endDTS=D.endDTS,U.minEndPTS=D.minEndPTS,U.duration=D.endPTS-D.startPTS,U.duration&&(l=U),d.PTSKnown=d.alignedSliding=!0),U.elementaryStreams=D.elementaryStreams,U.loader=D.loader,U.stats=D.stats,U.urlId=D.urlId,D.initSegment&&(U.initSegment=D.initSegment,T=D.initSegment)}),T){var f=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;f.forEach(function(D){var U;(!D.initSegment||D.initSegment.relurl===((U=T)===null||U===void 0?void 0:U.relurl))&&(D.initSegment=T)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(D){return!D}),d.deltaUpdateFailed)){I.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=d.skippedSegments;s--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var i=d.fragments;if(v){I.logger.warn("discontinuity sliding from playlist, take drift into account");for(var x=0;x<i.length;x++)i[x].cc+=v}d.skippedSegments&&(d.startCC=d.fragments[0].cc),C(u.partList,d.partList,function(D,U){U.elementaryStreams=D.elementaryStreams,U.stats=D.stats}),l?O(d,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):A(u,d),i.length&&(d.totalduration=d.edge-i[0].start),d.driftStartTime=u.driftStartTime,d.driftStart=u.driftStart;var m=d.advancedDateTime;if(d.advanced&&m){var E=d.edge;d.driftStart||(d.driftStartTime=m,d.driftStart=E),d.driftEndTime=m,d.driftEnd=E}else d.driftEndTime=u.driftEndTime,d.driftEnd=u.driftEnd,d.advancedDateTime=u.advancedDateTime}function C(u,d,T){if(u&&d)for(var p=0,h=0,S=u.length;h<=S;h++){var v=u[h],l=d[h+p];v&&l&&v.index===l.index&&v.fragment.sn===l.fragment.sn?T(v,l):p--}}function R(u,d,T){for(var p=d.skippedSegments,h=Math.max(u.startSN,d.startSN)-d.startSN,S=(u.fragmentHint?1:0)+(p?d.endSN:Math.min(u.endSN,d.endSN))-d.startSN,v=d.startSN-u.startSN,l=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,f=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,s=h;s<=S;s++){var i=f[v+s],x=l[s];p&&!x&&s<p&&(x=d.fragments[s]=i),i&&x&&T(i,x)}}function A(u,d){var T=d.startSN+d.skippedSegments-u.startSN,p=u.fragments;if(T<0||T>=p.length)return;b(d,p[T].start)}function b(u,d){if(d){for(var T=u.fragments,p=u.skippedSegments;p<T.length;p++)T[p].start+=d;u.fragmentHint&&(u.fragmentHint.start+=d)}}function g(u,d){var T=1e3*u.levelTargetDuration,p=T/2,h=u.age,S=h>0&&h<T*3,v=d.loading.end-d.loading.start,l,f=u.availabilityDelay;if(u.updated===!1)if(S){var s=333*u.misses;l=Math.max(Math.min(p,v*2),s),u.availabilityDelay=(u.availabilityDelay||0)+l}else l=p;else S?(f=Math.min(f||T/2,h),u.availabilityDelay=f,l=f+T-h):l=T-v;return Math.round(l)}function c(u,d,T){if(!u||!u.details)return null;var p=u.details,h=p.fragments[d-p.startSN];return h||(h=p.fragmentHint,h&&h.sn===d?h:d<p.startSN&&T&&T.sn===d?T:null)}function o(u,d,T){if(!u||!u.details)return null;var p=u.details.partList;if(p)for(var h=p.length;h--;){var S=p[h];if(S.index===T&&S.fragment.sn===d)return S}return null}},"./src/controller/stream-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return p});var z=L("./src/polyfills/number.ts"),I=L("./src/controller/base-stream-controller.ts"),P=L("./src/is-supported.ts"),B=L("./src/events.ts"),N=L("./src/utils/buffer-helper.ts"),_=L("./src/controller/fragment-tracker.ts"),O=L("./src/types/loader.ts"),y=L("./src/loader/fragment.ts"),C=L("./src/demux/transmuxer-interface.ts"),R=L("./src/types/transmuxer.ts"),A=L("./src/controller/gap-controller.ts"),b=L("./src/errors.ts"),g=L("./src/utils/logger.ts");function c(h,S){for(var v=0;v<S.length;v++){var l=S[v];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function o(h,S,v){return S&&c(h.prototype,S),v&&c(h,v),h}function u(h,S){h.prototype=Object.create(S.prototype),h.prototype.constructor=h,d(h,S)}function d(h,S){return d=Object.setPrototypeOf||function(l,f){return l.__proto__=f,l},d(h,S)}var T=100,p=function(h){u(S,h);function S(l,f){var s;return s=h.call(this,l,f,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var v=S.prototype;return v._registerListeners=function(){var f=this.hls;f.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),f.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.on(B.Events.ERROR,this.onError,this),f.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var f=this.hls;f.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.off(B.Events.ERROR,this.onError,this),f.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(f){if(this.levels){var s=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.setInterval(T),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var x=i.startLevel;x===-1&&(i.config.testBandwidth?(x=0,this.bitrateTest=!0):x=i.nextAutoLevel),this.level=i.nextLoadLevel=x,this.loadedmetadata=!1}s>0&&f===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),f=s),this.state=I.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()}else this._forceStartLoad=!0,this.state=I.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,h.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_LEVEL:{var f,s=this.levels,i=this.level,x=s==null||((f=s[i])===null||f===void 0)?void 0:f.details;if(x&&(!x.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(x))break;this.state=I.State.IDLE;break}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var m,E=self.performance.now(),D=this.retryDate;(!D||E>=D||(m=this.media)!==null&&m!==void 0&&m.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=I.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){h.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var f,s,i=this.hls,x=this.levelLastLoaded,m=this.levels,E=this.media,D=i.config,U=i.nextLoadLevel;if(x===null||!E&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!m||!m[U])return;var j=m[U];this.level=i.nextLoadLevel=U;var K=j.details;if(!K||this.state===I.State.WAITING_LEVEL||K.live&&this.levelLastLoaded!==U){this.state=I.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,O.PlaylistLevelType.MAIN);if(k===null)return;var M=k.len,G=this.getMaxBufferLength(j.maxBitrate);if(M>=G)return;if(this._streamEnded(k,K)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(B.Events.BUFFER_EOS,ee),this.state=I.State.ENDED;return}var ue=k.end,de=this.getNextFragment(ue,K);if(this.couldBacktrack&&!this.fragPrevious&&de&&de.sn!=="initSegment"){var be=de.sn-K.startSN;be>1&&(de=K.fragments[be-1],this.fragmentTracker.removeFragment(de))}if(de&&this.fragmentTracker.getState(de)===_.FragmentState.OK&&this.nextLoadPosition>ue){var Ee=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,Ee,O.PlaylistLevelType.MAIN),de=this.getNextFragment(this.nextLoadPosition,K)}if(!de)return;de.initSegment&&!de.initSegment.data&&!this.bitrateTest&&(de=de.initSegment),((f=de.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((s=de.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(de,K):this.loadFragment(de,K,ue)},v.loadFragment=function(f,s,i){var x,m=this.fragmentTracker.getState(f);if(this.fragCurrent=f,m===_.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(f);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else m=_.FragmentState.NOT_LOADED}m===_.FragmentState.NOT_LOADED||m===_.FragmentState.PARTIAL?f.sn==="initSegment"?this._loadInitSegment(f):this.bitrateTest?(f.bitrateTest=!0,this.log("Fragment "+f.sn+" of level "+f.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(f)):(this.startFragRequested=!0,h.prototype.loadFragment.call(this,f,s,i)):m===_.FragmentState.APPENDING?this.reduceMaxBufferLength(f.duration)&&this.fragmentTracker.removeFragment(f):((x=this.media)===null||x===void 0?void 0:x.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(f){var s=this.fragmentTracker.getAppendedFrag(f,O.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},v.getBufferedFrag=function(f){return this.fragmentTracker.getBufferedFrag(f,O.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(f){return f?this.getBufferedFrag(f.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var f=this.levels,s=this.media;if(s!=null&&s.readyState){var i,x=this.getAppendedFrag(s.currentTime);if(x&&x.start>1&&this.flushMainBuffer(0,x.start-1),!s.paused&&f){var m=this.hls.nextLoadLevel,E=f[m],D=this.fragLastKbps;D&&this.fragCurrent?i=this.fragCurrent.duration*E.maxBitrate/(1e3*D)+1:i=0}else i=0;var U=this.getBufferedFrag(s.currentTime+i);if(U){var j=this.followingBufferedFrag(U);if(j){this.abortCurrentFrag();var K=j.maxStartPTS?j.maxStartPTS:j.start,k=j.duration,M=Math.max(U.end,K+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(M,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var f=this.fragCurrent;this.fragCurrent=null,f!=null&&f.loader&&f.loader.abort(),this.state===I.State.KEY_LOADING&&(this.state=I.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(f,s){h.prototype.flushMainBuffer.call(this,f,s,this.altAudio?"video":null)},v.onMediaAttached=function(f,s){h.prototype.onMediaAttached.call(this,f,s);var i=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new A.default(this.config,i,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var f=this.media;f&&(f.removeEventListener("playing",this.onvplaying),f.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),h.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var f=this.media,s=f?f.currentTime:null;Object(z.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(B.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(f,s){var i=!1,x=!1,m;s.levels.forEach(function(E){m=E.audioCodec,m&&(m.indexOf("mp4a.40.2")!==-1&&(i=!0),m.indexOf("mp4a.40.5")!==-1&&(x=!0))}),this.audioCodecSwitch=i&&x&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},v.onLevelLoading=function(f,s){var i=this.levels;if(!i||this.state!==I.State.IDLE)return;var x=i[s.level];(!x.details||x.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(x.details))&&(this.state=I.State.WAITING_LEVEL)},v.onLevelLoaded=function(f,s){var i,x=this.levels,m=s.level,E=s.details,D=E.totalduration;if(!x){this.warn("Levels were reset while loading level "+m);return}this.log("Level "+m+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+D);var U=this.fragCurrent;U&&(this.state===I.State.FRAG_LOADING||this.state===I.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==s.level&&U.loader&&(this.state=I.State.IDLE,U.loader.abort()));var j=x[m],K=0;if(E.live||(i=j.details)!==null&&i!==void 0&&i.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;K=this.alignPlaylists(E,j.details)}if(j.details=E,this.levelLastLoaded=m,this.hls.trigger(B.Events.LEVEL_UPDATED,{details:E,level:m}),this.state===I.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=I.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,K),this.tick()},v._handleFragmentLoadProgress=function(f){var s,i=f.frag,x=f.part,m=f.payload,E=this.levels;if(!E){this.warn("Levels were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered");return}var D=E[i.level],U=D.details;if(!U){this.warn("Dropping fragment "+i.sn+" of level "+i.level+" after level details were reset");return}var j=D.videoCodec,K=U.PTSKnown||!U.live,k=(s=i.initSegment)===null||s===void 0?void 0:s.data,M=this._getAudioCodec(D),G=this.transmuxer=this.transmuxer||new C.default(this.hls,O.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=x?x.index:-1,ue=ee!==-1,de=new R.ChunkMetadata(i.level,i.sn,i.stats.chunkCount,m.byteLength,ee,ue),be=this.initPTS[i.cc];G.push(m,k,M,j,i,x,U.totalduration,K,de,be)},v.onAudioTrackSwitching=function(f,s){var i=this.altAudio,x=!!s.url,m=s.id;if(!x){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var E=this.fragCurrent;E!=null&&E.loader&&(this.log("Switching to main audio track, cancel main fragment load"),E.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var D=this.hls;i&&D.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:m})}},v.onAudioTrackSwitched=function(f,s){var i=s.id,x=!!this.hls.audioTracks[i].url;if(x){var m=this.videoBuffer;m&&this.mediaBuffer!==m&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=m)}this.altAudio=x,this.tick()},v.onBufferCreated=function(f,s){var i=s.tracks,x,m,E=!1;for(var D in i){var U=i[D];if(U.id==="main"){if(m=D,x=U,D==="video"){var j=i[D];j&&(this.videoBuffer=j.buffer)}}else E=!0}E&&x?(this.log("Alternate track found, use "+m+".buffered to schedule main fragment loading"),this.mediaBuffer=x.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(f,s){var i=s.frag,x=s.part;if(i&&i.type!==O.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(i)){this.warn("Fragment "+i.sn+(x?" p: "+x.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state),this.state===I.State.PARSED&&(this.state=I.State.IDLE);return}var m=x?x.stats:i.stats;this.fragLastKbps=Math.round(8*m.total/(m.buffering.end-m.loading.first)),i.sn!=="initSegment"&&(this.fragPrevious=i),this.fragBufferedComplete(i,x)},v.onError=function(f,s){switch(s.details){case b.ErrorDetails.FRAG_LOAD_ERROR:case b.ErrorDetails.FRAG_LOAD_TIMEOUT:case b.ErrorDetails.KEY_LOAD_ERROR:case b.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(O.PlaylistLevelType.MAIN,s);break;case b.ErrorDetails.LEVEL_LOAD_ERROR:case b.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==I.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=I.State.ERROR):!s.levelRetry&&this.state===I.State.WAITING_LEVEL&&(this.state=I.State.IDLE));break;case b.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var i=!0,x=this.getFwdBufferInfo(this.media,O.PlaylistLevelType.MAIN);x&&x.len>.5&&(i=!this.reduceMaxBufferLength(x.len)),i&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},v.checkBuffer=function(){var f=this.media,s=this.gapController;if(!f||!s||!f.readyState)return;var i=N.BufferHelper.getBuffered(f);!this.loadedmetadata&&i.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=f.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=I.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(f,s){var i=s.type;if(i!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var x=(i===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(x,i,O.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(f,s){this.levels=s.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var f=this.media,s=f.currentTime,i=this.startPosition;if(i>=0&&s<i){if(f.seeking){g.logger.log("could not seek to "+i+", already seeking at "+s);return}var x=N.BufferHelper.getBuffered(f),m=x.length?x.start(0):0,E=m-i;E>0&&(E<this.config.maxBufferHole||E<this.config.maxFragLookUpTolerance)&&(g.logger.log("adjusting start position by "+E+" to match buffer start"),i+=E,this.startPosition=i),this.log("seek to target start position "+i+" from current time "+s),f.currentTime=i}},v._getAudioCodec=function(f){var s=this.config.defaultAudioCodec||f.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},v._loadBitrateTestFrag=function(f){var s=this;this._doFragLoad(f).then(function(i){var x=s.hls;if(!i||x.nextLoadLevel||s.fragContextChanged(f))return;s.fragLoadError=0,s.state=I.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var m=f.stats;m.parsing.start=m.parsing.end=m.buffering.start=m.buffering.end=self.performance.now(),x.trigger(B.Events.FRAG_LOADED,i)})},v._handleTransmuxComplete=function(f){var s,i="main",x=this.hls,m=f.remuxResult,E=f.chunkMeta,D=this.getCurrentContext(E);if(!D){this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(E.level);return}var U=D.frag,j=D.part,K=D.level,k=m.video,M=m.text,G=m.id3,ee=m.initSegment,ue=this.altAudio?void 0:m.audio;if(this.fragContextChanged(U))return;if(this.state=I.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(K,ee.tracks,U,E),x.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:i,tracks:ee.tracks}));var de=ee.initPTS,be=ee.timescale;Object(z.isFiniteNumber)(de)&&(this.initPTS[U.cc]=de,x.trigger(B.Events.INIT_PTS_FOUND,{frag:U,id:i,initPTS:de,timescale:be}))}if(k&&m.independent!==!1){if(K.details){var Ee=k.startPTS,ae=k.endPTS,$=k.startDTS,re=k.endDTS;if(j)j.elementaryStreams[k.type]={startPTS:Ee,endPTS:ae,startDTS:$,endDTS:re};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var J=this.getLoadPosition()+this.config.maxBufferHole;if(J<Ee){this.backtrack(U);return}U.setElementaryStreamInfo(k.type,U.start,ae,U.start,re,!0)}U.setElementaryStreamInfo(k.type,Ee,ae,$,re),this.bufferFragmentData(k,U,j,E)}}else if(m.independent===!1){this.backtrack(U);return}if(ue){var ie=ue.startPTS,V=ue.endPTS,Y=ue.startDTS,Z=ue.endDTS;j&&(j.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:V,startDTS:Y,endDTS:Z}),U.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,ie,V,Y,Z),this.bufferFragmentData(ue,U,j,E)}if(G!=null&&(s=G.samples)!==null&&s!==void 0&&s.length){var le={frag:U,id:i,samples:G.samples};x.trigger(B.Events.FRAG_PARSING_METADATA,le)}if(M){var xe={frag:U,id:i,samples:M.samples};x.trigger(B.Events.FRAG_PARSING_USERDATA,xe)}},v._bufferInitSegment=function(f,s,i,x){var m=this;if(this.state!==I.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var E=s.audio,D=s.video,U=s.audiovideo;if(E){var j=f.audioCodec,K=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),E.metadata.channelCount!==1&&K.indexOf("firefox")===-1&&(j="mp4a.40.5")),K.indexOf("android")!==-1&&E.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),f.audioCodec&&f.audioCodec!==j&&this.log('Swapping manifest audio codec "'+f.audioCodec+'" for "'+j+'"'),E.levelCodec=j,E.id="main",this.log("Init audio buffer, container:"+E.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(f.audioCodec||"")+"/"+E.codec+"]")}D&&(D.levelCodec=f.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(f.videoCodec||"")+"/"+D.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(f.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(k){var M=s[k],G=M.initSegment;G!=null&&G.byteLength&&m.hls.trigger(B.Events.BUFFER_APPENDING,{type:k,data:G,frag:i,part:null,chunkMeta:x,parent:i.type})}),this.tick()},v.backtrack=function(f){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(f);var s=this.fragmentTracker.backtrack(f);this.fragPrevious=null,this.nextLoadPosition=f.start,s?this.resetFragmentLoading(f):this.state=I.State.BACKTRACKING},v.checkFragmentChanged=function(){var f=this.media,s=null;if(f&&f.readyState>1&&f.seeking===!1){var i=f.currentTime;if(N.BufferHelper.isBuffered(f,i)?s=this.getAppendedFrag(i):N.BufferHelper.isBuffered(f,i+.1)&&(s=this.getAppendedFrag(i+.1)),s){var x=this.fragPlaying,m=s.level;(!x||s.sn!==x.sn||x.level!==m||s.urlId!==x.urlId)&&(this.hls.trigger(B.Events.FRAG_CHANGED,{frag:s}),(!x||x.level!==m)&&this.hls.trigger(B.Events.LEVEL_SWITCHED,{level:m}),this.fragPlaying=s)}}},o(S,[{key:"nextLevel",get:function(){var f=this.nextBufferedFrag;return f?f.level:-1}},{key:"currentLevel",get:function(){var f=this.media;if(f){var s=this.getAppendedFrag(f.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var f=this.media;if(f){var s=this.getAppendedFrag(f.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),S}(I.default)},"./src/controller/subtitle-stream-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"SubtitleStreamController",function(){return u});var z=L("./src/events.ts"),I=L("./src/utils/logger.ts"),P=L("./src/utils/buffer-helper.ts"),B=L("./src/controller/fragment-finders.ts"),N=L("./src/utils/discontinuities.ts"),_=L("./src/controller/level-helper.ts"),O=L("./src/controller/fragment-tracker.ts"),y=L("./src/controller/base-stream-controller.ts"),C=L("./src/types/loader.ts"),R=L("./src/types/level.ts");function A(d,T){for(var p=0;p<T.length;p++){var h=T[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function b(d,T,p){return T&&A(d.prototype,T),p&&A(d,p),d}function g(d,T){d.prototype=Object.create(T.prototype),d.prototype.constructor=d,c(d,T)}function c(d,T){return c=Object.setPrototypeOf||function(h,S){return h.__proto__=S,h},c(d,T)}var o=500,u=function(d){g(T,d);function T(h,S){var v;return v=d.call(this,h,S,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var p=T.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var S=this.hls;S.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(z.Events.ERROR,this.onError,this),S.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),S.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),S.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),S.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),S.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var S=this.hls;S.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(z.Events.ERROR,this.onError,this),S.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),S.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),S.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),S.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),S.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(o),this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},p.onLevelLoaded=function(S,v){this.mainDetails=v.details},p.onSubtitleFragProcessed=function(S,v){var l=v.frag,f=v.success;if(this.fragPrevious=l,this.state=y.State.IDLE,!f)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var i,x=l.start,m=0;m<s.length;m++)if(x>=s[m].start&&x<=s[m].end){i=s[m];break}var E=l.start+l.duration;i?i.end=E:(i={start:x,end:E},s.push(i)),this.fragmentTracker.fragBuffered(l)},p.onBufferFlushing=function(S,v){var l=v.startOffset,f=v.endOffset;if(l===0&&f!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,i=this.levels;if(!i.length||!i[s]||!i[s].details)return;var x=i[s].details,m=x.targetduration,E=f-m;if(E<=0)return;v.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(D){for(var U=0;U<D.length;){if(D[U].end<=E){D.shift();continue}else if(D[U].start<E)D[U].start=E;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(l,E,C.PlaylistLevelType.SUBTITLE)}},p.onError=function(S,v){var l,f=v.frag;if(!f||f.type!==C.PlaylistLevelType.SUBTITLE)return;(l=this.fragCurrent)!==null&&l!==void 0&&l.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},p.onSubtitleTracksUpdated=function(S,v){var l=this,f=v.subtitleTracks;this.tracksBuffered=[],this.levels=f.map(function(s){return new R.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){l.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},p.onSubtitleTrackSwitch=function(S,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var l=this.levels[this.currentTrackId];l!=null&&l.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,l&&this.setInterval(o)},p.onSubtitleTrackLoaded=function(S,v){var l,f=v.details,s=v.id,i=this.currentTrackId,x=this.levels;if(!x.length)return;var m=x[i];if(s>=x.length||s!==i||!m)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,f.live||(l=m.details)!==null&&l!==void 0&&l.live){var E=this.mainDetails;if(f.deltaUpdateFailed||!E)return;var D=E.fragments[0];if(!m.details)f.hasProgramDateTime&&E.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(f,E):D&&Object(_.addSliding)(f,D.start);else{var U=this.alignPlaylists(f,m.details);U===0&&D&&Object(_.addSliding)(f,D.start)}}if(m.details=f,this.levelLastLoaded=s,this.tick(),f.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var j=Object(B.findFragmentByPTS)(null,f.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),m.details=void 0)}},p._handleFragmentLoadComplete=function(S){var v=S.frag,l=S.payload,f=v.decryptdata,s=this.hls;if(this.fragContextChanged(v))return;if(l&&l.byteLength>0&&f&&f.key&&f.iv&&f.method==="AES-128"){var i=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(l),f.key.buffer,f.iv.buffer).then(function(x){var m=performance.now();s.trigger(z.Events.FRAG_DECRYPTED,{frag:v,payload:x,stats:{tstart:i,tdecrypt:m}})})}},p.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var S,v=this.currentTrackId,l=this.levels;if(!l.length||!l[v]||!l[v].details)return;var f=l[v].details,s=f.targetduration,i=this.config,x=this.media,m=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,x.currentTime-s,i.maxBufferHole),E=m.end,D=m.len,U=this.getMaxBufferLength()+s;if(D>U)return;console.assert(f,"Subtitle track details are defined on idle subtitle stream controller tick");var j=f.fragments,K=j.length,k=f.edge,M,G=this.fragPrevious;if(E<k){var ee=i.maxFragLookUpTolerance;G&&f.hasProgramDateTime&&(M=Object(B.findFragmentByPDT)(j,G.endProgramDateTime,ee)),M||(M=Object(B.findFragmentByPTS)(G,j,E,ee),!M&&G&&G.start<j[0].start&&(M=j[0]))}else M=j[K-1];(S=M)!==null&&S!==void 0&&S.encrypted?(I.logger.log("Loading key for "+M.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:M})):M&&this.fragmentTracker.getState(M)===O.FragmentState.NOT_LOADED&&this.loadFragment(M,f,E)}},p.loadFragment=function(S,v,l){this.fragCurrent=S,d.prototype.loadFragment.call(this,S,v,l)},b(T,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),T}(y.default)},"./src/controller/subtitle-track-controller.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/events.ts"),I=L("./src/utils/texttrack-utils.ts"),P=L("./src/controller/base-playlist-controller.ts"),B=L("./src/types/loader.ts");function N(A,b){for(var g=0;g<b.length;g++){var c=b[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(A,c.key,c)}}function _(A,b,g){return b&&N(A.prototype,b),g&&N(A,g),A}function O(A,b){A.prototype=Object.create(b.prototype),A.prototype.constructor=A,y(A,b)}function y(A,b){return y=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},y(A,b)}var C=function(A){O(b,A);function b(c){var o;return o=A.call(this,c,"[subtitle-track-controller]")||this,o.media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o.subtitleDisplay=!0,o.registerListeners(),o}var g=b.prototype;return g.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,A.prototype.destroy.call(this)},g.registerListeners=function(){var o=this.hls;o.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(z.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){var o=this.hls;o.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(z.Events.ERROR,this.onError,this)},g.onMediaAttached=function(o,u){if(this.media=u.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)},g.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},g.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 o=R(this.media.textTracks);o.forEach(function(u){Object(I.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},g.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},g.onManifestParsed=function(o,u){this.tracks=u.subtitleTracks},g.onSubtitleTrackLoaded=function(o,u){var d=u.id,T=u.details,p=this.trackId,h=this.tracksInGroup[p];if(!h){this.warn("Invalid subtitle track id "+d);return}var S=h.details;h.details=u.details,this.log("subtitle track "+d+" loaded ["+T.startSN+"-"+T.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,u,S))},g.onLevelLoading=function(o,u){this.switchLevel(u.level)},g.onLevelSwitching=function(o,u){this.switchLevel(u.level)},g.switchLevel=function(o){var u=this.hls.levels[o];if(!(u!=null&&u.textGroupIds))return;var d=u.textGroupIds[u.urlId];if(this.groupId!==d){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,p=this.tracks.filter(function(v){return!d||v.groupId===d});this.tracksInGroup=p;var h=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=d;var S={subtitleTracks:p};this.log("Updating subtitle tracks, "+p.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,S),h!==-1&&this.setSubtitleTrack(h,T)}},g.findTrackId=function(o){for(var u=this.tracksInGroup,d=0;d<u.length;d++){var T=u[d];if((!this.selectDefaultTrack||T.default)&&(!o||o===T.name))return T.id}return-1},g.onError=function(o,u){if(A.prototype.onError.call(this,o,u),u.fatal||!u.context)return;u.context.type===B.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},g.loadPlaylist=function(o){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var d=u.id,T=u.groupId,p=u.url;if(o)try{p=o.addDirectives(p)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:p,id:d,groupId:T,deliveryDirectives:o||null})}},g.toggleTrackModes=function(o){var u=this,d=this.media,T=this.subtitleDisplay,p=this.trackId;if(!d)return;var h=R(d.textTracks),S=h.filter(function(f){return f.groupId===u.groupId});if(o===-1)[].slice.call(h).forEach(function(f){f.mode="disabled"});else{var v=S[p];v&&(v.mode="disabled")}var l=S[o];l&&(l.mode=T?"showing":"hidden")},g.setSubtitleTrack=function(o,u){var d,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(d=T[o])!==null&&d!==void 0&&d.details)||o<-1||o>=T.length)return;this.clearTimer();var p=T[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,p){var h=p.id,S=p.groupId,v=S===void 0?"":S,l=p.name,f=p.type,s=p.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:h,groupId:v,name:l,type:f,url:s});var i=this.switchParams(p.url,u==null?void 0:u.details);this.loadPlaylist(i)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:o})},g.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,u=R(this.media.textTracks),d=0;d<u.length;d++)if(u[d].mode==="hidden")o=d;else if(u[d].mode==="showing"){o=d;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},_(b,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,u)}}]),b}(P.default);function R(A){for(var b=[],g=0;g<A.length;g++){var c=A[g];c.kind==="subtitles"&&c.label&&b.push(A[g])}return b}H.default=C},"./src/controller/timeline-controller.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"TimelineController",function(){return R});var z=L("./src/polyfills/number.ts"),I=L("./src/events.ts"),P=L("./src/utils/cea-608-parser.ts"),B=L("./src/utils/output-filter.ts"),N=L("./src/utils/webvtt-parser.ts"),_=L("./src/utils/texttrack-utils.ts"),O=L("./src/utils/imsc1-ttml-parser.ts"),y=L("./src/types/loader.ts"),C=L("./src/utils/logger.ts"),R=function(){function c(u){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=g(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.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 d=new B.default(this,"textTrack1"),T=new B.default(this,"textTrack2"),p=new B.default(this,"textTrack3"),h=new B.default(this,"textTrack4");this.cea608Parser1=new P.default(1,d,T),this.cea608Parser2=new P.default(3,p,h)}u.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(I.Events.FRAG_LOADING,this.onFragLoading,this),u.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=c.prototype;return o.destroy=function(){var d=this.hls;d.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(I.Events.FRAG_LOADING,this.onFragLoading,this),d.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(d,T,p,h,S){for(var v=!1,l=S.length;l--;){var f=S[l],s=b(f[0],f[1],T,p);if(s>=0&&(f[0]=Math.min(f[0],T),f[1]=Math.max(f[1],p),v=!0,s/(p-T)>.5))return}if(v||S.push([T,p]),this.config.renderTextTracksNatively){var i=this.captionsTracks[d];this.Cues.newCue(i,T,p,h)}else{var x=this.Cues.newCue(null,T,p,h);this.hls.trigger(I.Events.CUES_PARSED,{type:"captions",cues:x,track:d})}},o.onInitPtsFound=function(d,T){var p=this,h=T.frag,S=T.id,v=T.initPTS,l=T.timescale,f=this.unparsedVttFrags;S==="main"&&(this.initPTS[h.cc]=v,this.timescale[h.cc]=l),f.length&&(this.unparsedVttFrags=[],f.forEach(function(s){p.onFragLoaded(I.Events.FRAG_LOADED,s)}))},o.getExistingTrack=function(d){var T=this.media;if(T)for(var p=0;p<T.textTracks.length;p++){var h=T.textTracks[p];if(h[d])return h}return null},o.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},o.createNativeTrack=function(d){if(this.captionsTracks[d])return;var T=this.captionsProperties,p=this.captionsTracks,h=this.media,S=T[d],v=S.label,l=S.languageCode,f=this.getExistingTrack(d);if(f)p[d]=f,Object(_.clearCurrentCues)(p[d]),Object(_.sendAddTrackEvent)(p[d],h);else{var s=this.createTextTrack("captions",v,l);s&&(s[d]=!0,p[d]=s)}},o.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var T=this.captionsProperties[d];if(!T)return;var p=T.label,h={_id:d,label:p,kind:"captions",default:T.media?!!T.media.default:!1,closedCaptions:T.media};this.nonNativeCaptionsTracks[d]=h,this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[h]})},o.createTextTrack=function(d,T,p){var h=this.media;return h?h.addTextTrack(d,T,p):void 0},o.onMediaAttaching=function(d,T){this.media=T.media,this._cleanTracks()},o.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(T){Object(_.clearCurrentCues)(d[T]),delete d[T]}),this.nonNativeCaptionsTracks={}},o.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=g(),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())},o._cleanTracks=function(){var d=this.media;if(!d)return;var T=d.textTracks;if(T)for(var p=0;p<T.length;p++)Object(_.clearCurrentCues)(T[p])},o.onSubtitleTracksUpdated=function(d,T){var p=this;this.textTracks=[];var h=T.subtitleTracks||[],S=h.some(function(s){return s.textCodec===O.IMSC1_CODEC});if(this.config.enableWebVTT||S&&this.config.enableIMSC1){var v=this.tracks&&h&&this.tracks.length===h.length;if(this.tracks=h||[],this.config.renderTextTracksNatively){var l=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,i){var x;if(i<l.length){for(var m=null,E=0;E<l.length;E++)if(A(l[E],s)){m=l[E];break}m&&(x=m)}x?Object(_.clearCurrentCues)(x):(x=p.createTextTrack("subtitles",s.name,s.lang),x&&(x.mode="disabled")),x&&(x.groupId=s.groupId,p.textTracks.push(x))})}else if(!v&&this.tracks&&this.tracks.length){var f=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:f})}}},o.onManifestLoaded=function(d,T){var p=this;this.config.enableCEA708Captions&&T.captions&&T.captions.forEach(function(h){var S=/(?:CC|SERVICE)([1-4])/.exec(h.instreamId);if(!S)return;var v="textTrack"+S[1],l=p.captionsProperties[v];if(!l)return;l.label=h.name,h.lang&&(l.languageCode=h.lang),l.media=h})},o.onFragLoading=function(d,T){var p=this.cea608Parser1,h=this.cea608Parser2,S=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(p&&h))return;if(T.frag.type===y.PlaylistLevelType.MAIN){var l,f,s=T.frag.sn,i=(l=T==null||((f=T.part)===null||f===void 0)?void 0:f.index)!=null?l:-1;s===S+1||s===S&&i===v+1||(p.reset(),h.reset()),this.lastSn=s,this.lastPartIndex=i}},o.onFragLoaded=function(d,T){var p=T.frag,h=T.payload,S=this.initPTS,v=this.unparsedVttFrags;if(p.type===y.PlaylistLevelType.SUBTITLE)if(h.byteLength){if(!Object(z.isFiniteNumber)(S[p.cc])){v.push(T),S.length&&this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Missing initial subtitle PTS")});return}var l=p.decryptdata;if(l==null||l.key==null||l.method!=="AES-128"){var f=this.tracks[p.level],s=this.vttCCs;s[p.cc]||(s[p.cc]={start:p.start,prevCC:this.prevCC,new:!0},this.prevCC=p.cc),f&&f.textCodec===O.IMSC1_CODEC?this._parseIMSC1(p,h):this._parseVTTs(p,h,s)}}else this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(d,T){var p=this,h=this.hls;Object(O.parseIMSC1)(T,this.initPTS[d.cc],this.timescale[d.cc],function(S){p._appendCues(S,d.level),h.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(S){C.logger.log("Failed to parse IMSC1: "+S),h.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:S})})},o._parseVTTs=function(d,T,p){var h=this,S=this.hls;Object(N.parseWebVTT)(T,this.initPTS[d.cc],this.timescale[d.cc],p,d.cc,d.start,function(v){h._appendCues(v,d.level),S.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(v){h._fallbackToIMSC1(d,T),C.logger.log("Failed to parse VTT cue: "+v),S.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:v})})},o._fallbackToIMSC1=function(d,T){var p=this,h=this.tracks[d.level];h.textCodec||Object(O.parseIMSC1)(T,this.initPTS[d.cc],this.timescale[d.cc],function(){h.textCodec=O.IMSC1_CODEC,p._parseIMSC1(d,T)},function(){h.textCodec="wvtt"})},o._appendCues=function(d,T){var p=this.hls;if(this.config.renderTextTracksNatively){var h=this.textTracks[T];if(h.mode==="disabled")return;d.forEach(function(l){return Object(_.addCueToTrack)(h,l)})}else{var S=this.tracks[T],v=S.default?"default":"subtitles"+T;p.trigger(I.Events.CUES_PARSED,{type:"subtitles",cues:d,track:v})}},o.onFragDecrypted=function(d,T){var p=T.frag;if(p.type===y.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[p.cc])){this.unparsedVttFrags.push(T);return}this.onFragLoaded(I.Events.FRAG_LOADED,T)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(d,T){var p=this.cea608Parser1,h=this.cea608Parser2;if(!this.enabled||!(p&&h))return;for(var S=0;S<T.samples.length;S++){var v=T.samples[S].bytes;if(v){var l=this.extractCea608Data(v);p.addData(T.samples[S].pts,l[0]),h.addData(T.samples[S].pts,l[1])}}},o.onBufferFlushing=function(d,T){var p=T.startOffset,h=T.endOffset,S=T.endOffsetSubtitles,v=T.type,l=this.media;if(!l||l.currentTime<h)return;if(!v||v==="video"){var f=this.captionsTracks;Object.keys(f).forEach(function(i){return Object(_.removeCuesInRange)(f[i],p,h)})}if(this.config.renderTextTracksNatively&&(p===0&&S!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(i){return Object(_.removeCuesInRange)(s[i],p,S)})}},o.extractCea608Data=function(d){for(var T=d[0]&31,p=2,h=[[],[]],S=0;S<T;S++){var v=d[p++],l=127&d[p++],f=127&d[p++],s=(4&v)!==0,i=3&v;if(l===0&&f===0)continue;s&&((i===0||i===1)&&(h[i].push(l),h[i].push(f)))}return h},c}();function A(c,o){return c&&c.label===o.name&&!(c.textTrack1||c.textTrack2)}function b(c,o,u,d){return Math.min(o,d)-Math.max(c,u)}function g(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return z});var z=function(){function I(B,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=B,this.aesIV=N}var P=I.prototype;return P.decrypt=function(N,_){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},_,N)},I}()},"./src/crypt/aes-decryptor.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"removePadding",function(){return I}),L.d(H,"default",function(){return P});var z=L("./src/utils/typed-array.ts");function I(B){var N=B.byteLength,_=N&&new DataView(B.buffer).getUint8(N-1);return _?Object(z.sliceUint8)(B,0,N-_):B}var P=function(){function B(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var N=B.prototype;return N.uint8ArrayToUint32Array_=function(O){for(var y=new DataView(O),C=new Uint32Array(4),R=0;R<4;R++)C[R]=y.getUint32(R*4);return C},N.initTable=function(){var O=this.sBox,y=this.invSBox,C=this.subMix,R=C[0],A=C[1],b=C[2],g=C[3],c=this.invSubMix,o=c[0],u=c[1],d=c[2],T=c[3],p=new Uint32Array(256),h=0,S=0,v=0;for(v=0;v<256;v++)v<128?p[v]=v<<1:p[v]=v<<1^283;for(v=0;v<256;v++){var l=S^S<<1^S<<2^S<<3^S<<4;l=l>>>8^l&255^99,O[h]=l,y[l]=h;var f=p[h],s=p[f],i=p[s],x=p[l]*257^l*16843008;R[h]=x<<24|x>>>8,A[h]=x<<16|x>>>16,b[h]=x<<8|x>>>24,g[h]=x,x=i*16843009^s*65537^f*257^h*16843008,o[l]=x<<24|x>>>8,u[l]=x<<16|x>>>16,d[l]=x<<8|x>>>24,T[l]=x,h?(h=f^p[p[p[i^f]]],S^=p[p[S]]):h=S=1}},N.expandKey=function(O){for(var y=this.uint8ArrayToUint32Array_(O),C=!0,R=0;R<y.length&&C;)C=y[R]===this.key[R],R++;if(C)return;this.key=y;var A=this.keySize=y.length;if(A!==4&&A!==6&&A!==8)throw new Error("Invalid aes key size="+A);var b=this.ksRows=(A+6+1)*4,g,c,o=this.keySchedule=new Uint32Array(b),u=this.invKeySchedule=new Uint32Array(b),d=this.sBox,T=this.rcon,p=this.invSubMix,h=p[0],S=p[1],v=p[2],l=p[3],f,s;for(g=0;g<b;g++){if(g<A){f=o[g]=y[g];continue}s=f,g%A===0?(s=s<<8|s>>>24,s=d[s>>>24]<<24|d[s>>>16&255]<<16|d[s>>>8&255]<<8|d[s&255],s^=T[g/A|0]<<24):A>6&&g%A===4&&(s=d[s>>>24]<<24|d[s>>>16&255]<<16|d[s>>>8&255]<<8|d[s&255]),o[g]=f=(o[g-A]^s)>>>0}for(c=0;c<b;c++)g=b-c,c&3?s=o[g]:s=o[g-4],c<4||g<=4?u[c]=s:u[c]=h[d[s>>>24]]^S[d[s>>>16&255]]^v[d[s>>>8&255]]^l[d[s&255]],u[c]=u[c]>>>0},N.networkToHostOrderSwap=function(O){return O<<24|(O&65280)<<8|(O&16711680)>>8|O>>>24},N.decrypt=function(O,y,C){for(var R=this.keySize+6,A=this.invKeySchedule,b=this.invSBox,g=this.invSubMix,c=g[0],o=g[1],u=g[2],d=g[3],T=this.uint8ArrayToUint32Array_(C),p=T[0],h=T[1],S=T[2],v=T[3],l=new Int32Array(O),f=new Int32Array(l.length),s,i,x,m,E,D,U,j,K,k,M,G,ee,ue,de=this.networkToHostOrderSwap;y<l.length;){for(K=de(l[y]),k=de(l[y+1]),M=de(l[y+2]),G=de(l[y+3]),E=K^A[0],D=G^A[1],U=M^A[2],j=k^A[3],ee=4,ue=1;ue<R;ue++)s=c[E>>>24]^o[D>>16&255]^u[U>>8&255]^d[j&255]^A[ee],i=c[D>>>24]^o[U>>16&255]^u[j>>8&255]^d[E&255]^A[ee+1],x=c[U>>>24]^o[j>>16&255]^u[E>>8&255]^d[D&255]^A[ee+2],m=c[j>>>24]^o[E>>16&255]^u[D>>8&255]^d[U&255]^A[ee+3],E=s,D=i,U=x,j=m,ee=ee+4;s=b[E>>>24]<<24^b[D>>16&255]<<16^b[U>>8&255]<<8^b[j&255]^A[ee],i=b[D>>>24]<<24^b[U>>16&255]<<16^b[j>>8&255]<<8^b[E&255]^A[ee+1],x=b[U>>>24]<<24^b[j>>16&255]<<16^b[E>>8&255]<<8^b[D&255]^A[ee+2],m=b[j>>>24]<<24^b[E>>16&255]<<16^b[D>>8&255]<<8^b[U&255]^A[ee+3],f[y]=de(s^p),f[y+1]=de(m^h),f[y+2]=de(x^S),f[y+3]=de(i^v),p=K,h=k,S=M,v=G,y=y+4}return f.buffer},B}()},"./src/crypt/decrypter.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return y});var z=L("./src/crypt/aes-crypto.ts"),I=L("./src/crypt/fast-aes-key.ts"),P=L("./src/crypt/aes-decryptor.ts"),B=L("./src/utils/logger.ts"),N=L("./src/utils/mp4-tools.ts"),_=L("./src/utils/typed-array.ts"),O=16,y=function(){function C(A,b,g){var c=g===void 0?{}:g,o=c.removePKCS7Padding,u=o===void 0?!0:o;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=A,this.config=b,this.removePKCS7Padding=u,u)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(T){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var R=C.prototype;return R.destroy=function(){this.observer=null},R.isSync=function(){return this.config.enableSoftwareAES},R.flush=function(){var b=this.currentResult;if(!b){this.reset();return}var g=new Uint8Array(b);return this.reset(),this.removePKCS7Padding?Object(P.removePadding)(g):g},R.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},R.decrypt=function(b,g,c,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(b),g,c);var u=this.flush();u&&o(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(b),g,c).then(o)},R.softwareDecrypt=function(b,g,c){var o=this.currentIV,u=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(b=Object(N.appendUint8Array)(d,b),this.remainderData=null);var T=this.getValidChunk(b);if(!T.length)return null;o&&(c=o);var p=this.softwareDecrypter;p||(p=this.softwareDecrypter=new P.default),p.expandKey(g);var h=u;return this.currentResult=p.decrypt(T.buffer,0,c),this.currentIV=Object(_.sliceUint8)(T,-16).buffer,h||null},R.webCryptoDecrypt=function(b,g,c){var o=this,u=this.subtle;return(this.key!==g||!this.fastAesKey)&&(this.key=g,this.fastAesKey=new I.default(u,g)),this.fastAesKey.expandKey().then(function(d){if(!u)return Promise.reject(new Error("web crypto not initialized"));var T=new z.default(u,c);return T.decrypt(b.buffer,d)}).catch(function(d){return o.onWebCryptoError(d,b,g,c)})},R.onWebCryptoError=function(b,g,c,o){return B.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",b),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(g,c,o)},R.getValidChunk=function(b){var g=b,c=b.length-b.length%O;return c!==b.length&&(g=Object(_.sliceUint8)(b,0,c),this.remainderData=Object(_.sliceUint8)(b,c)),g},R.logOnce=function(b){if(!this.logEnabled)return;B.logger.log("[decrypter.ts]: "+b),this.logEnabled=!1},C}()},"./src/crypt/fast-aes-key.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return z});var z=function(){function I(B,N){this.subtle=void 0,this.key=void 0,this.subtle=B,this.key=N}var P=I.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},I}()},"./src/demux/aacdemuxer.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/demux/base-audio-demuxer.ts"),I=L("./src/demux/adts.ts"),P=L("./src/utils/logger.ts"),B=L("./src/demux/id3.ts");function N(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,_(y,C)}function _(y,C){return _=Object.setPrototypeOf||function(A,b){return A.__proto__=b,A},_(y,C)}var O=function(y){N(C,y);function C(A,b){var g;return g=y.call(this)||this,g.observer=void 0,g.config=void 0,g.observer=A,g.config=b,g}var R=C.prototype;return R.resetInitSegment=function(b,g,c){y.prototype.resetInitSegment.call(this,b,g,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:b,duration:c,inputTimeScale:9e4,dropped:0}},C.probe=function(b){if(!b)return!1;for(var g=B.getID3Data(b,0)||[],c=g.length,o=b.length;c<o;c++)if(I.probe(b,c))return P.logger.log("ADTS sync word found !"),!0;return!1},R.canParse=function(b,g){return I.canParse(b,g)},R.appendFrame=function(b,g,c){I.initTrackConfig(b,this.observer,g,c,b.manifestCodec);var o=I.appendFrame(b,g,c,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},C}(z.default);O.minProbeByteLength=9,H.default=O},"./src/demux/adts.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"getAudioConfig",function(){return B}),L.d(H,"isHeaderPattern",function(){return N}),L.d(H,"getHeaderLength",function(){return _}),L.d(H,"getFullFrameLength",function(){return O}),L.d(H,"canGetFrameLength",function(){return y}),L.d(H,"isHeader",function(){return C}),L.d(H,"canParse",function(){return R}),L.d(H,"probe",function(){return A}),L.d(H,"initTrackConfig",function(){return b}),L.d(H,"getFrameDuration",function(){return g}),L.d(H,"parseFrameHeader",function(){return c}),L.d(H,"appendFrame",function(){return o});var z=L("./src/utils/logger.ts"),I=L("./src/errors.ts"),P=L("./src/events.ts");function B(u,d,T,p){var h,S,v,l,f=navigator.userAgent.toLowerCase(),s=p,i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];h=((d[T+2]&192)>>>6)+1;var x=(d[T+2]&60)>>>2;if(x>i.length-1){u.trigger(P.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+x});return}return v=(d[T+2]&1)<<2,v|=(d[T+3]&192)>>>6,z.logger.log("manifest codec:"+p+", ADTS type:"+h+", samplingIndex:"+x),/firefox/i.test(f)?x>=6?(h=5,l=new Array(4),S=x-3):(h=2,l=new Array(2),S=x):f.indexOf("android")!==-1?(h=2,l=new Array(2),S=x):(h=5,l=new Array(4),p&&(p.indexOf("mp4a.40.29")!==-1||p.indexOf("mp4a.40.5")!==-1)||!p&&x>=6?S=x-3:((p&&p.indexOf("mp4a.40.2")!==-1&&(x>=6&&v===1||/vivaldi/i.test(f))||!p&&v===1)&&(h=2,l=new Array(2)),S=x)),l[0]=h<<3,l[0]|=(x&14)>>1,l[1]|=(x&1)<<7,l[1]|=v<<3,h===5&&(l[1]|=(S&14)>>1,l[2]=(S&1)<<7,l[2]|=2<<2,l[3]=0),{config:l,samplerate:i[x],channelCount:v,codec:"mp4a.40."+h,manifestCodec:s}}function N(u,d){return u[d]===255&&(u[d+1]&246)===240}function _(u,d){return u[d+1]&1?7:9}function O(u,d){return(u[d+3]&3)<<11|u[d+4]<<3|(u[d+5]&224)>>>5}function y(u,d){return d+5<u.length}function C(u,d){return d+1<u.length&&N(u,d)}function R(u,d){return y(u,d)&&N(u,d)&&O(u,d)<=u.length-d}function A(u,d){if(C(u,d)){var T=_(u,d);if(d+T>=u.length)return!1;var p=O(u,d);if(p<=T)return!1;var h=d+p;return h===u.length||C(u,h)}return!1}function b(u,d,T,p,h){if(!u.samplerate){var S=B(d,T,p,h);if(!S)return;u.config=S.config,u.samplerate=S.samplerate,u.channelCount=S.channelCount,u.codec=S.codec,u.manifestCodec=S.manifestCodec,z.logger.log("parsed codec:"+u.codec+", rate:"+S.samplerate+", channels:"+S.channelCount)}}function g(u){return 1024*9e4/u}function c(u,d,T,p,h){var S=_(u,d),v=O(u,d);if(v-=S,v>0){var l=T+p*h;return{headerLength:S,frameLength:v,stamp:l}}}function o(u,d,T,p,h){var S=g(u.samplerate),v=c(d,T,p,h,S);if(v){var l=v.frameLength,f=v.headerLength,s=v.stamp,i=f+l,x=Math.max(0,T+i-d.length),m;x?(m=new Uint8Array(i-f),m.set(d.subarray(T+f,d.length),0)):m=d.subarray(T+f,T+i);var E={unit:m,pts:s};return x||u.samples.push(E),{sample:E,length:i,missing:x}}}},"./src/demux/base-audio-demuxer.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"initPTSFn",function(){return O});var z=L("./src/polyfills/number.ts"),I=L("./src/demux/id3.ts"),P=L("./src/demux/dummy-demuxed-track.ts"),B=L("./src/utils/mp4-tools.ts"),N=L("./src/utils/typed-array.ts"),_=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var C=y.prototype;return C.resetInitSegment=function(A,b,g){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},C.resetTimeStamp=function(){},C.resetContiguity=function(){},C.canParse=function(A,b){return!1},C.appendFrame=function(A,b,g){},C.demux=function(A,b){this.cachedData&&(A=Object(B.appendUint8Array)(this.cachedData,A),this.cachedData=null);var g=I.getID3Data(A,0),c=g?g.length:0,o,u,d=this._audioTrack,T=this._id3Track,p=g?I.getTimeStamp(g):void 0,h=A.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=O(p,b)),g&&g.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:g}),u=this.initPTS;c<h;){if(this.canParse(A,c)){var S=this.appendFrame(d,A,c);S?(this.frameIndex++,u=S.sample.pts,c+=S.length,o=c):c=h}else I.canParse(A,c)?(g=I.getID3Data(A,c),T.samples.push({pts:u,dts:u,data:g}),c+=g.length,o=c):c++;if(c===h&&o!==h){var v=Object(N.sliceUint8)(A,o);this.cachedData?this.cachedData=Object(B.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:d,avcTrack:Object(P.dummyTrack)(),id3Track:T,textTrack:Object(P.dummyTrack)()}},C.demuxSampleAes=function(A,b,g){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},C.flush=function(A){var b=this.cachedData;return b&&(this.cachedData=null,this.demux(b,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},C.destroy=function(){},y}(),O=function(C,R){return Object(z.isFiniteNumber)(C)?C*90:R*9e4};H.default=_},"./src/demux/chunk-cache.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return z});var z=function(){function P(){this.chunks=[],this.dataLength=0}var B=P.prototype;return B.push=function(_){this.chunks.push(_),this.dataLength+=_.length},B.flush=function(){var _=this.chunks,O=this.dataLength,y;if(_.length)_.length===1?y=_[0]:y=I(_,O);else return new Uint8Array(0);return this.reset(),y},B.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function I(P,B){for(var N=new Uint8Array(B),_=0,O=0;O<P.length;O++){var y=P[O];N.set(y,_),_+=y.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"dummyTrack",function(){return z});function z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/utils/logger.ts"),I=function(){function P(N){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=N,this.bytesAvailable=N.byteLength,this.word=0,this.bitsAvailable=0}var B=P.prototype;return B.loadWord=function(){var _=this.data,O=this.bytesAvailable,y=_.byteLength-O,C=new Uint8Array(4),R=Math.min(4,O);if(R===0)throw new Error("no bytes available");C.set(_.subarray(y,y+R)),this.word=new DataView(C.buffer).getUint32(0),this.bitsAvailable=R*8,this.bytesAvailable-=R},B.skipBits=function(_){var O;this.bitsAvailable>_?(this.word<<=_,this.bitsAvailable-=_):(_-=this.bitsAvailable,O=_>>3,_-=O>>3,this.bytesAvailable-=O,this.loadWord(),this.word<<=_,this.bitsAvailable-=_)},B.readBits=function(_){var O=Math.min(this.bitsAvailable,_),y=this.word>>>32-O;return _>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=O,this.bitsAvailable>0?this.word<<=O:this.bytesAvailable>0&&this.loadWord(),O=_-O,O>0&&this.bitsAvailable?y<<O|this.readBits(O):y},B.skipLZ=function(){var _;for(_=0;_<this.bitsAvailable;++_)if((this.word&2147483648>>>_)!==0)return this.word<<=_,this.bitsAvailable-=_,_;return this.loadWord(),_+this.skipLZ()},B.skipUEG=function(){this.skipBits(1+this.skipLZ())},B.skipEG=function(){this.skipBits(1+this.skipLZ())},B.readUEG=function(){var _=this.skipLZ();return this.readBits(_+1)-1},B.readEG=function(){var _=this.readUEG();return 1&_?1+_>>>1:-1*(_>>>1)},B.readBoolean=function(){return this.readBits(1)===1},B.readUByte=function(){return this.readBits(8)},B.readUShort=function(){return this.readBits(16)},B.readUInt=function(){return this.readBits(32)},B.skipScalingList=function(_){for(var O=8,y=8,C,R=0;R<_;R++)y!==0&&(C=this.readEG(),y=(O+C+256)%256),O=y===0?O:y},B.readSPS=function(){var _=0,O=0,y=0,C=0,R,A,b,g=this.readUByte.bind(this),c=this.readBits.bind(this),o=this.readUEG.bind(this),u=this.readBoolean.bind(this),d=this.skipBits.bind(this),T=this.skipEG.bind(this),p=this.skipUEG.bind(this),h=this.skipScalingList.bind(this);g();var S=g();if(c(5),d(3),g(),p(),S===100||S===110||S===122||S===244||S===44||S===83||S===86||S===118||S===128){var v=o();if(v===3&&d(1),p(),p(),d(1),u())for(A=v!==3?8:12,b=0;b<A;b++)u()&&(b<6?h(16):h(64))}p();var l=o();if(l===0)o();else if(l===1)for(d(1),T(),T(),R=o(),b=0;b<R;b++)T();p(),d(1);var f=o(),s=o(),i=c(1);i===0&&d(1),d(1),u()&&(_=o(),O=o(),y=o(),C=o());var x=[1,1];if(u()&&u()){var m=g();switch(m){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:{x=[g()<<8|g(),g()<<8|g()];break}}}return{width:Math.ceil((f+1)*16-_*2-O*2),height:(2-i)*(s+1)*16-(i?2:4)*(y+C),pixelRatio:x}},B.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();H.default=I},"./src/demux/id3.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"isHeader",function(){return z}),L.d(H,"isFooter",function(){return I}),L.d(H,"getID3Data",function(){return P}),L.d(H,"canParse",function(){return N}),L.d(H,"getTimeStamp",function(){return _}),L.d(H,"isTimeStampFrame",function(){return O}),L.d(H,"getID3Frames",function(){return C}),L.d(H,"decodeFrame",function(){return R}),L.d(H,"utf8ArrayToStr",function(){return o}),L.d(H,"testables",function(){return u});var z=function(h,S){return S+10<=h.length&&(h[S]===73&&h[S+1]===68&&h[S+2]===51&&(h[S+3]<255&&h[S+4]<255&&(h[S+6]<128&&h[S+7]<128&&h[S+8]<128&&h[S+9]<128)))},I=function(h,S){return S+10<=h.length&&(h[S]===51&&h[S+1]===68&&h[S+2]===73&&(h[S+3]<255&&h[S+4]<255&&(h[S+6]<128&&h[S+7]<128&&h[S+8]<128&&h[S+9]<128)))},P=function(h,S){for(var v=S,l=0;z(h,S);){l+=10;var f=B(h,S+6);l+=f,I(h,S+10)&&(l+=10),S+=l}return l>0?h.subarray(v,v+l):void 0},B=function(h,S){var v=0;return v=(h[S]&127)<<21,v|=(h[S+1]&127)<<14,v|=(h[S+2]&127)<<7,v|=h[S+3]&127,v},N=function(h,S){return z(h,S)&&B(h,S+6)+10<=h.length-S},_=function(h){for(var S=C(h),v=0;v<S.length;v++){var l=S[v];if(O(l))return c(l)}return},O=function(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"},y=function(h){var S=String.fromCharCode(h[0],h[1],h[2],h[3]),v=B(h,4),l=10;return{type:S,size:v,data:h.subarray(l,l+v)}},C=function(h){for(var S=0,v=[];z(h,S);){var l=B(h,S+6);S+=10;for(var f=S+l;S+8<f;){var s=y(h.subarray(S)),i=R(s);i&&v.push(i),S+=s.size+10}I(h,S)&&(S+=10)}return v},R=function(h){return h.type==="PRIV"?A(h):h.type[0]==="W"?g(h):b(h)},A=function(h){if(h.size<2)return;var S=o(h.data,!0),v=new Uint8Array(h.data.subarray(S.length+1));return{key:h.type,info:S,data:v.buffer}},b=function(h){if(h.size<2)return;if(h.type==="TXXX"){var S=1,v=o(h.data.subarray(S),!0);S+=v.length+1;var l=o(h.data.subarray(S));return{key:h.type,info:v,data:l}}var f=o(h.data.subarray(1));return{key:h.type,data:f}},g=function(h){if(h.type==="WXXX"){if(h.size<2)return;var S=1,v=o(h.data.subarray(S),!0);S+=v.length+1;var l=o(h.data.subarray(S));return{key:h.type,info:v,data:l}}var f=o(h.data);return{key:h.type,data:f}},c=function(h){if(h.data.byteLength===8){var S=new Uint8Array(h.data),v=S[3]&1,l=(S[4]<<23)+(S[5]<<15)+(S[6]<<7)+S[7];return l/=45,v&&(l+=4772185884e-2),Math.round(l)}return},o=function(h,S){S===void 0&&(S=!1);var v=T();if(v){var l=v.decode(h);if(S){var f=l.indexOf("\0");return f!==-1?l.substring(0,f):l}return l.replace(/\0/g,"")}for(var s=h.length,i,x,m,E="",D=0;D<s;){if(i=h[D++],i===0&&S)return E;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:E+=String.fromCharCode(i);break;case 12:case 13:x=h[D++],E+=String.fromCharCode((i&31)<<6|x&63);break;case 14:x=h[D++],m=h[D++],E+=String.fromCharCode((i&15)<<12|(x&63)<<6|(m&63)<<0);break;default:}}return E},u={decodeTextFrame:b},d;function T(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/demux/base-audio-demuxer.ts"),I=L("./src/demux/id3.ts"),P=L("./src/utils/logger.ts"),B=L("./src/demux/mpegaudio.ts");function N(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,_(y,C)}function _(y,C){return _=Object.setPrototypeOf||function(A,b){return A.__proto__=b,A},_(y,C)}var O=function(y){N(C,y);function C(){return y.apply(this,arguments)||this}var R=C.prototype;return R.resetInitSegment=function(b,g,c){y.prototype.resetInitSegment.call(this,b,g,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:b,duration:c,inputTimeScale:9e4,dropped:0}},C.probe=function(b){if(!b)return!1;for(var g=I.getID3Data(b,0)||[],c=g.length,o=b.length;c<o;c++)if(B.probe(b,c))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},R.canParse=function(b,g){return B.canParse(b,g)},R.appendFrame=function(b,g,c){return this.initPTS===null?void 0:B.appendFrame(b,g,c,this.initPTS,this.frameIndex)},C}(z.default);O.minProbeByteLength=4,H.default=O},"./src/demux/mp4demuxer.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/utils/mp4-tools.ts"),I=L("./src/demux/dummy-demuxed-track.ts"),P=function(){function B(_,O){this.remainderData=null,this.config=void 0,this.config=O}var N=B.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},B.probe=function(O){return Object(z.findBox)({data:O,start:0,end:Math.min(O.length,16384)},["moof"]).length>0},N.demux=function(O){var y=O,C=Object(I.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(z.appendUint8Array)(this.remainderData,O));var R=Object(z.segmentValidRange)(y);this.remainderData=R.remainder,C.samples=R.valid||new Uint8Array}else C.samples=y;return{audioTrack:Object(I.dummyTrack)(),avcTrack:C,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},N.flush=function(){var O=Object(I.dummyTrack)();return O.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(I.dummyTrack)(),avcTrack:O,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},N.demuxSampleAes=function(O,y,C){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},B}();P.minProbeByteLength=1024,H.default=P},"./src/demux/mpegaudio.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"appendFrame",function(){return _}),L.d(H,"parseHeader",function(){return O}),L.d(H,"isHeaderPattern",function(){return y}),L.d(H,"isHeader",function(){return C}),L.d(H,"canParse",function(){return R}),L.d(H,"probe",function(){return A});var z=null,I=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],B=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function _(b,g,c,o,u){if(c+24>g.length)return;var d=O(g,c);if(d&&c+d.frameLength<=g.length){var T=d.samplesPerFrame*9e4/d.sampleRate,p=o+u*T,h={unit:g.subarray(c,c+d.frameLength),pts:p,dts:p};return b.config=[],b.channelCount=d.channelCount,b.samplerate=d.sampleRate,b.samples.push(h),{sample:h,length:d.frameLength,missing:0}}}function O(b,g){var c=b[g+1]>>3&3,o=b[g+1]>>1&3,u=b[g+2]>>4&15,d=b[g+2]>>2&3;if(c!==1&&u!==0&&u!==15&&d!==3){var T=b[g+2]>>1&1,p=b[g+3]>>6,h=c===3?3-o:o===3?3:4,S=I[h*14+u-1]*1e3,v=c===3?0:c===2?1:2,l=P[v*3+d],f=p===3?1:2,s=B[c][o],i=N[o],x=s*8*i,m=Math.floor(s*S/l+T)*i;if(z===null){var E=navigator.userAgent||"",D=E.match(/Chrome\/(\d+)/i);z=D?parseInt(D[1]):0}var U=!!z&&z<=87;return U&&o===2&&S>=224e3&&p===0&&(b[g+3]=b[g+3]|128),{sampleRate:l,channelCount:f,frameLength:m,samplesPerFrame:x}}}function y(b,g){return b[g]===255&&(b[g+1]&224)===224&&(b[g+1]&6)!==0}function C(b,g){return g+1<b.length&&y(b,g)}function R(b,g){var c=4;return y(b,g)&&c<=b.length-g}function A(b,g){if(g+1<b.length&&y(b,g)){var c=4,o=O(b,g),u=c;o!=null&&o.frameLength&&(u=o.frameLength);var d=g+u;return d===b.length||C(b,d)}return!1}},"./src/demux/sample-aes.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/crypt/decrypter.ts"),I=L("./src/demux/tsdemuxer.ts"),P=function(){function B(_,O,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new z.default(_,O,{removePKCS7Padding:!1})}var N=B.prototype;return N.decryptBuffer=function(O,y){this.decrypter.decrypt(O,this.keyData.key.buffer,this.keyData.iv.buffer,y)},N.decryptAacSample=function(O,y,C,R){var A=O[y].unit,b=A.subarray(16,A.length-A.length%16),g=b.buffer.slice(b.byteOffset,b.byteOffset+b.length),c=this;this.decryptBuffer(g,function(o){var u=new Uint8Array(o);A.set(u,16),R||c.decryptAacSamples(O,y+1,C)})},N.decryptAacSamples=function(O,y,C){for(;;y++){if(y>=O.length){C();return}if(O[y].unit.length<32)continue;var R=this.decrypter.isSync();if(this.decryptAacSample(O,y,C,R),!R)return}},N.getAvcEncryptedData=function(O){for(var y=Math.floor((O.length-48)/160)*16+16,C=new Int8Array(y),R=0,A=32;A<=O.length-16;A+=160,R+=16)C.set(O.subarray(A,A+16),R);return C},N.getAvcDecryptedUnit=function(O,y){for(var C=new Uint8Array(y),R=0,A=32;A<=O.length-16;A+=160,R+=16)O.set(C.subarray(R,R+16),A);return O},N.decryptAvcSample=function(O,y,C,R,A,b){var g=Object(I.discardEPB)(A.data),c=this.getAvcEncryptedData(g),o=this;this.decryptBuffer(c.buffer,function(u){A.data=o.getAvcDecryptedUnit(g,u),b||o.decryptAvcSamples(O,y,C+1,R)})},N.decryptAvcSamples=function(O,y,C,R){if(O instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,C=0){if(y>=O.length){R();return}for(var A=O[y].units;!(C>=A.length);C++){var b=A[C];if(b.data.length<=48||b.type!==1&&b.type!==5)continue;var g=this.decrypter.isSync();if(this.decryptAvcSample(O,y,C,R,b,g),!g)return}}},B}();H.default=P},"./src/demux/transmuxer-interface.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return A});var z=L("./node_modules/webworkify-webpack/index.js"),I=L.n(z),P=L("./src/events.ts"),B=L("./src/demux/transmuxer.ts"),N=L("./src/utils/logger.ts"),_=L("./src/errors.ts"),O=L("./src/utils/mediasource-helper.ts"),y=L("./node_modules/eventemitter3/index.js"),C=L.n(y),R=Object(O.getMediaSource)()||{isTypeSupported:function(){return!1}},A=function(){function b(c,o,u,d){var T=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=c,this.id=o,this.onTransmuxComplete=u,this.onFlush=d;var p=c.config,h=function(s,i){i=i||{},i.frag=T.frag,i.id=T.id,c.trigger(s,i)};this.observer=new y.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,h),this.observer.on(P.Events.ERROR,h);var S={mp4:R.isTypeSupported("video/mp4"),mpeg:R.isTypeSupported("audio/mpeg"),mp3:R.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(p.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var l;try{l=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(f){c.trigger(P.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(f.message+" ("+f.filename+":"+f.lineno+")")})},l.postMessage({cmd:"init",typeSupported:S,vendor:v,id:o,config:JSON.stringify(p)})}catch(f){N.logger.warn("Error in worker:",f),N.logger.error("Error while initializing DemuxerWorker, fallback to inline"),l&&self.URL.revokeObjectURL(l.objectURL),this.transmuxer=new B.default(this.observer,S,p,v,o),this.worker=null}}else this.transmuxer=new B.default(this.observer,S,p,v,o)}var g=b.prototype;return g.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},g.push=function(o,u,d,T,p,h,S,v,l,f){var s=this;l.transmuxing.start=self.performance.now();var i=this.transmuxer,x=this.worker,m=h?h.start:p.start,E=p.decryptdata,D=this.frag,U=!(D&&p.cc===D.cc),j=!(D&&l.level===D.level),K=D?l.sn-D.sn:-1,k=this.part?l.part-this.part.index:1,M=!j&&(K===1||K===0&&k===1),G=self.performance.now();(j||K||p.stats.parsing.start===0)&&(p.stats.parsing.start=G),h&&(k||!M)&&(h.stats.parsing.start=G);var ee=new B.TransmuxState(U,M,v,j,m);if(!M||U){N.logger.log("[transmuxer-interface, "+p.type+"]: Starting new transmux session for sn: "+l.sn+" p: "+l.part+" level: "+l.level+" id: "+l.id+`
|
|
discontinuity: `+U+`
|
|
trackSwitch: `+j+`
|
|
contiguous: `+M+`
|
|
accurateTimeOffset: `+v+`
|
|
timeOffset: `+m);var ue=new B.TransmuxConfig(d,T,u,S,f);this.configureTransmuxer(ue)}if(this.frag=p,this.part=h,x)x.postMessage({cmd:"demux",data:o,decryptdata:E,chunkMeta:l,state:ee},o instanceof ArrayBuffer?[o]:[]);else if(i){var de=i.push(o,E,l,ee);Object(B.isPromise)(de)?de.then(function(be){s.handleTransmuxComplete(be)}):this.handleTransmuxComplete(de)}},g.flush=function(o){var u=this;o.transmuxing.start=self.performance.now();var d=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:o});else if(d){var p=d.flush(o);Object(B.isPromise)(p)?p.then(function(h){u.handleFlushResult(h,o)}):this.handleFlushResult(p,o)}},g.handleFlushResult=function(o,u){var d=this;o.forEach(function(T){d.handleTransmuxComplete(T)}),this.onFlush(u)},g.onWorkerMessage=function(o){var u=o.data,d=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,d.trigger(u.event,u.data);break}}},g.configureTransmuxer=function(o){var u=this.worker,d=this.transmuxer;u?u.postMessage({cmd:"configure",config:o}):d&&d.configure(o)},g.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},b}()},"./src/demux/transmuxer-worker.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return _});var z=L("./src/demux/transmuxer.ts"),I=L("./src/events.ts"),P=L("./src/utils/logger.ts"),B=L("./node_modules/eventemitter3/index.js"),N=L.n(B);function _(A){var b=new B.EventEmitter,g=function(o,u){A.postMessage({event:o,data:u})};b.on(I.Events.FRAG_DECRYPTED,g),b.on(I.Events.ERROR,g),A.addEventListener("message",function(c){var o=c.data;switch(o.cmd){case"init":{var u=JSON.parse(o.config);A.transmuxer=new z.default(b,o.typeSupported,u,o.vendor,o.id),Object(P.enableLogs)(u.debug),g("init",null);break}case"configure":{A.transmuxer.configure(o.config);break}case"demux":{var d=A.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(z.isPromise)(d)?d.then(function(h){O(A,h)}):O(A,d);break}case"flush":{var T=o.chunkMeta,p=A.transmuxer.flush(T);Object(z.isPromise)(p)?p.then(function(h){C(A,h,T)}):C(A,p,T);break}default:break}})}function O(A,b){if(R(b.remuxResult))return;var g=[],c=b.remuxResult,o=c.audio,u=c.video;o&&y(g,o),u&&y(g,u),A.postMessage({event:"transmuxComplete",data:b},g)}function y(A,b){b.data1&&A.push(b.data1.buffer),b.data2&&A.push(b.data2.buffer)}function C(A,b,g){b.forEach(function(c){O(A,c)}),A.postMessage({event:"flush",data:g})}function R(A){return!A.audio&&!A.video&&!A.text&&!A.id3&&!A.initSegment}},"./src/demux/transmuxer.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return u}),L.d(H,"isPromise",function(){return p}),L.d(H,"TransmuxConfig",function(){return h}),L.d(H,"TransmuxState",function(){return S});var z=L("./src/events.ts"),I=L("./src/errors.ts"),P=L("./src/crypt/decrypter.ts"),B=L("./src/demux/aacdemuxer.ts"),N=L("./src/demux/mp4demuxer.ts"),_=L("./src/demux/tsdemuxer.ts"),O=L("./src/demux/mp3demuxer.ts"),y=L("./src/remux/mp4-remuxer.ts"),C=L("./src/remux/passthrough-remuxer.ts"),R=L("./src/demux/chunk-cache.ts"),A=L("./src/utils/mp4-tools.ts"),b=L("./src/utils/logger.ts"),g;try{g=self.performance.now.bind(self.performance)}catch(v){b.logger.debug("Unable to use Performance API on this environment"),g=self.Date.now}var c=[{demux:_.default,remux:y.default},{demux:N.default,remux:C.default},{demux:B.default,remux:y.default},{demux:O.default,remux:y.default}],o=1024;c.forEach(function(v){var l=v.demux;o=Math.max(o,l.minProbeByteLength)});var u=function(){function v(f,s,i,x,m){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 R.default,this.observer=f,this.typeSupported=s,this.config=i,this.vendor=x,this.id=m}var l=v.prototype;return l.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},l.push=function(s,i,x,m){var E=this,D=x.transmuxing;D.executeStart=g();var U=new Uint8Array(s),j=this.cache,K=this.config,k=this.currentTransmuxState,M=this.transmuxConfig;m&&(this.currentTransmuxState=m);var G=d(U,i);if(G&&G.method==="AES-128"){var ee=this.getDecrypter();if(K.enableSoftwareAES){var ue=ee.softwareDecrypt(U,G.key.buffer,G.iv.buffer);if(!ue)return D.executeEnd=g(),T(x);U=new Uint8Array(ue)}else return this.decryptionPromise=ee.webCryptoDecrypt(U,G.key.buffer,G.iv.buffer).then(function(Te){var De=E.push(Te,null,x);return E.decryptionPromise=null,De}),this.decryptionPromise}var de=m||k,be=de.contiguous,Ee=de.discontinuity,ae=de.trackSwitch,$=de.accurateTimeOffset,re=de.timeOffset,J=M.audioCodec,ie=M.videoCodec,V=M.defaultInitPts,Y=M.duration,Z=M.initSegmentData;if((Ee||ae)&&this.resetInitSegment(Z,J,ie,Y),Ee&&this.resetInitialTimestamp(V),be||this.resetContiguity(),this.needsProbing(U,Ee,ae)){if(j.dataLength){var le=j.flush();U=Object(A.appendUint8Array)(le,U)}this.configureTransmuxer(U,M)}var xe=this.transmux(U,G,re,$,x),he=this.currentTransmuxState;return he.contiguous=!0,he.discontinuity=!1,he.trackSwitch=!1,D.executeEnd=g(),xe},l.flush=function(s){var i=this,x=s.transmuxing;x.executeStart=g();var m=this.decrypter,E=this.cache,D=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return i.flush(s)});var j=[],K=D.timeOffset;if(m){var k=m.flush();k&&j.push(this.push(k,null,s))}var M=E.dataLength;E.reset();var G=this.demuxer,ee=this.remuxer;if(!G||!ee)return M>=o&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),x.executeEnd=g(),[T(s)];var ue=G.flush(K);return p(ue)?ue.then(function(de){return i.flushRemux(j,de,s),j}):(this.flushRemux(j,ue,s),j)},l.flushRemux=function(s,i,x){var m=i.audioTrack,E=i.avcTrack,D=i.id3Track,U=i.textTrack,j=this.currentTransmuxState,K=j.accurateTimeOffset,k=j.timeOffset;b.logger.log("[transmuxer.ts]: Flushed fragment "+x.sn+(x.part>-1?" p: "+x.part:"")+" of level "+x.level);var M=this.remuxer.remux(m,E,D,U,k,K,!0,this.id);s.push({remuxResult:M,chunkMeta:x}),x.transmuxing.executeEnd=g()},l.resetInitialTimestamp=function(s){var i=this.demuxer,x=this.remuxer;if(!i||!x)return;i.resetTimeStamp(s),x.resetTimeStamp(s)},l.resetContiguity=function(){var s=this.demuxer,i=this.remuxer;if(!s||!i)return;s.resetContiguity(),i.resetNextTimestamp()},l.resetInitSegment=function(s,i,x,m){var E=this.demuxer,D=this.remuxer;if(!E||!D)return;E.resetInitSegment(i,x,m),D.resetInitSegment(s,i,x)},l.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},l.transmux=function(s,i,x,m,E){var D;return i&&i.method==="SAMPLE-AES"?D=this.transmuxSampleAes(s,i,x,m,E):D=this.transmuxUnencrypted(s,x,m,E),D},l.transmuxUnencrypted=function(s,i,x,m){var E=this.demuxer.demux(s,i,!1,!this.config.progressive),D=E.audioTrack,U=E.avcTrack,j=E.id3Track,K=E.textTrack,k=this.remuxer.remux(D,U,j,K,i,x,!1,this.id);return{remuxResult:k,chunkMeta:m}},l.transmuxSampleAes=function(s,i,x,m,E){var D=this;return this.demuxer.demuxSampleAes(s,i,x).then(function(U){var j=D.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,x,m,!1,D.id);return{remuxResult:j,chunkMeta:E}})},l.configureTransmuxer=function(s,i){for(var x=this.config,m=this.observer,E=this.typeSupported,D=this.vendor,U=i.audioCodec,j=i.defaultInitPts,K=i.duration,k=i.initSegmentData,M=i.videoCodec,G,ee=0,ue=c.length;ee<ue;ee++)if(c[ee].demux.probe(s)){G=c[ee];break}G||(b.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:N.default,remux:C.default});var de=this.demuxer,be=this.remuxer,Ee=G.remux,ae=G.demux;(!be||!(be instanceof Ee))&&(this.remuxer=new Ee(m,x,E,D)),(!de||!(de instanceof ae))&&(this.demuxer=new ae(m,x,E),this.probe=ae.probe),this.resetInitSegment(k,U,M,K),this.resetInitialTimestamp(j)},l.needsProbing=function(s,i,x){return!this.demuxer||!this.remuxer||i||x},l.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new P.default(this.observer,this.config)),s},v}();function d(v,l){var f=null;return v.byteLength>0&&l!=null&&l.key!=null&&l.iv!==null&&l.method!=null&&(f=l),f}var T=function(l){return{remuxResult:{},chunkMeta:l}};function p(v){return"then"in v&&v.then instanceof Function}var h=function(l,f,s,i,x){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=l,this.videoCodec=f,this.initSegmentData=s,this.duration=i,this.defaultInitPts=x},S=function(l,f,s,i,x){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=l,this.contiguous=f,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=x}},"./src/demux/tsdemuxer.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"discardEPB",function(){return T});var z=L("./src/demux/adts.ts"),I=L("./src/demux/mpegaudio.ts"),P=L("./src/demux/exp-golomb.ts"),B=L("./src/demux/id3.ts"),N=L("./src/demux/sample-aes.ts"),_=L("./src/events.ts"),O=L("./src/utils/mp4-tools.ts"),y=L("./src/utils/logger.ts"),C=L("./src/errors.ts"),R={video:1,audio:2,id3:3,text:4},A=function(){function p(S,v,l){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=S,this.config=v,this.typeSupported=l}p.probe=function(v){var l=p.syncOffset(v);return l<0?!1:(l&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+l+", junk ahead ?"),!0)},p.syncOffset=function(v){for(var l=Math.min(1e3,v.length-3*188),f=0;f<l;){if(v[f]===71&&v[f+188]===71&&v[f+2*188]===71)return f;f++}return-1},p.createTrack=function(v,l){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:R[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?l:void 0}};var h=p.prototype;return h.resetInitSegment=function(v,l,f){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=p.createTrack("video",f),this._audioTrack=p.createTrack("audio",f),this._id3Track=p.createTrack("id3",f),this._txtTrack=p.createTrack("text",f),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=l,this._duration=f},h.resetTimeStamp=function(){},h.resetContiguity=function(){var v=this._audioTrack,l=this._avcTrack,f=this._id3Track;v&&(v.pesData=null),l&&(l.pesData=null),f&&(f.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},h.demux=function(v,l,f,s){f===void 0&&(f=!1),s===void 0&&(s=!1),f||(this.sampleAes=null);var i,x=this._avcTrack,m=this._audioTrack,E=this._id3Track,D=x.pid,U=x.pesData,j=m.pid,K=E.pid,k=m.pesData,M=E.pesData,G=!1,ee=this.pmtParsed,ue=this._pmtId,de=v.length;if(this.remainderData&&(v=Object(O.appendUint8Array)(this.remainderData,v),de=v.length,this.remainderData=null),de<188&&!s)return this.remainderData=v,{audioTrack:m,avcTrack:x,id3Track:E,textTrack:this._txtTrack};var be=Math.max(0,p.syncOffset(v));de-=(de+be)%188,de<v.byteLength&&!s&&(this.remainderData=new Uint8Array(v.buffer,de,v.buffer.byteLength-de));for(var Ee=be;Ee<de;Ee+=188)if(v[Ee]===71){var ae=!!(v[Ee+1]&64),$=((v[Ee+1]&31)<<8)+v[Ee+2],re=(v[Ee+3]&48)>>4,J=void 0;if(re>1){if(J=Ee+5+v[Ee+4],J===Ee+188)continue}else J=Ee+4;switch($){case D:ae&&(U&&(i=o(U))&&this.parseAVCPES(i,!1),U={data:[],size:0}),U&&(U.data.push(v.subarray(J,Ee+188)),U.size+=Ee+188-J);break;case j:ae&&(k&&(i=o(k))&&(m.isAAC?this.parseAACPES(i):this.parseMPEGPES(i)),k={data:[],size:0}),k&&(k.data.push(v.subarray(J,Ee+188)),k.size+=Ee+188-J);break;case K:ae&&(M&&(i=o(M))&&this.parseID3PES(i),M={data:[],size:0}),M&&(M.data.push(v.subarray(J,Ee+188)),M.size+=Ee+188-J);break;case 0:ae&&(J+=v[J]+1),ue=this._pmtId=g(v,J);break;case ue:{ae&&(J+=v[J]+1);var ie=c(v,J,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,f);D=ie.avc,D>0&&(x.pid=D),j=ie.audio,j>0&&(m.pid=j,m.isAAC=ie.isAAC),K=ie.id3,K>0&&(E.pid=K),G&&!ee&&(y.logger.log("reparse from beginning"),G=!1,Ee=be-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(_.Events.ERROR,_.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});x.pesData=U,m.pesData=k,E.pesData=M;var V={audioTrack:m,avcTrack:x,id3Track:E,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(V),V},h.flush=function(){var v=this.remainderData;this.remainderData=null;var l;return v?l=this.demux(v,-1,!1,!0):l={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(l),this.sampleAes?this.decrypt(l,this.sampleAes):l},h.extractRemainingSamples=function(v){var l=v.audioTrack,f=v.avcTrack,s=v.id3Track,i=f.pesData,x=l.pesData,m=s.pesData,E;i&&(E=o(i))?(this.parseAVCPES(E,!0),f.pesData=null):f.pesData=i,x&&(E=o(x))?(l.isAAC?this.parseAACPES(E):this.parseMPEGPES(E),l.pesData=null):(x!=null&&x.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),l.pesData=x),m&&(E=o(m))?(this.parseID3PES(E),s.pesData=null):s.pesData=m},h.demuxSampleAes=function(v,l,f){var s=this.demux(v,f,!0,!this.config.progressive),i=this.sampleAes=new N.default(this.observer,this.config,l);return this.decrypt(s,i)},h.decrypt=function(v,l){return new Promise(function(f){var s=v.audioTrack,i=v.avcTrack;s.samples&&s.isAAC?l.decryptAacSamples(s.samples,0,function(){i.samples?l.decryptAvcSamples(i.samples,0,0,function(){f(v)}):f(v)}):i.samples&&l.decryptAvcSamples(i.samples,0,0,function(){f(v)})})},h.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},h.parseAVCPES=function(v,l){var f=this,s=this._avcTrack,i=this.parseAVCNALu(v.data),x=!1,m=this.avcSample,E,D=!1;v.data=null,m&&i.length&&!s.audFound&&(u(m,s),m=this.avcSample=b(!1,v.pts,v.dts,"")),i.forEach(function(U){switch(U.type){case 1:{E=!0,m||(m=f.avcSample=b(!0,v.pts,v.dts,"")),x&&(m.debug+="NDR "),m.frame=!0;var j=U.data;if(D&&j.length>4){var K=new P.default(j).readSliceType();(K===2||K===4||K===7||K===9)&&(m.key=!0)}break}case 5:E=!0,m||(m=f.avcSample=b(!0,v.pts,v.dts,"")),x&&(m.debug+="IDR "),m.key=!0,m.frame=!0;break;case 6:{E=!0,x&&m&&(m.debug+="SEI ");var k=new P.default(T(U.data));k.readUByte();for(var M=0,G=0,ee=!1,ue=0;!ee&&k.bytesAvailable>1;){M=0;do ue=k.readUByte(),M+=ue;while(ue===255);G=0;do ue=k.readUByte(),G+=ue;while(ue===255);if(M===4&&k.bytesAvailable!==0){ee=!0;var de=k.readUByte();if(de===181){var be=k.readUShort();if(be===49){var Ee=k.readUInt();if(Ee===1195456820){var ae=k.readUByte();if(ae===3){for(var $=k.readUByte(),re=k.readUByte(),J=31&$,ie=[$,re],V=0;V<J;V++)ie.push(k.readUByte()),ie.push(k.readUByte()),ie.push(k.readUByte());d(f._txtTrack.samples,{type:3,pts:v.pts,bytes:ie})}}}}}else if(M===5&&k.bytesAvailable!==0){if(ee=!0,G>16){for(var Y=[],Z=0;Z<16;Z++)Y.push(k.readUByte().toString(16)),(Z===3||Z===5||Z===7||Z===9)&&Y.push("-");for(var le=G-16,xe=new Uint8Array(le),he=0;he<le;he++)xe[he]=k.readUByte();d(f._txtTrack.samples,{pts:v.pts,payloadType:M,uuid:Y.join(""),userData:Object(B.utf8ArrayToStr)(xe),userDataBytes:xe})}}else if(G<k.bytesAvailable)for(var Te=0;Te<G;Te++)k.readUByte()}break}case 7:if(E=!0,D=!0,x&&m&&(m.debug+="SPS "),!s.sps){var De=new P.default(U.data),Pe=De.readSPS();s.width=Pe.width,s.height=Pe.height,s.pixelRatio=Pe.pixelRatio,s.sps=[U.data],s.duration=f._duration;for(var Be=U.data.subarray(1,4),Me="avc1.",ke=0;ke<3;ke++){var Ve=Be[ke].toString(16);Ve.length<2&&(Ve="0"+Ve),Me+=Ve}s.codec=Me}break;case 8:E=!0,x&&m&&(m.debug+="PPS "),s.pps||(s.pps=[U.data]);break;case 9:E=!1,s.audFound=!0,m&&u(m,s),m=f.avcSample=b(!1,v.pts,v.dts,x?"AUD ":"");break;case 12:E=!1;break;default:E=!1,m&&(m.debug+="unknown NAL "+U.type+" ");break}if(m&&E){var Se=m.units;Se.push(U)}}),l&&m&&(u(m,s),this.avcSample=null)},h.getLastNalUnit=function(){var v,l=this.avcSample,f;if(!l||l.units.length===0){var s=this._avcTrack.samples;l=s[s.length-1]}if((v=l)!==null&&v!==void 0&&v.units){var i=l.units;f=i[i.length-1]}return f},h.parseAVCNALu=function(v){var l=v.byteLength,f=this._avcTrack,s=f.naluState||0,i=s,x=[],m=0,E,D,U,j=-1,K=0;for(s===-1&&(j=0,K=v[0]&31,s=0,m=1);m<l;){if(E=v[m++],!s){s=E?0:1;continue}if(s===1){s=E?0:2;continue}if(!E)s=3;else if(E===1){if(j>=0){var k={data:v.subarray(j,m-s-1),type:K};x.push(k)}else{var M=this.getLastNalUnit();if(M&&(i&&m<=4-i&&(M.state&&(M.data=M.data.subarray(0,M.data.byteLength-i))),D=m-s-1,D>0)){var G=new Uint8Array(M.data.byteLength+D);G.set(M.data,0),G.set(v.subarray(0,D),M.data.byteLength),M.data=G,M.state=0}}m<l?(U=v[m]&31,j=m,K=U,s=0):s=-1}else s=0}if(j>=0&&s>=0){var ee={data:v.subarray(j,l),type:K,state:s};x.push(ee)}if(x.length===0){var ue=this.getLastNalUnit();if(ue){var de=new Uint8Array(ue.data.byteLength+v.byteLength);de.set(ue.data,0),de.set(v,ue.data.byteLength),ue.data=de}}return f.naluState=s,x},h.parseAACPES=function(v){var l=0,f=this._audioTrack,s=this.aacOverFlow,i=v.data;if(s){this.aacOverFlow=null;var x=s.sample.unit.byteLength,m=Math.min(s.missing,x),E=x-m;s.sample.unit.set(i.subarray(0,m),E),f.samples.push(s.sample),l=s.missing}var D,U;for(D=l,U=i.length;D<U-1&&!z.isHeader(i,D);D++);if(D!==l){var j,K;if(D<U-1?(j="AAC PES did not start with ADTS header,offset:"+D,K=!1):(j="no ADTS header found in AAC PES",K=!0),y.logger.warn("parsing error:"+j),this.observer.emit(_.Events.ERROR,_.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:K,reason:j}),K)return}z.initTrackConfig(f,this.observer,i,D,this.audioCodec);var k;if(v.pts!==void 0)k=v.pts;else if(s){var M=z.getFrameDuration(f.samplerate);k=s.sample.pts+M}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;D<U;)if(z.isHeader(i,D)){if(D+5<U){var ee=z.appendFrame(f,i,D,k,G);if(ee)if(ee.missing)this.aacOverFlow=ee;else{D+=ee.length,G++;continue}}break}else D++},h.parseMPEGPES=function(v){var l=v.data,f=l.length,s=0,i=0,x=v.pts;if(x===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;i<f;)if(I.isHeader(l,i)){var m=I.appendFrame(this._audioTrack,l,i,x,s);if(m)i+=m.length,s++;else break}else i++},h.parseID3PES=function(v){if(v.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},p}();A.minProbeByteLength=188;function b(p,h,S,v){return{key:p,frame:!1,pts:h,dts:S,units:[],debug:v,length:0}}function g(p,h){return(p[h+10]&31)<<8|p[h+11]}function c(p,h,S,v){var l={audio:-1,avc:-1,id3:-1,isAAC:!0},f=(p[h+1]&15)<<8|p[h+2],s=h+3+f-4,i=(p[h+10]&15)<<8|p[h+11];for(h+=12+i;h<s;){var x=(p[h+1]&31)<<8|p[h+2];switch(p[h]){case 207:if(!v){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:l.audio===-1&&(l.audio=x);break;case 21:l.id3===-1&&(l.id3=x);break;case 219:if(!v){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:l.avc===-1&&(l.avc=x);break;case 3:case 4:S?l.audio===-1&&(l.audio=x,l.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}h+=((p[h+3]&15)<<8|p[h+4])+5}return l}function o(p){var h=0,S,v,l,f,s,i=p.data;if(!p||p.size===0)return null;for(;i[0].length<19&&i.length>1;){var x=new Uint8Array(i[0].length+i[1].length);x.set(i[0]),x.set(i[1],i[0].length),i[0]=x,i.splice(1,1)}S=i[0];var m=(S[0]<<16)+(S[1]<<8)+S[2];if(m===1){if(v=(S[4]<<8)+S[5],v&&v>p.size-6)return null;var E=S[7];E&192&&(f=(S[9]&14)*536870912+(S[10]&255)*4194304+(S[11]&254)*16384+(S[12]&255)*128+(S[13]&254)/2,E&64?(s=(S[14]&14)*536870912+(S[15]&255)*4194304+(S[16]&254)*16384+(S[17]&255)*128+(S[18]&254)/2,f-s>60*9e4&&(y.logger.warn(Math.round((f-s)/9e4)+"s delta between PTS and DTS, align them"),f=s)):s=f),l=S[8];var D=l+9;if(p.size<=D)return null;p.size-=D;for(var U=new Uint8Array(p.size),j=0,K=i.length;j<K;j++){S=i[j];var k=S.byteLength;if(D)if(D>k){D-=k;continue}else S=S.subarray(D),k-=D,D=0;U.set(S,h),h+=k}return v&&(v-=l+3),{data:U,pts:f,dts:s,len:v}}return null}function u(p,h){if(p.units.length&&p.frame){if(p.pts===void 0){var S=h.samples,v=S.length;if(v){var l=S[v-1];p.pts=l.pts,p.dts=l.dts}else{h.dropped++;return}}h.samples.push(p)}p.debug.length&&y.logger.log(p.pts+"/"+p.dts+":"+p.debug)}function d(p,h){var S=p.length;if(S>0){if(h.pts>=p[S-1].pts)p.push(h);else for(var v=S-1;v>=0;v--)if(h.pts<p[v].pts){p.splice(v,0,h);break}}else p.push(h)}function T(p){for(var h=p.byteLength,S=[],v=1;v<h-2;)p[v]===0&&p[v+1]===0&&p[v+2]===3?(S.push(v+2),v+=2):v++;if(S.length===0)return p;var l=h-S.length,f=new Uint8Array(l),s=0;for(v=0;v<l;s++,v++)s===S[0]&&(s++,S.shift()),f[v]=p[s];return f}H.default=A},"./src/errors.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"ErrorTypes",function(){return z}),L.d(H,"ErrorDetails",function(){return I});var z;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})(z||(z={}));var I;(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"})(I||(I={}))},"./src/events.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"Events",function(){return z});var z;(function(I){I.MEDIA_ATTACHING="hlsMediaAttaching",I.MEDIA_ATTACHED="hlsMediaAttached",I.MEDIA_DETACHING="hlsMediaDetaching",I.MEDIA_DETACHED="hlsMediaDetached",I.BUFFER_RESET="hlsBufferReset",I.BUFFER_CODECS="hlsBufferCodecs",I.BUFFER_CREATED="hlsBufferCreated",I.BUFFER_APPENDING="hlsBufferAppending",I.BUFFER_APPENDED="hlsBufferAppended",I.BUFFER_EOS="hlsBufferEos",I.BUFFER_FLUSHING="hlsBufferFlushing",I.BUFFER_FLUSHED="hlsBufferFlushed",I.MANIFEST_LOADING="hlsManifestLoading",I.MANIFEST_LOADED="hlsManifestLoaded",I.MANIFEST_PARSED="hlsManifestParsed",I.LEVEL_SWITCHING="hlsLevelSwitching",I.LEVEL_SWITCHED="hlsLevelSwitched",I.LEVEL_LOADING="hlsLevelLoading",I.LEVEL_LOADED="hlsLevelLoaded",I.LEVEL_UPDATED="hlsLevelUpdated",I.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",I.LEVELS_UPDATED="hlsLevelsUpdated",I.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",I.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",I.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",I.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",I.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",I.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",I.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",I.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",I.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",I.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",I.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",I.CUES_PARSED="hlsCuesParsed",I.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",I.INIT_PTS_FOUND="hlsInitPtsFound",I.FRAG_LOADING="hlsFragLoading",I.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",I.FRAG_LOADED="hlsFragLoaded",I.FRAG_DECRYPTED="hlsFragDecrypted",I.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",I.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",I.FRAG_PARSING_METADATA="hlsFragParsingMetadata",I.FRAG_PARSED="hlsFragParsed",I.FRAG_BUFFERED="hlsFragBuffered",I.FRAG_CHANGED="hlsFragChanged",I.FPS_DROP="hlsFpsDrop",I.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",I.ERROR="hlsError",I.DESTROYING="hlsDestroying",I.KEY_LOADING="hlsKeyLoading",I.KEY_LOADED="hlsKeyLoaded",I.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",I.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return p});var z=L("./node_modules/url-toolkit/src/url-toolkit.js"),I=L.n(z),P=L("./src/loader/playlist-loader.ts"),B=L("./src/loader/key-loader.ts"),N=L("./src/controller/id3-track-controller.ts"),_=L("./src/controller/latency-controller.ts"),O=L("./src/controller/level-controller.ts"),y=L("./src/controller/fragment-tracker.ts"),C=L("./src/controller/stream-controller.ts"),R=L("./src/is-supported.ts"),A=L("./src/utils/logger.ts"),b=L("./src/config.ts"),g=L("./node_modules/eventemitter3/index.js"),c=L.n(g),o=L("./src/events.ts"),u=L("./src/errors.ts");function d(h,S){for(var v=0;v<S.length;v++){var l=S[v];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function T(h,S,v){return S&&d(h.prototype,S),v&&d(h,v),h}var p=function(){h.isSupported=function(){return Object(R.isSupported)()};function h(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new g.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 l=this.config=Object(b.mergeConfig)(h.DefaultConfig,v);this.userConfig=v,Object(A.enableLogs)(l.debug),this._autoLevelCapping=-1,l.progressive&&Object(b.enableStreamingMode)(l);var f=l.abrController,s=l.bufferController,i=l.capLevelController,x=l.fpsController,m=this.abrController=new f(this),E=this.bufferController=new s(this),D=this.capLevelController=new i(this),U=new x(this),j=new P.default(this),K=new B.default(this),k=new N.default(this),M=this.levelController=new O.default(this),G=new y.FragmentTracker(this),ee=this.streamController=new C.default(this,G);D.setStreamController(ee),U.setStreamController(ee);var ue=[M,ee];this.networkControllers=ue;var de=[j,K,m,E,D,U,k,G];this.audioTrackController=this.createController(l.audioTrackController,null,ue),this.createController(l.audioStreamController,G,ue),this.subtitleTrackController=this.createController(l.subtitleTrackController,null,ue),this.createController(l.subtitleStreamController,G,ue),this.createController(l.timelineController,null,de),this.emeController=this.createController(l.emeController,null,de),this.cmcdController=this.createController(l.cmcdController,null,de),this.latencyController=this.createController(_.default,null,de),this.coreComponents=de}var S=h.prototype;return S.createController=function(l,f,s){if(l){var i=f?new l(this,f):new l(this);return s&&s.push(i),i}return null},S.on=function(l,f,s){s===void 0&&(s=this),this._emitter.on(l,f,s)},S.once=function(l,f,s){s===void 0&&(s=this),this._emitter.once(l,f,s)},S.removeAllListeners=function(l){this._emitter.removeAllListeners(l)},S.off=function(l,f,s,i){s===void 0&&(s=this),this._emitter.off(l,f,s,i)},S.listeners=function(l){return this._emitter.listeners(l)},S.emit=function(l,f,s){return this._emitter.emit(l,f,s)},S.trigger=function(l,f){if(this.config.debug)return this.emit(l,l,f);try{return this.emit(l,l,f)}catch(s){A.logger.error("An internal error happened while handling event "+l+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(o.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:l,error:s})}return!1},S.listenerCount=function(l){return this._emitter.listenerCount(l)},S.destroy=function(){A.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(l){return l.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(l){return l.destroy()}),this.coreComponents.length=0},S.attachMedia=function(l){A.logger.log("attachMedia"),this._media=l,this.trigger(o.Events.MEDIA_ATTACHING,{media:l})},S.detachMedia=function(){A.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},S.loadSource=function(l){this.stopLoad();var f=this.media,s=this.url,i=this.url=z.buildAbsoluteURL(self.location.href,l,{alwaysNormalize:!0});A.logger.log("loadSource:"+i),f&&s&&s!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(f)),this.trigger(o.Events.MANIFEST_LOADING,{url:l})},S.startLoad=function(l){l===void 0&&(l=-1),A.logger.log("startLoad("+l+")"),this.networkControllers.forEach(function(f){f.startLoad(l)})},S.stopLoad=function(){A.logger.log("stopLoad"),this.networkControllers.forEach(function(l){l.stopLoad()})},S.swapAudioCodec=function(){A.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},S.recoverMediaError=function(){A.logger.log("recoverMediaError");var l=this._media;this.detachMedia(),l&&this.attachMedia(l)},S.removeLevel=function(l,f){f===void 0&&(f=0),this.levelController.removeLevel(l,f)},T(h,[{key:"levels",get:function(){var l=this.levelController.levels;return l||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(l){A.logger.log("set currentLevel:"+l),this.loadLevel=l,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(l){A.logger.log("set nextLevel:"+l),this.levelController.manualLevel=l,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(l){A.logger.log("set loadLevel:"+l),this.levelController.manualLevel=l}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(l){this.levelController.nextLoadLevel=l}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(l){A.logger.log("set firstLevel:"+l),this.levelController.firstLevel=l}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(l){A.logger.log("set startLevel:"+l),l!==-1&&(l=Math.max(l,this.minAutoLevel)),this.levelController.startLevel=l}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(l){var f=!!l;f!==this.config.capLevelToPlayerSize&&(f?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=f)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(l){this._autoLevelCapping!==l&&(A.logger.log("set autoLevelCapping:"+l),this._autoLevelCapping=l)}},{key:"bandwidthEstimate",get:function(){var l=this.abrController.bwEstimator;return l?l.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var l=this.levels,f=this.config.minAutoBitrate;if(!l)return 0;for(var s=l.length,i=0;i<s;i++)if(l[i].maxBitrate>f)return i;return 0}},{key:"maxAutoLevel",get:function(){var l=this.levels,f=this.autoLevelCapping,s;return f===-1&&l&&l.length?s=l.length-1:s=f,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(l){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,l)}},{key:"audioTracks",get:function(){var l=this.audioTrackController;return l?l.audioTracks:[]}},{key:"audioTrack",get:function(){var l=this.audioTrackController;return l?l.audioTrack:-1},set:function(l){var f=this.audioTrackController;f&&(f.audioTrack=l)}},{key:"subtitleTracks",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTrack:-1},set:function(l){var f=this.subtitleTrackController;f&&(f.subtitleTrack=l)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var l=this.subtitleTrackController;return l?l.subtitleDisplay:!1},set:function(l){var f=this.subtitleTrackController;f&&(f.subtitleDisplay=l)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(l){this.config.lowLatencyMode=l}},{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 o.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return h.defaultConfig?h.defaultConfig:b.hlsDefaultConfig},set:function(l){h.defaultConfig=l}}]),h}();p.defaultConfig=void 0},"./src/is-supported.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"isSupported",function(){return P}),L.d(H,"changeTypeSupported",function(){return B});var z=L("./src/utils/mediasource-helper.ts");function I(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var N=Object(z.getMediaSource)();if(!N)return!1;var _=I(),O=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!_||_.prototype&&typeof _.prototype.appendBuffer=="function"&&typeof _.prototype.remove=="function";return!!O&&!!y}function B(){var N,_=I();return typeof(_==null||((N=_.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return A}),L.d(H,"LoadError",function(){return g});var z=L("./src/polyfills/number.ts"),I=L("./src/errors.ts");function P(c,o){c.prototype=Object.create(o.prototype),c.prototype.constructor=c,y(c,o)}function B(c){var o=typeof Map=="function"?new Map:void 0;return B=function(d){if(d===null||!O(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(d))return o.get(d);o.set(d,T)}function T(){return N(d,arguments,C(this).constructor)}return T.prototype=Object.create(d.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),y(T,d)},B(c)}function N(c,o,u){return _()?N=Reflect.construct:N=function(T,p,h){var S=[null];S.push.apply(S,p);var v=Function.bind.apply(T,S),l=new v;return h&&y(l,h.prototype),l},N.apply(null,arguments)}function _(){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(c){return!1}}function O(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function y(c,o){return y=Object.setPrototypeOf||function(d,T){return d.__proto__=T,d},y(c,o)}function C(c){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},C(c)}var R=Math.pow(2,17),A=function(){function c(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var o=c.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(d,T){var p=this,h=d.url;if(!h)return Promise.reject(new g({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(h?"part list":"url")));this.abort();var S=this.config,v=S.fLoader,l=S.loader;return new Promise(function(f,s){p.loader&&p.loader.destroy();var i=p.loader=d.loader=v?new v(S):new l(S),x=b(d),m={timeout:S.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:S.fragLoadingMaxRetryTimeout,highWaterMark:R};d.stats=i.stats,i.load(x,m,{onSuccess:function(D,U,j,K){p.resetLoader(d,i),f({frag:d,part:null,payload:D.data,networkDetails:K})},onError:function(D,U,j){p.resetLoader(d,i),s(new g({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:D,networkDetails:j}))},onAbort:function(D,U,j){p.resetLoader(d,i),s(new g({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:j}))},onTimeout:function(D,U,j){p.resetLoader(d,i),s(new g({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:j}))},onProgress:function(D,U,j,K){T&&T({frag:d,part:null,payload:j,networkDetails:K})}})})},o.loadPart=function(d,T,p){var h=this;this.abort();var S=this.config,v=S.fLoader,l=S.loader;return new Promise(function(f,s){h.loader&&h.loader.destroy();var i=h.loader=d.loader=v?new v(S):new l(S),x=b(d,T),m={timeout:S.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:S.fragLoadingMaxRetryTimeout,highWaterMark:R};T.stats=i.stats,i.load(x,m,{onSuccess:function(D,U,j,K){h.resetLoader(d,i),h.updateStatsFromPart(d,T);var k={frag:d,part:T,payload:D.data,networkDetails:K};p(k),f(k)},onError:function(D,U,j){h.resetLoader(d,i),s(new g({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:T,response:D,networkDetails:j}))},onAbort:function(D,U,j){d.stats.aborted=T.stats.aborted,h.resetLoader(d,i),s(new g({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:T,networkDetails:j}))},onTimeout:function(D,U,j){h.resetLoader(d,i),s(new g({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:T,networkDetails:j}))}})})},o.updateStatsFromPart=function(d,T){var p=d.stats,h=T.stats,S=h.total;if(p.loaded+=h.loaded,S){var v=Math.round(d.duration/T.duration),l=Math.min(Math.round(p.loaded/S),v),f=v-l,s=f*Math.round(p.loaded/l);p.total=p.loaded+s}else p.total=Math.max(p.loaded,p.total);var i=p.loading,x=h.loading;i.start?i.first+=x.first-x.start:(i.start=x.start,i.first=x.first),i.end=x.end},o.resetLoader=function(d,T){d.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},c}();function b(c,o){o===void 0&&(o=null);var u=o||c,d={frag:c,part:o,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},T=u.byteRangeStartOffset,p=u.byteRangeEndOffset;return Object(z.isFiniteNumber)(T)&&Object(z.isFiniteNumber)(p)&&(d.rangeStart=T,d.rangeEnd=p),d}var g=function(c){P(o,c);function o(u){for(var d,T=arguments.length,p=new Array(T>1?T-1:0),h=1;h<T;h++)p[h-1]=arguments[h];return d=c.call.apply(c,[this].concat(p))||this,d.data=void 0,d.data=u,d}return o}(B(Error))},"./src/loader/fragment.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"ElementaryStreamTypes",function(){return A}),L.d(H,"BaseSegment",function(){return b}),L.d(H,"Fragment",function(){return g}),L.d(H,"Part",function(){return c});var z=L("./src/polyfills/number.ts"),I=L("./node_modules/url-toolkit/src/url-toolkit.js"),P=L.n(I),B=L("./src/utils/logger.ts"),N=L("./src/loader/level-key.ts"),_=L("./src/loader/load-stats.ts");function O(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,y(o,u)}function y(o,u){return y=Object.setPrototypeOf||function(T,p){return T.__proto__=p,T},y(o,u)}function C(o,u){for(var d=0;d<u.length;d++){var T=u[d];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(o,T.key,T)}}function R(o,u,d){return u&&C(o.prototype,u),d&&C(o,d),o}var A;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(A||(A={}));var b=function(){function o(d){var T;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(T={},T[A.AUDIO]=null,T[A.VIDEO]=null,T[A.AUDIOVIDEO]=null,T),this.baseurl=d}var u=o.prototype;return u.setByteRange=function(T,p){var h=T.split("@",2),S=[];h.length===1?S[0]=p?p.byteRangeEndOffset:0:S[0]=parseInt(h[1]),S[1]=parseInt(h[0])+S[0],this._byteRange=S},R(o,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(I.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(T){this._url=T}}]),o}(),g=function(o){O(u,o);function u(T,p){var h;return h=o.call(this,p)||this,h._decryptdata=null,h.rawProgramDateTime=null,h.programDateTime=null,h.tagList=[],h.duration=0,h.sn=0,h.levelkey=void 0,h.type=void 0,h.loader=null,h.level=-1,h.cc=0,h.startPTS=void 0,h.endPTS=void 0,h.appendedPTS=void 0,h.startDTS=void 0,h.endDTS=void 0,h.start=0,h.deltaPTS=void 0,h.maxStartPTS=void 0,h.minEndPTS=void 0,h.stats=new _.LoadStats,h.urlId=0,h.data=void 0,h.bitrateTest=!1,h.title=null,h.initSegment=null,h.type=T,h}var d=u.prototype;return d.createInitializationVector=function(p){for(var h=new Uint8Array(16),S=12;S<16;S++)h[S]=p>>8*(15-S)&255;return h},d.setDecryptDataFromLevelKey=function(p,h){var S=p;return(p==null?void 0:p.method)==="AES-128"&&p.uri&&!p.iv&&(S=N.LevelKey.fromURI(p.uri),S.method=p.method,S.iv=this.createInitializationVector(h),S.keyFormat="identity"),S},d.setElementaryStreamInfo=function(p,h,S,v,l,f){f===void 0&&(f=!1);var s=this.elementaryStreams,i=s[p];if(!i){s[p]={startPTS:h,endPTS:S,startDTS:v,endDTS:l,partial:f};return}i.startPTS=Math.min(i.startPTS,h),i.endPTS=Math.max(i.endPTS,S),i.startDTS=Math.min(i.startDTS,v),i.endDTS=Math.max(i.endDTS,l)},d.clearElementaryStreamInfo=function(){var p=this.elementaryStreams;p[A.AUDIO]=null,p[A.VIDEO]=null,p[A.AUDIOVIDEO]=null},R(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var p=this.sn;typeof p!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&B.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),p=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,p)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var p=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+p*1e3}},{key:"encrypted",get:function(){var p;return!!((p=this.decryptdata)!==null&&p!==void 0&&p.keyFormat&&this.decryptdata.uri)}}]),u}(b),c=function(o){O(u,o);function u(d,T,p,h,S){var v;v=o.call(this,p)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new _.LoadStats,v.duration=d.decimalFloatingPoint("DURATION"),v.gap=d.bool("GAP"),v.independent=d.bool("INDEPENDENT"),v.relurl=d.enumeratedString("URI"),v.fragment=T,v.index=h;var l=d.enumeratedString("BYTERANGE");return l&&v.setByteRange(l,S),S&&(v.fragOffset=S.fragOffset+S.duration),v}return R(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),u}(b)},"./src/loader/key-loader.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return B});var z=L("./src/events.ts"),I=L("./src/errors.ts"),P=L("./src/utils/logger.ts"),B=function(){function N(O){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=O,this._registerListeners()}var _=N.prototype;return _._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},_._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},_.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var C=this.loaders[y];C&&C.destroy()}this.loaders={}},_.onKeyLoading=function(y,C){var R=C.frag,A=R.type,b=this.loaders[A];if(!R.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var g=R.decryptdata.uri;if(g!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(b&&(P.logger.warn("abort previous key loader for type:"+A),b.abort()),!g){P.logger.warn("key uri is falsy");return}var o=c.loader,u=R.loader=this.loaders[A]=new o(c);this.decrypturl=g,this.decryptkey=null;var d={url:g,frag:R,responseType:"arraybuffer"},T={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(d,T,p)}else this.decryptkey&&(R.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:R}))},_.loadsuccess=function(y,C,R){var A=R.frag;if(!A.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=A.decryptdata.key=new Uint8Array(y.data),A.loader=null,delete this.loaders[A.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:A})},_.loaderror=function(y,C){var R=C.frag,A=R.loader;A&&A.abort(),delete this.loaders[R.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:R,response:y})},_.loadtimeout=function(y,C){var R=C.frag,A=R.loader;A&&A.abort(),delete this.loaders[R.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:R})},N}()},"./src/loader/level-details.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"LevelDetails",function(){return N});var z=L("./src/polyfills/number.ts");function I(_,O){for(var y=0;y<O.length;y++){var C=O[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}function P(_,O,y){return O&&I(_.prototype,O),y&&I(_,y),_}var B=10,N=function(){function _(y){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=y}var O=_.prototype;return O.reloaded=function(C){if(!C){this.advanced=!0,this.updated=!0;return}var R=this.lastPartSn-C.lastPartSn,A=this.lastPartIndex-C.lastPartIndex;this.updated=this.endSN!==C.endSN||!!A||!!R,this.advanced=this.endSN>C.endSN||R>0||R===0&&A>0,this.updated||this.advanced?this.misses=Math.floor(C.misses*.6):this.misses=C.misses+1,this.availabilityDelay=C.availabilityDelay},P(_,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||B}},{key:"drift",get:function(){var C=this.driftEndTime-this.driftStartTime;if(C>0){var R=this.driftEnd-this.driftStart;return R*1e3/C}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var C;return(C=this.fragments)!==null&&C!==void 0&&C.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 C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),_}()},"./src/loader/level-key.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"LevelKey",function(){return N});var z=L("./node_modules/url-toolkit/src/url-toolkit.js"),I=L.n(z);function P(_,O){for(var y=0;y<O.length;y++){var C=O[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}function B(_,O,y){return O&&P(_.prototype,O),y&&P(_,y),_}var N=function(){_.fromURL=function(y,C){return new _(y,C)},_.fromURI=function(y){return new _(y)};function _(O,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(z.buildAbsoluteURL)(O,y,{alwaysNormalize:!0}):this._uri=O}return B(_,[{key:"uri",get:function(){return this._uri}}]),_}()},"./src/loader/load-stats.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"LoadStats",function(){return z});var z=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return u});var z=L("./src/polyfills/number.ts"),I=L("./node_modules/url-toolkit/src/url-toolkit.js"),P=L.n(I),B=L("./src/loader/fragment.ts"),N=L("./src/loader/level-details.ts"),_=L("./src/loader/level-key.ts"),O=L("./src/utils/attr-list.ts"),y=L("./src/utils/logger.ts"),C=L("./src/utils/codecs.ts"),R=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,A=/#EXT-X-MEDIA:(.*)/g,b=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),g=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("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function o(S){var v,l;return c.test((v=(l=I.parseURL(S))===null||l===void 0?void 0:l.path)!=null?v:"")}var u=function(){function S(){}return S.findGroup=function(l,f){for(var s=0;s<l.length;s++){var i=l[s];if(i.id===f)return i}},S.convertAVC1ToAVCOTI=function(l){var f=l.split(".");if(f.length>2){var s=f.shift()+".";return s+=parseInt(f.shift()).toString(16),s+=("000"+parseInt(f.shift()).toString(16)).substr(-4),s}return l},S.resolve=function(l,f){return I.buildAbsoluteURL(f,l,{alwaysNormalize:!0})},S.parseMasterPlaylist=function(l,f){var s=[],i={},x=!1;R.lastIndex=0;for(var m;(m=R.exec(l))!=null;)if(m[1]){var E=new O.AttrList(m[1]),D={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:S.resolve(m[2],f)},U=E.decimalResolution("RESOLUTION");U&&(D.width=U.width,D.height=U.height),d((E.CODECS||"").split(/[ ,]+/).filter(function(K){return K}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=S.convertAVC1ToAVCOTI(D.videoCodec)),s.push(D)}else if(m[3]){var j=new O.AttrList(m[3]);j["DATA-ID"]&&(x=!0,i[j["DATA-ID"]]=j)}return{levels:s,sessionData:x?i:null}},S.parseMasterPlaylistMedia=function(l,f,s,i){i===void 0&&(i=[]);var x,m=[],E=0;for(A.lastIndex=0;(x=A.exec(l))!==null;){var D=new O.AttrList(x[1]);if(D.TYPE===s){var U={attrs:D,bitrate:0,id:E++,groupId:D["GROUP-ID"],instreamId:D["INSTREAM-ID"],name:D.NAME||D.LANGUAGE||"",type:s,default:D.bool("DEFAULT"),autoselect:D.bool("AUTOSELECT"),forced:D.bool("FORCED"),lang:D.LANGUAGE,url:D.URI?S.resolve(D.URI,f):""};if(i.length){var j=S.findGroup(i,U.groupId)||i[0];T(U,j,"audioCodec"),T(U,j,"textCodec")}m.push(U)}}return m},S.parseLevelPlaylist=function(l,f,s,i,x){var m=new N.LevelDetails(f),E=m.fragments,D=null,U=0,j=0,K=0,k=0,M=null,G=new B.Fragment(i,f),ee,ue,de,be=-1,Ee=!1;for(b.lastIndex=0,m.m3u8=l;(ee=b.exec(l))!==null;){Ee&&(Ee=!1,G=new B.Fragment(i,f),G.start=K,G.sn=U,G.cc=k,G.level=s,D&&(G.initSegment=D,G.rawProgramDateTime=D.rawProgramDateTime));var ae=ee[1];if(ae){G.duration=parseFloat(ae);var $=(" "+ee[2]).slice(1);G.title=$||null,G.tagList.push($?["INF",ae,$]:["INF",ae])}else if(ee[3])Object(z.isFiniteNumber)(G.duration)&&(G.start=K,de&&(G.levelkey=de),G.sn=U,G.level=s,G.cc=k,G.urlId=x,E.push(G),G.relurl=(" "+ee[3]).slice(1),h(G,M),M=G,K+=G.duration,U++,j=0,Ee=!0);else if(ee[4]){var re=(" "+ee[4]).slice(1);M?G.setByteRange(re,M):G.setByteRange(re)}else if(ee[5])G.rawProgramDateTime=(" "+ee[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),be===-1&&(be=E.length);else{if(ee=ee[0].match(g),!ee){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(ue=1;ue<ee.length&&!(typeof ee[ue]!="undefined");ue++);var J=(" "+ee[ue]).slice(1),ie=(" "+ee[ue+1]).slice(1),V=ee[ue+2]?(" "+ee[ue+2]).slice(1):"";switch(J){case"PLAYLIST-TYPE":m.type=ie.toUpperCase();break;case"MEDIA-SEQUENCE":U=m.startSN=parseInt(ie);break;case"SKIP":{var Y=new O.AttrList(ie),Z=Y.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(Z)){m.skippedSegments=Z;for(var le=Z;le--;)E.unshift(null);U+=Z}var xe=Y.enumeratedString("RECENTLY-REMOVED-DATERANGES");xe&&(m.recentlyRemovedDateranges=xe.split(" "));break}case"TARGETDURATION":m.targetduration=parseFloat(ie);break;case"VERSION":m.version=parseInt(ie);break;case"EXTM3U":break;case"ENDLIST":m.live=!1;break;case"#":(ie||V)&&G.tagList.push(V?[ie,V]:[ie]);break;case"DIS":k++;case"GAP":G.tagList.push([J]);break;case"BITRATE":G.tagList.push([J,ie]);break;case"DISCONTINUITY-SEQ":k=parseInt(ie);break;case"KEY":{var he,Te=new O.AttrList(ie),De=Te.enumeratedString("METHOD"),Pe=Te.URI,Be=Te.hexadecimalInteger("IV"),Me=Te.enumeratedString("KEYFORMATVERSIONS"),ke=Te.enumeratedString("KEYID"),Ve=(he=Te.enumeratedString("KEYFORMAT"))!=null?he:"identity",Se=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Se.indexOf(Ve)>-1){y.logger.warn("Keyformat "+Ve+" is not supported from the manifest");continue}else if(Ve!=="identity")continue;De&&(de=_.LevelKey.fromURL(f,Pe),Pe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(De)>=0&&(de.method=De,de.keyFormat=Ve,ke&&(de.keyID=ke),Me&&(de.keyFormatVersions=Me),de.iv=Be));break}case"START":{var Re=new O.AttrList(ie),_e=Re.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(_e)&&(m.startTimeOffset=_e);break}case"MAP":{var Ne=new O.AttrList(ie);G.relurl=Ne.URI,Ne.BYTERANGE&&G.setByteRange(Ne.BYTERANGE),G.level=s,G.sn="initSegment",de&&(G.levelkey=de),G.initSegment=null,D=G,Ee=!0;break}case"SERVER-CONTROL":{var Fe=new O.AttrList(ie);m.canBlockReload=Fe.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=Fe.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&Fe.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=Fe.optionalFloat("PART-HOLD-BACK",0),m.holdBack=Fe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ue=new O.AttrList(ie);m.partTarget=Ue.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=m.partList;Ce||(Ce=m.partList=[]);var He=j>0?Ce[Ce.length-1]:void 0,je=j++,we=new B.Part(new O.AttrList(ie),G,f,je,He);Ce.push(we),G.duration+=we.duration;break}case"PRELOAD-HINT":{var Ie=new O.AttrList(ie);m.preloadHint=Ie;break}case"RENDITION-REPORT":{var ge=new O.AttrList(ie);m.renditionReports=m.renditionReports||[],m.renditionReports.push(ge);break}default:y.logger.warn("line parsed but not handled: "+ee);break}}}M&&!M.relurl?(E.pop(),K-=M.duration,m.partList&&(m.fragmentHint=M)):m.partList&&(h(G,M),G.cc=k,m.fragmentHint=G);var ce=E.length,me=E[0],q=E[ce-1];if(K+=m.skippedSegments*m.targetduration,K>0&&ce&&q){m.averagetargetduration=K/ce;var ne=q.sn;m.endSN=ne!=="initSegment"?ne:0,me&&(m.startCC=me.cc,me.initSegment||m.fragments.every(function(se){return se.relurl&&o(se.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new B.Fragment(i,f),G.relurl=q.relurl,G.level=s,G.sn="initSegment",me.initSegment=G,m.needSidxRanges=!0))}else m.endSN=0,m.startCC=0;return m.fragmentHint&&(K+=m.fragmentHint.duration),m.totalduration=K,m.endCC=k,be>0&&p(E,be),m},S}();function d(S,v){["video","audio","text"].forEach(function(l){var f=S.filter(function(i){return Object(C.isCodecType)(i,l)});if(f.length){var s=f.filter(function(i){return i.lastIndexOf("avc1",0)===0||i.lastIndexOf("mp4a",0)===0});v[l+"Codec"]=s.length>0?s[0]:f[0],S=S.filter(function(i){return f.indexOf(i)===-1})}}),v.unknownCodecs=S}function T(S,v,l){var f=v[l];f&&(S[l]=f)}function p(S,v){for(var l=S[v],f=v;f--;){var s=S[f];if(!s)return;s.programDateTime=l.programDateTime-s.duration*1e3,l=s}}function h(S,v){S.rawProgramDateTime?S.programDateTime=Date.parse(S.rawProgramDateTime):v!=null&&v.programDateTime&&(S.programDateTime=v.endProgramDateTime),Object(z.isFiniteNumber)(S.programDateTime)||(S.programDateTime=null,S.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/polyfills/number.ts"),I=L("./src/events.ts"),P=L("./src/errors.ts"),B=L("./src/utils/logger.ts"),N=L("./src/utils/mp4-tools.ts"),_=L("./src/loader/m3u8-parser.ts"),O=L("./src/types/loader.ts"),y=L("./src/utils/attr-list.ts");function C(b){var g=b.type;switch(g){case O.PlaylistContextType.AUDIO_TRACK:return O.PlaylistLevelType.AUDIO;case O.PlaylistContextType.SUBTITLE_TRACK:return O.PlaylistLevelType.SUBTITLE;default:return O.PlaylistLevelType.MAIN}}function R(b,g){var c=b.url;return(c===void 0||c.indexOf("data:")===0)&&(c=g.url),c}var A=function(){function b(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var g=b.prototype;return g.registerListeners=function(){var o=this.hls;o.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(I.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.unregisterListeners=function(){var o=this.hls;o.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(I.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.createInternalLoader=function(o){var u=this.hls.config,d=u.pLoader,T=u.loader,p=d||T,h=new p(u);return o.loader=h,this.loaders[o.type]=h,h},g.getInternalLoader=function(o){return this.loaders[o.type]},g.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},g.destroyInternalLoaders=function(){for(var o in this.loaders){var u=this.loaders[o];u&&u.destroy(),this.resetInternalLoader(o)}},g.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},g.onManifestLoading=function(o,u){var d=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:O.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},g.onLevelLoading=function(o,u){var d=u.id,T=u.level,p=u.url,h=u.deliveryDirectives;this.load({id:d,groupId:null,level:T,responseType:"text",type:O.PlaylistContextType.LEVEL,url:p,deliveryDirectives:h})},g.onAudioTrackLoading=function(o,u){var d=u.id,T=u.groupId,p=u.url,h=u.deliveryDirectives;this.load({id:d,groupId:T,level:null,responseType:"text",type:O.PlaylistContextType.AUDIO_TRACK,url:p,deliveryDirectives:h})},g.onSubtitleTrackLoading=function(o,u){var d=u.id,T=u.groupId,p=u.url,h=u.deliveryDirectives;this.load({id:d,groupId:T,level:null,responseType:"text",type:O.PlaylistContextType.SUBTITLE_TRACK,url:p,deliveryDirectives:h})},g.load=function(o){var u,d=this.hls.config,T=this.getInternalLoader(o);if(T){var p=T.context;if(p&&p.url===o.url){B.logger.trace("[playlist-loader]: playlist request ongoing");return}B.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),T.abort()}var h,S,v,l;switch(o.type){case O.PlaylistContextType.MANIFEST:h=d.manifestLoadingMaxRetry,S=d.manifestLoadingTimeOut,v=d.manifestLoadingRetryDelay,l=d.manifestLoadingMaxRetryTimeout;break;case O.PlaylistContextType.LEVEL:case O.PlaylistContextType.AUDIO_TRACK:case O.PlaylistContextType.SUBTITLE_TRACK:h=0,S=d.levelLoadingTimeOut;break;default:h=d.levelLoadingMaxRetry,S=d.levelLoadingTimeOut,v=d.levelLoadingRetryDelay,l=d.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(o),(u=o.deliveryDirectives)!==null&&u!==void 0&&u.part){var f;if(o.type===O.PlaylistContextType.LEVEL&&o.level!==null?f=this.hls.levels[o.level].details:o.type===O.PlaylistContextType.AUDIO_TRACK&&o.id!==null?f=this.hls.audioTracks[o.id].details:o.type===O.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(f=this.hls.subtitleTracks[o.id].details),f){var s=f.partTarget,i=f.targetduration;s&&i&&(S=Math.min(Math.max(s*3,i*.8)*1e3,S))}}var x={timeout:S,maxRetry:h,retryDelay:v,maxRetryDelay:l,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(o,x,m)},g.loadsuccess=function(o,u,d,T){if(T===void 0&&(T=null),d.isSidxRequest){this.handleSidxRequest(o,d),this.handlePlaylistLoaded(o,u,d,T);return}this.resetInternalLoader(d.type);var p=o.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,d,"no EXTM3U delimiter",T);return}u.parsing.start=performance.now(),p.indexOf("#EXTINF:")>0||p.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,u,d,T):this.handleMasterPlaylist(o,u,d,T)},g.loaderror=function(o,u,d){d===void 0&&(d=null),this.handleNetworkError(u,d,!1,o)},g.loadtimeout=function(o,u,d){d===void 0&&(d=null),this.handleNetworkError(u,d,!0)},g.handleMasterPlaylist=function(o,u,d,T){var p=this.hls,h=o.data,S=R(o,d),v=_.default.parseMasterPlaylist(h,S),l=v.levels,f=v.sessionData;if(!l.length){this.handleManifestParsingError(o,d,"no level found in manifest",T);return}var s=l.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),i=l.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),x=_.default.parseMasterPlaylistMedia(h,S,"AUDIO",s),m=_.default.parseMasterPlaylistMedia(h,S,"SUBTITLES",i),E=_.default.parseMasterPlaylistMedia(h,S,"CLOSED-CAPTIONS");if(x.length){var D=x.some(function(U){return!U.url});!D&&l[0].audioCodec&&!l[0].attrs.AUDIO&&(B.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),x.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}p.trigger(I.Events.MANIFEST_LOADED,{levels:l,audioTracks:x,subtitles:m,captions:E,url:S,stats:u,networkDetails:T,sessionData:f})},g.handleTrackOrLevelPlaylist=function(o,u,d,T){var p=this.hls,h=d.id,S=d.level,v=d.type,l=R(o,d),f=Object(z.isFiniteNumber)(h)?h:0,s=Object(z.isFiniteNumber)(S)?S:f,i=C(d),x=_.default.parseLevelPlaylist(o.data,l,s,i,f);if(!x.fragments.length){p.trigger(I.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:l,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(v===O.PlaylistContextType.MANIFEST){var m={attrs:new y.AttrList({}),bitrate:0,details:x,name:"",url:l};p.trigger(I.Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:l,stats:u,networkDetails:T,sessionData:null})}if(u.parsing.end=performance.now(),x.needSidxRanges){var E,D=(E=x.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:D,isSidxRequest:!0,type:v,level:S,levelDetails:x,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=x,this.handlePlaylistLoaded(o,u,d,T)},g.handleSidxRequest=function(o,u){var d=Object(N.parseSegmentIndex)(new Uint8Array(o.data));if(!d)return;var T=d.references,p=u.levelDetails;T.forEach(function(h,S){var v=h.info,l=p.fragments[S];l.byteRange.length===0&&l.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),l.initSegment&&l.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},g.handleManifestParsingError=function(o,u,d,T){this.hls.trigger(I.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===O.PlaylistContextType.MANIFEST,url:o.url,reason:d,response:o,context:u,networkDetails:T})},g.handleNetworkError=function(o,u,d,T){d===void 0&&(d=!1),B.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var p=P.ErrorDetails.UNKNOWN,h=!1,S=this.getInternalLoader(o);switch(o.type){case O.PlaylistContextType.MANIFEST:p=d?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,h=!0;break;case O.PlaylistContextType.LEVEL:p=d?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,h=!1;break;case O.PlaylistContextType.AUDIO_TRACK:p=d?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case O.PlaylistContextType.SUBTITLE_TRACK:p=d?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,h=!1;break}S&&this.resetInternalLoader(o.type);var v={type:P.ErrorTypes.NETWORK_ERROR,details:p,fatal:h,url:o.url,loader:S,context:o,networkDetails:u};T&&(v.response=T),this.hls.trigger(I.Events.ERROR,v)},g.handlePlaylistLoaded=function(o,u,d,T){var p=d.type,h=d.level,S=d.id,v=d.groupId,l=d.loader,f=d.levelDetails,s=d.deliveryDirectives;if(!(f!=null&&f.targetduration)){this.handleManifestParsingError(o,d,"invalid target duration",T);return}if(!l)return;f.live&&(l.getCacheAge&&(f.ageHeader=l.getCacheAge()||0),(!l.getCacheAge||isNaN(f.ageHeader))&&(f.ageHeader=0));switch(p){case O.PlaylistContextType.MANIFEST:case O.PlaylistContextType.LEVEL:this.hls.trigger(I.Events.LEVEL_LOADED,{details:f,level:h||0,id:S||0,stats:u,networkDetails:T,deliveryDirectives:s});break;case O.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(I.Events.AUDIO_TRACK_LOADED,{details:f,id:S||0,groupId:v||"",stats:u,networkDetails:T,deliveryDirectives:s});break;case O.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(I.Events.SUBTITLE_TRACK_LOADED,{details:f,id:S||0,groupId:v||"",stats:u,networkDetails:T,deliveryDirectives:s});break}},b}();H.default=A},"./src/polyfills/number.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"isFiniteNumber",function(){return z}),L.d(H,"MAX_SAFE_INTEGER",function(){return I});var z=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},I=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(oe,H,L){"use strict";L.r(H);var z=function(){function I(){}return I.getSilentFrame=function(B,N){switch(B){case"mp4a.40.2":if(N===1)return new Uint8Array([0,200,0,128,35,128]);if(N===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(N===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(N===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(N===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(N===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(N===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(N===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(N===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},I}();H.default=z},"./src/remux/mp4-generator.ts":function(oe,H,L){"use strict";L.r(H);var z=Math.pow(2,32)-1,I=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 N;for(N in P.types)P.types.hasOwnProperty(N)&&(P.types[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.charCodeAt(3)]);var _=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]),O=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:_,audio:O};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=C,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 R=new Uint8Array([105,115,111,109]),A=new Uint8Array([97,118,99,49]),b=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,R,b,R,A),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,y))},P.box=function(N){for(var _=8,O=arguments.length,y=new Array(O>1?O-1:0),C=1;C<O;C++)y[C-1]=arguments[C];for(var R=y.length,A=R;R--;)_+=y[R].byteLength;var b=new Uint8Array(_);for(b[0]=_>>24&255,b[1]=_>>16&255,b[2]=_>>8&255,b[3]=_&255,b.set(N,4),R=0,_=8;R<A;R++)b.set(y[R],_),_+=y[R].byteLength;return b},P.hdlr=function(N){return P.box(P.types.hdlr,P.HDLR_TYPES[N])},P.mdat=function(N){return P.box(P.types.mdat,N)},P.mdhd=function(N,_){_*=N;var O=Math.floor(_/(z+1)),y=Math.floor(_%(z+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,N>>24&255,N>>16&255,N>>8&255,N&255,O>>24,O>>16&255,O>>8&255,O&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},P.mdia=function(N){return P.box(P.types.mdia,P.mdhd(N.timescale,N.duration),P.hdlr(N.type),P.minf(N))},P.mfhd=function(N){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},P.minf=function(N){return N.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(N)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(N))},P.moof=function(N,_,O){return P.box(P.types.moof,P.mfhd(N),P.traf(O,_))},P.moov=function(N){for(var _=N.length,O=[];_--;)O[_]=P.trak(N[_]);return P.box.apply(null,[P.types.moov,P.mvhd(N[0].timescale,N[0].duration)].concat(O).concat(P.mvex(N)))},P.mvex=function(N){for(var _=N.length,O=[];_--;)O[_]=P.trex(N[_]);return P.box.apply(null,[P.types.mvex].concat(O))},P.mvhd=function(N,_){_*=N;var O=Math.floor(_/(z+1)),y=Math.floor(_%(z+1)),C=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,O>>24,O>>16&255,O>>8&255,O&255,y>>24,y>>16&255,y>>8&255,y&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return P.box(P.types.mvhd,C)},P.sdtp=function(N){var _=N.samples||[],O=new Uint8Array(4+_.length),y,C;for(y=0;y<_.length;y++)C=_[y].flags,O[y+4]=C.dependsOn<<4|C.isDependedOn<<2|C.hasRedundancy;return P.box(P.types.sdtp,O)},P.stbl=function(N){return P.box(P.types.stbl,P.stsd(N),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(N){var _=[],O=[],y,C,R;for(y=0;y<N.sps.length;y++)C=N.sps[y],R=C.byteLength,_.push(R>>>8&255),_.push(R&255),_=_.concat(Array.prototype.slice.call(C));for(y=0;y<N.pps.length;y++)C=N.pps[y],R=C.byteLength,O.push(R>>>8&255),O.push(R&255),O=O.concat(Array.prototype.slice.call(C));var A=P.box(P.types.avcC,new Uint8Array([1,_[3],_[4],_[5],252|3,224|N.sps.length].concat(_).concat([N.pps.length]).concat(O))),b=N.width,g=N.height,c=N.pixelRatio[0],o=N.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,b>>8&255,b&255,g>>8&255,g&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]),A,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([c>>24,c>>16&255,c>>8&255,c&255,o>>24,o>>16&255,o>>8&255,o&255])))},P.esds=function(N){var _=N.config.length;return new Uint8Array([0,0,0,0,3,23+_,0,1,0,4,15+_,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([_]).concat(N.config).concat([6,1,2]))},P.mp4a=function(N){var _=N.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,N.channelCount,0,16,0,0,0,0,_>>8&255,_&255,0,0]),P.box(P.types.esds,P.esds(N)))},P.mp3=function(N){var _=N.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,N.channelCount,0,16,0,0,0,0,_>>8&255,_&255,0,0]))},P.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(N)):P.box(P.types.stsd,P.STSD,P.mp4a(N)):P.box(P.types.stsd,P.STSD,P.avc1(N))},P.tkhd=function(N){var _=N.id,O=N.duration*N.timescale,y=N.width,C=N.height,R=Math.floor(O/(z+1)),A=Math.floor(O%(z+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,_>>24&255,_>>16&255,_>>8&255,_&255,0,0,0,0,R>>24,R>>16&255,R>>8&255,R&255,A>>24,A>>16&255,A>>8&255,A&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,C>>8&255,C&255,0,0]))},P.traf=function(N,_){var O=P.sdtp(N),y=N.id,C=Math.floor(_/(z+1)),R=Math.floor(_%(z+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,C>>24,C>>16&255,C>>8&255,C&255,R>>24,R>>16&255,R>>8&255,R&255])),P.trun(N,O.length+16+20+8+16+8+8),O)},P.trak=function(N){return N.duration=N.duration||4294967295,P.box(P.types.trak,P.tkhd(N),P.mdia(N))},P.trex=function(N){var _=N.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(N,_){var O=N.samples||[],y=O.length,C=12+16*y,R=new Uint8Array(C),A,b,g,c,o,u;for(_+=8+C,R.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255],0),A=0;A<y;A++)b=O[A],g=b.duration,c=b.size,o=b.flags,u=b.cts,R.set([g>>>24&255,g>>>16&255,g>>>8&255,g&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*A);return P.box(P.types.trun,R)},P.initSegment=function(N){P.types||P.init();var _=P.moov(N),O=new Uint8Array(P.FTYP.byteLength+_.byteLength);return O.set(P.FTYP),O.set(_,P.FTYP.byteLength),O},P}();I.types=void 0,I.HDLR_TYPES=void 0,I.STTS=void 0,I.STSC=void 0,I.STCO=void 0,I.STSZ=void 0,I.VMHD=void 0,I.SMHD=void 0,I.STSD=void 0,I.FTYP=void 0,I.DINF=void 0,H.default=I},"./src/remux/mp4-remuxer.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return u}),L.d(H,"normalizePts",function(){return d});var z=L("./src/polyfills/number.ts"),I=L("./src/remux/aac-helper.ts"),P=L("./src/remux/mp4-generator.ts"),B=L("./src/events.ts"),N=L("./src/errors.ts"),_=L("./src/utils/logger.ts"),O=L("./src/types/loader.ts"),y=L("./src/utils/timescale-conversion.ts");function C(){return C=Object.assign||function(S){for(var v=1;v<arguments.length;v++){var l=arguments[v];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(S[f]=l[f])}return S},C.apply(this,arguments)}var R=10*1e3,A=1024,b=1152,g=null,c=null,o=!1,u=function(){function S(l,f,s,i){if(i===void 0&&(i=""),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=l,this.config=f,this.typeSupported=s,this.ISGenerated=!1,g===null){var x=navigator.userAgent||"",m=x.match(/Chrome\/(\d+)/i);g=m?parseInt(m[1]):0}if(c===null){var E=navigator.userAgent.match(/Safari\/(\d+)/i);c=E?parseInt(E[1]):0}o=!!g&&g<75||!!c&&c<600}var v=S.prototype;return v.destroy=function(){},v.resetTimeStamp=function(f){_.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=f},v.resetNextTimestamp=function(){_.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){_.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(f){var s=!1,i=f.reduce(function(x,m){var E=m.pts-x;return E<-4294967296?(s=!0,d(x,m.pts)):E>0?x:m.pts},f[0].pts);return s&&_.logger.debug("PTS rollover detected"),i},v.remux=function(f,s,i,x,m,E,D,U){var j,K,k,M,G,ee,ue=m,de=m,be=f.pid>-1,Ee=s.pid>-1,ae=s.samples.length,$=f.samples.length>0,re=ae>1,J=(!be||$)&&(!Ee||re)||this.ISGenerated||D;if(J){this.ISGenerated||(k=this.generateIS(f,s,m));var ie=this.isVideoContiguous,V=-1;if(re&&(V=T(s.samples),!ie&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,V>0){_.logger.warn("[mp4-remuxer]: Dropped "+V+" out of "+ae+" video samples due to a missing keyframe");var Y=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(V),s.dropped+=V,de+=(s.samples[0].pts-Y)/(s.timescale||9e4)}else V===-1&&(_.logger.warn("[mp4-remuxer]: No keyframe found out of "+ae+" video samples"),ee=!1);if(this.ISGenerated){if($&&re){var Z=this.getVideoStartPts(s.samples),le=d(f.samples[0].pts,Z)-Z,xe=le/s.inputTimeScale;ue+=Math.max(0,xe),de+=Math.max(0,-xe)}if($){if(f.samplerate||(_.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(f,s,m)),K=this.remuxAudio(f,ue,this.isAudioContiguous,E,Ee||re||U===O.PlaylistLevelType.AUDIO?de:void 0),re){var he=K?K.endPTS-K.startPTS:0;s.inputTimeScale||(_.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(f,s,m)),j=this.remuxVideo(s,de,ie,he)}}else re&&(j=this.remuxVideo(s,de,ie,0));j&&(j.firstKeyFrame=V,j.independent=V!==-1)}}return this.ISGenerated&&(i.samples.length&&(G=this.remuxID3(i,m)),x.samples.length&&(M=this.remuxText(x,m))),{audio:K,video:j,initSegment:k,independent:ee,text:M,id3:G}},v.generateIS=function(f,s,i){var x=f.samples,m=s.samples,E=this.typeSupported,D={},U=!Object(z.isFiniteNumber)(this._initPTS),j="audio/mp4",K,k,M;if(U&&(K=k=Infinity),f.config&&x.length&&(f.timescale=f.samplerate,f.isAAC||(E.mpeg?(j="audio/mpeg",f.codec=""):E.mp3&&(f.codec="mp3")),D.audio={id:"audio",container:j,codec:f.codec,initSegment:!f.isAAC&&E.mpeg?new Uint8Array(0):P.default.initSegment([f]),metadata:{channelCount:f.channelCount}},U&&(M=f.inputTimeScale,K=k=x[0].pts-Math.round(M*i))),s.sps&&s.pps&&m.length&&(s.timescale=s.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:P.default.initSegment([s]),metadata:{width:s.width,height:s.height}},U)){M=s.inputTimeScale;var G=this.getVideoStartPts(m),ee=Math.round(M*i);k=Math.min(k,d(m[0].dts,G)-ee),K=Math.min(K,G-ee)}if(Object.keys(D).length)return this.ISGenerated=!0,U&&(this._initPTS=K,this._initDTS=k),{tracks:D,initPTS:K,timescale:M}},v.remuxVideo=function(f,s,i,x){var m=f.inputTimeScale,E=f.samples,D=[],U=E.length,j=this._initPTS,K=this.nextAvcDts,k=8,M,G,ee,ue=Number.POSITIVE_INFINITY,de=Number.NEGATIVE_INFINITY,be=0,Ee=!1;if(!i||K===null){var ae=s*m,$=E[0].pts-d(E[0].dts,E[0].pts);K=ae-$}for(var re=0;re<U;re++){var J=E[re];if(J.pts=d(J.pts-j,K),J.dts=d(J.dts-j,K),J.dts>J.pts){var ie=9e4*.2;be=Math.max(Math.min(be,J.pts-J.dts),-1*ie)}J.dts<E[re>0?re-1:re].dts&&(Ee=!0)}Ee&&E.sort(function(yt,st){var rt=yt.dts-st.dts,Tt=yt.pts-st.pts;return rt||Tt}),G=E[0].dts,ee=E[E.length-1].dts;var V=Math.round((ee-G)/(U-1));if(be<0){if(be<V*-2){_.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-V,!0)+" ms");for(var Y=be,Z=0;Z<U;Z++)E[Z].dts=Y=Math.max(Y,E[Z].pts-V),E[Z].pts=Math.max(Y,E[Z].pts)}else{_.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(be,!0)+" ms to overcome this issue");for(var le=0;le<U;le++)E[le].dts=E[le].dts+be}G=E[0].dts}if(i){var xe=G-K,he=xe>V,Te=xe<-1;if(he||Te){he?_.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(xe,!0)+" ms ("+xe+"dts) hole between fragments detected, filling it"):_.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-xe,!0)+" ms ("+xe+"dts) overlapping between fragments detected"),G=K;var De=E[0].pts-xe;E[0].dts=G,E[0].pts=De,_.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(De,!0)+"/"+Object(y.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(xe,!0)+" ms")}}o&&(G=Math.max(0,G));for(var Pe=0,Be=0,Me=0;Me<U;Me++){for(var ke=E[Me],Ve=ke.units,Se=Ve.length,Re=0,_e=0;_e<Se;_e++)Re+=Ve[_e].data.length;Be+=Re,Pe+=Se,ke.length=Re,ke.dts=Math.max(ke.dts,G),ke.pts=Math.max(ke.pts,ke.dts,0),ue=Math.min(ke.pts,ue),de=Math.max(ke.pts,de)}ee=E[U-1].dts;var Ne=Be+4*Pe+8,Fe;try{Fe=new Uint8Array(Ne)}catch(yt){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ne,reason:"fail allocating video mdat "+Ne});return}var Ue=new DataView(Fe.buffer);Ue.setUint32(0,Ne),Fe.set(P.default.types.mdat,4);for(var Ce=0;Ce<U;Ce++){for(var He=E[Ce],je=He.units,we=0,Ie=0,ge=je.length;Ie<ge;Ie++){var ce=je[Ie],me=ce.data,q=ce.data.byteLength;Ue.setUint32(k,q),k+=4,Fe.set(me,k),k+=q,we+=4+q}if(Ce<U-1)M=E[Ce+1].dts-He.dts;else{var ne=this.config,se=He.dts-E[Ce>0?Ce-1:Ce].dts;if(ne.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(ne.maxBufferHole*m),ye=(x?ue+x*m:this.nextAudioPts)-He.pts;ye>pe?(M=ye-se,M<0&&(M=se),_.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+M/90+" ms for the last video frame.")):M=se}else M=se}var Le=Math.round(He.pts-He.dts);D.push(new p(He.key,M,we,Le))}if(D.length&&g&&g<70){var Ke=D[0].flags;Ke.dependsOn=2,Ke.isNonSync=0}console.assert(M!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=K=ee+M,this.isVideoContiguous=!0;var Je=P.default.moof(f.sequenceNumber++,G,C({},f,{samples:D})),et="video",Qe={data1:Je,data2:Fe,startPTS:ue/m,endPTS:(de+M)/m,startDTS:G/m,endDTS:K/m,type:et,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:f.dropped};return f.samples=[],f.dropped=0,console.assert(Fe.length,"MDAT length must not be zero"),Qe},v.remuxAudio=function(f,s,i,x,m){var E=f.inputTimeScale,D=f.samplerate?f.samplerate:E,U=E/D,j=f.isAAC?A:b,K=j*U,k=this._initPTS,M=!f.isAAC&&this.typeSupported.mpeg,G=[],ee=f.samples,ue=M?0:8,de=this.nextAudioPts||-1,be=s*E;if(this.isAudioContiguous=i=i||ee.length&&de>0&&(x&&Math.abs(be-de)<9e3||Math.abs(d(ee[0].pts-k,be)-de)<20*K),ee.forEach(function(me){me.pts=d(me.pts-k,be)}),!i||de<0){if(ee=ee.filter(function(me){return me.pts>=0}),!ee.length)return;m===0?de=0:x?de=Math.max(0,be):de=ee[0].pts}if(f.isAAC)for(var Ee=m!==void 0,ae=this.config.maxAudioFramesDrift,$=0,re=de;$<ee.length;$++){var J=ee[$],ie=J.pts,V=ie-re,Y=Math.abs(1e3*V/E);if(V<=-ae*K&&Ee)$===0&&(_.logger.warn("Audio frame @ "+(ie/E).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*V/E)+" ms."),this.nextAudioPts=de=re=ie);else if(V>=ae*K&&Y<R&&Ee){var Z=Math.round(V/K);re=ie-Z*K,re<0&&(Z--,re+=K),$===0&&(this.nextAudioPts=de=re),_.logger.warn("[mp4-remuxer]: Injecting "+Z+" audio frame @ "+(re/E).toFixed(3)+"s due to "+Math.round(1e3*V/E)+" ms gap.");for(var le=0;le<Z;le++){var xe=Math.max(re,0),he=I.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);he||(_.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),he=J.unit.subarray()),ee.splice($,0,{unit:he,pts:xe}),re+=K,$++}}J.pts=re,re+=K}for(var Te=null,De=null,Pe,Be=0,Me=ee.length;Me--;)Be+=ee[Me].unit.byteLength;for(var ke=0,Ve=ee.length;ke<Ve;ke++){var Se=ee[ke],Re=Se.unit,_e=Se.pts;if(De!==null){var Ne=G[ke-1];Ne.duration=Math.round((_e-De)/U)}else if(i&&f.isAAC&&(_e=de),Te=_e,Be>0){Be+=ue;try{Pe=new Uint8Array(Be)}catch(me){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Be,reason:"fail allocating audio mdat "+Be});return}if(!M){var Fe=new DataView(Pe.buffer);Fe.setUint32(0,Be),Pe.set(P.default.types.mdat,4)}}else return;Pe.set(Re,ue);var Ue=Re.byteLength;ue+=Ue,G.push(new p(!0,j,Ue,0)),De=_e}var Ce=G.length;if(!Ce)return;var He=G[G.length-1];this.nextAudioPts=de=De+U*He.duration;var je=M?new Uint8Array(0):P.default.moof(f.sequenceNumber++,Te/U,C({},f,{samples:G}));f.samples=[];var we=Te/E,Ie=de/E,ge="audio",ce={data1:je,data2:Pe,startPTS:we,endPTS:Ie,startDTS:we,endDTS:Ie,type:ge,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(Pe.length,"MDAT length must not be zero"),ce},v.remuxEmptyAudio=function(f,s,i,x){var m=f.inputTimeScale,E=f.samplerate?f.samplerate:m,D=m/E,U=this.nextAudioPts,j=(U!==null?U:x.startDTS*m)+this._initDTS,K=x.endDTS*m+this._initDTS,k=D*A,M=Math.ceil((K-j)/k),G=I.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);if(_.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){_.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],ue=0;ue<M;ue++){var de=j+ue*k;ee.push({unit:G,pts:de,dts:de})}return f.samples=ee,this.remuxAudio(f,s,i,!1)},v.remuxID3=function(f,s){var i=f.samples.length;if(!i)return;for(var x=f.inputTimeScale,m=this._initPTS,E=this._initDTS,D=0;D<i;D++){var U=f.samples[D];U.pts=d(U.pts-m,s*x)/x,U.dts=d(U.dts-E,s*x)/x}var j=f.samples;return f.samples=[],{samples:j}},v.remuxText=function(f,s){var i=f.samples.length;if(!i)return;for(var x=f.inputTimeScale,m=this._initPTS,E=0;E<i;E++){var D=f.samples[E];D.pts=d(D.pts-m,s*x)/x}f.samples.sort(function(j,K){return j.pts-K.pts});var U=f.samples;return f.samples=[],{samples:U}},S}();function d(S,v){var l;if(v===null)return S;for(v<S?l=-8589934592:l=8589934592;Math.abs(S-v)>4294967296;)S+=l;return S}function T(S){for(var v=0;v<S.length;v++)if(S[v].key)return v;return-1}var p=function(v,l,f,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=l,this.size=f,this.cts=s,this.flags=new h(v)},h=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/polyfills/number.ts"),I=L("./src/utils/mp4-tools.ts"),P=L("./src/loader/fragment.ts"),B=L("./src/utils/logger.ts"),N=function(){function y(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var C=y.prototype;return C.destroy=function(){},C.resetTimeStamp=function(A){this.initPTS=A,this.lastEndDTS=null},C.resetNextTimestamp=function(){this.lastEndDTS=null},C.resetInitSegment=function(A,b,g){this.audioCodec=b,this.videoCodec=g,this.generateInitSegment(A),this.emitInitSegment=!0},C.generateInitSegment=function(A){var b=this.audioCodec,g=this.videoCodec;if(!A||!A.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(I.parseInitSegment)(A);b||(b=O(c.audio,P.ElementaryStreamTypes.AUDIO)),g||(g=O(c.video,P.ElementaryStreamTypes.VIDEO));var o={};c.audio&&c.video?o.audiovideo={container:"video/mp4",codec:b+","+g,initSegment:A,id:"main"}:c.audio?o.audio={container:"audio/mp4",codec:b,initSegment:A,id:"audio"}:c.video?o.video={container:"video/mp4",codec:g,initSegment:A,id:"main"}:B.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},C.remux=function(A,b,g,c,o){var u=this.initPTS,d=this.lastEndDTS,T={audio:void 0,video:void 0,text:c,id3:g,initSegment:void 0};Object(z.isFiniteNumber)(d)||(d=this.lastEndDTS=o||0);var p=b.samples;if(!p||!p.length)return T;var h={initPTS:void 0,timescale:1},S=this.initData;if((!S||!S.length)&&(this.generateInitSegment(p),S=this.initData),!S||!S.length)return B.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(u)||(this.initPTS=h.initPTS=u=_(S,p,d));var v=Object(I.getDuration)(p,S),l=d,f=v+l;Object(I.offsetStartDTS)(S,p,u),v>0?this.lastEndDTS=f:(B.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!S.audio,i=!!S.video,x="";s&&(x+="audio"),i&&(x+="video");var m={data1:p,startPTS:l,startDTS:l,endPTS:f,endDTS:f,type:x,hasAudio:s,hasVideo:i,nb:1,dropped:0};return T.audio=m.type==="audio"?m:void 0,T.video=m.type!=="audio"?m:void 0,T.text=c,T.id3=g,T.initSegment=h,T},y}(),_=function(C,R,A){return Object(I.getStartDTS)(C,R)-A};function O(y,C){var R=y==null?void 0:y.codec;return R&&R.length>4?R:R==="hvc1"?"hvc1.1.c.L120.90":R==="av01"?"av01.0.04M.08":R==="avc1"||C===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=N},"./src/task-loop.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return z});var z=function(){function I(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=I.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(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!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(){},I}()},"./src/types/cmcd.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"CMCDVersion",function(){return z}),L.d(H,"CMCDObjectType",function(){return I}),L.d(H,"CMCDStreamingFormat",function(){return P}),L.d(H,"CMCDStreamType",function(){return B});var z=1,I;(function(N){N.MANIFEST="m",N.AUDIO="a",N.VIDEO="v",N.MUXED="av",N.INIT="i",N.CAPTION="c",N.TIMED_TEXT="tt",N.KEY="k",N.OTHER="o"})(I||(I={}));var P;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(P||(P={}));var B;(function(N){N.VOD="v",N.LIVE="l"})(B||(B={}))},"./src/types/level.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"HlsSkip",function(){return P}),L.d(H,"getSkipValue",function(){return B}),L.d(H,"HlsUrlParameters",function(){return N}),L.d(H,"Level",function(){return _});function z(O,y){for(var C=0;C<y.length;C++){var R=y[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,R.key,R)}}function I(O,y,C){return y&&z(O.prototype,y),C&&z(O,C),O}var P;(function(O){O.No="",O.Yes="YES",O.v2="v2"})(P||(P={}));function B(O,y){var C=O.canSkipUntil,R=O.canSkipDateRanges,A=O.endSN,b=y!==void 0?y-A:0;return C&&b<C?R?P.v2:P.Yes:P.No}var N=function(){function O(C,R,A){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=C,this.part=R,this.skip=A}var y=O.prototype;return y.addDirectives=function(R){var A=new self.URL(R);return this.msn!==void 0&&A.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&A.searchParams.set("_HLS_part",this.part.toString()),this.skip&&A.searchParams.set("_HLS_skip",this.skip),A.toString()},O}(),_=function(){function O(y){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(C){return C}).join(",").replace(/\.[^.,]+/g,"")}return I(O,[{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(C){var R=C%this.url.length;this._urlId!==R&&(this.details=void 0,this._urlId=R)}}]),O}()},"./src/types/loader.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"PlaylistContextType",function(){return z}),L.d(H,"PlaylistLevelType",function(){return I});var z;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var I;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(I||(I={}))},"./src/types/transmuxer.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"ChunkMetadata",function(){return z});var z=function(B,N,_,O,y,C){O===void 0&&(O=0),y===void 0&&(y=-1),C===void 0&&(C=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=I(),this.buffering={audio:I(),video:I(),audiovideo:I()},this.level=B,this.sn=N,this.id=_,this.size=O,this.part=y,this.partial=C};function I(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"AttrList",function(){return P});var z=/^(\d+)x(\d+)$/,I=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function B(_){typeof _=="string"&&(_=B.parseAttrList(_));for(var O in _)_.hasOwnProperty(O)&&(this[O]=_[O])}var N=B.prototype;return N.decimalInteger=function(O){var y=parseInt(this[O],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},N.hexadecimalInteger=function(O){if(this[O]){var y=(this[O]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var C=new Uint8Array(y.length/2),R=0;R<y.length/2;R++)C[R]=parseInt(y.slice(R*2,R*2+2),16);return C}else return null},N.hexadecimalIntegerAsNumber=function(O){var y=parseInt(this[O],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},N.decimalFloatingPoint=function(O){return parseFloat(this[O])},N.optionalFloat=function(O,y){var C=this[O];return C?parseFloat(C):y},N.enumeratedString=function(O){return this[O]},N.bool=function(O){return this[O]==="YES"},N.decimalResolution=function(O){var y=z.exec(this[O]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},B.parseAttrList=function(O){var y,C={},R='"';for(I.lastIndex=0;(y=I.exec(O))!==null;){var A=y[2];A.indexOf(R)===0&&A.lastIndexOf(R)===A.length-1&&(A=A.slice(1,-1)),C[y[1]]=A}return C},B}()},"./src/utils/binary-search.ts":function(oe,H,L){"use strict";L.r(H);var z={search:function(P,B){for(var N=0,_=P.length-1,O=null,y=null;N<=_;){O=(N+_)/2|0,y=P[O];var C=B(y);if(C>0)N=O+1;else if(C<0)_=O-1;else return y}return null}};H.default=z},"./src/utils/buffer-helper.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"BufferHelper",function(){return P});var z=L("./src/utils/logger.ts"),I={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function B(){}return B.isBuffered=function(_,O){try{if(_){for(var y=B.getBuffered(_),C=0;C<y.length;C++)if(O>=y.start(C)&&O<=y.end(C))return!0}}catch(R){}return!1},B.bufferInfo=function(_,O,y){try{if(_){var C=B.getBuffered(_),R=[],A;for(A=0;A<C.length;A++)R.push({start:C.start(A),end:C.end(A)});return this.bufferedInfo(R,O,y)}}catch(b){}return{len:0,start:O,end:O,nextStart:void 0}},B.bufferedInfo=function(_,O,y){O=Math.max(0,O),_.sort(function(h,S){var v=h.start-S.start;return v||S.end-h.end});var C=[];if(y)for(var R=0;R<_.length;R++){var A=C.length;if(A){var b=C[A-1].end;_[R].start-b<y?_[R].end>b&&(C[A-1].end=_[R].end):C.push(_[R])}else C.push(_[R])}else C=_;for(var g=0,c,o=O,u=O,d=0;d<C.length;d++){var T=C[d].start,p=C[d].end;if(O+y>=T&&O<p)o=T,u=p,g=u-O;else if(O+y<T){c=T;break}}return{len:g,start:o||0,end:u||0,nextStart:c}},B.getBuffered=function(_){try{return _.buffered}catch(O){return z.logger.log("failed to get media.buffered",O),I}},B}()},"./src/utils/cea-608-parser.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"Row",function(){return u}),L.d(H,"CaptionScreen",function(){return d});var z=L("./src/utils/logger.ts"),I={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},P=function(f){var s=f;return I.hasOwnProperty(f)&&(s=I[f]),String.fromCharCode(s)},B=15,N=100,_={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},O={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},C={25:2,26:4,29:6,30:8,31:10,27:13,28:15},R=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],A;(function(l){l[l.ERROR=0]="ERROR",l[l.TEXT=1]="TEXT",l[l.WARNING=2]="WARNING",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l[l.DATA=3]="DATA"})(A||(A={}));var b=function(){function l(){this.time=null,this.verboseLevel=A.ERROR}var f=l.prototype;return f.log=function(i,x){this.verboseLevel>=i&&z.logger.log(this.time+" ["+i+"] "+x)},l}(),g=function(f){for(var s=[],i=0;i<f.length;i++)s.push(f[i].toString(16));return s},c=function(){function l(s,i,x,m,E){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=i||!1,this.italics=x||!1,this.background=m||"black",this.flash=E||!1}var f=l.prototype;return f.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},f.setStyles=function(i){for(var x=["foreground","underline","italics","background","flash"],m=0;m<x.length;m++){var E=x[m];i.hasOwnProperty(E)&&(this[E]=i[E])}},f.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},f.equals=function(i){return this.foreground===i.foreground&&this.underline===i.underline&&this.italics===i.italics&&this.background===i.background&&this.flash===i.flash},f.copy=function(i){this.foreground=i.foreground,this.underline=i.underline,this.italics=i.italics,this.background=i.background,this.flash=i.flash},f.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},l}(),o=function(){function l(s,i,x,m,E,D){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new c(i,x,m,E,D)}var f=l.prototype;return f.reset=function(){this.uchar=" ",this.penState.reset()},f.setChar=function(i,x){this.uchar=i,this.penState.copy(x)},f.setPenState=function(i){this.penState.copy(i)},f.equals=function(i){return this.uchar===i.uchar&&this.penState.equals(i.penState)},f.copy=function(i){this.uchar=i.uchar,this.penState.copy(i.penState)},f.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},l}(),u=function(){function l(s){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var i=0;i<N;i++)this.chars.push(new o);this.logger=s,this.pos=0,this.currPenState=new c}var f=l.prototype;return f.equals=function(i){for(var x=!0,m=0;m<N;m++)if(!this.chars[m].equals(i.chars[m])){x=!1;break}return x},f.copy=function(i){for(var x=0;x<N;x++)this.chars[x].copy(i.chars[x])},f.isEmpty=function(){for(var i=!0,x=0;x<N;x++)if(!this.chars[x].isEmpty()){i=!1;break}return i},f.setCursor=function(i){this.pos!==i&&(this.pos=i),this.pos<0?(this.logger.log(A.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>N&&(this.logger.log(A.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},f.moveCursor=function(i){var x=this.pos+i;if(i>1)for(var m=this.pos+1;m<x+1;m++)this.chars[m].setPenState(this.currPenState);this.setCursor(x)},f.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},f.insertChar=function(i){i>=144&&this.backSpace();var x=P(i);if(this.pos>=N){this.logger.log(A.ERROR,"Cannot insert "+i.toString(16)+" ("+x+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(x,this.currPenState),this.moveCursor(1)},f.clearFromPos=function(i){var x;for(x=i;x<N;x++)this.chars[x].reset()},f.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},f.clearToEndOfRow=function(){this.clearFromPos(this.pos)},f.getTextString=function(){for(var i=[],x=!0,m=0;m<N;m++){var E=this.chars[m].uchar;E!==" "&&(x=!1),i.push(E)}return x?"":i.join("")},f.setPenStyles=function(i){this.currPenState.setStyles(i);var x=this.chars[this.pos];x.setPenState(this.currPenState)},l}(),d=function(){function l(s){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var i=0;i<B;i++)this.rows.push(new u(s));this.logger=s,this.currRow=B-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var f=l.prototype;return f.reset=function(){for(var i=0;i<B;i++)this.rows[i].clear();this.currRow=B-1},f.equals=function(i){for(var x=!0,m=0;m<B;m++)if(!this.rows[m].equals(i.rows[m])){x=!1;break}return x},f.copy=function(i){for(var x=0;x<B;x++)this.rows[x].copy(i.rows[x])},f.isEmpty=function(){for(var i=!0,x=0;x<B;x++)if(!this.rows[x].isEmpty()){i=!1;break}return i},f.backSpace=function(){var i=this.rows[this.currRow];i.backSpace()},f.clearToEndOfRow=function(){var i=this.rows[this.currRow];i.clearToEndOfRow()},f.insertChar=function(i){var x=this.rows[this.currRow];x.insertChar(i)},f.setPen=function(i){var x=this.rows[this.currRow];x.setPenStyles(i)},f.moveCursor=function(i){var x=this.rows[this.currRow];x.moveCursor(i)},f.setCursor=function(i){this.logger.log(A.INFO,"setCursor: "+i);var x=this.rows[this.currRow];x.setCursor(i)},f.setPAC=function(i){this.logger.log(A.INFO,"pacData = "+JSON.stringify(i));var x=i.row-1;if(this.nrRollUpRows&&x<this.nrRollUpRows-1&&(x=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==x){for(var m=0;m<B;m++)this.rows[m].clear();var E=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var U=D.rows[E].cueStartTime,j=this.logger.time;if(U&&j!==null&&U<j)for(var K=0;K<this.nrRollUpRows;K++)this.rows[x-this.nrRollUpRows+K+1].copy(D.rows[E+K])}}this.currRow=x;var k=this.rows[this.currRow];if(i.indent!==null){var M=i.indent,G=Math.max(M-1,0);k.setCursor(i.indent),i.color=k.chars[G].penState.foreground}var ee={foreground:i.color,underline:i.underline,italics:i.italics,background:"black",flash:!1};this.setPen(ee)},f.setBkgData=function(i){this.logger.log(A.INFO,"bkgData = "+JSON.stringify(i)),this.backSpace(),this.setPen(i),this.insertChar(32)},f.setRollUpRows=function(i){this.nrRollUpRows=i},f.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(A.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(A.TEXT,this.getDisplayText());var i=this.currRow+1-this.nrRollUpRows,x=this.rows.splice(i,1)[0];x.clear(),this.rows.splice(this.currRow,0,x),this.logger.log(A.INFO,"Rolling up")},f.getDisplayText=function(i){i=i||!1;for(var x=[],m="",E=-1,D=0;D<B;D++){var U=this.rows[D].getTextString();U&&(E=D+1,i?x.push("Row "+E+": '"+U+"'"):x.push(U.trim()))}return x.length>0&&(i?m="["+x.join(" | ")+"]":m=x.join(`
|
|
`)),m},f.getTextAndFormat=function(){return this.rows},l}(),T=function(){function l(s,i,x){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=s,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new d(x),this.nonDisplayedMemory=new d(x),this.lastOutputScreen=new d(x),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=x}var f=l.prototype;return f.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},f.getHandler=function(){return this.outputFilter},f.setHandler=function(i){this.outputFilter=i},f.setPAC=function(i){this.writeScreen.setPAC(i)},f.setBkgData=function(i){this.writeScreen.setBkgData(i)},f.setMode=function(i){if(i===this.mode)return;this.mode=i,this.logger.log(A.INFO,"MODE="+i),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=i},f.insertChars=function(i){for(var x=0;x<i.length;x++)this.writeScreen.insertChar(i[x]);var m=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(A.INFO,m+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(A.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},f.ccRCL=function(){this.logger.log(A.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},f.ccBS=function(){if(this.logger.log(A.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},f.ccAOF=function(){},f.ccAON=function(){},f.ccDER=function(){this.logger.log(A.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},f.ccRU=function(i){this.logger.log(A.INFO,"RU("+i+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(i)},f.ccFON=function(){this.logger.log(A.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},f.ccRDC=function(){this.logger.log(A.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},f.ccTR=function(){this.logger.log(A.INFO,"TR"),this.setMode("MODE_TEXT")},f.ccRTD=function(){this.logger.log(A.INFO,"RTD"),this.setMode("MODE_TEXT")},f.ccEDM=function(){this.logger.log(A.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},f.ccCR=function(){this.logger.log(A.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},f.ccENM=function(){this.logger.log(A.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},f.ccEOC=function(){if(this.logger.log(A.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var i=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=i,this.writeScreen=this.nonDisplayedMemory,this.logger.log(A.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},f.ccTO=function(i){this.logger.log(A.INFO,"TO("+i+") - Tab Offset"),this.writeScreen.moveCursor(i)},f.ccMIDROW=function(i){var x={flash:!1};if(x.underline=i%2===1,x.italics=i>=46,x.italics)x.foreground="white";else{var m=Math.floor(i/2)-16,E=["white","green","blue","cyan","red","yellow","magenta"];x.foreground=E[m]}this.logger.log(A.INFO,"MIDROW: "+JSON.stringify(x)),this.writeScreen.setPen(x)},f.outputDataUpdate=function(i){i===void 0&&(i=!1);var x=this.logger.time;if(x===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=x:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,x,this.lastOutputScreen),i&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:x),this.lastOutputScreen.copy(this.displayedMemory))},f.cueSplitAtTime=function(i){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,i,this.displayedMemory),this.cueStartTime=i))},l}(),p=function(){function l(s,i,x){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var m=new b;this.channels=[null,new T(s,i,m),new T(s+1,x,m)],this.cmdHistory=v(),this.logger=m}var f=l.prototype;return f.getHandler=function(i){return this.channels[i].getHandler()},f.setHandler=function(i,x){this.channels[i].setHandler(x)},f.addData=function(i,x){var m,E,D,U=!1;this.logger.time=i;for(var j=0;j<x.length;j+=2){if(E=x[j]&127,D=x[j+1]&127,E===0&&D===0)continue;if(this.logger.log(A.DATA,"["+g([x[j],x[j+1]])+"] -> ("+g([E,D])+")"),m=this.parseCmd(E,D),m||(m=this.parseMidrow(E,D)),m||(m=this.parsePAC(E,D)),m||(m=this.parseBackgroundAttributes(E,D)),!m&&(U=this.parseChars(E,D),U)){var K=this.currentChannel;if(K&&K>0){var k=this.channels[K];k.insertChars(U)}else this.logger.log(A.WARNING,"No channel found yet. TEXT-MODE?")}!m&&!U&&this.logger.log(A.WARNING,"Couldn't parse cleaned data "+g([E,D])+" orig: "+g([x[j],x[j+1]]))}},f.parseCmd=function(i,x){var m=this.cmdHistory,E=(i===20||i===28||i===21||i===29)&&x>=32&&x<=47,D=(i===23||i===31)&&x>=33&&x<=35;if(!(E||D))return!1;if(S(i,x,m))return h(null,null,m),this.logger.log(A.DEBUG,"Repeated command ("+g([i,x])+") is dropped"),!0;var U=i===20||i===21||i===23?1:2,j=this.channels[U];return i===20||i===21||i===28||i===29?x===32?j.ccRCL():x===33?j.ccBS():x===34?j.ccAOF():x===35?j.ccAON():x===36?j.ccDER():x===37?j.ccRU(2):x===38?j.ccRU(3):x===39?j.ccRU(4):x===40?j.ccFON():x===41?j.ccRDC():x===42?j.ccTR():x===43?j.ccRTD():x===44?j.ccEDM():x===45?j.ccCR():x===46?j.ccENM():x===47&&j.ccEOC():j.ccTO(x-32),h(i,x,m),this.currentChannel=U,!0},f.parseMidrow=function(i,x){var m=0;if((i===17||i===25)&&x>=32&&x<=47){if(i===17?m=1:m=2,m!==this.currentChannel)return this.logger.log(A.ERROR,"Mismatch channel in midrow parsing"),!1;var E=this.channels[m];return E?(E.ccMIDROW(x),this.logger.log(A.DEBUG,"MIDROW ("+g([i,x])+")"),!0):!1}return!1},f.parsePAC=function(i,x){var m,E=this.cmdHistory,D=(i>=17&&i<=23||i>=25&&i<=31)&&x>=64&&x<=127,U=(i===16||i===24)&&x>=64&&x<=95;if(!(D||U))return!1;if(S(i,x,E))return h(null,null,E),!0;var j=i<=23?1:2;x>=64&&x<=95?m=j===1?_[i]:y[i]:m=j===1?O[i]:C[i];var K=this.channels[j];return K?(K.setPAC(this.interpretPAC(m,x)),h(i,x,E),this.currentChannel=j,!0):!1},f.interpretPAC=function(i,x){var m,E={color:null,italics:!1,indent:null,underline:!1,row:i};return x>95?m=x-96:m=x-64,E.underline=(m&1)===1,m<=13?E.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(m/2)]:m<=15?(E.italics=!0,E.color="white"):E.indent=Math.floor((m-16)/2)*4,E},f.parseChars=function(i,x){var m,E=null,D=null;if(i>=25?(m=2,D=i-8):(m=1,D=i),D>=17&&D<=19){var U;D===17?U=x+80:D===18?U=x+112:U=x+144,this.logger.log(A.INFO,"Special char '"+P(U)+"' in channel "+m),E=[U]}else i>=32&&i<=127&&(E=x===0?[i]:[i,x]);if(E){var j=g(E);this.logger.log(A.DEBUG,"Char codes = "+j.join(",")),h(i,x,this.cmdHistory)}return E},f.parseBackgroundAttributes=function(i,x){var m=(i===16||i===24)&&x>=32&&x<=47,E=(i===23||i===31)&&x>=45&&x<=47;if(!(m||E))return!1;var D,U={};i===16||i===24?(D=Math.floor((x-32)/2),U.background=R[D],x%2===1&&(U.background=U.background+"_semi")):x===45?U.background="transparent":(U.foreground="black",x===47&&(U.underline=!0));var j=i<=23?1:2,K=this.channels[j];return K.setBkgData(U),h(i,x,this.cmdHistory),!0},f.reset=function(){for(var i=0;i<Object.keys(this.channels).length;i++){var x=this.channels[i];x&&x.reset()}this.cmdHistory=v()},f.cueSplitAtTime=function(i){for(var x=0;x<this.channels.length;x++){var m=this.channels[x];m&&m.cueSplitAtTime(i)}},l}();function h(l,f,s){s.a=l,s.b=f}function S(l,f,s){return s.a===l&&s.b===f}function v(){return{a:null,b:null}}H.default=p},"./src/utils/codecs.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"isCodecType",function(){return I}),L.d(H,"isCodecSupportedInMp4",function(){return P});var z={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function I(B,N){var _=z[N];return!!_&&_[B.slice(0,4)]===!0}function P(B,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+B+'"')}},"./src/utils/cues.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/utils/vttparser.ts"),I=L("./src/utils/webvtt-parser.ts"),P=L("./src/utils/texttrack-utils.ts"),B=/\s/,N={newCue:function(O,y,C,R){for(var A=[],b,g,c,o,u,d=self.VTTCue||self.TextTrackCue,T=0;T<R.rows.length;T++)if(b=R.rows[T],c=!0,o=0,u="",!b.isEmpty()){for(var p=0;p<b.chars.length;p++)B.test(b.chars[p].uchar)&&c?o++:(u+=b.chars[p].uchar,c=!1);b.cueStartTime=y,y===C&&(C+=1e-4),o>=16?o--:o++;var h=Object(z.fixLineBreaks)(u.trim()),S=Object(I.generateCueId)(y,C,h);(!O||!O.cues||!O.cues.getCueById(S))&&(g=new d(y,C,h),g.id=S,g.line=T+1,g.align="left",g.position=10+Math.min(80,Math.floor(o*8/32)*10),A.push(g))}return O&&A.length&&(A.sort(function(v,l){return v.line==="auto"||l.line==="auto"?0:v.line>8&&l.line>8?l.line-v.line:v.line-l.line}),A.forEach(function(v){return Object(P.addCueToTrack)(O,v)})),A}};H.default=N},"./src/utils/discontinuities.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"findFirstFragWithCC",function(){return B}),L.d(H,"shouldAlignOnDiscontinuities",function(){return N}),L.d(H,"findDiscontinuousReferenceFrag",function(){return _}),L.d(H,"adjustSlidingStart",function(){return y}),L.d(H,"alignStream",function(){return C}),L.d(H,"alignPDT",function(){return A}),L.d(H,"alignFragmentByPDTDelta",function(){return b}),L.d(H,"alignMediaPlaylistByPDT",function(){return g});var z=L("./src/polyfills/number.ts"),I=L("./src/utils/logger.ts"),P=L("./src/controller/level-helper.ts");function B(c,o){for(var u=null,d=0,T=c.length;d<T;d++){var p=c[d];if(p&&p.cc===o){u=p;break}}return u}function N(c,o,u){return!!(o.details&&(u.endCC>u.startCC||c&&c.cc<u.startCC))}function _(c,o){var u=c.fragments,d=o.fragments;if(!d.length||!u.length){I.logger.log("No fragments to align");return}var T=B(u,d[0].cc);if(!T||T&&!T.startPTS){I.logger.log("No frag in previous level to align on");return}return T}function O(c,o){if(c){var u=c.start+o;c.start=c.startPTS=u,c.endPTS=u+c.duration}}function y(c,o){for(var u=o.fragments,d=0,T=u.length;d<T;d++)O(u[d],c);o.fragmentHint&&O(o.fragmentHint,c),o.alignedSliding=!0}function C(c,o,u){if(!o)return;R(c,u,o),!u.alignedSliding&&o.details&&A(u,o.details),!u.alignedSliding&&o.details&&!u.skippedSegments&&Object(P.adjustSliding)(o.details,u)}function R(c,o,u){if(N(c,u,o)){var d=_(u.details,o);d&&Object(z.isFiniteNumber)(d.start)&&(I.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),y(d.start,o))}}function A(c,o){if(!o.fragments.length||!c.hasProgramDateTime||!o.hasProgramDateTime)return;var u=o.fragments[0].programDateTime,d=c.fragments[0].programDateTime,T=(d-u)/1e3+o.fragments[0].start;T&&Object(z.isFiniteNumber)(T)&&(I.logger.log("Adjusting PTS using programDateTime delta "+(d-u)+"ms, sliding:"+T.toFixed(3)+" "+c.url+" "),y(T,c))}function b(c,o){var u=c.programDateTime;if(!u)return;var d=(u-o)/1e3;c.start=c.startPTS=d,c.endPTS=d+c.duration}function g(c,o){if(!o.fragments.length||!c.hasProgramDateTime||!o.hasProgramDateTime)return;var u=o.fragments[0].programDateTime,d=o.fragments[0].start,T=u-d*1e3;c.fragments.forEach(function(p){b(p,T)}),c.fragmentHint&&b(c.fragmentHint,T),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/utils/ewma.ts"),I=function(){function P(N,_,O){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=O,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new z.default(N),this.fast_=new z.default(_)}var B=P.prototype;return B.update=function(_,O){var y=this.slow_,C=this.fast_;this.slow_.halfLife!==_&&(this.slow_=new z.default(_,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==O&&(this.fast_=new z.default(O,C.getEstimate(),C.getTotalWeight()))},B.sample=function(_,O){_=Math.max(_,this.minDelayMs_);var y=8*O,C=_/1e3,R=y/C;this.fast_.sample(C,R),this.slow_.sample(C,R)},B.canEstimate=function(){var _=this.fast_;return _&&_.getTotalWeight()>=this.minWeight_},B.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},B.destroy=function(){},P}();H.default=I},"./src/utils/ewma.ts":function(oe,H,L){"use strict";L.r(H);var z=function(){function I(B,N,_){N===void 0&&(N=0),_===void 0&&(_=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=B,this.alpha_=B?Math.exp(Math.log(.5)/B):0,this.estimate_=N,this.totalWeight_=_}var P=I.prototype;return P.sample=function(N,_){var O=Math.pow(this.alpha_,N);this.estimate_=_*(1-O)+O*this.estimate_,this.totalWeight_+=N},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},I}();H.default=z},"./src/utils/fetch-loader.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"fetchSupported",function(){return b});var z=L("./src/polyfills/number.ts"),I=L("./src/loader/load-stats.ts"),P=L("./src/demux/chunk-cache.ts");function B(d,T){d.prototype=Object.create(T.prototype),d.prototype.constructor=d,C(d,T)}function N(d){var T=typeof Map=="function"?new Map:void 0;return N=function(h){if(h===null||!y(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(h))return T.get(h);T.set(h,S)}function S(){return _(h,arguments,R(this).constructor)}return S.prototype=Object.create(h.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),C(S,h)},N(d)}function _(d,T,p){return O()?_=Reflect.construct:_=function(S,v,l){var f=[null];f.push.apply(f,v);var s=Function.bind.apply(S,f),i=new s;return l&&C(i,l.prototype),i},_.apply(null,arguments)}function O(){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(d){return!1}}function y(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function C(d,T){return C=Object.setPrototypeOf||function(h,S){return h.__proto__=S,h},C(d,T)}function R(d){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},R(d)}function A(){return A=Object.assign||function(d){for(var T=1;T<arguments.length;T++){var p=arguments[T];for(var h in p)Object.prototype.hasOwnProperty.call(p,h)&&(d[h]=p[h])}return d},A.apply(this,arguments)}function b(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var g=function(){function d(p){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=p.fetchSetup||o,this.controller=new self.AbortController,this.stats=new I.LoadStats}var T=d.prototype;return T.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},T.abortInternal=function(){var h=this.response;(!h||!h.ok)&&(this.stats.aborted=!0,this.controller.abort())},T.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},T.load=function(h,S,v){var l=this,f=this.stats;if(f.loading.start)throw new Error("Loader can only be used once.");f.loading.start=self.performance.now();var s=c(h,this.controller.signal),i=v.onProgress,x=h.responseType==="arraybuffer",m=x?"byteLength":"length";this.context=h,this.config=S,this.callbacks=v,this.request=this.fetchSetup(h,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){l.abortInternal(),v.onTimeout(f,h,l.response)},S.timeout),self.fetch(this.request).then(function(E){if(l.response=l.loader=E,!E.ok){var D=E.status,U=E.statusText;throw new u(U||"fetch, bad network response",D,E)}return f.loading.first=Math.max(self.performance.now(),f.loading.start),f.total=parseInt(E.headers.get("Content-Length")||"0"),i&&Object(z.isFiniteNumber)(S.highWaterMark)?l.loadProgressively(E,f,h,S.highWaterMark,i):x?E.arrayBuffer():E.text()}).then(function(E){var D=l.response;self.clearTimeout(l.requestTimeout),f.loading.end=Math.max(self.performance.now(),f.loading.first),f.loaded=f.total=E[m];var U={url:D.url,data:E};i&&!Object(z.isFiniteNumber)(S.highWaterMark)&&i(f,h,E,D),v.onSuccess(U,f,h,D)}).catch(function(E){if(self.clearTimeout(l.requestTimeout),f.aborted)return;var D=E.code||0;v.onError({code:D,text:E.message},h,E.details)})},T.getCacheAge=function(){var h=null;if(this.response){var S=this.response.headers.get("age");h=S?parseFloat(S):null}return h},T.loadProgressively=function(h,S,v,l,f){l===void 0&&(l=0);var s=new P.default,i=h.body.getReader(),x=function m(){return i.read().then(function(E){if(E.done)return s.dataLength&&f(S,v,s.flush(),h),Promise.resolve(new ArrayBuffer(0));var D=E.value,U=D.length;return S.loaded+=U,U<l||s.dataLength?(s.push(D),s.dataLength>=l&&f(S,v,s.flush(),h)):f(S,v,D,h),m()}).catch(function(){return Promise.reject()})};return x()},d}();function c(d,T){var p={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(A({},d.headers))};return d.rangeEnd&&p.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),p}function o(d,T){return new self.Request(d.url,T)}var u=function(d){B(T,d);function T(p,h,S){var v;return v=d.call(this,p)||this,v.code=void 0,v.details=void 0,v.code=h,v.details=S,v}return T}(N(Error));H.default=g},"./src/utils/imsc1-ttml-parser.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"IMSC1_CODEC",function(){return y}),L.d(H,"parseIMSC1",function(){return b});var z=L("./src/utils/mp4-tools.ts"),I=L("./src/utils/vttparser.ts"),P=L("./src/utils/vttcue.ts"),B=L("./src/demux/id3.ts"),N=L("./src/utils/timescale-conversion.ts"),_=L("./src/utils/webvtt-parser.ts");function O(){return O=Object.assign||function(l){for(var f=1;f<arguments.length;f++){var s=arguments[f];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(l[i]=s[i])}return l},O.apply(this,arguments)}var y="stpp.ttml.im1t",C=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,R=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,A={left:"start",center:"center",right:"end",start:"start",end:"end"};function b(l,f,s,i,x){var m=Object(z.findBox)(new Uint8Array(l),["mdat"]);if(m.length===0){x(new Error("Could not parse IMSC1 mdat"));return}var E=m[0],D=Object(B.utf8ArrayToStr)(new Uint8Array(l,E.start,E.end-E.start)),U=Object(N.toTimescaleFromScale)(f,1,s);try{i(g(D,U))}catch(j){x(j)}}function g(l,f){var s=new DOMParser,i=s.parseFromString(l,"text/xml"),x=i.getElementsByTagName("tt")[0];if(!x)throw new Error("Invalid ttml");var m={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},E=Object.keys(m).reduce(function(k,M){return k[M]=x.getAttribute("ttp:"+M)||m[M],k},{}),D=x.getAttribute("xml:space")!=="preserve",U=o(c(x,"styling","style")),j=o(c(x,"layout","region")),K=c(x,"body","[begin]");return[].map.call(K,function(k){var M=u(k,D);if(!M||!k.hasAttribute("begin"))return null;var G=h(k.getAttribute("begin"),E),ee=h(k.getAttribute("dur"),E),ue=h(k.getAttribute("end"),E);if(G===null)throw p(k);if(ue===null){if(ee===null)throw p(k);ue=G+ee}var de=new P.default(G-f,ue-f,M);de.id=Object(_.generateCueId)(de.startTime,de.endTime,de.text);var be=j[k.getAttribute("region")],Ee=U[k.getAttribute("style")];de.position=10,de.size=80;var ae=d(be,Ee),$=ae.textAlign;if($){var re=A[$];re&&(de.lineAlign=re),de.align=$}return O(de,ae),de}).filter(function(k){return k!==null})}function c(l,f,s){var i=l.getElementsByTagName(f)[0];return i?[].slice.call(i.querySelectorAll(s)):[]}function o(l){return l.reduce(function(f,s){var i=s.getAttribute("xml:id");return i&&(f[i]=s),f},{})}function u(l,f){return[].slice.call(l.childNodes).reduce(function(s,i,x){var m;return i.nodeName==="br"&&x?s+`
|
|
`:(m=i.childNodes)!==null&&m!==void 0&&m.length?u(i,f):f?s+i.textContent.trim().replace(/\s+/g," "):s+i.textContent},"")}function d(l,f){var s="http://www.w3.org/ns/ttml#styling",i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return i.reduce(function(x,m){var E=T(f,s,m)||T(l,s,m);return E&&(x[m]=E),x},{})}function T(l,f,s){return l.hasAttributeNS(f,s)?l.getAttributeNS(f,s):null}function p(l){return new Error("Could not parse ttml timestamp "+l)}function h(l,f){if(!l)return null;var s=Object(I.parseTimeStamp)(l);return s===null&&(C.test(l)?s=S(l,f):R.test(l)&&(s=v(l,f))),s}function S(l,f){var s=C.exec(l),i=(s[4]|0)+(s[5]|0)/f.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+i/f.frameRate}function v(l,f){var s=R.exec(l),i=Number(s[1]),x=s[2];switch(x){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/f.frameRate;case"t":return i/f.tickRate}return i}},"./src/utils/logger.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"enableLogs",function(){return _}),L.d(H,"logger",function(){return O});var z=function(){},I={trace:z,debug:z,log:z,warn:z,info:z,error:z},P=I;function B(y){var C=self.console[y];return C?C.bind(self.console,"["+y+"] >"):z}function N(y){for(var C=arguments.length,R=new Array(C>1?C-1:0),A=1;A<C;A++)R[A-1]=arguments[A];R.forEach(function(b){P[b]=y[b]?y[b].bind(y):B(b)})}function _(y){if(self.console&&y===!0||typeof y=="object"){N(y,"debug","log","info","warn","error");try{P.log()}catch(C){P=I}}else P=I}var O=P},"./src/utils/mediakeys-helper.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"KeySystems",function(){return z}),L.d(H,"requestMediaKeySystemAccess",function(){return I});var z;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})(z||(z={}));var I=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"bin2str",function(){return N}),L.d(H,"readUint16",function(){return _}),L.d(H,"readUint32",function(){return O}),L.d(H,"writeUint32",function(){return y}),L.d(H,"findBox",function(){return C}),L.d(H,"parseSegmentIndex",function(){return R}),L.d(H,"parseInitSegment",function(){return A}),L.d(H,"getStartDTS",function(){return b}),L.d(H,"getDuration",function(){return g}),L.d(H,"computeRawDurationFromSamples",function(){return c}),L.d(H,"offsetStartDTS",function(){return o}),L.d(H,"segmentValidRange",function(){return u}),L.d(H,"appendUint8Array",function(){return d});var z=L("./src/utils/typed-array.ts"),I=L("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,B=[].push;function N(T){return String.fromCharCode.apply(null,T)}function _(T,p){"data"in T&&(p+=T.start,T=T.data);var h=T[p]<<8|T[p+1];return h<0?65536+h:h}function O(T,p){"data"in T&&(p+=T.start,T=T.data);var h=T[p]<<24|T[p+1]<<16|T[p+2]<<8|T[p+3];return h<0?4294967296+h:h}function y(T,p,h){"data"in T&&(p+=T.start,T=T.data),T[p]=h>>24,T[p+1]=h>>16&255,T[p+2]=h>>8&255,T[p+3]=h&255}function C(T,p){var h=[];if(!p.length)return h;var S,v,l;"data"in T?(S=T.data,v=T.start,l=T.end):(S=T,v=0,l=S.byteLength);for(var f=v;f<l;){var s=O(S,f),i=N(S.subarray(f+4,f+8)),x=s>1?f+s:l;if(i===p[0])if(p.length===1)h.push({data:S,start:f+8,end:x});else{var m=C({data:S,start:f+8,end:x},p.slice(1));m.length&&B.apply(h,m)}f=x}return h}function R(T){var p=C(T,["moov"]),h=p[0],S=h?h.end:null,v=C(T,["sidx"]);if(!v||!v[0])return null;var l=[],f=v[0],s=f.data[0],i=s===0?8:16,x=O(f,i);i+=4;var m=0,E=0;s===0?i+=8:i+=16,i+=2;var D=f.end+E,U=_(f,i);i+=2;for(var j=0;j<U;j++){var K=i,k=O(f,K);K+=4;var M=k&2147483647,G=(k&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=O(f,K);K+=4,l.push({referenceSize:M,subsegmentDuration:ee,info:{duration:ee/x,start:D,end:D+M-1}}),D+=M,K+=4,i=K}return{earliestPresentationTime:m,timescale:x,version:s,referencesCount:U,references:l,moovEndOffset:S}}function A(T){for(var p=[],h=C(T,["moov","trak"]),S=0;S<h.length;S++){var v=h[S],l=C(v,["tkhd"])[0];if(l){var f=l.data[l.start],s=f===0?12:20,i=O(l,s),x=C(v,["mdia","mdhd"])[0];if(x){f=x.data[x.start],s=f===0?12:20;var m=O(x,s),E=C(v,["mdia","hdlr"])[0];if(E){var D=N(E.data.subarray(E.start+8,E.start+12)),U={soun:I.ElementaryStreamTypes.AUDIO,vide:I.ElementaryStreamTypes.VIDEO}[D];if(U){var j=C(v,["mdia","minf","stbl","stsd"])[0],K=void 0;j&&(K=N(j.data.subarray(j.start+12,j.start+16))),p[i]={timescale:m,type:U},p[U]={timescale:m,id:i,codec:K}}}}}}var k=C(T,["moov","mvex","trex"]);return k.forEach(function(M){var G=O(M,4),ee=p[G];ee&&(ee.default={duration:O(M,12),flags:O(M,20)})}),p}function b(T,p){return C(p,["moof","traf"]).reduce(function(h,S){var v=C(S,["tfdt"])[0],l=v.data[v.start],f=C(S,["tfhd"]).reduce(function(s,i){var x=O(i,4),m=T[x];if(m){var E=O(v,4);l===1&&(E*=Math.pow(2,32),E+=O(v,8));var D=m.timescale||9e4,U=E/D;if(isFinite(U)&&(s===null||U<s))return U}return s},null);return f!==null&&isFinite(f)&&(h===null||f<h)?f:h},null)||0}function g(T,p){for(var h=0,S=0,v=0,l=C(T,["moof","traf"]),f=0;f<l.length;f++){var s=l[f],i=C(s,["tfhd"])[0],x=O(i,4),m=p[x];if(!m)continue;var E=m.default,D=O(i,0)|(E==null?void 0:E.flags),U=E==null?void 0:E.duration;D&8&&(D&2?U=O(i,12):U=O(i,8));for(var j=m.timescale||9e4,K=C(s,["trun"]),k=0;k<K.length;k++){if(U){var M=O(K[k],4);h=U*M}else h=c(K[k]);m.type===I.ElementaryStreamTypes.VIDEO?S+=h/j:m.type===I.ElementaryStreamTypes.AUDIO&&(v+=h/j)}}if(S===0&&v===0){var G=R(T);if(G!=null&&G.references)return G.references.reduce(function(ee,ue){return ee+ue.info.duration||0},0)}return S||v}function c(T){var p=O(T,0),h=8;p&1&&(h+=4),p&4&&(h+=4);for(var S=0,v=O(T,4),l=0;l<v;l++){if(p&256){var f=O(T,h);S+=f,h+=4}p&512&&(h+=4),p&1024&&(h+=4),p&2048&&(h+=4)}return S}function o(T,p,h){C(p,["moof","traf"]).forEach(function(S){C(S,["tfhd"]).forEach(function(v){var l=O(v,4),f=T[l];if(!f)return;var s=f.timescale||9e4;C(S,["tfdt"]).forEach(function(i){var x=i.data[i.start],m=O(i,4);if(x===0)y(i,4,m-h*s);else{m*=Math.pow(2,32),m+=O(i,8),m-=h*s,m=Math.max(m,0);var E=Math.floor(m/(P+1)),D=Math.floor(m%(P+1));y(i,4,E),y(i,8,D)}})})})}function u(T){var p={valid:null,remainder:null},h=C(T,["moof"]);if(h){if(h.length<2)return p.remainder=T,p}else return p;var S=h[h.length-1];return p.valid=Object(z.sliceUint8)(T,0,S.start-8),p.remainder=Object(z.sliceUint8)(T,S.start-8),p}function d(T,p){var h=new Uint8Array(T.length+p.length);return h.set(T),h.set(p,T.length),h}},"./src/utils/output-filter.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"default",function(){return z});var z=function(){function I(B,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=B,this.trackName=N}var P=I.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(N,_,O){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=_,this.screen=O,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},I}()},"./src/utils/texttrack-utils.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"sendAddTrackEvent",function(){return I}),L.d(H,"addCueToTrack",function(){return P}),L.d(H,"clearCurrentCues",function(){return B}),L.d(H,"removeCuesInRange",function(){return N}),L.d(H,"getCuesInRange",function(){return O});var z=L("./src/utils/logger.ts");function I(y,C){var R;try{R=new Event("addtrack")}catch(A){R=document.createEvent("Event"),R.initEvent("addtrack",!1,!1)}R.track=y,C.dispatchEvent(R)}function P(y,C){var R=y.mode;if(R==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(C.id))try{if(y.addCue(C),!y.cues.getCueById(C.id))throw new Error("addCue is failed for: "+C)}catch(b){z.logger.debug("[texttrack-utils]: "+b);var A=new self.TextTrackCue(C.startTime,C.endTime,C.text);A.id=C.id,y.addCue(A)}R==="disabled"&&(y.mode=R)}function B(y){var C=y.mode;if(C==="disabled"&&(y.mode="hidden"),y.cues)for(var R=y.cues.length;R--;)y.removeCue(y.cues[R]);C==="disabled"&&(y.mode=C)}function N(y,C,R){var A=y.mode;if(A==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var b=O(y.cues,C,R),g=0;g<b.length;g++)y.removeCue(b[g]);A==="disabled"&&(y.mode=A)}function _(y,C){if(C<y[0].startTime)return 0;var R=y.length-1;if(C>y[R].endTime)return-1;for(var A=0,b=R;A<=b;){var g=Math.floor((b+A)/2);if(C<y[g].startTime)b=g-1;else if(C>y[g].startTime&&A<R)A=g+1;else return g}return y[A].startTime-C<C-y[b].startTime?A:b}function O(y,C,R){var A=[],b=_(y,C);if(b>-1)for(var g=b,c=y.length;g<c;g++){var o=y[g];if(o.startTime>=C&&o.endTime<=R)A.push(o);else if(o.startTime>R)return A}return A}},"./src/utils/time-ranges.ts":function(oe,H,L){"use strict";L.r(H);var z={toString:function(P){for(var B="",N=P.length,_=0;_<N;_++)B+="["+P.start(_).toFixed(3)+","+P.end(_).toFixed(3)+"]";return B}};H.default=z},"./src/utils/timescale-conversion.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"toTimescaleFromBase",function(){return I}),L.d(H,"toTimescaleFromScale",function(){return P}),L.d(H,"toMsFromMpegTsClock",function(){return B}),L.d(H,"toMpegTsClockFromTimescale",function(){return N});var z=9e4;function I(_,O,y,C){y===void 0&&(y=1),C===void 0&&(C=!1);var R=_*O*y;return C?Math.round(R):R}function P(_,O,y,C){return y===void 0&&(y=1),C===void 0&&(C=!1),I(_,O,1/y,C)}function B(_,O){return O===void 0&&(O=!1),I(_,1e3,1/z,O)}function N(_,O){return O===void 0&&(O=1),I(_,z,1/O)}},"./src/utils/typed-array.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"sliceUint8",function(){return z});function z(I,P,B){return Uint8Array.prototype.slice?I.slice(P,B):new Uint8Array(Array.prototype.slice.call(I,P,B))}},"./src/utils/vttcue.ts":function(oe,H,L){"use strict";L.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],I=["start","middle","end","left","right"];function P(y,C){if(typeof C!="string")return!1;if(!Array.isArray(y))return!1;var R=C.toLowerCase();return~y.indexOf(R)?R:!1}function B(y){return P(z,y)}function N(y){return P(I,y)}function _(y){for(var C=arguments.length,R=new Array(C>1?C-1:0),A=1;A<C;A++)R[A-1]=arguments[A];for(var b=1;b<arguments.length;b++){var g=arguments[b];for(var c in g)y[c]=g[c]}return y}function O(y,C,R){var A=this,b={enumerable:!0};A.hasBeenReset=!1;var g="",c=!1,o=y,u=C,d=R,T=null,p="",h=!0,S="auto",v="start",l=50,f="middle",s=50,i="middle";Object.defineProperty(A,"id",_({},b,{get:function(){return g},set:function(m){g=""+m}})),Object.defineProperty(A,"pauseOnExit",_({},b,{get:function(){return c},set:function(m){c=!!m}})),Object.defineProperty(A,"startTime",_({},b,{get:function(){return o},set:function(m){if(typeof m!="number")throw new TypeError("Start time must be set to a number.");o=m,this.hasBeenReset=!0}})),Object.defineProperty(A,"endTime",_({},b,{get:function(){return u},set:function(m){if(typeof m!="number")throw new TypeError("End time must be set to a number.");u=m,this.hasBeenReset=!0}})),Object.defineProperty(A,"text",_({},b,{get:function(){return d},set:function(m){d=""+m,this.hasBeenReset=!0}})),Object.defineProperty(A,"region",_({},b,{get:function(){return T},set:function(m){T=m,this.hasBeenReset=!0}})),Object.defineProperty(A,"vertical",_({},b,{get:function(){return p},set:function(m){var E=B(m);if(E===!1)throw new SyntaxError("An invalid or illegal string was specified.");p=E,this.hasBeenReset=!0}})),Object.defineProperty(A,"snapToLines",_({},b,{get:function(){return h},set:function(m){h=!!m,this.hasBeenReset=!0}})),Object.defineProperty(A,"line",_({},b,{get:function(){return S},set:function(m){if(typeof m!="number"&&m!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");S=m,this.hasBeenReset=!0}})),Object.defineProperty(A,"lineAlign",_({},b,{get:function(){return v},set:function(m){var E=N(m);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");v=E,this.hasBeenReset=!0}})),Object.defineProperty(A,"position",_({},b,{get:function(){return l},set:function(m){if(m<0||m>100)throw new Error("Position must be between 0 and 100.");l=m,this.hasBeenReset=!0}})),Object.defineProperty(A,"positionAlign",_({},b,{get:function(){return f},set:function(m){var E=N(m);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");f=E,this.hasBeenReset=!0}})),Object.defineProperty(A,"size",_({},b,{get:function(){return s},set:function(m){if(m<0||m>100)throw new Error("Size must be between 0 and 100.");s=m,this.hasBeenReset=!0}})),Object.defineProperty(A,"align",_({},b,{get:function(){return i},set:function(m){var E=N(m);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");i=E,this.hasBeenReset=!0}})),A.displayState=void 0}return O.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},O}()},"./src/utils/vttparser.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"parseTimeStamp",function(){return P}),L.d(H,"fixLineBreaks",function(){return C}),L.d(H,"VTTParser",function(){return R});var z=L("./src/utils/vttcue.ts"),I=function(){function A(){}var b=A.prototype;return b.decode=function(c,o){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},A}();function P(A){function b(c,o,u,d){return(c|0)*3600+(o|0)*60+(u|0)+parseFloat(d||0)}var g=A.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return g?parseFloat(g[2])>59?b(g[2],g[3],0,g[4]):b(g[1],g[2],g[3],g[4]):null}var B=function(){function A(){this.values=Object.create(null)}var b=A.prototype;return b.set=function(c,o){!this.get(c)&&o!==""&&(this.values[c]=o)},b.get=function(c,o,u){return u?this.has(c)?this.values[c]:o[u]:this.has(c)?this.values[c]:o},b.has=function(c){return c in this.values},b.alt=function(c,o,u){for(var d=0;d<u.length;++d)if(o===u[d]){this.set(c,o);break}},b.integer=function(c,o){/^-?\d+$/.test(o)&&this.set(c,parseInt(o,10))},b.percent=function(c,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var u=parseFloat(o);if(u>=0&&u<=100)return this.set(c,u),!0}return!1},A}();function N(A,b,g,c){var o=c?A.split(c):[A];for(var u in o){if(typeof o[u]!="string")continue;var d=o[u].split(g);if(d.length!==2)continue;var T=d[0],p=d[1];b(T,p)}}var _=new z.default(0,0,""),O=_.align==="middle"?"middle":"center";function y(A,b,g){var c=A;function o(){var T=P(A);if(T===null)throw new Error("Malformed timestamp: "+c);return A=A.replace(/^[^\sa-zA-Z-]+/,""),T}function u(T,p){var h=new B;N(T,function(l,f){var s;switch(l){case"region":for(var i=g.length-1;i>=0;i--)if(g[i].id===f){h.set(l,g[i].region);break}break;case"vertical":h.alt(l,f,["rl","lr"]);break;case"line":s=f.split(","),h.integer(l,s[0]),h.percent(l,s[0])&&h.set("snapToLines",!1),h.alt(l,s[0],["auto"]),s.length===2&&h.alt("lineAlign",s[1],["start",O,"end"]);break;case"position":s=f.split(","),h.percent(l,s[0]),s.length===2&&h.alt("positionAlign",s[1],["start",O,"end","line-left","line-right","auto"]);break;case"size":h.percent(l,f);break;case"align":h.alt(l,f,["start",O,"end","left","right"]);break}},/:/,/\s/),p.region=h.get("region",null),p.vertical=h.get("vertical","");var S=h.get("line","auto");S==="auto"&&_.line===-1&&(S=-1),p.line=S,p.lineAlign=h.get("lineAlign","start"),p.snapToLines=h.get("snapToLines",!0),p.size=h.get("size",100),p.align=h.get("align",O);var v=h.get("position","auto");v==="auto"&&_.position===50&&(v=p.align==="start"||p.align==="left"?0:p.align==="end"||p.align==="right"?100:50),p.position=v}function d(){A=A.replace(/^\s+/,"")}if(d(),b.startTime=o(),d(),A.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);A=A.substr(3),d(),b.endTime=o(),d(),u(A,b)}function C(A){return A.replace(/<br(?: \/)?>/gi,`
|
|
`)}var R=function(){function A(){this.state="INITIAL",this.buffer="",this.decoder=new I,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var b=A.prototype;return b.parse=function(c){var o=this;c&&(o.buffer+=o.decoder.decode(c,{stream:!0}));function u(){var v=o.buffer,l=0;for(v=C(v);l<v.length&&v[l]!=="\r"&&v[l]!==`
|
|
`;)++l;var f=v.substr(0,l);return v[l]==="\r"&&++l,v[l]===`
|
|
`&&++l,o.buffer=v.substr(l),f}function d(v){N(v,function(l,f){},/:/)}try{var T="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;T=u();var p=T.match(/^()?WEBVTT([ \t].*)?$/);if(!p||!p[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var h=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;h?h=!1:T=u();switch(o.state){case"HEADER":/:/.test(T)?d(T):T||(o.state="ID");continue;case"NOTE":T||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(T)){o.state="NOTE";break}if(!T)continue;if(o.cue=new z.default(0,0,""),o.state="CUE",T.indexOf("-->")===-1){o.cue.id=T;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{y(T,o.cue,o.regionList)}catch(v){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var S=T.indexOf("-->")!==-1;if(!T||S&&(h=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
|
|
`),o.cue.text+=T}continue;case"BADCUE":T||(o.state="ID")}}}catch(v){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},b.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=`
|
|
|
|
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){c.onparsingerror&&c.onparsingerror(o)}return c.onflush&&c.onflush(),this},A}()},"./src/utils/webvtt-parser.ts":function(oe,H,L){"use strict";L.r(H),L.d(H,"generateCueId",function(){return R}),L.d(H,"parseWebVTT",function(){return b});var z=L("./src/polyfills/number.ts"),I=L("./src/utils/vttparser.ts"),P=L("./src/demux/id3.ts"),B=L("./src/utils/timescale-conversion.ts"),N=L("./src/remux/mp4-remuxer.ts"),_=/\r\n|\n\r|\n|\r/g,O=function(c,o,u){return u===void 0&&(u=0),c.substr(u,o.length)===o},y=function(c){var o=parseInt(c.substr(-3)),u=parseInt(c.substr(-6,2)),d=parseInt(c.substr(-9,2)),T=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(o)||!Object(z.isFiniteNumber)(u)||!Object(z.isFiniteNumber)(d)||!Object(z.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return o+=1e3*u,o+=60*1e3*d,o+=60*60*1e3*T,o},C=function(c){for(var o=5381,u=c.length;u;)o=o*33^c.charCodeAt(--u);return(o>>>0).toString()};function R(g,c,o){return C(g.toString())+C(c.toString())+C(o)}var A=function(c,o,u){var d=c[o],T=c[d.prevCC];if(!T||!T.new&&d.new){c.ccOffset=c.presentationOffset=d.start,d.new=!1;return}for(;(p=T)!==null&&p!==void 0&&p.new;){var p;c.ccOffset+=d.start-T.start,d.new=!1,d=T,T=c[d.prevCC]}c.presentationOffset=u};function b(g,c,o,u,d,T,p,h){var S=new I.VTTParser,v=Object(P.utf8ArrayToStr)(new Uint8Array(g)).trim().replace(_,`
|
|
`).split(`
|
|
`),l=[],f=Object(B.toMpegTsClockFromTimescale)(c,o),s="00:00.000",i=0,x=0,m,E=!0,D=!1;S.oncue=function(U){var j=u[d],K=u.ccOffset,k=(i-f)/9e4;if(j!=null&&j.new&&(x!==void 0?K=u.ccOffset=j.start:A(u,d,k)),k&&(K=k-u.presentationOffset),D){var M=U.endTime-U.startTime,G=Object(N.normalizePts)((U.startTime+K-x)*9e4,T*9e4)/9e4;U.startTime=G,U.endTime=G+M}var ee=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(ee)),U.id||(U.id=R(U.startTime,U.endTime,ee)),U.endTime>0&&l.push(U)},S.onparsingerror=function(U){m=U},S.onflush=function(){if(m){h(m);return}p(l)},v.forEach(function(U){if(E)if(O(U,"X-TIMESTAMP-MAP=")){E=!1,D=!0,U.substr(16).split(",").forEach(function(j){O(j,"LOCAL:")?s=j.substr(6):O(j,"MPEGTS:")&&(i=parseInt(j.substr(7)))});try{x=y(s)/1e3}catch(j){D=!1,m=j}return}else U===""&&(E=!1);S.parse(U+`
|
|
`)}),S.flush()}},"./src/utils/xhr-loader.ts":function(oe,H,L){"use strict";L.r(H);var z=L("./src/utils/logger.ts"),I=L("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,B=function(){function N(O){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=O?O.xhrSetup:null,this.stats=new I.LoadStats,this.retryDelay=0}var _=N.prototype;return _.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},_.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},_.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},_.load=function(y,C,R){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=C,this.callbacks=R,this.retryDelay=C.retryDelay,this.loadInternal()},_.loadInternal=function(){var y=this.config,C=this.context;if(!y)return;var R=this.loader=new self.XMLHttpRequest,A=this.stats;A.loading.first=0,A.loaded=0;var b=this.xhrSetup;try{if(b)try{b(R,C.url)}catch(o){R.open("GET",C.url,!0),b(R,C.url)}R.readyState||R.open("GET",C.url,!0);var g=this.context.headers;if(g)for(var c in g)R.setRequestHeader(c,g[c])}catch(o){this.callbacks.onError({code:R.status,text:o.message},C,R);return}C.rangeEnd&&R.setRequestHeader("Range","bytes="+C.rangeStart+"-"+(C.rangeEnd-1)),R.onreadystatechange=this.readystatechange.bind(this),R.onprogress=this.loadprogress.bind(this),R.responseType=C.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),R.send()},_.readystatechange=function(){var y=this.context,C=this.loader,R=this.stats;if(!y||!C)return;var A=C.readyState,b=this.config;if(R.aborted)return;if(A>=2)if(self.clearTimeout(this.requestTimeout),R.loading.first===0&&(R.loading.first=Math.max(self.performance.now(),R.loading.start)),A===4){C.onreadystatechange=null,C.onprogress=null;var g=C.status;if(g>=200&&g<300){R.loading.end=Math.max(self.performance.now(),R.loading.first);var c,o;if(y.responseType==="arraybuffer"?(c=C.response,o=c.byteLength):(c=C.responseText,o=c.length),R.loaded=R.total=o,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(R,y,c,C),!this.callbacks)return;var d={url:C.responseURL,data:c};this.callbacks.onSuccess(d,R,y,C)}else R.retry>=b.maxRetry||g>=400&&g<499?(z.logger.error(g+" while loading "+y.url),this.callbacks.onError({code:g,text:C.statusText},y,C)):(z.logger.warn(g+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,b.maxRetryDelay),R.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout)},_.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},_.loadprogress=function(y){var C=this.stats;C.loaded=y.loaded,y.lengthComputable&&(C.total=y.total)},_.getCacheAge=function(){var y=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var C=this.loader.getResponseHeader("age");y=C?parseFloat(C):null}return y},N}();H.default=B}}).default})}}]);
|